Uncategorized

Keyboard shortcut for suspend in Ubuntu

So I’ve got this Samsung X900 laptop where Ubuntu won’t suspend ( automatically ) when I close the lid . Ubuntu already has this documented at help.ubuntu.com , and by the way : impressive docs Ubuntu ! .
It seems to be possible to fix this with a samsung firmware upgrade , but that exe file seem to be for windows only ( looking into that later ) .

For now I found this nice little hint over at askubuntu.com, I can manually suspend the machine from cli with

$ dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend

So I just mapped that command to Alt+s via custom keyboard shortcuts in Ubuntu settings, and I’m 99% satisfied .
I’ll reach for 100% satisfaction later when I’ll go for that windows firmware update .

When you have to backup millions of files, use zfs if you can

I’ve been increasingly worried about one of the media servers I backup, the backup time has been crawling it’s ways from 12 to about 14 hours as of today. It’s not that it’s so many TB’s, only 1.4 TB actually, the problem is that there is more than 2 000 000 small files, and rsync have to fstat every one of them. So even when there hasn’t been much change the backup takes longer and longer.
So yesterday I figured I should try out zfs. The media server is already on zfs, and I use zfs on the backup server + I have already got a zfs sync script which I modified some months ago to use mbuffer for maximum bandwith utilization .

And how did this turn out ? well, the backup time went from about 14 hours to 7 seconds … I just realised I could never go away from zfs for these kind of setups (backing up millions of files ) .

lsof equivalent in FreeBSD

When I want to umount a filesystem in Linux and the kernel says it can’t umount because the filesystem is busy I usually do something like

# lsof | grep [mount point]

To figure out what files are open in the mount point .

In FreeBSD you may install lsof or you could instead use the builtin fstat command that comes bundled with FreeBSD . For cases like the one mentioned above fstat with the -f switch is really handy:

# zfs destroy tank/data
cannot unmount '/tank/data': Device busy
#
# fstat -f /tank/data
USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W
www      java        1674    4 -        20595308 -rw-r--r--  19269164  r
www      java        1674    5 -        20595308 -rw-r--r--  19269164  r
# 

Reload VirtualBox modules in Fedora 19

I keep forgetting to install the corresponding VirtualBox modules in Fedora when I get a kernel upgrade. Since Fedora uses systemd, which I’m kinda a n00b at I end up google’ing this over and over.
After rebooting to a new kernel, realising I can’t load a virtual machine in VirtualBox, I yum install the corresponding kmod-VirtualBox-3.10.[something] , but there’s no init script in /etc/init.d like I’m used to. systemctl -a and grepping for anything related to vbox doesn’t show anything either !

But it seem to be the systemd-modules-load service that check and load modules, so reloading that service will load the VirtualBox modules

# systemctl restart systemd-modules-load.service

Thanks forums.virtualbox.org

gnome 3

I’ve installed gnome 3. GREAT !
Now I have to learn how to use my computer again … (why did I do this (banging my head against the wall))
The best part is i switched from Ubuntu to Debian ’cause I was tired of ‘stuff’ that broke between the 6 months release cycle Ubuntu follows … Debian is a lot more stable, except I couldn’t settle with stable debian, it’s too old… so I’ve dist-upgrade’ed to testing …
Then I envied all those cool screenshots from gnome 3 … installing gnome 3 on debian today involves pulling packages from the experimental and testing repositories …
It’s a wonder my computer boot at all …
I’m looking back at Ubuntu… They have such cool themes, it’s slick, and it’s consistent. Debian is cool, but they’re not the king of ‘bling’ …
I probably need professional help (as in: a shrink) …