Troubles with Linux

I have had my share of problems with Linux. But sometimes I forget to write the solutions down. Here are the dated solutions that worked for me.

Large kernels

2001-04-22

Tired of the warning: kernel is too big for standalone boot from floppy? Kernels over app. 900 kb (compressed) will not work with 'make bzdisk'. You can instead use syslinux to make those boot:

make bzImage
mformat a:
syslinux /dev/fd0
mcopy arch/i386/boot/bzImage a:linux
This works up to atleast 1270 kb kernels. An image of a working syslinux-disk is found here. An image of an empty syslinux-disk is found here.

NE-2000 PCI and Tulip-card does not work in kernel 2.4.0

2001-04-22

On a 2 CPU SMP system the cards stop responding after transmitting app. 250000 packets. Solution: Upgrade to 2.4.? (? > 3).

2 mice

I have a serial and a PS2. Solution: in /etc/X11/XF86Config-4
# **********************************************************************
# Pointer section
# **********************************************************************

Section "InputDevice"

    Identifier "Mouse1"
    Driver      "mouse"
    Option "Protocol"    "PS/2"
    Option "Device"      "/dev/psaux"
    Option "Emulate3Buttons"
    Option "Emulate3Timeout"    "50"

# ChordMiddle is an option for some 3-button Logitech mice

#    Option "ChordMiddle"

EndSection

Section "InputDevice"

    Identifier "Mouse2"
    Driver      "mouse"
    Option "Protocol"    "MicroSoft"
#    Option "Device"      "/dev/ttyS2"
    Option "Device"      "/dev/mouse2"
    Option "Emulate3Buttons"
    Option "Emulate3Timeout"    "50"

# ChordMiddle is an option for some 3-button Logitech mice

#    Option "ChordMiddle"

EndSection
Make a symlink from /dev/mouse2 to the second mouse.

Gratis fonts

2001-04-25

Where to get gratis fonts for Linux? Microsoft Use the Win3.11 fonts and use unzip to unpack. I don't know how to unpack those that are not available for Win3.11 (Arial and Times New Roman, Courier new).

wget http://www.eu.microsoft.com/typography/downloads/mtcom.exe
wget http://www.eu.microsoft.com/typography/downloads/webdings.exe
wget http://www.eu.microsoft.com/typography/downloads/trebuc.exe
wget http://www.eu.microsoft.com/typography/downloads/georgia.exe
wget http://www.eu.microsoft.com/typography/downloads/verdana.exe
wget http://www.eu.microsoft.com/typography/downloads/comic.exe
wget http://www.eu.microsoft.com/typography/downloads/ariblk.exe
wget http://www.eu.microsoft.com/typography/downloads/impact.exe

unzip -o mtcom.exe
unzip -o webdings.exe
unzip -o trebuc.exe
unzip -o georgia.exe
unzip -o verdana.exe
unzip -o comic.exe
unzip -o ariblk.exe
unzip -o impact.exe
unzip -o impact.exe
http://www.iconian.com/ http://www.larabiefonts.com/ http://www.1001freefonts.com

Login under X gdm fails

2001-04-26

.Xauthority must have permission 600.

XF86Config-4 for Samsung SyncMaster 1100p+

2001-06-15

For optimal use this.

XF86Config-4 for SiS 630 on Vega+

2001-06-17

To make X work on SiS 630 you must have 3 things: XFree-4.1.0, kernel with framebuffer support and lilo.conf that activates the framebuffer. This XF86Config-4 gives 1024x768x16bpp. This bzImage-kernel is generated from This .config and gives framebuffer support. This lilo.conf activates the framebuffer in 1024x768x16bpp.

2002-02-24

It seems XFree 4.2.0 solves the problem. Here is my XF86Config.

Converting Reiserfs from 3.5.x to 3.6.x

2001-07-02

This is done by mounting the partition with -oconv However, / cannot be converted. If you move the drive to another machine and convert it there, you will get massive file corruption. Reinstall instead /. Mandrake 8.0 can make / ver. 3.6.x.

Long ping-time

2001-07-02

Using a MX-netcard (Tulip).

/proc/ioports
d000-d0ff : Macronix, Inc. [MXIC] MX987x5
  d000-d0ff : tulip

ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:FC:18:1C:58
          inet addr:10.0.0.2  Bcast:10.0.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5891185 errors:36 dropped:0 overruns:0 frame:36
          TX packets:24910077 errors:30 dropped:0 overruns:0 carrier:11
          collisions:4899539 txqueuelen:100
          Interrupt:16 Base address:0xd000
It just starts delaying packets for 16 secs. /etc/init.d/network restart solves the matter.

2 GB limit 4 GB limit

2001-07-02

Some programs have a 31-bit or 32-bit limit. This goes for: ProFTPD 1.2.0 (2GB), scp (2GB).

Slow login via ssh

2001-07-02

Caused by DNS-reverse lookup that fails. Very common on private address space (192.168.x.x, 10.x.x.x, 172.x.x.x)

Slow harddisk

2001-12-28
# hdparm -u 0 -d 0 -t /dev/hda

/dev/hda:
 setting unmaskirq to 0 (off)
 setting using_dma to 0 (off)
 unmaskirq    =  0 (off)
 using_dma    =  0 (off)
 Timing buffered disk reads:  64 MB in 19.08 seconds =  3.35 MB/sec
# hdparm -u 1 -d 1 -X66 -t /dev/hda

/dev/hda:
 setting unmaskirq to 1 (on)
 setting using_dma to 1 (on)
 setting xfermode to 66 (UltraDMA mode2)
 unmaskirq    =  1 (on)
 using_dma    =  1 (on)
 Timing buffered disk reads:  64 MB in  3.32 seconds = 19.28 MB/sec

ntpdate fails

2002-01-10
# ntpdate time.timeserver.com 
18 Jun 13:04:33 ntpdate[2711]: Can't adjust the time of day: Invalid argument
Try: -b
# ntpdate -b time.timeserver.com 

quota on reiserfs

2002-01-13

Get the kernelpatch. Recompile kernel. My .config.

Problem:

# quotaon /hdd1
quotaon: using /hdd1/aquota.user on /dev/hdd1: No such file or directory
# touch /hdd1/aquota.user
# quotaon /hdd1
quotaon: using /hdd1/aquota.user on /dev/hdd1: Invalid argument

New quota-tools >3.00. In /etc/fstab:

# grep quota /etc/fstab
/dev/hda1      /           reiserfs rw,usrquota,grpquota 1 1
/dev/hdd1      /hdd1       reiserfs rw,usrquota,grpquota 1 2
/dev/hdc1      /hdc1       reiserfs rw,usrquota,grpquota 1 2

# quotaon /hdd1
quotaon: using /hdd1/aquota.user on /dev/hdd1 [/hdd1]: Invalid argument
# quotacheck -c /hdd1
# quotaon /hdd1

Maxtor diagnostics tool powermax on a floppy

2002-01-30

Maxtor has a diagnostics tool called powermax. It will not run under Linux. It will however run under FreeDOS. So I made a bootable floppy disk with it. Write the disk with:

bunzip2 < powermax.img.bz2 > /dev/fd0

Recording sound

2002-01-31

Sound recording does not work.

rec -r 44100 -c 2  fil.au
does not send anything to fil.au. It does not work as root either. aumix has Mic marked for recording and sound from the mic can be heard in loudspeakers.

Solution: Unknown

Workaround: Reboot

crontab does not work

2002-02-18

Cron stops running crontabs. If the clock on the server has been set into the future (e.g. 2021-08-31) and now is set back to current time, then cron will wait for until 2021-08-31 before running any tasks.

Solution: Restart crond

vsound dumps core

2002-03-11

vsound realplay http://foo.bar.com dumps core.

Solution: use --timing: vsound --timing realplay http://foo.bar.com

top dumps core

2002-03-20

top stops after setting cursor to bold+invisible.

Solution: export LANG=C

locate dumps core

2002-03-28

locate stops after searching part of the database through.

Solution: use updatedb --old-format

systems locks

2002-07-13

Last log-entry: Jun 28 04:35:52 ns.pi.dk postfix/smtpd[1077]: reject: RCPT from unknown[194.198.208.46]: 550 <apalmer@om.com>: User unknown; from=<john@duevil.com> to=<apalmer@odoom.com> Jul 13 09:20:05 tigger syslogd 1.4-0: restart (remote reception). Jul 13 09:20:05 tigger syslog: syslogd startup succeeded

Solution: Seems to be caused by a faulty drive. ide-smart can be a great help, but don't trust it if you have not accessed the whole disk recently. To be safe do:

cat </dev/hda >/dev/null; ide-smart /dev/hda

XFree86 locks with a flashy screen

2002-07-13

XFree for ATI Radeon Mobility M6 locks irregularly.

Solution: Disable most modules in XF86Config. My current XF86Config.

ATI Radeon mobility M6 LY crash with OpenGL

2002-11-20

glxgears crashes with: drmRadeonSwapBuffers: return = -16

In syslog I find:

Nov 20 09:20:53 medi kernel: [drm:radeon_cp_vertex] *ERROR* ring space check failed!
Nov 20 09:20:53 medi kernel: [drm:radeon_cp_vertex] *ERROR* ring space check failed!
Nov 20 09:20:53 medi kernel: [drm:radeon_cp_swap] *ERROR* ring space check failed!
Nov 20 09:20:53 medi kernel: [drm:radeon_cp_indirect] *ERROR* ring space check failed!

Solution: Use XFree 4.2.1 and my current XF86Config.

Fonts are fuzzy and not sharp

2002-09-04
# cd /usr/X11R6/lib
# ln -sf libXft.so.1.0 libXft.so.1

syslog is very slow. logger seems to block for 1 minute

2002-10-14

It seems to relate to DNS. However, simply restarting DNS does not help. Restarting network does not help. Restarting syslog does not help.

Workaround: Either stop syslog or reboot.

Printing is blurred

2002-10-23

The print does not look sharp

Solution: Do not use Ghostscripts gimp-print driver. Use Ghostscripts ljet driver instead.

Removing PCMCIA Compact Flash card locks machine

2002-11-17

Inserting the compact flash card works fine. But when removing it the computer locks with a kernel panic.

Workaround: stop cardmgr (pcmcia), remove the card, start cardmgr (pcmcia)

Wget does not work with Freenet URL

2002-12-09

This does not work:

wget http://localhost:8888/SSK@FaP94HgrzsEY2BSW8rp4ZNHnAMUPAgM/cruft//
wget strips the last '//' down to '/'.

Solution: use lwp-rget

Postfix eats a lot of memory (10 MB) per process

2003-01-08

It seems newer versions of Postfix reads the whole alias table in every process. In my case the aliastable is 10 MB.

Solution: use proxymap. Instead of 'map:file' use 'proxy:map:file'. The map will still be read into memory but only by the proxymap process.

Transparent white cursor in X X11 XFree XFree86

2003-02-21

I upgaded to XFree-4.3 and my cursor became a transparent cursor that is just as cool as it is useless. I have problems locating the cursor on the screen.

Solution: Edit /usr/X11R6/lib/X11/icons/default/index.theme to Inherits=redglass This will make the cursor red (though still transparent).

Install of Netscape 7.02 fails

2003-03-19

I tried using netscape-installer. This downloads 16 MB and starts installing. When extracting libplc4.so I get the following error:

Error [-620]: A xpistub call failed

It installs OK on an older machine. Maybe it is Glibc-2.3? The older machine has Glibc-2.2

Solution: unknown - mail me if you find out

LUFS: sshfs breaks

2003-05-05

I installed lufs. I got sshfs working once. After this I get:

mount failed: Invalid argument
And in the logfile I get:
May  5 11:41:40 medi kernel: (lu_read_super) - no server_socket specified!
May  5 11:41:40 medi kernel: (lu_read_super) - mount failed!

Solution: Unknown.

IDE-SCSI after boot without kernel parameter

2003-08-20 I have booted my machine and after boot I want to activate my CD-ROM as CD-Writer. But I get:
cdrecord -scanbus
Cdrecord 2.01a14 (i686-pc-linux-gnu) Copyright (C) 1995-2003 Jörg Schilling
cdrecord: No such file or directory. Cannot open '/dev/pg*'. Cannot open SCSI driver.
cdrecord: For possible targets try 'cdrecord -scanbus'. Make sure you are root.
cdrecord: For possible transport specifiers try 'cdrecord dev=help'.

Solution: First I remove all CD-modules:

rmmod ide-cd
rmmod sr_mod
rmmod sg
rmmod sd_mod
rmmod scsi_mod
rmmod cdrom
rmmod ide-scsi
Then I install the ide-scsi-modules:
/sbin/modprobe scsi_mod
/sbin/modprobe sd_mod
/sbin/modprobe ide-scsi
/sbin/modprobe sr_mod
Now I can run
cdrecord -scanbus
or
cdrecord dev=5,0,0 speed=16 file.iso ;eject
.

Recording a session and converting it to a Microsoft Windows-playable video

2003-12-01 To record use vncrec.
vncrec -record foo.vnc -truecolour 172.16.3.236
To play the recorded file:
vncrec -play foo.vnc -truecolour 172.16.3.236
To convert the file use transcode. Newer versions support vnc-format as input (my 0.6.10 does).
transcode -i foo.vnc -y xvid -o foo.avi -z -k --print_status 20
Codecs that does not work with Microsoft Windows: xvid, ffmpeg(-F mpeg4), dv, mp2enc, ffmpeg(-F msmpeg4),null

Codecs that works - partly: (mpeg2enc,null) gives flipped view and bgr-flipped colours. (ffmpeg,null -F msmpeg4v2) gives flipped view and bgr-flipped colours.

Codecs that works:

Disabling ugly fonts in X11

2004-01-04 Updated: 2005-01-18 I love antialiased fonts and it hurts my eyes when some fonts are not antialiased. X11's substitution for Helvetica is Type1 and is not antialiased. To disable this do:
xset -fp /usr/share/fonts/default/Type1
(works for every new program started.) Disable in XF86Config:
#    FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"
Unfortunately this does not seem to work everywhere.

SSH will not log in

2004-03-12 From the logfile:
sshd[18384]: error: openpty: No such file or directory
sshd[18384]: error: session_pty_req: session 0 alloc failed
This is because of missing pty's. In my case it was solved with booting with the option 'devfs=mount' (in LILO or GRUB).

X and ssh

2004-10-12
$ xclock
debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
debug1: client_request_x11: request from 127.0.0.1 41479
debug1: channel 1: new [x11]
debug1: confirm x11
Xlib: connection to "localhost:10.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
debug1: channel 1: free: x11, nchannels 2
Error: Can't open display: localhost:10.0
Solution: On client write:
xhost +local:

lsmod: QM_MODULES: Function not implemented

2005-01-18 Solution: upgrade modutils to module-init-tools

CODA client

2005-04-01 I get the following error:
12:47:09 Coda Venus, version 6.0.7
12:47:09 /var/lib/coda/LOG size is 2693010 bytes
12:47:09 /var/lib/coda/DATA size is 10772040 bytes
12:47:09 Initializing RVM data...
12:47:09 ...done
12:47:09 Loading RVM data
12:47:09 Starting RealmDB scan
12:47:09        Found 1 realms
12:47:09 starting VDB scan
12:47:09        0 volume replicas
12:47:09        0 replicated volumes
12:47:09        0 CML entries allocated
12:47:09        0 CML entries on free-list
12:47:09 starting FSDB scan (4166, 100000) (25, 75, 4)
12:47:09        0 cache files in table (0 blocks)
12:47:09        4166 cache files on free-list
12:47:09 starting HDB scan
12:47:09        0 hdb entries in table
12:47:09        0 hdb entries on free-list
12:47:09 WorkerInit: Version Skew with kernel! Get a newer kernel!
12:47:09 WorkerInit: Kernel version is 2
It is caused by 96-bit CODA (CONFIG_CODA_FS_OLD_API=y). Change to 'n' and recompile kernel (recompiling module is not enough).

Windows key as middle mouse button

2005-04-01 The middle mouse button is often missing on portable computers. You can emulate it by pressing left and right simultaniously. On some hardware that works remarkably bad. Therefore it might be nice to have an alternative such as pressing the windows-key (next to altgr).
$ cat /usr/lib/X11/xkb/compat/mousek
default partial xkb_compatibility "mousek" {
    interpret Menu {
        action = PointerButton(button=2);
    };
};
$ setxkbmap -compat complete+mousek
For some reason I have yet to get it to work without entering the last line by hand.

Remote hosts are not allowed to connect to at port forwarded by ssh

2005-05-11, 2005-08-31 Solution: -g on the client. GatewayPorts yes in sshd.conf on the server.

SMTP, POP3 and IMAP-sessions

2005-07-21

How to talk directly to SMTP

$ telnet pi.dk 25
Trying 130.228.0.10...
Connected to pi.dk.
Escape character is '^]'.
220 ns4.pi.dk ESMTP Postfix
helo my.name
250 ns4.pi.dk
mail from: <sender@tange.dk>
250 Ok
rcpt to: <recipient@tange.dk>
250 Ok
data
354 End data with <CR><LF>.<CR><LF>
Message-id: <2005-07-21-random@tange.dk>
Subject: Test

This is a test
.
250 Ok: queued as 8DF64AD51D7
quit
221 Bye
Connection closed by foreign host.

How to talk directly to POP3

$ telnet pop3 110
Trying 12.70.0.1...
Connected to pop3.
Escape character is '^]'.
+OK DBMAIL pop3 server ready to rock <c0ad95f3ecdc0dfa161a9a108932e595@vns4>
user tange
+OK Password required for john
pass secret
+OK tange has 2 messages (64 octets)
retr 1
+OK 61 octets
Message-id: <2005-07-21-random@tange.dk>
Subject: Test

This is a test
.
dele 1
+OK message 1 deleted
quit
+OK see ya later
Connection closed by foreign host.

How to talk directly to IMAP

$ telnet imap 143
Trying 13.22.80.10...
Connected to imap.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE] Courier-IMAP ready. Copyright 1998-2003 Double Precision, Inc.  See COPYING for distribution information.
1 capability
* CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE
1 OK CAPABILITY completed
2 login "tange" "secret"
2 OK LOGIN Ok.
3 list "" "INBOX"
* LIST (\Unmarked \HasChildren) "." "INBOX"
3 OK LIST completed.
4 select "INBOX"
* FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
* 1 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1121977059] Ok
4 OK [READ-WRITE] Ok
5 UID fetch 1 (UID RFC822.SIZE FLAGS BODY.PEEK[HEADER.FIELDS (From To Cc Subject Date Message-ID Priority X-Priority References Newsgroups In-Reply-To Content-Type)])
* 1 FETCH (UID 1 RFC822.SIZE 1388 FLAGS (\Seen) BODY[HEADER.FIELDS ("From" "To" "Cc" "Subject" "Date" "Message-ID" "Priority" "X-Priority" "References" "Newsgroups" "In-Reply-To" "Content-Type")] {213}
Message-ID: <42E0026B.5090908@tange.dk>
Date: Thu, 21 Jul 2005 22:15:39 +0200
From: Ole Tange <ole@tange.dk>
To: tange@ns.pi.dk
Subject: test
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

)
5 OK FETCH completed.
6 logout
* BYE Courier-IMAP server shutting down
6 OK LOGOUT completed
Connection closed by foreign host.

mcopy/mtools for USB storage

2005-10-19 I have a digital camera that works as a USB storage device. I can mount it as vfat but usually I only want to copy everything from the camera and unmount it again. mcopy does this.

If the USB device is /dev/sda1 put this in /etc/mtools.conf:

drive c: file="/dev/sda1"
mtools_skip_check=1
Now you can do:
mcopy -s c: .

Undelete msdos under Linux

2005-11-12 Try:
fsck.msdos -u /dir/file
http://jbj.rapanden.dk/magicrescue/

Danish keyboard in XFree86

2007-08-31 This section gave me Danish keyboard.
Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option          "CoreKeyboard"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc105"
        Option          "XkbLayout"     "dk"
EndSection

Force CUPS to print on A4 not Letter

2007-08-31

Problem:

The printer only has A4 paper, but sometimes documents in Letter format should be printed. So how to force paper size to A4 or ignore Letter as the specified media and instead print using the default A4.

Solution:

In /usr/lib/cups/filter/pstoraster add '-sPAPERSIZE=a4 -dFIXEDMEDIA' and remove -dNOMEDIAATTRS:
gsopts="$gsopts -sPAPERSIZE=a4 -dFIXEDMEDIA -sDEVICE=cups -sstdout=%stderr"

Use rsync to a server behind a gateway or behind NAT

2008-01-24

Problem:

From the machine foo I have ssh access to the server bar. From the server bar I have ssh access to the server quux. But I do not have ssh access directly from foo to quux. Now I want to rsync data between foo and quux.

Solution:

Make sure you can do this without having to enter anything:
ssh bar ssh quux echo It worked
Now run:
rsync -Have"ssh bar ssh" files-to-transfer quux:destinationdir
quux does not have to be known from foo (i.e. it might just be an entry in bar's /etc/hosts).

Log all file accesses from a command and its subcommands

2008-03-19

Problem:

You have a command that reads or writes to a file, but you do not know which. You want to figure out which.

Solution:

Often you can use strace.
strace -ff -e trace=file command
But it fails sometimes, and it is hard to see what the absolute file name is of calls like:
fchmodat(6, "foo.xml", 0755) = 0
Installwatch might work better if the file is not statically linked:
installwatch -o /tmp/fileaccesses.log command
It fails if the command e.g. is firefox.

loggedFS works if you are only looking at dirs and files, but fails if you use devices (/dev/null).

mkdir /tmp/root
mount --bind / /tmp/root
loggedfs -f -p /tmp/root
In another window:
chroot /tmp/root
ls /dev/null
echo >/dev/null
bash: /dev/null: Permission denied

iwl3945: Microcode SW error detected. Restarting 0x82000008

2008-03-31

Problem:

The wireless driver breaks down when transfering lots of data.

Solution:

Download and install drivers as per http://linuxwireless.org/en/users/Download.

Do not upgrade a Debian package

2008-03-31

Problem:

You have a few packages that you do not want to upgrade automatically.

Solution:

sudo dpkg --get-selections > listOfPackages.txt
# change 'install' to 'hold' for the packages you want to keep
emacs listOfPackages.txt
sudo dpkg --set-selections < listOfPackages.txt

Convert LVM (LVM2) image to normal disk image

2008-08-26

Problem:

You have a disk image in LVM2 like this:
$ file oracle10g_x86.img
oracle10g_x86.img: LVM2 (Linux Logical Volume Manager) , UUID: ivtxaIFIqDDDMPDNni3VzkgKJZKv998
You want an image like this: # file disk.img disk.img: Linux rev 1.0 ext3 filesystem data, UUID=8c0d9123-a5e8-4d13-8cf8-17849dcd4dc9 (large files)

Solution:

losetup /dev/loop7 oracle10g_x86.img
vgchange -ay
ls -l /dev/VolGroup01/LogVol00
cat /dev/VolGroup01/LogVol00 > disk.img

Weblogic 10 jsp: javelin.java.CyclicDependencyException

2008-09-12

Problem:

Weblogic 10 complains on a jsp page:
Caused by: javax.servlet.ServletException: Exception occuured while processing 'foo.jsp'
at weblogic.servlet.jsp.JavelinxJSPStub.compilePage(JavelinxJSPStub.java:309)
...
Caused by: javelin.java.CyclicDependencyException
at javelin.Application.detectDeadlock(Application.java:1369)

Solution

The problem is caused by:
public final class MyClass implements Iterable {
    ...
    public static final class SubCall {
        ...
    }
}
Rewrite the code to:
public final class MyClassSubClass {
    ...
}

public final class MyClass implements Iterable {
    ...
}

Compile fails with: false cru

2008-09-15

Problem:

A compile fails with something like:
false cru .libs/libCglClique.a .libs/CglClique.o .libs/CglCliqueHelper.o

Solution

The problem is caused by missing command 'ar'. Set the path so 'ar' is in your path.

syslog: APIC error on CPU0: 40(40)

2008-09-24

Problem:

Every other entry of syslog says: APIC error on CPU0: 40(40).

Non solution:

Boot with 'noapic' in /boot/grub/menu.lst:
kernel          /vmlinuz-2.6.25-2-686 root=/dev/mapper/sda2_crypt ro noapic
This caused massive file corruption on two ext3 filesystems.

Find the filename that occupies a given block

2008-09-26

Problem:

A block has gone bad on your harddrive. 'badblocks' reports the block number. Which file was hit?

Solution:

Find the inode using the block. Then find the name of that inode.
# debugfs
debugfs: open /dev/sda1
debugfs: icheck 100239934
debugfs: ncheck 9093126

tap device not found

2008-09-29

Problem:

QEMU says:
warning: could not configure /dev/net/tun: no virtual network emulation
Could not initialize device 'tap'
ifconfig says:
sudo ifconfig tap1 2.3.4.5
SIOCSIFADDR: No such device
Solution:
modprobe tun
apt-get install uml-utilities
# Find first unused TAP device
TAP_ID=0;
while ifconfig tap$TAP_ID >/dev/null 2>/dev/null; do
  TAP_ID=$((TAP_ID+1))
done
TAP=tap$TAP_ID

sudo tunctl -u `whoami` -t $TAP

Keyboard input stops working in X

2009-05-12

Problem: Keyboard input stops working in X

Solution: Run 'xev'. Now the keyboard starts working. Exit xev.

Java 6 in IceWeasel Firefox

2009-06-08

Problem: Java in the browser is not the configured one

Solution: sudo update-alternatives --config iceweasel-javaplugin.so

Eikbank java makes IceWeasel Firefox freeze

2009-06-08

Problem: Java in the browser freezes the browser

Solution: sudo update-alternatives --config iceweasel-javaplugin.so Choose: /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so Restart browser

kqemu will not compile on Debian

2009-08-17

Problem: make[4]: *** No rule to make target `/home/tange/qemu/kqemu/kqemu-1.4.0pre1/kqemu-mod-x86.o', needed by `/home/tange/qemu/kqemu/kqemu-1.4.0pre1/kqemu-mod.o'. Stop.

Solution: apt-get remove linux-headers-2.6.30-1-686;apt-get install linux-headers-2.6.30-1-686

Network interface in Solaris under Qemu

2009-08-17

Problem: Solaris does not see any network interfaces

Solution: http://www.yonahruss.com/2007/03/solaris-10-doesnt-find-network-card.html

modload /kernel/drv/rtls
ifconfig rtls0 plumb
touch /etc/dhcp.rtls0
touch /etc/hostname.rtls0
reboot

Create user in PostgreSQL

2009-08-27

Problem: How to create a user in PostgreSQL

Solution:

su - postgres
psql
postgres=# create user tange password 'password' createdb;

Postfix problem with fatal: unknown service: smtp/tcp

2009-12-23

Problem: Postfix complains "fatal: unknown service: smtp/tcp" - but only under heavy load

Solution: Stop nscd for /etc/services and copy it in:

cp /etc/services /var/spool/postfix/etc

Git: fatal: Out of memory, malloc failed error: failed to run repack

2010-03-23

Problem: git complains:

fatal: Out of memory, malloc failed
error: failed to run repack

Solution:

git repack -adf --window-memory=1g
This does not work:
[core]
	compression = 1
	windowMemory = 200m
[pack]
	windowMemory = 400m
	compression = 1
        # windowMemory should be (free RAM)/(number of cores).

Debian package authentication fails

2010-03-24

Problem: apt-get complains:

WARNING: The following packages cannot be authenticated!                           
Install these packages without verification [y/N]?                                 
E: Some packages could not be authenticated

Solution:

apt-get update # Works sometime
GET http://ftp-master.debian.org/keys/archive-key-5.0.asc | gpg --import
gpg --export -a 55BE302B | sudo apt-key add -
# Or if you trust nothing is tampered:
GET http://ftp-master.debian.org/keys/archive-key-5.0.asc | sudo apt-key add -

Meassure tcp packet loss

2010-03-24

Problem: We have a problem with the connection to a server. ICMP works fine with no packet loss and no odd delays. But TCP connections get stuck for a few seconds every 10 seconds or so. So I deviced this test to measure the problem:

ssh root@server 'ping localhost' \
| perl -ne '$|=1; $a=`date +%s.%N`*1000; printf "%0.2f ms TCP fluctuation since last\n", $a-$f;$f=$a+1000'|tail -n +3
It shows the fluctuation in delay in milliseconds for TCP connections. On a stable connection with no packet loss and no random delays you should see numbers between -5 and +5.

Interactive ssh jump on a machine

2010-10-13

Problem: I have to login to serverfoo to login to serverbar. I want an interactive session.

Solution:

ssh -t serverfoo ssh -t serverbar