Commands by dreffed (1)

  • This is based on the Windows Version of VirtualBox. From the /? ... VBoxManage clonehd | [--format VDI|VMDK|VHD|RAW|] [--variant Standard,Fixed,Split2G,Stream,ESX] [--type normal|writethrough|immutable|shareable] [--remember] [--existing] From the online help.. VBoxManage clonehd This command duplicates a registered virtual hard disk image to a new image file with a new unique identifier (UUID). The new image can be transferred to another host system or imported into VirtualBox again using the Virtual Media Manager; see the section called ?The Virtual Media Manager? and the section called ?Cloning disk images?. The syntax is as follows: VBoxManage clonehd | [--format VDI|VMDK|VHD|RAW|] [--variant Standard,Fixed,Split2G,Stream,ESX] [--type normal|writethrough|immutable] [--remember] where the parameters mean: format Allow to choose a file format for the output file different from the file format of the input file. variant Allow to choose a file format variant for the output file. It is a comma-separated list of variant flags. Not all combinations are supported, and specifying inconsistent flags will result in an error message. type Only honored if --remember is also specified. Defines what kind of hard disk type this image should be. remember Keep the destination image registered after it was successfully written. Show Sample Output

    vboxmanage clonehd --format VMDK <source image|uuid> <destination image>
    dreffed · 2010-10-04 16:42:12 0

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Check These Out

Add directory to $PATH if it's not already there
Sometimes in a script you want to make sure that a directory is in the path, and add it in if it's not already there. In this example, $dir contains the new directory you want to add to the path if it's not already present. There are multiple ways to do this, but this one is a nice clean shell-internal approach. I based it on You can also do it using tr to separate the path into lines and grep -x to look for exact matches, like this: $ if ! $(echo "$PATH" | tr ":" "\n" | grep -qx "$dir") ; then PATH=$PATH:$dir ; fi which I got from Or replace the "echo | tr" part with a shell parameter expansion, like $ if ! $(echo "${PATH//:/$'\n'}" | grep -qx "$dir") ; then PATH=$PATH:$dir ; fi which I got from There are also other more regex-y ways to do it, but I find the ones listed here easiest to follow. Note some of this is specific to the bash shell.

Minimize Apps When Middle Clicking on Titlebar
Middle click on titlebar to minimize apps

Mouse Tracking
Will track your mouse and save it to a file. You can use gnuplot to graph it: $ gnuplot -persist

Calculate days on which Friday the 13th occurs (inspired from the work of the user justsomeguy)
Friday is the 5th day of the week, monday is the 1st. Output may be affected by locale.

print contents of file from line 1 until we match regex
Start printing the contents of filename to stdout, until a matching line to regex is found, then stop.

Copy the text from the 3rd line to the 9th line into a new file with VI

check open ports without netstat or lsof

Juste a reminder that this works.
You can do some boolean logic like A or B then C else D using or : || and : && So you can do some : # false || false && echo true || echo false false # true || false && echo true || echo false true # false || true && echo true || echo false true # true || true && echo true || echo false true and so on ... I use it like : $(ssh 'test something') || $(ssh 'test something') && echo ok || echo ko

Set laptop display brightness
Run as root. Path may vary depending on laptop model and video card (this was tested on an Acer laptop with ATI HD3200 video). $ cat /proc/acpi/video/VGA/LCD/brightness to discover the possible values for your display.

Create a zip file ignoring .svn files

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: