How to cut videos from the command line in Ubuntu 12.10 and later (Mint 14 and later)

avconv -i DP4U12.ogv -vcodec copy -acodec copy -ss 00:00:00 -t 00:04:20 DP4U12_complete.ogv

The above command preserves the same format of the input file, where:

DP4U12.ogv is the input file

DP4U12_complete.ogv is the output file

The command cuts the video from the beginning till 4 minutes 20 seconds.

Posted in Uncategorized | Tagged , , , , , | 1 Comment

How to extract multi-part, e.g. .z01, .z02 type of zip files on Ubuntu

I couldn’t extract an archive that I downloaded from edelivery which was in 3 files, 1.zip, 1.z01 and 1.z02:

In order to extract on Ubuntu, do the following:

zip -s- Input.zip -O output.zip

This will gather the Input.zip file and all following .z0x in one file called output.zip, which you can then extract and do whatever you want on it, e.g

zip -s- dac_win_11g_infa_win_64bit_901.zip -O output.zip

Posted in Uncategorized | Tagged , , , | 7 Comments

How to install the VirtualBox Extension Pack from the Command Line on Ubuntu

The following command was needed after upgrading the VirtualBox version to install the new version of the extension pack and replace the old one:

sudo VBoxManage extpack install –replace Oracle_VM_VirtualBox_Extension_Pack-4.2.12-84980.vbox-extpack

Posted in Uncategorized | Tagged , , , , | Leave a comment

How to manually install a Gnome Shell extension

This is a must-know for those who love some old extensions that are no longer compatible with their new upgrade of gnome shell, since many extensions are already compatible with the new versions of the gnome-shell, but all what differs is that this is not explicitly stated in the meta-data file.

My system is on Ubuntu 13.04 beta with Gnome 3.8.

Here are the steps:

  1. Get the exact version of your gnome-shell, “gnome-shell –version”, mine is 3.8.0.1
  2. Download the 2 files of any extension, extension.js and metadata.json, or simply copy their text into new empty files that you create (with the same name of course)
  3. In the .json file, go to the shell-version section and your version that you got into step 1, e.g.: “shell-version”: [
         “3.2”, “3.5.2”, “3.8.0”, “3.8”, “3.8.0.1”
      ],
  4. From the same file, you will find a uuid section, you will use that name to create a folder with the same name, e.g. folder name would be steal-my-focus@kagesenshi.org in this example: “uuid”: “steal-my-focus@kagesenshi.org”
  5. Copy the two files into that folder
  6. Copy that folder into “~/.local/share/gnome-shell/extensions
  7. Restart your shell, you can do that by pressing Alt+F2 then typing r and pressing enter
  8. Go to your gnome-tweak tool and activate that new extension by setting to on or activate it through the web interface
  9. Enjoy!
Posted in Uncategorized | Tagged , , , , , | 6 Comments

How to extract a number from a string (not a file) in Bash

export hobba=ksjdjf123ksks
export nokka=`sed “s/[^0-9]//g” <<< $hobba`
echo $nokka
123

Sources: http://stackoverflow.com/questions/13055889/sed-with-a-literal-string-not-input-file, http://stackoverflow.com/questions/6388046/extract-integer-from-string-using-bash

Posted in Uncategorized | Tagged , , , , , | Leave a comment