Categories
Computergeekery

Restoring C-A-backspace to Xorg server

Recent versions of Xorg have removed the old stalwart key combination of pressing CTRL-ALT-BKSPACE to kill the X server. I’m not sure why this was removed. I can only guess that such a drastic way of exiting your X session, without of course asking if you need to save any of your documents, was regarded as a non-desktop way of doing things. Although I like this key combo I can see this reasoning only too well.

If, like me, you like this behaviour to be restored then there are a few ways of doing so.

  • If you use .xinitrc or .xsession to manage your X session, then simply run this command from there:

    setxkbmap -option terminate:ctrl_alt_bksp

    On Gentoo (the distro I use) you’ll need to emerge the following package:

    x11-apps/setxkbmap
  • If you use HAL to manage input devices, copy the following few lines into the fdi file from /etc/hal/fdi/policy/ which you use to control your keyboard.

    Incidentally HAL was deprecated as of x.org 1.8 in favour of udev. So if your distro uses Xorg.18 or higher you’ll need to find a different way

     <merge key="input.xkb.options" type="string">terminate:ctrl_alt_bksp</merge> 

    (If you do not have any custom keyboard rules, you can copy and adapt rules from /usr/share/hal/fdi/policy/10osvendor/10-x11-input.fdi)

  • Finally you can edit xorg.conf with the following code to your keyboard’s InputDevice section :

     Option "XkbOptions" "terminate:ctrl_alt_bksp".

    

  •  

     

    Categories
    Computergeekery Mac

    Navigating to the $HOME/Library folder in Lion

    In Lion the Library folder in your $HOME folder is now hidden. You can unhide it fairly easy, but a far easier way of navigating to it is holding down the [OPTION] key and using the FINDER GO menu.

    Categories
    Computergeekery

    messing up .htaccess in WordPress

    If you change a hard link in WordPress it appears to edit your “.htaccess” file to fix it.

    I’d had some custom lines to use php5 instead of php4. These got removed and my website stopped working.

    Simple-Tweet is php5 only and this brought the whole lot down.

    Categories
    Computergeekery

    Impressed by the write speed on my new ReadyNas Pro 6

    A 100GB file to a NFS mounted share

    scotgate mnt # dd if=/dev/zero of=/mnt/distfiles2/TEMP bs=1024 count=100000000
    100000000+0 records in
    100000000+0 records out
    102400000000 bytes (102 GB) copied, 1115.25 s, 91.8 MB/s
    
    scotgate mnt # dd of=/dev/zero if=/mnt/distfiles2/TEMP bs=1024 count=100000000
    100000000+0 records in
    100000000+0 records out
    102400000000 bytes (102 GB) copied, 1076.49 s, 95.1 MB/s
    scotgate mnt # 

    That’s quite tidy!

    Categories
    Computergeekery

    removing a file extension from a bunch of files

    During my Ph.D. I used a VMS machine with GCG a great deal. Not a powerful machine by any stretch of the definition but it was there, accessible and had a copy of GCG with updated databases.

    VMS has more than a few differences when compared to UNIX. A great feature is filesystem level versioning.All save operations will create a new version. Edit a file called “mess” and upon saving you will now have “mess;0” and “mess;1”. Edit it a subsequent time and you have “mess;2” and so on. This is a great way to fix a problem if you messed up editing it, Although having all those files in a directory does get a little annoying. I guess that the shell allowed you to only display the most current revision of a file but I never got around to finding how!

    Anyway I recently had cause to revisit a bunch of sequences from my Ph.D. days and had to get rid of the extension of a whole bunch of files (a few thousand). Performing rename operations under UNIX is always a pain in the arse. Linux has the rename command which makes this easier (remember rename is just a mv), but I was doing this from OS X which has no such command. Normally when I come across such a missing app under OS X I’d use Fink to compile and install a missing command, but it seems there’s no package for it.

    Basically I needed to do the following operation on many files:

    mv './INTERESTING.LIST;4' './INTERESTING.LIST'

    However that ;4 could be any digit from ;0 to ;10 depending how many times I’d edited the sequence under VMS.

    For such renaming operations I would use ‘find’ and ‘xargs’, however, for the life of me I could not get it to work.

    In the end I settled for the following command. It’s quite an elegant solution as it uses echo to send the substituted command through sed to remove the version number from the second iteration of the found file, and then pipe this through to the shell to execute it..

    find . -name "*;4" -exec echo "mv '{}' '{}'" \;

    sed 's/\;4//2'

    The full command is:

    find . -name "*;2" -exec echo "mv '{}' '{}'" \;| sed 's/\;2//2' | /bin/sh

    I found this in a post on the Macworld Forums.

    Of course if I had have been clever I’d have run this in a shell loop to perform for each digit. However, I’d wasted too much time as it is and I just ran the command ten times.

    Technorati Tags:

    Categories
    Computergeekery

    Problems uploading images to 1and1 hosts : Server error 500

    I’ve had lots of problems with a 1and1 WordPress installation and uploading images within Marsedit.

    Generally the image was uploaded correctly to the correct location on the host but gave a “Server Error 500” error message. This meant that Marsedit did not insert the link of the image and neither did it show in the Published Images Media Manager

    There’s a quick workaround where I manually added the code to insert the image into the blog post. However, whereas the ability to write raw HTML is always handy, in this case it prevented me from finding a proper fix. I think I’ve had this problem for like a year. What a lazy sod!

    The proper fix is to ensure that PHP is properly setup. Which is hard when you have little control over the host. So a quick fix is to add some lines for handling PHP script execution to your .htaccess file.

    AddType x-mapp-php5 .php
    AddHandler x-mapp-php5 .php

    – Download that file from your WordPress installation, if it exists.

    – Add those line

    – Upload the modified file.

    Note you may need to change your FTP client’s settings to ensure you see dot/hidden files.

    I came across this fix on the wordpress forums.

    Technorati Tags:
    ,

    Categories
    Computergeekery

    New mythtv frontend setup

    I’ve just setup a new Mythtv box. Although the previous system was relatively quiet, it was in a big box, and I want minimalism now rather then obvious geekery in the living room.

    So I’ve got myself an Acer Revo r6310, found at a cracking price on the superb UK Hot Deals. This is a Nvidia ION dual core Intel Atom powered beasty. The old Mythtv box is now up in the loft.

    I was going to try out one of the Mythbuntu releases. But it took ages to download, so I ended up putting a Gentoo minimal installer on a bootable USB stick and went from there. After setting up distcc on my main Linux box (also 64bit) the compilation took about 36 hours.

    Using VDPAU with the binary Nvidia drivers. playback is awesome. So far the largest 1080p sample I have (The trailer for Alexander) plays perfectly. Although I seem to be unable to get WMV audio to play.

    Video output is via the HDMI > DVI and audio is purely via SPDIF to the amplifier.

    Very pleased so far.

    Categories
    Computergeekery

    weird scsi controller shennanigans

    My main Linux workstation uses a pair of u320 300GB SCSI drives with a pair of RAID1 arrays (Linux RAID) attached with a LSI Logic LSI20320-R MPT Fusion based controller. This card has stood me in good stead for quite a few years now. It is a HP branded one I bought on Ebay, however, I flashed it with the LSI generic firmware I found.

    My motherboard is an Asus NCT-D with 1 PCI-e, 1xPCI-e x16 three PCI-X and a single PCI card slot. I wanted to place a PCI card DVB-S in there to act as a slave MYTHTV backend to serve the satellite channels. The only free slot was the one above the SCSI card. However, after adding the DVB-S card my machine refused to boot. The SCSI BIOS did not load.

    It appears that this card MUST be the first card in all the PCI slots (does’t include the PCI-e slots). I’ve never come across this before in many years of messing with scsi host adapters!

    Categories
    Computergeekery Mac

    Update for Quicksilver

    So after writing about Alfred the other week, there’s an update to Quicksilver!

    Download it here

    The changelog says increased performance. Nice to see an old dog keep getting updated!

    Categories
    Computergeekery Mac

    Alfred: A Quicksilver replacement?

    Alfred is a new app launcher (and as with the best of those apps it is much more) for OS X. It’s currently in beta, that you can sign up for at their website.

    Ever since Raj pointed me to Quicksilver it’s become a pretty essential tool on any Mac I use. However, development has dropped off over the past few years and whereas it still works perfectly now if there’s any major OS update it could be that it breaks. Scary! It’s to Albert’s credit that after a week of using it it’s slipped straight into my workflow without hardly any interruption or even being noticed!

    Nice!

    What’s also cool, although location only relevant for property programmes, is that the guys are local (to me in Cambridge that is!).