remove exim4 debian wheezy

Remove exim4 --the default MTA of debian wheezy-- from a debian wheezy GNU linux system

# apt-get --purge remove exim4-base exim4 exim4-config exim4-daemon-light
# cat /dev/null > /var/log/mail.err 
# cat /dev/null > /var/log/ 
# cat /dev/null > /var/log/mail.log 
# cat /dev/null > /var/log/mail.warn

Remove exim4 from debian wheezy

synergy - ubuntu 10.04 and windows 7

A quick note on choosing a synergy version that works OK on an Ubuntu 10.04 64b box.

Choose synergy-1.4.16-r1969-Linux-x86_64.deb and not the 1.4.17 or an 1.3.* version otherwise dependencies, shift and CTRL keys will drive you crazy ... get it from

The synergy client
$ cat /etc/issue /etc/debian_version 
Ubuntu 10.04.3 LTS \n \l

$ sudo -s
# wget
# dpkg -i synergy-1.4.16-r1969-Linux-x86_64.deb
# synergyc -f

Whups, I forgot a short description ...
synergy is pieces of software that let you share a keyboard and a mouse among computers in your LAN. It is like a KVM on steroids and I have been using it on and off for many years ... and I would recommend it to everyone ... more about it at

Synergy ubuntu and windows

debian install X11 with gnome notes

Install the Xorg server and the gnome windows manager on a debian system.

Install the X11 server.
# apt-get install xorg 

Install the gnome-desktop task
# tasksel install gnome-desktop --new-install
# tasksel -t install gnome-desktop
debconf-apt-progress -- apt-get -q -y -o APT::Install-Recommends=true -o APT::Get::AutomaticRemove=true install task-gnome-desktop


Start X11
# startx

debian system V init

System V init basics


# grep -i runlevel /etc/inittab |egrep "0|1|2|6"
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

better ( /usr/share/doc/sysv-rc/README.runlevels.gz )
 N       System bootup (NONE).
 S       Single user mode (not to be switched to directly)
 0       halt
 1       single user mode
 2 .. 5  multi user mode
 6       reboot

... man 8 init

Runlevels 7-9 are also valid, though not really documented. This is because "traditional" Unix variants don't use them.

Runlevels S and s are the same.  Internally they are aliases for the same runlevel.

Scripts linked by links starting with a K run with the argument 'stop' in each runlevel ( except S and 2 )

scripts linked by links starting with S and run with the argument 'start' in all runlevels


See What Starts When
# ls /etc/rc?.d/S*

Disable a service or system initialization script
# update-rc.d -f service_name remove
# ls /etc/rc?.d/S* |grep bluetooth
# update-rc.d -f bluetooth remove
update-rc.d: using dependency based boot sequencing
# ls /etc/rc?.d/S* |grep bluetooth

Start a service in Runlevels 2 through 5
# update-rc.d service_name defaults
# ls /etc/init.d/bluetooth 
# ls /etc/rc?.d/S* |grep bluetooth
# update-rc.d bluetooth defaults
update-rc.d: using dependency based boot sequencing
# ls /etc/rc?.d/S* |grep bluetooth

To create an init.d script look at /etc/init.d/skeleton for an example.
You may want to create a ghetto init.d script that does not speak to innserv with comments.

man update-rc.d
man 8 init
man 5 inittab
man telinit
man 8 insserv

system V init - debian

disable ipv6 debian wheezy

Disable IPv6 on debian wheezy

What I used to do for squeeze ( there is a post about it ) does not seem to work well

The system
# cat /etc/issue /etc/debian_version ;uname -a
Debian GNU/Linux 7 \n \l

Linux eudoxus 3.2.0-4-amd64 #1 SMP Debian 3.2.57-3+deb7u1 x86_64 GNU/Linux

Add the following lines to /etc/sysctl.conf
# tail -5 /etc/sysctl.conf 

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1

net.ipv6.conf.eth1.disable_ipv6=1 ...
if you have more network interfaces

enable the changes in proc
# sysctl -p
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1

Restart networking
# /etc/init.d/networking restart

even though most of the time I am politically incorrect, this time it seems I got it right :)

disable IPv6 Debian Wheezy

ssmtp debian linux

Notes on setting up ssmpt on debian squeeze

The system
# cat /etc/issue /etc/debian_version ;
Debian GNU/Linux 6.0 \n \l


You may need to remove exim first
# apt-get --purge remove exim4-base exim4-config

Install ssmtp
# apt-get install ssmtp

An example ssmtp.conf
# cat /etc/ssmtp/ssmtp.conf 
# Config file for sSMTP sendmail
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.

# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named

# Where will the mail seem to come from?

# The full hostname

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address

Test ssmpt setup
# echo "what up" |ssmtp -v systems@ipduh.awmn -f me
[<-] 220 ares.ipduh.awmn ESMTP Postfix
[->] HELO xenocrates.ipduh.awmn
[<-] 250 ares.ipduh.awmn
[<-] 250 2.1.0 Ok
[->] RCPT TO:
[<-] 250 2.1.5 Ok
[->] DATA
[<-] 354 End data with .
[->] Received: by xenocrates.ipduh.awmn (sSMTP sendmail emulation); Sun, 18 May 2014 16:25:07 +0300
[->] From: "root" 
[->] Date: Sun, 18 May 2014 16:25:07 +0300
[->] what up
[->] .
[<-] 250 2.0.0 Ok: queued as 025E055A31
[->] QUIT
[<-] 221 2.0.0 Bye

ssmtp setup debian squeeze

phpmyadmin install on debian

Install phpmyadmin on debian

# apt-get install phpmyadmin
choose http daemon (apache or lighttpd) and then No.

Set password for http://host/phpmyadmin/setup directory
# htpasswd -b /etc/phpmyadmin/htpasswd.setup admin password

# /usr/sbin/pma-configure
the above makes /var/lib/phpmyadmin/ writeable so you can configure phpmyadmin at http://host/phpmyadmin/setup with 'admin' and 'password'

Edit configuration at http://host/phpmyadmin/setup (log in with admin and password)

Lock configuration
# /usr/sbin/pma-secure

You may log in to phpmyadmin at http://host/phpmyadmin with a mysql user.

phpmyadmin install on debian

iptables port forwarding ... torrent tracker connectable

Port forwarding on a linux firewall so you seem connectable to an Internet torrent tracker.

# iptables -t nat -A PREROUTING -i eth3 -p tcp -d --dport 51413 -j DNAT --to-destination

where is your Internet Address
and the socket used by your torrent client / client-daemon

procmail postfix debian

I am not sure if this is the best postfix-procmail configuration
but it does what I needed get done ...

# grep mailbox /etc/postfix/ 
mailbox_command = /usr/bin/procmail -a "$EXTENSION" DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir
home_mailbox = Maildir/
mailbox_size_limit = 0

procmail system-wide config
# cat /etc/procmailrc 

procmail user config
I am using just ~/.procmailrc
and not ~/.forward for each system user

procmail postfix debian

reconfigure locales

Been on a system that responds in a foreign language effectively breaking most of your scripts?

I always forget how to change this ... the easy way

dpkg-reconfigure locales
select en_US.UTF-8 UTF-8

Reconfigure Locales fast on debian

debian wheezy ssl imap

Configure SSL imap courier on debian wheezy

# apt-get install courier-imap-ssl
select 's' for configuration directories-files instead of one configuration file

in /etc/courier set
and TLS_CERTFILE ( if you are using signed --not the SnakeOil created during installation-- Keys ) eg:
where my-signed-imapd.pem is both the private key and the signed certificate eg:
# cat private.pem signed.crt >> my-signed-imapd.pem

use IMAP+ , 993 , SSL and Password for your mail-client setup

debian wheezy ssl imap

mutt with postfix ~/Maildir

Configure mutt
on systems with a postfix MTA and system user accounts

eg set in /etc/postfix/
home_mailbox = Maildir/

then add the followin to the end of /etc/Muttrc
set folder="~/Maildir"
set mask="!^\\.[^.]"
set mbox="~/Maildir"
set record="+.Sent"
set postponed="+.Drafts"
set spoolfile="~/Maildir"

the user's mailboxes are in their home directories instead of /var/mail/mailuser and look like directory structures instead of flat files eg.
# ls /home/testuser/Maildir/
cur  new  tmp

partially true for debian wheezy links:
debian Maildir Configuration
debian postfix

mutt with postfix and Maildir

Backup and Restore Thunderbird - Linux

Backup and Restore Thunderbird Profiles and Mail in Linux Based Systems The Profile and Locally Saved Mailboxes are usually in a hidden directory within the user home directory.
$ ls -la ~ |grep -i thunder
lrwxrwxrwx   1 o    o        20 2011-05-01 21:54 .mozilla-thunderbird -> /home/g/.thunderbird
drwx------   5 o    o      4096 2013-01-26 03:10 .thunderbird

.mozilla-thunderbird is just a link, I need the .thunderbird directory

Let 's see how big it is
$ du -h --max-depth=1 .thunderbird/
28K .thunderbird/signature
341M .thunderbird/o-mailbox
3.1G .thunderbird/bi6vfzcd.default
3.4G .thunderbird/
Too big, I better create a compressed archive

Create the compressed archive
$ tar czvf thunderbird.`date +%s`.backup.tar.gz ~/.thunderbird

Wait ... done!

$ du -h thunderbird.1*
1.6G thunderbird.1395816237.backup.tar.gz
OK compression and relatively fast ... I will save the archive to another medium for backup and the copy it to another GNU-Linux System to test the Restore Process In my case the 'from' system is a ubuntu 10.4 with thunderbird 3.1.15 and the 'to' system is a Debian wheezy with thunderbird 24.

I do not have any email settings in the debian system so I will just replace the .thunderbird directory with the one in my archive
$tar xzvf thunderbird.1395816237.backup.tar.gz;mv thunderbird.1395816237.backup.tar.gz .thunderbird
IT DID NOT WORK ... searching for thunderbird 3.1.15 ( ) click on Security a few minor security issues we know off not in the mozilla site ... I better get it off the Ubuntu System than some other site ...

In the Ubuntu System thunderbird 3.1.15 is at /usr/lib/thunderbird-3.1.15

In the Debian System
# rm /opt/thunderbird/ -r
# mv thunderbird-3.1.15/ /opt/
# rm /usr/bin/thunderbird
# ln -s /opt/thunderbird-3.1.15/thunderbird /usr/bin/thunderbird