Author Archives: bolt

xorg.conf for KVM

Found this somewhere. Works for me. Section “ServerLayout” Identifier “BodhiZazen’s KVM xorg.conf” Screen 0 “Screen0” 0 0 InputDevice “Mouse0” “CorePointer” InputDevice “Keyboard0” “CoreKeyboard” EndSection Section “Module” Load “record” Load “dri” Load “extmod” Load “glx” Load “dbe” Load “dri2” EndSection Section “InputDevice” Identifier “Keyboard0” Driver “kbd” EndSection Section “InputDevice” Identifier “Mouse0” Driver “vmmouse” Option “Protocol” “SysMouse” […]

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 […]

Debian APT Pinning properly explained

Accidentally stumbled across the “Debian Cheat Sheet” at http://carlo17.home.xs4all.nl/howto/debian.html (now dead – see pdf below) Finally some documentation on why the heck pinning with “Package: *” and “Package: mypackage” doesn’t mix well, and other useful knowledge. In case the link goes dead, here’s a PDF: debian_cheat_sheet.pdf

Using LD_PRELOAD to override a function

This was blatantly stolen from technovelty, kept here because I hate it when my bookmarks die. For some reason, people seem to get this quite wrong a lot of the time. Certainly one should not be playing with symbols that start with __ unless you really know what you’re doing with them. ianw@lime:~/tmp/override$ cat override.c […]

How difficult is it to misuse the code you write?

I found these “misuse levels” over at technovelty, which they originally ripped from Rusty Russel’s Bleeding Edge Page, which is a page you should definitely check out if you haven’t. Anyway, I found these “misuse levels” both hilarious to read and at the same time somewhat concerning, as I started thinking “Where does my code […]

Debian and Ubuntu auto-login and Xorg without a display manager

If you have a harddrive password (most laptops do this) or full disk encryption, you might not feel the need for an additional login after your system boots. On most Debian-based systems, TTY’s 1 through 6 are available after boot, while TTY 7 is used for Xorg. Therefore, I like to put my auto-login TTY […]

How to Hide a User Account from the Welcome Screen

Use RegEdit (start->run->”regedit”) to go to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\ Add, if one does not exist, a key called “SpecialAccounts” Under that, add a key called “UserList” Create new DWORD (32-bit) keys for each user you want to hide in your newly formed HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\Userlist Make the name of each DWORD the EXACT username you want to […]

Save and restore partition tables with sfdisk

In my raid setup, I set up the partitions a certain way for running several mdadm raids on the same drive. My server currently boots off of two drives, sda and sdb, where sda1 and sdb1 are the root file system in raid 1 (mirror) and sda2 and sdb2 are (encrypted) swap in raid 0 […]

sudo without a password

Note, this is not something I recommend doing. In fact, the only reason why I’m documenting it is that I am removing this solution from the last box I used to have it on. Anyway, edit the /etc/sudoers file (with visudo, as root), then add lines under the default one for root, like this: # […]