Category Archives: Linux

Statically compile redis 3.0.2 on CentOS 5 (RHEL 5)

How to statically compile redis 3.0.2 on CentOS 5 (RHEL 5)


Install tcl8.5

tar xfz tcl8.5.18-src.tar.gz
cd tcl8.5.18/unix
make test
make install

Compile redis

Statically linked binaries

make CFLAGS="-static" EXEEXT="-static" LDFLAGS="-I/usr/local/include/"

Dynamically linked binaries

make LDFLAGS="-I/usr/local/include/"

How to manually install redis

cd src/
cp redis-{server,cli} /usr/local/bin/
chown root: /usr/local/bin/redis-{server,cli}
chmod 755 /usr/local/bin/redis-{server,cli}
mkdir /{var,etc}/redis /var/redis/6379
chmod 775 /{var,etc}/redis
cp redis.conf /etc/redis/6379.conf
sed -i 's/daemonize no/daemonize yes/' /etc/redis/6379.conf
sed -i 's,pidfile /var/run/,pidfile /var/run/,' /etc/redis/6379.conf
sed -i 's/^# bind' /etc/redis/6379.conf
sed -i 's,logfile "",logfile "/var/log/redis_6379.log",' /etc/redis/6379.conf
sed -i 's,dir ./,dir /var/redis/6379,' /etc/redis/6379.conf

Useful aptitude commands

A simple list of installed packages

max@wonko:~$ aptitude search '~i' -F '%p'

Search for installed packages from the testing repo

max@wonko:~$ aptitude versions '~i ~Atesting' --group-by=none

Finding why a package is installed

I found fonts-font-awesome in my headless server, but there’s a reason

max@wonko:~$ aptitude why fonts-font-awesome
i   owncloud Depends fonts-font-awesome

Select packages that were removed but not purged

max@wonko:~$ aptitude search '~c'

Search in the package description

max@wonko:~$ aptitude search '~d"web browser"'

Upgradable packages

max@wonko:~$ aptitude search '~U'

How to compile rsync for Android in Ubuntu

My situation

My machine

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04 LTS
Release:    14.04
Codename:   trusty

The latest rsync version to compile (for me it was rsync-3.1.0.tar.gz)

$ curl -s \
    | sed -r 's/^.*href="([^"]*)".*$/\1/' | grep 'rsync-[0-9].*\.tar\.gz$'


  1. save the tarball name in a variable
    $ RSYNCTGZ="rsync-3.1.0.tar.gz"
  2. install needed software
    $ sudo aptitude install gcc-arm-linux-gnueabi
  3. download sources
    $ wget$RSYNCTGZ
    $ tar xzf $RSYNCTGZ
    $ cd rsync-[0-9]*
  4. compile
    $ ./configure --host=arm-linux-gnueabi CFLAGS=-static
    $ make
  5. install on the device
    $ adb push rsync /data/local/tmp && adb shell chmod 775 /data/local/tmp/rsync
  6. test execution
    $ adb shell /data/local/tmp/rsync