Keeping it Small and Simple


What Debian needs

Filed under: Debian — Tags: , , — Lorenzo E. Danielsson @ 23:22

Debian needs to be stable.
Oh wait, it already is.

Debian needs a sane release policy that is dictated by “ready for release” not “rush it out”.
Oh wait, it already has.

Debian needs to be able to run on old hardware.
Oh wait, it already does.

Debian needs to have a large repository of software.
Oh wait, it already has.

Debian needs to provide sane defaults.
Oh wait, it already does.

Debian needs to include “An Anarchist FAQ” in its repositories.
Oh wait, it already does.

Debian needs to be superior to its 1001 (decimal) derivates.
Oh wait, it already is.

Debian needs to use upstart.
No, it doesn’t.

Debian needs to..
Oh wait, this is getting silly.


Very simple NAT set-up on Debian

Filed under: Debian — Tags: , , , , , , , — Lorenzo E. Danielsson @ 14:25

Many people ask me how to set up network address translation (NAT), aka. IP masquerading on a Debian (Etch) box. There are different ways of doing this, but this just works(tm).

You need to know (1) which interface is connected to your ISP, (2) which interface is connected to your LAN and (3) the IP address of your ISPs gateway. Edit /etc/network/if-up.d/iptables (the file probably does not exist), and enter the following:

 1 #! /bin/sh
 3 # Firewall rules.
 4 #
 5 # Assumptions:
 6 #   eth0: connected to ISP
 7 #   eth1: connected to LAN
 8 #   ISP’s gw:
10 # Flush all rules.
11 iptables -F
12 iptables -t nat -F
13 iptables -t mangle -F
15 # Set up NAT.
16 iptables -t nat -A POSTROUTING -o eth0 -j SNAT –to
18 # Enable IP forwarding
19 echo 1 > /proc/sys/net/ipv4/ip_forward
21 # Secure.
22 iptables -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
23 iptables -A INPUT -m state –state NEW -i ! eth0 -j ACCEPT
24 iptables -P INPUT DROP
25 iptables -A FORWARD -i eth0 -o eth0 -j REJECT

You will need to modify to use the correct gateway address (no, that is *not* my ISPs gateway address, I made it up randomly). You may also need to swap eth0 and eth1 unless you have eth0 connected to your ISP.

This script will only set up what is necessary to enable NAT and to provide some rudimentary security. You will want to modify this script to provide other rules as well, to suit your own requirements.

You are done. Your Debian box can now act as a gateway to the Internet for other computers on your LAN, at least once they are configured to use the Debian box as their default gateway.


SCIM + Lenny = Ouch!

Filed under: Debian — Tags: , , , , — Lorenzo E. Danielsson @ 14:27

Just a little warning if you’ve got Lenny in your sources.list and considering upgrading. If SCIM is something you cannot live without, you may want to postpone that aptitude upgrade. Otherwise your computer will soon be as fast as a ZX Spectrum.

The SCIM I upgraded to was 1.4.7-3. There is Debian bug #434180 which contains a possible work-around. You could try it, but it doesn’t work for me. My problem is not sporadic lock-up, but that SCIM itself takes forever to start and consumes everything in its sight while doing so.

I’m going to run a few more searches and play around a bit. If the bug doesn’t seem to be in Debian BTS, I’ll have to add it. But I’m still hoping that there’s something I can do to at least (1) get rid of the problem, or (2) be a duplicate of an existing bug.

Of course, I’m on a etch/lenny/sid hybrid with possibly a sprinkle of experimental as well (although this was my first upgrade in ages). But still, think about it for at least 0.02 seconds before starting that upgrade.


Installing Gnome on Debian

Filed under: Debian, Humor — Tags: , , , — Lorenzo E. Danielsson @ 01:51

Before you begin

Your computer should looks something like the following:

There are of course many different types of computers and yours may not look exactly like this. You’ll probably be fine with the garba.. *er*.. computer you have. Important: If your computer looks as follows you do not need to install Gnome. You have a superior system already.

Step #1

% su
[type password]

Step #2

# aptitude install gnome

Step #3

Step #4
Wait some more….

Step #5
Wait even more.. 😦

Step #6
Done! Reboot. Your computer should now look something like this:

Step #7
Don’t you wish there was something better?


Setting up SCIM on Debian

Filed under: Chinese, Debian, Japanese — Tags: , , , , , , , — Lorenzo E. Danielsson @ 01:46

I’m struggling to keep my Japanese and Chinese alive while learning Ga, programming and trying to uphold my hard-earned reputation as hopelessly lazy. In order to be able to input Chinese and Japanese text on my Linux boxes I use SCIM. There are now lots of good instructions out there, but I’ll outline what I did to get SCIM up and running just in case somebody is still struggling with it.

I’m not sure if these instructions apply to Gnome or KDE. Most likely, Japanese and Chinese are not user-friendly enough for Gnome, and KDE offers you a GUI tool to configure your input methods that is so complex you need a triple-degree in nuclear physics to figure it out. The following should work on a normal X window manager, which is the preferred way of using Linux for normal people.

Install SCIM and related packages

The best thing to do first is aptitude search scim. You will at least need scim itself. For Japanese I use anthy, and for Chinese I use scim-chinese and scim-chewing. I also have a few other packages, like scim-gtk2-immodule and scim-qtimm (you might need to grab that one from the Sid repos) installed.

Adapt the following to your own requirements. Note that there are several other input methods available with SCIM as well, such as Korean. Unfortunately, I don’t know Korean (yet) so it is not something I currently need.

aptitude install scim scim-anthy scim-chinese scim-chewing scim-gtk2-immodule scim-qtimm

Get fonts

You can do aptitude search ttf | grep Japanese to find Japanese fonts. A similar search will give you Chinese. You might also be able to find some others floating around at various places on the ‘Net.

Aptitude install the ones you want. You can, and probably should do a bunch of fine-tuning as well, such as organizing your fonts, so that the best fonts get selected. I normally only do such things once I get annoyed enough. That hasn’t happened quite yet.

Edit .zshenv

The way it *should* be done, all according to the people who really know, is to set environment variables in /etc/X11/xinit/xinput.d/*. But I’m a non-conformist, and moreover far to lazy to change something that works for me. I stuck the following in ~/.zshenv:

export XMODIFIERS='@im=SCIM'
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"

Of course, I could have added these lines to ~/.xinitrc instead. But these are just environment variables. No harm can come from them being set in ~/.zshenv. I’ve never had any problems.

At least I added the following to ~/.xinitrc:

scim -d

I put this before exec startfluxbox. There is no need to append a & since the -d will daemonize scim.

Activate scim

Simplest way to do this is to exit your window manager, source ~/.zshenv and restart X.

% . ~/.zshenv
% startx

Success stories

  • rxvt-unicode (some people say it doesn’t work, don’t know why. It works fine for me
  • (g)vim, which is what really matters. I use gtk2-vim so it’s a gtk2 application.
  • opera, although the fonts look ugly (guess I need to play around with that a bit). Opera uses qt3.
  • Iceweasel/Firefox, without the fonts looking ugly.
  • Netbeans, which proves that it works with Java/Swing as well. Fonts *cough, cough* don’t look too good, however..
  • gjiten, which is a gtk2 application
  • qt4-config. Seems to be the only thing I have available to test that it works with qt4.
  • tkremind, which shows that it works with Tcl/Tk as well.

So, SCIM works with the important applications (urxvt, gvim) as well as tk, gtk2, qt3, qt4 and Java/Swing applications. It does not seem to work with fbrun, however (not that it matters at all to me, just had to test it). If everybody had stuck to motif/lesstif I wouldn’t have had to test so many applications.


Xorg 7.3 in Sid: harmful

Filed under: Debian — Tags: — Lorenzo E. Danielsson @ 23:39

If you are running Debian Sid and your system has begun to crawl, then try reverting Xorg. This hit me a few days ago, when I decided to do a few upgrades. All of a sudden my system became *very* slow. Xorg was using up 80-90% of my CPU and eating all the memory it could get. It was as if I were running Gnome or KDE.

The solution was simple. I reverted Xorg and the problem was gone. Now my system is fast and responsive again.


RSSOwl on Debian Etch

Filed under: Debian, Software — Lorenzo E. Danielsson @ 22:35

If you would like to try RSSOwl on Debian etch, here is a quick how to get it running:

First, download the RSSOwl package (the latest stable at the time of writing was 1.2.3). Next, become root and create a directory for rssowl (I used /usr/local/rssowl). Extract the archive into this directory. In summary:

# mkdir /usr/local/rssowl
# cd /usr/local/rssowl
# tar zxf /home/lorenzod/downloads/rssowl_1_2_3_linux_bin.tar.gz

Next create a launcher script called /usr/local/bin/rssowl. Add the following lines to it:

#! /bin/sh

export MOZILLA_FIVE_HOME=/usr/lib/xulrunner
cd /usr/local/rssowl

(You may have found posts similar to this one. They may have told you to set MOZILLA_FIVE_HOME to /usr/lib/mozilla or something similar. Well, don’t.)

Finally make sure you have the required dependencies installed. First of all you will need Gtk2. It’s very likely that you have it because it’s getting very difficult not to get it installed (trust me, I’ve tried). You will also need to have Iceweasel.

That should be it. Open up a shell and type rssowl and it should start. If it doesn’t you are probably missing some dependency. Read the error message. It can probably guide you.

If, after trying it for a while, you feel that RSSOwl is not for you then try this:

# aptitude install raggle


Zimbra on Debian Etch

Filed under: Debian, Zimbra — Lorenzo E. Danielsson @ 20:12

Zimbra is an open source collaboration suite. Basically that means, a pretentious email software. I’m not a big fan of Zimbra myself, but one of our clients wanted it implemented, so I didn’t really have a choice.

At the time of writing, there are no Zimbra packages for Debian Etch, only for Sarge. However, it can be installed on Etch, with a bit of massaging. There is a thread about it on the Zimbra Forums, and you’ll probably want to read that first. But, I was unable to install it following the instructions there, so I’m documenting what I did, just in case you, dear reader, happen to also be stuck.

The first thing I did was download the Zimbra packages for Sarge. Uncompress this and cd into the zcs directory. If you try to run the script, it will fail. Even if you install all the dependencies it will still fail. This is because your platform is not recognized. I tried editing this file in zcs/bin (I cannot remember the name, there is only one file there), and make it recognize DEBIAN4.0 as a platform, but only with limited success.

So I used a different trick. I edited /etc/debian_version and changed it from 4.0 to 3.1. It’s ugly, I know, but at least it worked. I’m sure there are better ways of doing this, but it would mean digging into a bit of code and I was lazy, had a dead-line and my solution worked.

You might still notice that fails on the dependencies. If your problem is with libgmp then simply edit the file zcs/utils/, search for the string DEBIAN and right underneath it where you see a list of dependencies, change libgmp3 to libgmp3c2.

After that, the installation should go without a hitch. In a few minutes you will have Zimbra up and running. I don’t know if there will be any hidden issues that may appear later, but at least for now Zimbra seems to be working fine.

Hopefully this post will become obsolete soon because the Zimbra team really ought to build some debs for Etch.

Blog at