Category: Linux

  • Disable “You have new mail” terminal message

    By default in linux you get a message saying something like

    You have new mail in

    when you log into a linux machine.

    Sometimes this gets annoying because you always have new mail, or because there seems to be a delay while checking the mail or because the mail is actually stored on some kind of remote disk.

    Disabling this setting is easy. Simply include

    unset MAILCHECK

    in your .bashrc file (for login shell) or .bash_profile (for non-login shells, i.e. ssh) and the message shouldn’t appear.

    For me it speeds up login for my linux server and removes clutter.
    I got this from:

    http://www.savarese.org/patches/bash.html

    There is also a more detailed explanation that I found here:

    http://www.cygwin.com/ml/cygwin/1998-08/msg00365.html

    This page explans the difference between .bashrc and .bash_profile:

    http://joshstaiger.org/archives/2005/07/bash_profile_vs.html

  • Linux autologin

    I use a collection of virtual machines in parallels for a number of things, like testing SQLEditor and running web apps that would otherwise require lots of software dependencies. However I’ve been getting tired of logging in to my linux virtual machines all the time. If it were just a case of ssh then obviously I could set up ssh key pairs and do auto-login, but I also need direct terminal access too, in this case in the main parallels window.

    With a physical machine to get autologin in this situation would mean that the machine would boot and immediately log the user in without interaction.

    Important Warning

    This represents some security risk. You need to consider your circumstances carefully first to ensure that this will not open your machine to malicious use.

    (Of course there is always the point that if someone has physical access to your machine then there’s not much hope anyway. But still …)

    Fortunately this is possible and actually quite easy if you don’t mind editing a configuration file.

    The file you need is /etc/inittab

    Important Warning (2)

    /etc/inittab is vital to the operation of your machine. Incorrect editing will cause a number of problems.

    If you are making these changes to a virtual machine simply make another. Alternatively try logging in via ssh to undo the changes.

    The change you need to make is to find the line that looks like:

    1:2345:respawn:/sbin/mingetty tty1

    and change it to look like this (where username is the user that you want to autologin as)

    1:2345:respawn:/sbin/mingetty --autologin username tty1

    The original source of this is EasyMameCab; which looks like a clever idea in itself. They are using linux as the base system for building a video game cabinet, so obviously they don’t want logins appearing.

  • Running Oracle – The Solution

    This follows on from my previous posting. Searching for an Oracle

    This is kind of old news now, because it’s been in use since SQLEditor 1.2 was released. However I though I would explain how I solved the problem that I was having with installing Oracle.

    The problem was that I didn’t have a linux machine with enough memory and at the time, qemu wasn’t really fast enough to run Oracle in a virtual machine.

    The first strategy I used was to upgrade the memory in my linux box (Cetaganda) to 512 MB. This solved the memory problem and meant that the testing could continue.

    Then Parallels Workstation was released, which was able to run Oracle XE in a virtual machine fast enough for regular use. It also uses a different IP address than the host machine, which is useful in itself for testing.

    Parallels is definitely the answer to this problem, I don’t need to switch on another machine, there is no additional noise and the performance is excellent for my purposes. I’m even considering adding the loading of the VM to the unit test setup so it will load automatically before the test cycle starts.

    I’ve also got MySQL and Postgres running inside virtual machines.

  • Change console keyboard layout in debian

    I’ve been using Parallels Workstation virtualization a lot recently for testing databases and it works amazingly well.

    However I did come across a weird problem. I’d installed Debian linux and the console keyboard layout wasn’t correct for my Apple USB keyboard.
    The solution was to use this command

    dpkg-reconfigure console-data

    Which walked me through selecting the right keyboard layout.

    [link]

    Update

    Djamu posted a comment suggesting that the following command might work better for server installations:

    dpkg-reconfigure keyboard-configuration

  • Searching for an Oracle

    Recently I’ve been trying to set up a box to run Oracle again. There are enough SQLEditor users that Oracle support is important.

    Fortunately Oracle have several downloads that can be used, there is a developer license for 10g and various chargeable options. However the option that is most interesting is Oracle Express. This is a cut down version of Oracle that has some limitations in maximum performance, but otherwise works the same as the regular version. For my purposes it’s perfect, since I’m not actually doing any data processing at all, maximum performance is irrelevant.

    So the next step was to download and install a copy.

    First I had to select windows or linux. Obviously a difficult choice, so I avoided it and downloaded both just in case.

    Next I looked around for a suitable machine to run this database on. Oracle 10g does run on macs, but no word of Intel mac support, so my Imac is out (directly at least).

    My next thought was a virtual machine on my Intel Imac ‘aslund’. Qemu runs windows really quite well and it runs linux perfectly well too. Unfortunately despite several hours playing around with settings I couldn’t get anything that would run fast enough and I couldn’t seem to get Oracle to run properly at all. I suspect that either I didn’t get one of the settings right, or there is some other problem somewhere.

    Next I thought about ‘cetaganda’, which is my windows box. This meets the minimum requirements of 256MB ram, and has both windows and linux. No worries there.

    Unfortunately it was debian linux and this requires Red Hat Enterprise Linux. After some thought I realized that Centos is a clone of Red Hat and so should work just as well. Which is probably would, if only my machine had enough memory. Unfortunately this machine was built to a (small) budget and has integrated graphics. The integrated graphics use memory from the main system for graphics, which reduces it from a nominal 256MB to only about 218 MB. 218MB isn’t enough for Oracle apparently and it complained.

    Next step, the windows download (lucky I got them both before).

    Windows XP sees the installer, unfortunately the same problem: not enough memory. (Although oddly the release notes mention this being a problem that has been fixed).

    Next I may consider my iBook ‘Komarr’, however that will be annoying, because when I tried it before, it was slow.

    The best plan may be to add more memory to cetaganda and run it that way.

  • PSpell in debian with PHP

    The default debian stable packages for php4 don’t seem to include pspell. I’ve been looking at using the AJAX spell checker in something, but then I realized that it wouldn’t work, at least not with my current server setup.

    http://lists.debian.org/debian-devel/2005/09/msg00064.html

  • Debian Sarge

    I realized that I’d managed to update to Sarge (v 3.1) mostly without noticing. I should have pinned my packages to woody (3.0) but didn’t realize, which meant that I went through the update process without actually noticing. This led to a number of odd problems. In particular I hadn’t disabled a number of backports, which led to difficulties with apache, php, mysql and postgresql. This happened because the ports were set up to target woody (3.0) rather than Sarge (3.1).

    However I have now properly upgraded to Sarge on marilac. Hopefully this will be a suitably satisfactory release and will provide many hours of happy uptime. 🙂