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

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
php

Cannot redeclare geoip_country_code_by_name

Today I had this error on my Ubuntu Linux box

Fatal error: Cannot redeclare geoip_country_code_by_name()

The reason was that I have geoip extension enabled in my PHP configuration and also I used the geoip.inc file from maxmind.com.

The solution is very simple. Actually, there are two solutions:

First is to disable the geoip extension from your configuration. In /etc/php5/apache2/conf.d/geoip.ini comment the first line:

[sourcecode language=”bash”]
;extension=geoip.so
[/sourcecode]

The second solution: in your geoip.inc file, look for this code

[sourcecode language=”php”]
function geoip_country_code_by_name($gi, $name) {

}

function geoip_country_name_by_name($gi, $name) {

}
[/sourcecode]

and replace with

[sourcecode language=”php”]
if (!function_exists(‘geoip_country_code_by_name’)) {
function geoip_country_code_by_name($gi, $name) {

}
}

if (!function_exists(‘geoip_country_name_by_name’)) {
function geoip_country_name_by_name($gi, $name) {

}
}
[/sourcecode]