linux

Avoid duplicates in your bash history

3 October, 2005 - 15:56
Categories:

Sometimes I need to repeat a command several times on the bash commandline. I don't mean a scenario where you could use a for or while loop, but take for example editing a script in an editor and periodically running it in a terminal. In that case my bash history used to be appended over and over with the same command for running that script.

If you set the shell variable HISTCONTROL to ignoredups, bash will not append a command to the history if it matches the last command of the history.

Read more...

Changing the theme of GTK/Gnome applications under KDE

19 August, 2005 - 12:10
Categories:

While I'm a KDE user, I still use some Gnome appliciations or other applications with a GTK interface (the gimp, synaptic, firefox and thunderbird for example). Their default skin when running under KDE (on my Kubuntu Linux system) was a bit ugly in my humble opinion, not to say it felt like motif uglyness.

Read more...

Get the last argument of the previous command in the bash shell

11 August, 2005 - 12:34
Categories:

Working on the command line shell typically involves using the same argument of the previous command. In bash there is a trick to save you those boring keystrokes. When you use "!$" (called bang dollar-sign) in a command, bash will expand it to the last argument of the previous command. A simple example to clarify:

$> file /etc/fstab
/etc/fstab: ASCII text
$> ls -l !$
ls -l /etc/fstab
-rw-r--r--  1 root root 894 2005-08-03 15:12 /etc/fstab
Read more...

Activate tab completion in interactive python mode with a python startup script

9 August, 2005 - 10:41
Categories:

Before my switch from Mandrake Linux to Ubuntu Linux I used the tab completion feature in interactive python without noticing it. But after the switch I noticed it wasn't there any more. On my search to find a way to reactivate it I found this page about the standard python module rlcompleter. I followed the instructions involving a python startup script and now I'm happy tab completing on the python shell again.

I also found a website about rlcompleter2, which should be a python module for a more advanced form of code completion for python's interactive mode.

Read more...

walking through directories with pushd and popd

6 August, 2005 - 13:28
Categories:

When you're spending a part of your life on the commandline, you'r probably cd'ing a lot in and out directories. Some handy commands (for bash):

  • cd (without arguments) brings you to your home directory
  • cd - (with just a minus) brings you to the previous directory you went to with cd
Read more...

Load url from clipboard on middle mouse click in Firefox on Linux

5 August, 2005 - 12:00
Categories:

A nice feature of working in X on Linux is copy/paste by selecting (copy) and pressing the middle mouse button (paste). When I'm sometimes forced to work in Windows I realise how much it replaced my old ctrl-c/ctrl-v habit. I also use the trick with Mozilla Firefox to load an URL that is not clickable, because there is no anchor element around, or because it's in some textfile for example.

Read more...

Installing Mandrake 10.1 and Ubuntu (Kubuntu in fact) on a Acer TravelMate 4000 laptop

3 August, 2005 - 16:16
Categories:

Introduction

Some months ago I got an Acer TravelMate 4000 laptop from my work. It came with Windows XP Home Edition SP 2 preinstalled, but because I like Linux more, I wanted to install Linux on it. I had some install cd's lying around (Mandrake 10.1, Ubuntui 4.10 and Gentoo) and chose to go for Mandrake, because that's the distro used at my work. I remember trying Ubuntu, but unsuccesful at that time, I got a blank screen after some boot messages.

Mandrake 10.1. It worked, but with glitches

Installing Mandrake 10.1 was rather painfull, if I recall correctly. After I added some "contrib" package sources (or however they are called properly), I could install the applications I needed/wanted like kdevelop and LyX. That way I was able to do some real work. But I had some problems too.
For example I couldn't find Mozilla Firefox or Mozilla Thunderbird in the package listings, so I had to install them myself. It's not hard, but not gracefull. Beside that I tried to install some RPM's, sometimes succesfull, sometimes not. Something very annoying was a problem during boot. During every boot "netprofile" (some Mandrake thing for managing network configuration) waited for some timeout or something and freezed the boot procedure for 2 minutes. Moreover I had to activate (ifup eth0) the network myself after log in because netprofile failed (I think). I spend/lost many time on looking/googling for a solution, without result. I didn't succeeded in getting the power management right (ACPI, APC and such). Related with that: Mandrake couldn't shut the laptop down. After the shut down message "Power down" nothing happened and I had to press the power button for some seconds to power it down manually. Not very convenient. I also wasn't able to solve a keyboard problem related with dead keys and xmodmap. In a nutshell, Mandrake 10.1 worked more or less, but it wasn't very comfortable working with (booting, shut down, installing software, typing, ...)

Read more...