28 Feb 2010, 2:05pm
linux:

leave a comment




  • Moving home to it’s own partion (Ubuntu)

    We are going to move all accounts includ­ing their per­sonal data on a dis­tinct par­ti­tion. This rec­om­mended in case of sys­tem fail­ure to not loose any data.
    I have no idea, why the Ubuntu instal­la­tion wiz­ard does not do this by default — it should!

    This post is based on an arti­cle in Ger­man — I will mainly trans­late it, strip some plush and add some stuff to make life eas­ier and to reduce the risk of data loss. But be aware: to per­form any of those fol­low­ing things, you will need super user rights and you should feel some­what comfy with using the com­mand line. And of course, it might be pos­si­ble in cir­cum­stances unfore­seen, that you lose all your per­sonal data — but there are a lot of backup steps included below.

    Here we go: (con­sole input or state­ments are writ­ten in ital­ics)

    1. Prepa­ra­tion
      1. Cre­ate a backup: rsync –avx –progress /home <your backup destination>
      2. If you do not have a free par­ti­tion yet, I rec­om­mend GParted to cre­ate one (use sudo apt-get install gparted). I rec­om­mend ext3 for com­pat­i­bil­ity 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 par­ti­tion is big enough for your home folder! Try to remem­ber the size (get size: du –sh /home) of /home, you can use it later on to ver­ify your new home location.
      3. Get par­tion name sudo fdisk –l /dev/sda — e.g. /dev/sda7 — I will refer to this name as (name)
      4. Copy your cur­rent file sys­tem con­fig­u­ra­tion: sudo cp /etc/fstab /etc/fstab.new
      5. Get par­tion UUID of new par­ti­tion: sudo blkid — you will find a line about (name) stat­ing 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 fol­lows (the lay­out should fol­low pre­vi­ous lines — sim­ply copy one and adjust it):
        UUID=(UUID)  /home                ext3         defaults                    0  2
    2. Copy
      1. Sign off / Log out
      2. Switch to con­sole mode by press­ing Ctrl+Alt+F1
      3. Cre­ate a mount point for the new par­ti­tion: sudo mkdir /mnt/tmp
      4. Add par­tion: sudo mount (name) /mnt/tmp
      5. Copy home from the old loca­tion to the new par­ti­tion: 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 mount­ing worked: sudo mount| grep /home should print out some­thing like
            (name) on /home
          • Switch
              1. yet another home backup: sudo mv /home /home.bak
              2. cre­ate new home mount point: sudo mkdir /home
              3. cre­ate a backup of fstab: sudo mv /etc/fstab /etc/fstab.bak
              4. put updated ver­sion in place: sudo mv /etc/fstab.new /etc/fstab
              5. reboot and you should be done: sudo reboot

              Ok, that’s that. If every­thing 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 use­ful and I did not put in a mis­take or typo. Gimme feed­back! :)

              18 Feb 2010, 7:10pm
              jobs projects:

              leave a comment




            • Getting Drupal’s Access Control Module to Work Properly

              After set­ting up some con­tent types — some pub­lic, some inter­nal. I installed the Access Con­trol mod­ule, set up inter­nal con­tent not to be vis­i­ble to anony­mous users — but with­out any effect.

              After some research, but with­out suc­cess, I real­ized the *Advanced* sec­tion at the bot­tom of the Access Con­trol tab for each con­tent type. And now the magic trick: Increase the weight and you are done. So I guess the build in access man­age­ment was fight­ing the Access Con­trol mod­ule, so it is up to you to make your favorite mod­ule stronger by giv­ing it more weight. — I doubt this is intu­itive. Addi­tion­ally, it is for sure dif­fi­cult to sim­ply find the tiny lit­tle select box down there in a sec­tion, which is by default folded.

              7 Feb 2010, 10:52pm
              linux:

              leave a comment




            • KDE vs. Gnome

              Now, my deci­sion is final: KDE rules (though I actu­ally pre­fer the look of Gnome :( ).

              Sim­ple rea­son: Gnome does not sup­port drag-and-drop in com­bi­na­tion with alt+tab (see bug tracker), but there might be hope with the upcom­ing Gnome 3.

              [Edit 2011-06-14: Indeed, drag-and-drop + alt-tab works since since Ubuntu 11.04 (did not try with 10.10). One major dif­fer­ence remains: Do you need a lot of con­fig­u­ra­tion and cus­tomiza­tion options? And are you will to accept com­plex, maybe not that self-explaining menu struc­tures for that? If yes, KDE is your choice, oth­er­wise Gnome might make your life eas­ier. See also this page for more details and screenshots.]

              In more detail: using drag-and-drop together with alt+tab key com­bi­na­tion allows to work very effi­ciently. For exam­ple, while order­ing my pho­tos, I want to work on one of them — as I do this reg­u­larly, Gimp is opened already, but in the back­ground — so what I do using KDE or MS Win­dows is, I grab the pic­ture, switch to Gimp by using alt+tab and imme­di­ately drop the pic­ture with­out mov­ing the mouse at all — I am quite con­fi­dent that this is the fastest way of open­ing a pic­ture for edit­ing. Some peo­ple advice to set Gimp as default appli­ca­tion to open JPEGs, but I am not always edit­ing pic­tures, most of the times I just want to view them.

              Using “Open With” on a JPEG file for sure is the com­mon approach — but let’s com­pare it:

              • Drag-and-drop & alt+tab
                • Actions to be per­formed: mouse down + key down + key up + mouse up
                • In total: four fast steps
              • Open With” solu­tion (hold­ing mouse down as improvement)
                • Actions to be performed:mouse down + mov­ing to “Open With” + wait for sub-menu to open + move to sub-menu + mouse up
                • In total: two fast, three slow steps
              2 Feb 2010, 7:13pm
              jobs projects:

              leave a comment




            • How to Make Jquerymenu for Drupal Keep its State on Page Reload

              While set­ting up the web­site for my new project “Glo­cal” www.glocal-project.eu), I came across the prob­lem of find­ing a proper menu mod­ule. Some­thing easy to use, sta­ble and effi­cient in the same time for the com­plex intranet struc­ture (there­fore, sorry, but you will not be able to see my solu­tion there unless you are a project mem­ber). Some­thing with a high usabil­ity in the end. Active­menu is still quite buggy and DHTML Menue requires a dou­ble click to actu­ally open a page — unbear­able in a non-doulbe-click envi­ron­ment like the Inter­net — who is sup­posed to guess, that this menu requires a dou­ble click?? Leav­ing me with JQuery­menu.

              First impres­sion: per­fect! Open and close branches by click­ing (+) or (-) — view page by click­ing menu item label. Even the few styling issues could be fixed eas­ily by using CSS. But as soon, as some­one clicks a label, the menu col­lapses to its default sta­tus. It does not remem­ber its last sta­tus after load­ing a dif­fer­ent page with the same menu.

              Is this it? All mod­ule have crit­i­cal down­sides like this? I was quite dis­ap­pointed! :(

              But I taught JQuery­menu to remember!

              As it is quite some code, I will not post it here directly, but added it to the tracker page for this “fea­ture request” or you can down­load the two updated files (jquerymenu.js and jquerymenu.module) here and replace the once in your /sites/all/modules/jquerymenu folder.

              But please be care­ful, it should be con­sid­ered an alpha ver­sion, there are quite some weak­nesses (see tracker page). Any feed­back or sug­ges­tions are very wel­come!