How to install and configure CherryMusic on a Debian


CherryMusic depends on Python. To install Python 3, issue:

apt-get install python3

now install dependencies:

apt-get install ffmpeg imagemagick python3-unidecode lame flack vorbis-tools


Create user dedicated account:

adduser cherrymusic

The easiest way to get the latest CherryMusic code and to update CherryMusic regularly is to use Git. Install Git with:

apt-get install git

Now, switch to the newly created user:

su cherrymusic

and get CherryMusic:

git clone --branch devel git:// /home/cherrymusic/cherrymusic-devel
cd /home/cherrymusic/cherrymusic-devel
python3 ./cherrymusic --help



Now, do the initial startup to generate the configuration and data files in your home directory:

python3 ./cherrymusic

This creates the configuration file “~/.config/cherrymusic/cherrymusic.conf”

now we need to edit the config file:


under “basedir” enter the path to your music collection – to make it easier to add further libraries I set the “basedir” to a folder /home/cherrymusic/music_dir and created symlinks in that directory pointing to the location of my music

mkdir /home/cherrymusic/music_dir
ln -s Path_to_your_music /home/cherrymusic/music_dir

now we need to update the cherrymusic database:


and then start the server to test it:




By default cherrymusic will run on http – for security we will set it to run on https:

I already have certificate created and openssl installed so I go ahead and change the CherryMusic config:

cd /home/cherrymusic/cherrymusic-devel
 nano ~/.config/cherrymusic/cherrymusic.conf

and change the following lines accordingly:

 ssl_enabled = True
 ssl_certificate = /etc/ssl/certs/server.crt
 ssl_private_key = /etc/ssl/private/server.key

Now, when you connect to CherryMusic, you should automatically be redirected to the SSL port and therefore have a secure connection.

sysvinit startup script

One final thing is to set it up as a service – instructions are provided on Lord-Simon’s github:

wget --no-check-certificate -O /etc/init.d/cherrymusic

then make the file executable:

chmod +x /etc/init.d/cherrymusic

open it for editing:

nano /etc/init.d/cherrymusic

1. Add the path of your cherrymusic folder to DIR (/home/cherrymusic/cherrymusic-devel)
2. Add the python executable path to the PYTHON (/usr/bin/python3)
3. Set the USER and GROUP under which the service will run

Test the the init script by running:

service cherrymusic start


Once all is working OK do this:

update-rc.d /etc/init.d/cherrymusic defaults


Systemd startup script

I recently moved my cherrymusic service to brand new debian 8 box running systemd and so here is the systemd service script:

Description=CherryMusic Service

ExecStart=/usr/bin/python3 /home/cherrymusic/folder/cherrymusic #use your path to cm


saved that file to /etc/systemd/system as a cherrymusic.service
then to start it up just run:

systemctl start cherrymusic

to ensure it starts automatically enable the service:

systemctl enable cherrymusic


Raspberry Pi – Debian – Network tools

ifstat – InterFace STATistics Monitoring

ifstat is a tool to report network interfaces bandwith just like vmstat/iostat do for other system counters. It can monitor local interfaces by polling the kernel counters, or remote hosts interfaces using SNMP.

To install run:

apt-get install ifstat

then just issue:


example output:

 KB/s in KB/s out
 4.22 237.91
 4.19 246.90
 4.17 248.41

to be continued….

Optimizing Raspberry Pi performance


The best way to overclock Raspberry Pi it is with the raspi-config tool


I go for the Modest option:



Modify nginx.con (/etc/nginx/nginx.conf)

We only have one CPU thread…

worker_processes  1;

In the http { section add the following:

# Optimize memory
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
sendfile        on;
tcp_nopush     on;
server_names_hash_bucket_size 128;
keepalive_timeout  65;
# Enable website compression - it takes a lot of CPU
# If you are running low on CPU disable the Zip part.
gzip  on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";

Also it is usefull to add:

#Hide Nginx version number
 server_tokens off;



Download and run this script: MySQL Tuner Perl script


then go to /etc/mysql/ and edit my.cnf accordingly.


Monitoring Raspberry Pi performance

CPU and Running processes

I use the classic: top. Installed as standard in our distributions, It will display the processes running and sort them according to certain criteria.

Here for example that the command returns on my server :

By default, the command will sort the programs by their CPU usage. To change the sorting press: ‘ f’ to select fields to display, then you move with the arrows. The SPACEBAR to display a field then ‘ s’ to use the field as default sort.

 Memory usage

To get some extra RAM reduce the graphics memory to 1MB using raspi-config tool:

Another great tool:

Disk Usage


There is always webmin that will give you some additional info:

Setting up NoIP on Raspberry Pi

Install No-IP client:

Create a directory for the client software

mkdir /home/noip
cd /home/noip

Download and extract the client software

tar vzxf noip-duc-linux.tar.gz

Now install the software:

cd noip-2.1.9-1
 make install

Next provide your NoIP username, password and refresh interval.
To start the program run:


Setup automatic startup

nano /etc/init.d/noip

and paste this:

#! /bin/sh
 # /etc/init.d/noip
 # Provides: noip
 # Required-Start: $remote_fs $syslog
 # Required-Stop: $remote_fs $syslog
 # Default-Start: 2 3 4 5
 # Default-Stop: 0 1 6
 # Short-Description: Simple script to start a program at boot
 # Description: A simple script from which will start / stop a program a boot / shutdown.
 # If you want a command to always run, put it here
 # Carry out specific functions when asked to by the system
 case "$1" in
 echo "Starting noip"
 # run application you want to start
 echo "Stopping noip"
 # kill application you want to stop
 killall noip2
 echo "Usage: /etc/init.d/noip {start|stop}"
 exit 1
 exit 0

Make script executable:

chmod 755 /etc/init.d/noip

Test starting the program:

/etc/init.d/noip start

Test stopping the program:

/etc/init.d/Noip stop

Register script to be run at start-up:

update-rc.d noip defaults