timdoug's interesting tidbits

Little bits of technical documentation and such. Hopefully helpful.

2012-12-13

How to install a fully patched and up-to-date lighttpd on Debian unstable that passes Qualys SSL Labs' tests

...well, except for the cipher suites that require an OpenSSL >= 1.0.0, but that's an adventure for another day.

wget http://redmine.lighttpd.net/attachments/download/1395/ssl-compression.diff
wget http://ftp.us.debian.org/debian/pool/main/l/lighttpd/lighttpd_1.4.31-3.debian.tar.gz
wget http://ftp.us.debian.org/debian/pool/main/l/lighttpd/lighttpd_1.4.31.orig.tar.gz
tar xvzf lighttpd_1.4.31.orig.tar.gz
cd lighttpd-1.4.31/
tar xvzf ../lighttpd_1.4.31-3.debian.tar.gz
vi debian/control [and get rid of the dpkg-dev version dependency]
vi debian/rules [and get rid of the "export=config" line and the previous backslash]
patch -p1 <../ssl-compression.diff
debuild -us -uc
[then install all of the dependencies it barks about and try again...]
cd ..
sudo dpkg -i lighttpd_1.4.31-3_amd64.deb
sudo /etc/init.d/lighttpd restart
And make sure these options are in your lighttpd ssl.conf:
    ssl.cipher-list = "RC4-SHA:AES256-SHA:AES128-SHA:DES-CBC3-SHA"
    ssl.honor-cipher-order = "enable"
    ssl.use-sslv2 = "disable"
    ssl.use-sslv3 = "disable"
    ssl.use-compression = "disable"

[/debian] permanent link

2010-11-09

NFS doesn't work!

Unable to start nfsd or portmap in Debian? Getting weird errors in /var/log like the following?

The solution: make sure that the loopback device is up. E.g., make sure this is in /etc/network/interfaces:
auto lo
iface lo inet loopback

[/debian] permanent link

2009-12-05

Help! I have no /dev/dsp!

Just modprobe snd_pcm_oss and snd_mixer_oss, and restart udev. Then relive all your old Mac game meories through SheepShaver...

[/debian] permanent link

2009-12-01

How to type accents in X

You'll want to use something called the Compose Key. Good instructions on this site, but here's a quick installation summary:

Mmm, háčeky.

[/debian] permanent link

2009-11-02

My Terminal Emulator Setup in Debian

On my Debian boxes I use evilwm as my window manager, because it gets out of my way in just the way I like. Hence, I don't use gnome-terminal or kterm or ETerm or what have you; xterm has worked perfectly fine.

Nevertheless, I frequently spawn a lot of terminals, and the 5MB that each xterm process eats up (not including the 3MB bash does) add up after I fill a few virtual desktops with terminals. Xterm is also quite slow: cat'ing a 15K line banner output takes ~4 seconds on my netbook.

Hence, I went looking for replacements. Rxvt takes ~2MB per instance and cats the same file in ~1.2 seconds. Mrxvt takes ~3MB and ~0.5 seconds. Rxvt-unicode takes the cake, though, at ~3 MB and ~0.3 seconds. The real kicker, though, is its "daemon" mode, in which only once process is spawned for all "client" terminals, saving a lot of RAM. (Just hope it doesn't crash!)

Here's my setup:

  1. apt-get install rxvt-unicode-lite
  2. ~/.Xresources: (for a nice black-on-white xterm-like experience)
    URxvt*scrollBar: false
    URxvt*reverseVideo: true
  3. sudo update-alternatives --config x-terminal-emulator and select urxvtcd
Now I save 4-5MB of RAM for every terminal I have open, and when that gets to ~10 terminals that's not an insignificant amount of memory on a machine with 1GB of memory (and even more important on my lower-spec'd machines).

[/debian] permanent link

2009-09-15

Installing SheepShaver and BasiliskII on Debian

I've tested SheepShaver with Mac OS 7.6.1 and Mac OS 8.1 with a 4MB OldWorld ROM. Sound works (even though ESD isn't used), video works, haven't tried ethernet. (all done on my current Debian unstable Intel Atom netbook.) The same instructions work for BasiliskII.

  1. Install the following packages: build-essential autoconf2.59 automake1.4 libxt-dev libxext-dev libxxf86dga-dev libxxf86vm-dev
  2. Follow the instructions here to download and the source from CVS, and make links as directed.
  3. Patch autogen.sh in src/Unix thusly:
    --- old/SheepShaver/src/Unix/autogen.sh 2007-06-13 14:09:05.000000000 +0200
    +++ ss2/SheepShaver/src/Unix/autogen.sh 2009-09-15 12:21:32.000000000 +0200
    @@ -40,13 +40,13 @@
     
     aclocalinclude="$ACLOCAL_FLAGS"; \
     (echo $_echo_n " + Running aclocal: $_echo_c"; \
    -    aclocal $aclocalinclude; \
    +    aclocal-1.4 $aclocalinclude; \
      echo "done.") && \
     (echo $_echo_n " + Running autoheader: $_echo_c"; \
    -    autoheader; \
    +    autoheader2.59; \
      echo "done.") && \
     (echo $_echo_n " + Running autoconf: $_echo_c"; \
    -    autoconf; \
    +    autoconf2.59; \
      echo "done.") 
     
     rm -f config.cache
  4. The output should look something like this:
    SheepShaver configuration summary:
    
    SDL support ...................... : none
    FBDev DGA support ................ : yes
    XFree86 DGA support .............. : yes
    XFree86 VidMode support .......... : yes
    Using PowerPC emulator ........... : yes
    Enable JIT compiler .............. : yes
    Enable video on SEGV signals ..... : yes
    ESD sound support ................ : no
    GTK user interface ............... : no
    mon debugger support ............. : no
    Addressing mode .................. : real
    Bad memory access recovery type .. : siginfo
    
    Configuration done. Now type "make".
  5. Patch sys_unix.cpp in src/Unix thusly:
    --- sys_unix.cpp.old    2009-09-15 12:28:54.000000000 +0200
    +++ sys_unix.cpp        2009-09-15 12:29:06.000000000 +0200
    @@ -883,11 +883,6 @@
                            }
                    }
     #endif
    -#ifdef CDROM_DRIVE_STATUS
    -               if (fh->cdrom_cap & CDC_DRIVE_STATUS) {
    -                       return ioctl(fh->fd, CDROM_DRIVE_STATUS, CDSL_CURRENT) == CDS_DISC_OK;
    -               }
    -#endif
                    cdrom_tochdr header;
                    return ioctl(fh->fd, CDROMREADTOCHDR, &header) == 0;
     #elif defined(__FreeBSD__) || defined(__NetBSD__)
  6. Make.
  7. If SheepShaver gets angry about ERROR: Cannot map Low Memory Globals: Permission denied. try: sudo sysctl -w vm.mmap_min_addr=0
To be continued...

[/debian] permanent link

2009-08-09

GMABooster segfaults on my machine!

Run it is root.

[/debian] permanent link

2009-07-22

Benchmarking Intel's UXA, round 2

Debian unstable just upgraded to xserver-xorg-video-intel version 2.8.0. (released two days ago -- who says Debian is out of date?) This release is notable in that it removes support for EXA and DRI1, leaving only UXA and DRI2 for acceleration. Considering my previous benchmarking attempts, I thought it was only right to check the new drivers.

UXA on 2.8 is still slower than EXA on 2.7, but not by much. Notably, it's much faster than UXA on 2.7. I'm sure further releases will only lower these numbers further.

[/debian] permanent link

2009-07-21

Installing Grub 2 on Debian sid

Sid has recently moved grub to grub-legacy and made grub 2 the default. My installation went fine -- all I had to do was remove grub-legacy (because of some conflicting man pages) and install os-prober and recreate grub.cfg to recognize my WinXP partition.

Hooray new packages in Debian!

[/debian] permanent link

2009-07-16

Benchmarking Intel's UXA vs EXA

There's been a lot of development with regard to Intel's new UXA acceleration framework for its GMA integrated graphics chips. Benchmarks over at Phoronix have shown mixed results, so I decided to run some tests myself.

Tests run on an Asus Eee PC 900HA, with a 1.6GHz Atom N270 processor and integrated GMA 950 graphics, gtkperf 0.40, default Debian kernel 2.6.30, Xorg 1.6.2, and Intel driver 2.7.1. (i.e., an up to date unstable installation.)

So it looks like I'm sticking with EXA for now. If you have any tips as to boost either of these numbers, do let me know.

[/debian] permanent link

2009-06-23

How to create a custom Debian package

I'm nowhere close to having the knowledge of a true Debian Developer, but I've used the OS enough to want to create my own packages. In this circumstance, I wanted a newer version of evilwm (it's 1.0.0 in the repo, and 1.0.1 is the newest release) and I wanted to change the mouse button behaviour. The steps I followed (I'm sure there's a cleaner way -- do inform me).

  1. apt-get install devscripts build-essential
  2. apt-get build-dep evilwm
  3. apt-get source evilwm
  4. Patch/hack away...
  5. debchange -n and document your non-maintainer changes
  6. debuild -us -uc so we don't try to sign it
  7. dpkg -i the resultant package
Cheers!

[/debian] permanent link

2009-06-22

Getting an Elantech touchpad working in Debian squeeze (or: how to disable tap-to-click on an Eee 900HA)

Tap to click on a trackpad is a terrible idea. When I want to click, I'll hit the damn button myself, thank you very much. My ratio of unwanted to wanted tap-to-clicks is understandably undefined.

Three systems need to be configured for this to work: the kernel, the Xorg driver, and the X server itself.

  1. The kernel
    As documented here, recent kernels don't need to be patched; they just need CONFIG_MOUSE_PS2_ELANTECH enabled. Sadly, because of other issues the maintainers know about, it won't be enabled in mainline Debian kernels anytime soon. So either you'll have to build a kernel yourself, or just take the psmouse.ko I've created from 2.6.30, and pop it in the apropriate location in /lib/modules.
  2. The Xorg driver
    Debian testing ("squeeze" at time of writing) has an old version of xserver-xorg-input-synaptics that doesnt have the necessary Elantech patches. Unstable does, but pinning the binary has other dependencies that would pretty much require upgrading all of X, which I'd rather not do. So you can either pin the source file and build it yourself, or download and install the package I've made. Grab it here.
  3. The X server
    We just need to poke aorund xorg.conf a bit. What worked for me:
    Section "InputDevice"
            Identifier      "Configured Mouse"
    	Option		"CorePointer"
            Driver          "synaptics"
            Option          "Device"                "/dev/input/event10"
            Option          "Protocol"              "auto-dev"
            Option          "SHMConfig"             "true"
    	Option		"MaxTapTime"		"0"
            Option          "VertTwoFingerScroll"   "1"
            Option          "HorizTwoFingerScroll"  "1"
    EndSection
Good luck!

[/debian] permanent link

Running Debian testing on an Eee PC 900HA

Great news: almost everything works out of the box. I was concerned about hardware support, and struggling with wireless, so I just apt-pinned the latest kernel from unstable, and it works perfectly.

  1. X11 at 1024x600, DRI
  2. Sound
  3. Ethernet
  4. Touchpad w/ two-finger scrolling (although with annoying-as-hell tap to click -- more on that later)
  5. Wireless
  6. Camera (w/ Skype)
  7. Suspend to RAM
Protip: make sure to modprobe acpi-cpufreq for frequency scaling.

I'm using evilwm as my window manager, because I love how it gets out of my way and lets me do my work. I'd post a screenshot, but there's no eye-candy to show off... =) I've also had to hack Firefox into shape so it doesn't take up silly amounts of vertical pixels.

[/debian] permanent link

2009-06-18

How to Install Debian on an Eee PC 900HA

I just picked up an Asus Eee PC 900HA. It, currently, has the best mix of size, cost, and capabilities for what I want in a netbook. I'm keeping Windows on it to use Ableton Live and for "just in case" purposes. Here's documentation of what I've done to re-partition, keeping the provided Windows installation, and install Debian testing.

  1. Download and repartition using a GParted bootable USB drive. I used the Windows-based choice 3.
  2. Make sure to set the USB disk as higher priority than the internal drive, or else it'll boot from the HD every time.
  3. My drive came partitioned into four partitions:
    1. Windows boot (~80 GB)
    2. Windows free (empty, ~60 GB)
    3. Windows restore partition (~8 GB)
    4. Extra restore info? (~40 MB)
    You should be safe deleting all but the first partition and going from there, but it's not as if I'm wanting for space on this netbook, so I let 'em stay.
  4. Follow the instructions on this page of the Debian installation manual.
To be continued...

[/debian] permanent link

2009-06-03

Help! I'm running out of stack space!

Edit /etc/security/limits.conf, open up a new shell, and have fun with ulimit.

[/debian] permanent link

2009-06-01

How to install rsh on Debian

Debian is aptly (hah!) fickle with regard to rsh -- by default, if you have OpenSSH installed, rsh is just a symlink to it. For my research I need rsh in order to get around the overhead that ssh incurs; security isn't an issue because the machines are on a private network anyway.

  1. apt-get install rsh-redone-client rsh-redone-server
  2. Add appropriate hostnames to ~/.rhosts
  3. Edit /etc/hosts.deny and add in.rshd in.rlogind: ALL
  4. Edit /etc/hosts.allow and add in.rshd in.rlogind: [hostnames] as necessary.
Have (insecure) fun!

[/debian] permanent link


© 2006-18 timdoug | email: "me" at this domain
So necessary