Dec 17, 2013
0 notes

Generate bogus MAC according to IP address

To produce a MAC address from an IP address, to ensure uniqueness when adding to DHCP settings, say:

alias p=printf
function genmac {
    p 20;p ':%02X' 0 ${1//./ }
}

Now use genmac 127.0.0.1 and you’ll have a MAC address you can use in your configs without fear of clashes. Lovely :D

Dec 10, 2013
0 notes

Making a bootable USB stick from a Windows DVD iso

In my attempts to turn a backup iso of a Dell OEM Windows DVD into a bootable USB stick (to reinstall a Dell desktop machine), I found many and varied accounts of how to achieve this.

There are loads of tools to help with this — winusb, unetbootin and so on, but I couldn’t get them to work.

However, it turns out that for a simple single boot image USB stick (which was all I wanted at the time) all you need is:

  • A single FAT32 or NTFS partition
  • The contents of the Windows DVD copied onto that partition
  • A Windows MBR on the USB stick

…and it Just Works{tm}.

So it should be as simple as:

  • Ensure the usb stick is unmounted — probably using pumount /dev/sd<something>
  • fdisk /dev/sdx (or whatever device the usb stick has shown up as), remove all existing partitions and create a single partition set as NTFS or FAT32 (LBA)
  • mkfs.ntfs (or mkfs.vfat) /dev/sdx1
  • Mount this somewhere with mount /dev/sdx1 /media/usb, or eject and re-insert the stick
  • Copy the contents of the iso onto the USB stick — you can either extract the contents using 7z x backup.iso or by loopback mounting the iso with mount -o ro,loop backup.iso /media/loop and then copying
  • Use ms-sys to put a standard windows MBR on the USB stick
  • And that’s it! (The only tool required is ms-sys, but that should be packaged by your distro or it’s trivial to build from sources)

The same should also be true to creating such a bootable USB stick from Windows, just using fdisk /mbr on the usb device in place of ms-sys.

(The available tools are probably a better bet if you want to have a multi-boot stick and a menu to pick what to boot, but this will do for a simple single-use stick)

Oct 17, 2013
0 notes

modinfo — show options available to linux kernel modules

e.g. modinfo iwlwifi

Really quite useful when fiddling with the options available to see if you can make your Intel wireless card actually work properly under Linux…

It seems there are a lot of reported problems with 802.11n support on the Intel wireless chipsets over a couple of years, but no proper fixes yet :(

Oct 8, 2013
0 notes

Debian unstable stumpwm “cannot find component” errors

It seems that there is a bug with the current Debian unstable asdf which causes Lisp compilers to fail to find the installed components if the XDG_DATA_DIRS variable is not set. This variable is set if you use Gnome, but when not set asdf fails to use a default setting for where to look for systems or source and so doesn’t find anything at all!

This has been reported as Debian bug 723977 and a fix is in testing so hopefully it will be updated soon.

As a workaround, you can add the following to a file which is included by the common-lisp-controller, such as /home/username/.config/common-lisp/source-registry.conf.d/system.conf (anything in the ~/.config/common-lisp/source-registry.conf.d directory is included, so you can have multiple separate files in here), containing:

(:tree "/usr/share/common-lisp/source/")

..and this will allow all lisp compilers/interpreters to find the installed packages. It used to be that symlinks were required from /usr/share/common-lisp/systems/ into the individual package directories, but this has been deprecated in favour of it searching the source tree.

This took me a while to find, so I thought it would be good to share this for others to find and save some time and pain :)

Jul 7, 2013
0 notes

Outrun Cannonball OpenGL output

OpenGL rendering added which improved performance considerably :D

Apr 1, 2013
0 notes

DVD ripping part 2 — ddrescue, “dvdbackup —mirror” and “dvdbackup —feature”

So I’ve got things working a bit better now. There have still been one or two that haven’t ripped using one of these three methods, but this covers 99% of my DVDs that I want to play with MythTV:

  • Method 1 : ddrescue

    ddrescue -n -b 2048 /dev/sr0 dvdtitle.iso dvdtitle.log
    

    When this works you might get one or two error sectors, but most of the disc will rip without error. These errors are intentionally added as part of the copy-protection. This gives a DVD iso image which mythvideo is happy to play.

  • Method 2 : dvdbackup —mirror

    This produces a VIDEO_TS folder which, again, mythvideo is happy to play. Sometimes this doesn’t work, or produces a damaged rip which is several times the size of the real DVD. If it’s bigger than about 10GB then this probably won’t play, so try method 3:

  • Method 3 : dvdbackup —feature

    This produces a VIDEO_TS folder, but often mythvideo won’t play it. mplayer is generally happy to play this.

All in all, still a bit of a pain but at least I can play most of the DVDs I own now!

Mar 29, 2013
0 notes

Moved from Posterous to Tumblr…

Blog moved since Posterous is closing soon to “concentrate on Twitter”… Hopefully the RSS feed will continue working (need to check on this!)

http://Justmigrate.com was a big help to move the posts across but the (very few) comments can’t be migrated on this way, so apologies to both commenters when on the previous host!

The main features I was using were post-by- email and Markdown for formatting, both of which are available on Tumblr. Phew :D

Mar 29, 2013
0 notes

Outrun Cannonball

Reverse-engineered open-source Outrun with improved graphics and (coming soon) track editor. Acebest!

Feb 17, 2013
0 notes

MythTV playing of copy-protected DVDs

After a fair amount of pain trying to find ways of getting copy-protected DVDs to play under MythTV:

  • Seeing if MythTV can play these DVDs directly from the disc (no)
  • Trying to find Linux tools which can rip the DVDs (none)
  • Running various windows DVD-ripping tools under WINE (just gives disc read errors and fails)
  • Running various windows DVD-ripping tools in a VirtualBox VM (just gives disc read errors and fails)
  • Realising that one of the DVD drives I was trying this on is still region-locked (Linux kernel messages like “Add. Sense: Read of scrambled sector without authentication”)
  • etc

..I’ve made the sad realisation that I’m just going to have to keep a Windows machine around to be able to use something like DVDFab HD Decrypter to rip to an iso or AUDIO_TS/VIDEO_TS directory structure, which MythVideo can then play fine (either locally on the frontend, perhaps via a USB stick, or via a network filesystem mount like NFS or samba).

Ah well, at least I have a way of playing these DVDs now, so it’s better than nothing, but it would be nice to get this all working without having to resort to a Windows box and some proprietary software. (I got rid of my DVD player yonks ago, after switching to MythTV for all my TV-related shenanigans)

Oct 21, 2012
0 notes

Encrypted USB stick goodness on Linux as a non-root user (LUKS + cryptsetup + pmount)

(Distilled from the instructions at http://www.mattmckimmy.com/blog/2009/09/21/setting-up-luks-encryption-on-usb-… and with added pmount and not so many screenshots :)

This uses LUKS and cryptsetup, as well as pmount to allow non-root users to mount the device.

Steps required are

  • apt-get install pmount cryptsetup (or equivalent on non-Debian distros)
  • add user to required group (plugdev, on Debian) to allow pmount to be used by a normal user to mount removable devices
  • dmesg | tail => check for device name, such as sdb
  • fdisk /dev/sdb (or whichever disk dmesg said) => create sdb1 as type Linux and to fill usb stick
  • cryptsetup --verify-passphrase luksFormat /dev/sdb1 and set passphrase
  • cryptsetup luksOpen /dev/sdb1 secureUSB
  • mkfs.vfat /dev/mapper/secureUSB
    • If you use vfat then there is max file size of 4Gb
    • If you use ext4 or a similar filesystem then you’ll need to ensure that the UIDs/GIDs match with the machine(s) you’re going to plug the usb stick into, as the filesystem will store the file and dir owners, permissions etc.
  • cryptsetup luksClose secureUSB and you’re done with the setup of the stick
  • Now as a normal user you should be able to do pmount /dev/sdb1 and it will ask you for your passphrase.
  • pumount /dev/sdb1 will unmount this
  • Rejoice! :D
Navigate
« To the past Page 1 of 2
About