Rss

Archives for : Debian

Using php5-geoip on Debian

Here is a straight way to get a fully functionnal GeoIP module for PHP5 on Debian:

apt-get install php5-geoip geoip-database-contrib

The second package is actually a download facility to fetch the various free databases from Maxmind. Once it’s done, edit the php.ini configuration file to append:

[geoip]
geoip.custom_directory = "/usr/share/GeoIP/"

Reload the web server and it should now work.

Distributed storage on Debian made easy with GlusterFS

GlusterFS is a mature, elegant and powerful distributed filesystem targeted at very high capacities and availability. Sponsored by Red Hat Inc. and included in their storage server solution, this open-source software is kindly available for some other Linux distributions package system or as sources.

Unlike many other distributed solutions, there is no need to have many computers in order to have a taste of Gluster ease of use. A few minutes to spare is fairly enough to do it on your own computer. Note also that only the amd64 architecture is present in the repository and thus the following apply to those 64 bits machines only.

First, add the GnuPG key for the repository and the corresponding entry for APT:

wget -O - http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.3/Debian/pubkey.gpg | apt-key add -
echo "deb [ arch=amd64 ] http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.3/Debian/apt wheezy main" >/etc/apt/sources.list.d/glusterfs.list

The arch option is useful, as documented in Multiarch specs in case you’re using multiarch with some foreign architecture package already installed.

Next, update the packages database and install both the server and client packages:

apt-get update
apt-get install glusterfs-server glusterfs-client

Now, either you have a whole disk or partition available or, like me, you don’t. Let’s just use a file as our disk then. In any case, the goal is to format our disk, preferably with XFS, and mount it.

Doing it with a disk or a partition is left to the reader’s discretion and knowledge ;] with a file, it’s as easy as (thanks to this libgfapi doc):

truncate -s 5GB /srv/xfsdisk
mkfs.xfs -i size=512 /srv/xfsdisk
mkdir -p /export/brick
echo "/srv/xfsdisk /export/brick xfs loop,inode64,noatime,nodiratime 0 0" >> /etc/fstab
mount /export/brick

Last tip before starting our cluster, as Gluster doesn’t want us to use localhost as a valid node hostname, we add a definition for another name on our loopback network:

echo "127.0.1.1 localnode" >>/etc/hosts

Now the real work with Gluster may begin; first, create a directory in the dedicated mount-point and add it as a brick on our upcoming volume:

mkdir /export/brick/b1
gluster volume create test localnode:/export/brick/b1

Last, start the volume and enjoy, it’s working.

gluster volume start test

And now…? Now you may play a little with the powerful gluster CLI, gluster help will output the available commands. You may also be a client of your cluster storage (yes, you can) by simply mounting the volume somewhere, like:

mkdir /mnt/gluster
mount -t glusterfs localnode:/test /mnt/gluster

Streaming to Twitch with avconv on Debian

I successfully managed to stream to Twitch using avconv from a Debian Wheezy system.

Here is the command used to display (part of) the desktop:

avconv -f x11grab -s 1680x1050 -r 15 -i :0.0 -c:v libx264 -pre fast -pix_fmt yuv420p -s 640x480 -threads 0 -f flv "rtmp://live.twitch.tv/app/live..."

Which means: grab the top left 1680×1050 pixels of the desktop at 15 fps and encode it using libx264 with the “fast” preset and the yuv240p picture format, resize this to 640×480 pixels using 1 CPU core and format all of this as a FLV stream to be sent using RTMP to the Twitch server (using the secret live streaming key).

Adapted from the FFmpeg streaming guide.

Remote Linux access using X2go

The X2Go project is a fairly efficient way to provide a graphical remote access to a Linux box. It is based on the excellent NoMachine free libraries, which is the technology behind the NX server and the FreeNX project, which seems not developped anymore.

A client will then only need a SSH access to the server to get a full featured graphical remote desktop.

Available for many Linux flavours, MS Windows and Mac OS X, the installation on a Debian client or server is really easy and straightforward, thanks to the packaging effort done by X2Go, and all the relevant information can be found on the wiki of the X2Go project.

Continue Reading >>

ownCloud media player not working?

Thanks to this post on the ownCloud ML, if you have troubles using the embedded media player, install the getid3 PHP extension (Debian package php-getid3) and it should works.
Successfully tested on ownCloud 3.0.2.