Categories
linux Programming

How to do VoD with nginx

You can read my last post on LeaseWeb Labs – Streaming Video on Demand with nginx and RTMP Module

Categories
linux

Find the wireless password on Ubuntu

How many times happen to have a guest that asks you about the wireless password and you cannot remember it? On Ubuntu Linux, you can easily retrieve the wireless password like this:

[code language=”bash”]
sudo cat /etc/NetworkManager/system-connections/YOUR_NETWORK_NAME_HERE | grep "psk="
[/code]

The output will be something like:
[code language=”bash”]
psk=myultrasecretpassword
[/code]

Categories
linux

Ubuntu 12/13 install and configure Java JRE

1. Download JRE 7 from Oracle website.
2. Unarchive the file:
[code language=”bash”]
tar zxpvf jre-7u25-linux-x64.tar.gz
[/code]
3. Create the installation directory
[code language=”bash”]
sudo mkdir -p /usr/lib/jvm/
[/code]
4. Move the unarchived directory in the newly created one
[code language=”bash”]
sudo mv ./jre1.7.0* /usr/lib/jvm/jre1.7.0
[/code]
5. execute this wonderful command:
[code language=”bash”]
sudo update-alternatives –install /usr/bin/java java /usr/lib/jvm/jre1.7.0/bin/java 3
[/code]
Done.
You can see the java version doing:
[code language=”bash”]
java -version
[/code]

KISS

Categories
linux

Vagrant broken with VirtualBox 4.2.14

Today I had this issue with Vagrant and VirtualBox 4.2.14 (virtualbox-4.2_4.2.14-86644~Ubuntu~raring_amd64) on an Ubuntu 13.04 host.

[bash]
vagrant up
Bringing machine ‘default’ up with ‘virtualbox’ provider…
[default] Importing base box ‘ubuntu12_04_v1’…
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["import", "/home/razvan/.vagrant.d/boxes/cdn-ubuntu12_04_v1/virtualbox/box.ovf"]

Stderr: 0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Interpreting /home/razvan/.vagrant.d/boxes/ubuntu12_04_v1/virtualbox/box.ovf…
OK.
0%…
Progress object failure: NS_ERROR_CALL_FAILED
[/bash]

The solution is even to downgrade your VirtualBox to 4.2.12 or to upgrade to 4.2.15 from VirtualBox website (the link is possible to be broken soon).

Categories
linux

What’s new in Linux Kernel 3.7

Linux Kernel 3.7

The version 3.7 of Linux Kernel was just released few days ago (11 December).  In this version there are a lot of interesting features, and I will mention only unified system architecture support for ARMTCP Fast Open and Virtual extensible LAN tunneling protocol. For an extended list of the new features, you can check a list here.

Categories
linux

How to display the Mercurial branch name to bash prompt

To have your current branch name in your bash prompt, just add this code into .bash_profile file from your home directory.

[sourcecode language=”bash”]
hgBranch ()
{
if [ -d .hg ]; then
printf "$1" "$(hg branch)"
fi
}

export PS1=’${USER}@${HOSTNAME}:\w$(hgBranch " [\033[1;31m(%s)\033[0m]")$ ‘
[/sourcecode]

Ofcourse, after you edit .bash_profile, you must logout and login again to see the changes.

//later edit

If you want to have the same feature in the graphical terminal, you should add the code above in the .bashrc file.

//2nd later edit
You can find a good “how to” for git on LeaseWeb Labs.