Category Archives: Solved Problems

Problems and solutions. Good stuff.

Linux on Mac Mini – power on after power loss

The Mac Mini doesn’t save this information in its BIOS (or equivalent), so you need to set it on each boot. I use my distribution’s /etc/rc.local file for this. Either way, these are the commands to run (copy, and uncomment the correct line for your Mini): ## PPC Mac Mini #echo server_mode=1 > /proc/pmu/options ## […]

Fixing “shmget() failed: No space left on device”

I had this happen when someone ran a script to kill x11vnc every so often, using kill -9 (don’t ask). Killing x11vnc with SIGTERM (15) allows it to clean up its shared memory segments. SIGKILL (9) will not. Googling around, I found a script over here (backup copy here). The problem with that was that […]

SSH in a while loop – stdin problems

When SSH is used with a line like “while read ….”, the while loop will only run once. This can be seen by running this simple example: $ seq 1 10 | while read line; do ssh remotehostname “echo x${line}x”; done x1x You might expect this to connect to the host with the name “remotehostname” […]

GCC stray X in program

Problem: IEMGD_HEAD_Linux/common/drm/emgd/display/pi/cmn/pi.c:1: error: stray ‘\357’ in program This is caused by “invalid” characters in the code, specifically I encountered this while trying to compile the Intel EMGD driver for my EEEPC’s graphics card. Thanks to the helpful folks over here, there’s a solution: cd IEMGD_HEAD_Linux/common/drm/emgd/display/pi/cmn cat -v pi.c | awk ‘{if(NR>1) print $0}’ > tmp […]

bash time limit on commands

Several programs, like “timelimit” and “timeout”, exist to prevent a process from running for too long. However, if you want to do this on a box where neither is installed, there’s a way to do so with bash alone. Based on the original script I found at pixelbeat.org… #!/bin/sh # Execute a command with a […]

What’s touching that config file?!

Recently I started wondering what the heck was putting “root: bolt” at the end of /etc/aliases “every time” I did an upgrade of something. I asked #debian on irc.freenode.net, who told me to run this: grep /etc/aliases /var/lib/dpkg/info/*postinst What it does is basically to look though all files which names end in “postinst” in the […]

Putty keeps disconnecting

On a recent vacation, taking a train across the entire country, I was using my cell phone’s 3G connection to provide my Internet connection. Every little tunnel and other signal interference along the way would cut off the SSH connection I was sending all my traffic through. While googling, still on the train, I found […]