Changing timezone in debian

sudo dpkg-reconfigure tzdata

.. another Germany themed post

Installing Ubuntu on a macbook air

Short way... spring for the macbook air crippled superdrive...  Update -- take the short way!

This is the only device other than the internal hard drive that you can use to boot the laptop from. No, you can't boot from another external usb cdrom drive or usb drive. Apple prevents you from booting another OS.

Long Way... you like pain and want to install without buying apples additional hardware... this is not recommended, but I am stubborn and did this. This requires an additional computer and a large external hard drive.

1) We have to get the OS on the internal hard drive somehow... so install elsewhere and then copy over the installed partition.

You may think... hey I can partition the internal drive into three partitions, MacOS, installer partition and target ubuntu partition. Then I'll boot from installer partition and install to target partition. However, ubiquity (the ubuntu installer) in intrepid doesn't allow you to install (doesn't even see!) partitions on the drive you boot from.

2) To allow booting external partitions, we install the rEFIt program onto the OSX partition.

3) Then, booting an ubuntu live cd on our other computer we install to an external hard drive partition, say /dev/sdb1 of say 24 GB.

4) Use Boot Camp Assistant to make your macbook drive a 25GB mac partition and 25GB partition for ubuntu.

5) Plug your external hard drive with the ubuntu install into the macbook air. Then use dd to copy the externally installed partition onto your macbook air. Here's how: Use 'diskutil list' on the mac to find what the disk partitions are called, say /dev/disks1s2 (source) and /dev/disks0s5 (target). Just put an 'r' in front of the disk names to force raw mode and prevent a "resource is busy" error, and plug them into the dd command like so:

dd if=/dev/rdisk1s2 of=/dev/rdisk0s5

This will take a really long time (30 mins?) to copy over every little bit...

6) Then before we can boot to linux, we need to "bless" the ubuntu partition to make the wierd-ass mac boot system happy.

sudo bless --device /dev/disk0s3 --setBoot --legacy --verbose

OK, so the above isn't going so well.. ... Went out and spent $99 on a superdrive for the macbook air (the only drive tweaked so that the macbook will boot a non-macos from it). I highly recommend going this route to avoid much pain.

Microsoft Access Mysterious Blank Pages

If you have a report in Microsoft Access that suddenly starts printing blank pages between each report page, you probably have fiddled around with the width of the report. Make sure your report canvas is not wider than your page width (minus margins). Skinny your report and the blank pages shall vanish.

Untar all files in a directory

for a in `ls -1 *.tar.gz`; do tar -zxvf $a; done

those are backticks.
thanks to linuxquestions.org forums.

Dev machine LAMP stop start restart

Say you have a debian laptop of limited horsepower. Say that on your laptop you don't want mysql and apache running all the time, so you can set them to only start up when you want them. Say you don't want XAMP or something that installs your services in no standard places that debian won't find them to update them. So write your own script to only start LAMP when you want it running.

First remove apache and mysql tendency to start with the machine:

update-rc.d -f mysql remove
update-rc.d mysql stop 20 2 3 4 5 .

update-rc.d -f apache2 remove
update-rc.d apache2 stop 20 2 3 4 5 .

then create a bash script that will allow you to do:

sudo lamp start
sudo lamp stop
sudo lamp restart

Here's the script:

#!/bin/sh
case "${1:-''}" in
'start')
/etc/init.d/mysql start
/etc/init.d/apache2 start
;;

'stop')
/etc/init.d/mysql stop
/etc/init.d/apache2 stop
;;

'restart')
lamp stop
lamp start
;;
*)
echo "start stop or restart, please"
;;
esac

then mod the script to be executable
chmod o+x lamp.sh

then move or link the script from a directory in your command path
ln -s path/to/lamp.sh /usr/bin/lamp

You're done.

Turn off "spatial finder" in debian?

On Mac OS 9 the main file manager program was called the "finder" and it opened a separate window for every folder or directory that you opened. By the time you drilled down 6 levels, 6 windows cluttered your desktop. Each window represented one specific open folder. This metaphor is supposed to help people visualize where they are in an abstract filesystem and make the system more useable. This was called the "spatial finder".

Of course, proponents of silly and annoying metaphors like this are totally wrong, and the Mac moved to the OS X finder where windows exhibit "browsing" behavior instead. There you open a window which represents not a folder, but a changing view into the filesystem which follows you up and down a directory tree. You only need one window, unless you want to view more than one place in the tree simultaneously.

The Gnome file manager "Nautilus" can do either a "spatial" or a "browse" mode. Debian, purists that they are, sets nautilus to spatial mode, while the ever practical Ubuntu guys set it to browse mode. This is one time that I agree with Ubuntu over Debian. Here's how to fix their shortsightedness.

In your nautilus window:
Edit > Preferences > Behavior > Always open in Browser window.

Done! The time you will save closing excess windows will repay the time it took to read this post in about 2-4 minutes of file browsing - I promise!

The easier way to install your ssh key on remote servers

You want to install your ssh key on a remote server so that you can log into it without a password. Most guides will show you something like this:

user@host:~$ scp ~/.ssh/key.pub remoteuser@remotehost:~/
$ ssh remoteuser@remotehost
remoteuser@remotehost's password:
remoteuser@remotehost:~$ cat key.pub >> ~/.ssh/authorized_keys
remoteuser@remotehost:~$ rm key.pub
remoteuser@remotehost:~$ exit

That's fine, but why not do it in one step?
user@host:~$ ssh-copy-id -i ~/.ssh/key.pub remoteuser@remotehost
remoteuser@remotehost's password:

And you're done.