Öppna Finders nuvarande plats i Terminal

En sak som jag tänkt på mycket men aldrig kommit mig för att undersöka är om det fanns något smidigt sätt att öppna katalogen man navigerat till via Finder i Terminal. En liten snabb googlesökning tog mig, givetvis, till macosxhints.com: A script to open current Finder folder in the Terminal.

Öppna “AppleScript Editor” (finns under Applications, Utilities), kopiera kodsnutten från ovanstående länk och spara. Det är dock väldigt viktigt att spara det som en applikation och inte ett script.

När detta är gjort är det bara att dra filen till Finderns verktygsrad. I och med detta får den dock standard ikonen, vilket inte är särkilt snyggt. Gå till Applications, Utilities och högerklicka på “Terminal”, välj “Get Info”. Högerklicka på AppleScript filen (som sparats som en applikation) och välj “Get Info”. Klicka på ikonen för “Terminal” och tryck cmd+c (kopiera), klicka på ikonen för AppleScriptet och tryck cmd+v (klistra in). Detta gör att ditt AppleScript får samma ikon som “Terminal”.

Asus EEE PC 901 och Ubuntu 8.10 Intrepid

The latest Ubuntu version (Intrepid Ibex, 8.10) was released a while back, so I thought it was about time to install it on my Asus EEE PC 901. I was running Ubuntu EEE previously, but due to copyright problems they had to change name since they didn’t want to comply with Ubuntus remix “trademark”. I thought this was a bit silly, so I decided to do a vanilla installation and afterwards optimize the installation with the help of the repositories from array.org.

I started by downloading the desktop installation CD and set it up to use it as a Live CD. Instructions on how to do that from Ubuntu is available here [launchpad.net] and for Windows here [sourceforge.net]. Then it is just to follow the ordinary installation instructions. One thing I skipped this time though, was creating a swap partition. This will yield a warning, but it can be ignored. The reason for this was that it the computer had sufficient with RAM and the swap partition was never really used, combined with the fact that the netbook has very limited disk space.

When the installation was finished, I installed all the available updated and then started with the optimizations.

Apparently Asus has a bug in their bios (ACPI settings) which causes third-party operating system to boot slower. Of course there was a guy that had a fix [osrom.net] for that. Download the file, put it on a USB-stick and rename it to 901.rom. During boot, press alt+f2 and start the bios upgrade. I haven’t noticed any big difference. This is not supported by Asus, so if you would run into problem and need to send the computer for repair you need to remember to switch back to an official Asus bios (if that is possible).

array.org has really good documentation, so I will not duplicate them here. Rather just follow their guide [array.org]. I chosed to go with linux-eepc-lean, even though it is currently marked as testing. The new kernel doesn’t seem to be installed as the default kernel (in grub), so I edited /boot/grub/menu.lst and moved the two *-eepc-lean entries so they were before the *-generic entries (it is also possible to change the default parameter in the beginning to something like 2). After making the changes:

sudo update-grub

Make sure that the correct kernel is running (after rebooting):

uname -a

With the eepc-lean kernel booted, it feels a lot smoother!

Flash disk optimizations
Flash disk has a problem when it comes to number of writes and life time. So to improve the lifetime I moved directories and files which is written to often to a tmpfs (located in the memory).
Instructions on how to do this is available here [ubuntu-eee.com]. I skipped the steps under “blkid.tab and mtab” since it would cause problems with FUSE, which I wanted to run.

Touchpad drivers
Instructions available here [array.org].

Asus EEE 901 och Ubuntu EEE

I bought an Asus EEE 901 today. I chosed the black model with Windows XP. But it didn’t take long time before I installed Ubuntu EEE, which is a tailor made Ubuntu based distribution.

On their homepage there are some optimization guides. I started with How to: Reduce Disk Writes to Prolong the Life of your Flash Drive [ubuntu-eee.com]. I skipped the second part of the commands under “blkid.tab and mtab”, since I wanted to continue with Transparent Encryption for home folder [ubuntu-eee.com] which uses FUSE.

I followed the guide mostly step by step, except I didn’t add pam_encfs.so in /etc/pam.d/common-session. That line make sure that the volumes is unmounted when logging out, but it resulted in some error messages every time I ran a command with sudo:

umount: /home/mikael: device is busy
umount: /home/mikael: device is busy

I’m not really sure what sudo is up to, but it seems like the login process for users ends, which results in trying to unmount the home directory.

Eyecandy is a must, it was however not possible to enable them via “System”, “Settings”, “Apperance”, “Visual effects”. So I had to install them manually and then activate them.

sudo apt-get install compiz compizconfig-settings-manager avant-window-navigator

The first package enables visual effects in genera, the second is for being able to configure the visual effects and the third is a Mac OS X-like dock. Recommended effects are “Rotating Cube”, “Reflection Cube” and “Ring switcher”.

Next step was to get my Huawei E220 3G modem working. Fortunately, people had already solved that problem: Mobitel 3G with Huawei E220 on Debian [sayura.net]. I skipped the udev rule and the associated script since I didn’t want it to connect automagically when detected. When I want to connect, I plugin the modem, click on the NetworkManager applet and uncheck “Enable wireless”, then right-click on the same applet, chose “Dial Up Connections” and “Connect to ppp0 via modem…”. Unfortunately there’s a bug in NetworkManager that makes it not possible to detect a working connection that has been configured outside of it, this results in Firefox running in offline-mode. Since Firefox 3.0.1 the way to get around this is to configure “toolkit.networkmanager.disable” to “true” through “about:config”.

A really annoying thing is that pipe (|) doesn’t work in the terminal. A quick google search took me to skrivmaskin.se/linux. I never use caps-lock, so let’s remapping it to |:

echo "setxkbmap -option ctrl:nocaps" >> ~/.bashrc
echo " xmodmap -e \"keycode 66 = bar\"" >> ~/.bashrc

Bluetooth worked out-of-the-box, as long as the feature was activated in BIOS. “Accessories”, “Bluetooth File Sharing” was the only thing needed to get it work. It does however have a really ugly icon in the menu bar, so with the help of strace I found out which icon it was using and replaced it with something that suited my taste. There are 6 pictures which has to be replaced in /usr/share/gnome-bluetooth/pixmaps: frame1.png, frame2.png, ..., frame6.png.

The end result:

Rengör din Macbook

Jag har haft min vita Macbook i ungefär 1.5 år, och jag har inte rengjort den riktigt under den tiden (torkat skärmen och damm regelbundet). Den började bli två små fläckar vid handlovsstöden, så jag tyckte att det var dags att rengöra den ordentligt. Jag var och hälsade på mor & far, så jag tog en runda i deras städskåp för att se vad de hade. Jag hittade två Ajax-produkter; Professional och Triple Action. Jag tog Ajax Professional och rengjorde alla plastytor (ovansidan, tangentbordet, handlovsstödet etc) och Ajax Triple Action till skärmen.

Nu är den som ny igen 🙂