Archive

Posts Tagged ‘command line’

bittorrent client from the command line

January 14, 2014 Leave a comment

Install:

sudo apt-get install transmission-cli

Usage:

$ transmission-cli  -w <download_dir>  <file|url|magnet>
Categories: bash Tags: ,

Start a VirtualBox operating system from the command line

November 9, 2012 Leave a comment

Problem
Under Linux I have a Windows 7 system in VirtualBox that I mainly use for Powerpoint. I have some more virtual operating systems too but I almost always launch Windows 7 only. Starting the GUI and clicking on the “Show” button to launch it quickly became a pain in the ass. How to launch my Windows 7 from the command line?

Solution

jabba@montreal:~$ VBoxManage list vms
"Windows 7 (old Office XP)" {80ce13dd-8a59-4d0a-94b5-9d8fa1130c62}
"Ubuntu 12.04" {e76ac634-1b73-42fc-85c0-f4f700edbe14}
"Office 2007" {43553e05-55b1-4095-8b66-8dcda275d9e2}
"Ubuntu 12.10 beta" {a22a2b9b-7a64-4345-8fb2-26d766989773}

jabba@montreal:~$ VBoxManage startvm "Office 2007"

I put it in a shell script called “office2007″. Done.

More info

Mount a truecrypt volume from the command line

September 9, 2012 Leave a comment
sudo truecrypt <truecrypt-file> <mount-point>

This will open a GUI window where you can specify the password.

If you want a full CLI solution, check out this page.

Update (20130617)
To unmount a volume, do this:

sudo truecrypt -d <path-to-truecrypt-file>
Categories: bash Tags: ,

View images in slideshow

July 27, 2012 Leave a comment

Problem
You have a collection of images and you want to view them in randomized order. In addition, you want to see them in a slideshow and you want to set the delay between the images.

Solution

feh -zsZFD 5 .

It will start displaying the images in the current folder. Installation: “sudo apt-get install feh“. More info: “man feh“.

Check the number of arguments in a bash script

October 30, 2011 Leave a comment

Problem
My bash script requires a parameter. How to check its presence?

Solution

#!/bin/sh

if [ "$#" -ne 1 ]
   then
      echo "Usage: $0 <input_file>"
      exit 1
fi
# else
# work with "$1" ...
Categories: bash Tags: ,
Follow

Get every new post delivered to your Inbox.

Join 72 other followers