one liner

Linux one liner: Create an ISO image from the contents of a directory

Create an iso image from the contents of a directory:

mkisofs -hide-joliet-trans-tbl -l -J -f -T -r . > "../directory_dump_`basename $PWD`.iso"

When run in a directory (say tmp) it will create a file called directory_dump_tmp.iso one directory higher, which will contain the contents of the tmp directory in it's root.

Linux one liner: Disable a module (blacklist)

sudo sh -c 'echo install module_name /bin/true >> /etc/modprobe.d/personal_blacklist'

This line will create (or append) a blacklisting rule for module_name in the file /etc/modprobe.d/personal_blacklist. Remove or edit this file to lift the ban again.

Workes with: Ubuntu 8.10 (jaunty)

Linux one liner: Convert scalable vector graphics (SVG) to PNG with gstreamer

I don't need to say more then the title, right? You can do this with convert from the ImageMagick package, but doing it with gstreamer was news to me. Here is the code to svg2png with gstreamer:

gst-launch filesrc location=intput.svg ! gdkpixbufdec ! pngenc ! filesink location=output.png

I used this in a Makefile rule:
%.png: %.svg
gst-launch filesrc location=$< ! gdkpixbufdec ! pngenc ! filesink location=$@  2>&1

Sync the time from your local computer to your OpenMoko phone

Set the time on you OpenMoko phone to the time on your local computer using SSH:

ssh root@192.168.0.202 "date -s `date +'%Y.%m.%d-%H:%M:%S'`; echo `cat /etc/timezone` > /etc/timezone"

Linux one liner: turn off your screen

xset dpms force off

Works with: Ubuntu 8.10 (jaunty)

Syndicate content