8 May 2010, 11:25am
Uncategorized

leave a comment

Resizing System or Home Partion

A very convenient tool for creating, moving, and resizing partitions is GParted. I use it for all my partition-changing-needs — it is really powerful and yet easy to use! :)

But it is not possible to resize system relevant partitions while the system is running — makes sense, right? ;)

But you can download GParted as LiveCD ISO file and burn it on a CD. After that, restart your computer with the CD in your drive and a small linux will start up directly from CD including GParted, thus allowing you to modify any drive and partition there is. :) Do all required changes, click the exit button and you are done. In my case, the computer did not reboot automatically, instead I ended up with a command line interface — use the command “sudo reboot” to restart the system yourself if that happens.

And just by the way, GParted does also handle Windows partitions easily — so there is no need to buy or “get” Partition Magic from somewhere. But never forget to backup your data first.

Yet another hint: GParted works most reliable if you do one step at a time. So for example, there are partitions A and B (A is in front of B) and you wish to give some of the free space in A to B. You need to do following steps: Shrink A, move B left and finally grow B. From my experience, GParted works best if you really do all those steps separately, apply each of then, and go for the next one if the last one finished successfully.

26 Apr 2010, 9:34pm
Uncategorized

leave a comment

Change hotkey of Kubuntu’s Quick Launch Tool KRunner

First of all: I love those quick launch tools aka keystroke launchers, they are real time savers — everyone should have one!

[For those without a glue what a keystroke launcher is:] It is THE tool for launching any kind of software or even opening documents. Instead of moving your mouse to you applications menu, click it, search the program, move the mouse there, maybe pick a sub-folder, move mouse again and finally click — unless you accidentally moved a little but to far and the menu close again, completely. :( But it is easy to put an end to this (as described below). Instead of doing all that clicking, you hit a special key combination, by default [Alt] and [Space], this will make a small input box show up, now, you only enter the first letters of the program — e.g. “f” will do after a few uses to start Firefox (the program learned that you use it a lot). It might save only a few seconds each time, but the sum up and, hey, it is very convenient, too!

So here is what you need to do:
Mac OS: It is already built-in — Just hit Alt+Space and type the name of the program you want to start (or files or whatever).
Windows: Get/install Launchy and use it as explained above.
Kubuntu: built-in as well, BUUUT you have to hit Alt+F2 instead.

And there it is, something that kept annoying me about Kubuntu for quite a bit. I was hoping to get used to it but for what reason? Alt+F2 is really not handy compared to Alt+Space.
Finally, based on this old forum post and a few adjustments to fit nowadays Kubuntu, all you need to do is this:

  1. Go to “Settings” -> “Keyboard and mouse”
  2. Select “Global Keyboard Shortcuts”
  3. Pick from the select box “KDE component” at the top “Run Command Interface”
  4. Now, you can access “Run Command” — Change it to whatever you like :)
28 Feb 2010, 2:05pm
Uncategorized

leave a comment

Moving home to it’s own partion (Ubuntu)

We are going to move all accounts including their personal data on a distinct partition. This recommended in case of system failure to not loose any data.
I have no idea, why the Ubuntu installation wizard does not do this by default — it should!

This post is based on an article in German – I will mainly translate it, strip some plush and add some stuff to make life easier and to reduce the risk of data loss. But be aware: to perform any of those following things, you will need super user rights and you should feel somewhat comfy with using the command line. And of course, it might be possible in circumstances unforeseen, that you lose all your personal data — but there are a lot of backup steps included below.

Here we go: (console input or statements are written in italics)

  1. Preparation
    1. Create a backup: rsync -avx –progress /home <your backup destination>
    2. If you do not have a free partition yet, I recommend GParted to create one (use sudo apt-get install gparted). I recommend ext3 for compatibility issues — but if you use Linux only, you can go for ext4 (please change ext3 to ext4 in step 1.6 in case) — make sure your new partition is big enough for your home folder! Try to remember the size (get size: du -sh /home) of /home, you can use it later on to verify your new home location.
    3. Get partion name sudo fdisk -l /dev/sda — e.g. /dev/sda7 — I will refer to this name as (name)
    4. Copy your current file system configuration: sudo cp /etc/fstab /etc/fstab.new
    5. Get partion UUID of new partition: sudo blkid — you will find a line about (name) stating a UUID (quite a long hex string), I will refer to it as (uuid) — copy it.
    6. Edit /etc/fstab.new, add a new line at the end as follows (the layout should follow previous lines – simply copy one and adjust it):
      UUID=(UUID)  /home                ext3         defaults                    0  2
  2. Copy
    1. Sign off / Log out
    2. Switch to console mode by pressing Ctrl+Alt+F1
    3. Create a mount point for the new partition: sudo mkdir /mnt/tmp
    4. Add partion: sudo mount (name) /mnt/tmp
    5. Copy home from the old location to the new partition: sudo rsync -avx –progress /home/ /mnt/tmp
    • Test
        1. Mount copy of home as new home: sudo mount (name) /home
        2. Check size of home folder — should be the same as in step 1.: du -sh /home
        3. Check mounting worked: sudo mount| grep /home should print out something like
          (name) on /home
        • Switch
            1. yet another home backup: sudo mv /home /home.bak
            2. create new home mount point: sudo mkdir /home
            3. create a backup of fstab: sudo mv /etc/fstab /etc/fstab.bak
            4. put updated version in place: sudo mv /etc/fstab.new /etc/fstab
            5. reboot and you should be done: sudo reboot

            Ok, that’s that. If everything works fine, you can delete the backup home sudo rm -rf /home.bak and the fstab backup sudo rm /etc/fstab.bak. Hope you found it useful and I did not put in a mistake or typo. Gimme feedback! :)

            Simple redirection using PHP and HTML meta tag

            Something everyone needs once in a while… maybe you moved a file on your server or you did not install wordpress in the root folder of your webserver – like I did neither ;) – a redirection or forwarding can be an easy answer.

            The script is rather simple – it redirects in three ways to provide a reasonable fall back if any of the automatic redirecting fails. To use it on your server, just enter the URL/address/file name/folder you would like the user to be redirected to in the second line of the page/script.

            Put the whole code and markup in a file with file extension “.php”.
            In my case, every user ending up at “www.svenbuschbeck.net” should to be forwarded to “www.svenbuschbeck.net/wordpress/home”. So I adjusted the script below like “$url = ‘wordpress/home’”, named the file “index.php” and put it in the root folder. Done :) .
            <?php
            $url = 'put your URL between the parenthesis';
            header("Location: $url");
            ?>
            <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
            <html>
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
            <meta http-equiv="refresh" content="0;url=<?php echo $url; ?>"/>
            <title>You will be redirected... </title>
            </head>
            <body>
            If you are not redirected automatically, please click <a href="<?php echo $url; ?>">here</a>.
            </body>
            </html>

            good & bad usablity
            the tap example

            Everyone interested in HCI and Usability saw the cover picture of The Design of Everyday Things by Donald Norman. But there are examples about good and bad usability all around us, every day and I want to share one of mine.

            I realized how much more comfortable the shower tap at my parents place is, compared to the one in my shared flat.

            don't move! If you are lucky, the water gets only turned of... otherwise you get frozen or boiled...

            Don't move! If you touch it and you are lucky, the water gets only turned off... otherwise you get frozen or boiled.

            an good example of a water-tap for a shower

            A good example of a water-tap for a shower.

            .

            The example to the left  is a typical one – most probably following an assumption like “this tap is working for the washbowl, so it will do for a shower as well”. As it is mounted waist-high, it is easy to reach, also by mistake, which can be quite dangerous as it can easily be turned towards hot water by a slight touch. The re-engineered example on the right shows a functional and easy-to-use solution, in addition, the water temperature can be set up very precisely, but most important, there is no way to change the water temperature by accident as it is selected with a knob. Additionally, due to the knob, its almost impossible to reach the handle, which is used to set up the water amount, by accident.