Archive for April, 2007

Install Ubuntu (Feisty) from USB Stick

April 27th, 2007 No comments

For details, see Ubuntu docs here.

  1. mkdosfs /dev/sdc1 – replace sdc with usb stick device
  2. syslinux /dev/sdc1
  3. may need to install-mbr /dev/sdc
  4. find hd-media files for distro and copy to first usb partition
  5. create syslinux.cfg with:
  6. default vmlinuz
    append initrd=initrd.gz ramdisk_size=12000 root=/dev/rd/0 rw
  7. copy Ubuntu iso (apparently any will work)
  8. boot from stick

Note: syslinux.cfg as described in the docs does not work – removing the “init=/linuxrc” fixes the problem.

Categories: Uncategorized Tags:

Seven Post-Install Tips for Ubuntu 7.04

April 20th, 2007 No comments

From PC-Week: check this out.

Categories: Uncategorized Tags:

Ubuntu: Fix your Screen Resolution

April 20th, 2007 No comments

You’ve booted into Ubuntu and your expensive high-res display is running at a paltry 1024 by 768 resolution instead of the 1280 by 1024 or 1600 by 1200 you’re accustomed to. So you click System, Preferences, Screen Resolution, only to find that the higher resolutions you know your display can support are not offered in the drop-down list. What the heck?This is usually an indication that Ubuntu has failed to suss out the characteristics of your monitor. (Graphics card woes are also possible in this case, but in my experience monitor trouble is more common.) Luckily, a helpful Fix Video Resolution Howto in the Ubuntu wiki has solved this issue every time I’ve encountered it. The instructions there should be enough to get your display in gear.

Categories: Uncategorized Tags:

Xorcom BRI Zaptel

April 19th, 2007 No comments

Can be found here.

Categories: Uncategorized Tags:

CentOS Kernel Header Issue

April 16th, 2007 No comments

Nasty little glitch in CentOS 4.4 kernel headers can be fixed with:

sed -i s/rw_lock/rwlock/ /usr/src/kernels/`uname -r`-`uname -m`/include/linux/spinlock.h

Categories: Uncategorized Tags:

Array to Hash in Ruby

April 11th, 2007 No comments
a = [1, 2, 3]
Hash[*a.collect { |v| v, v*2].flatten]

or from something Ryan Carver was trying to do:


I found myself writing something like this far too often:

def map_something(array)
  hash = {}
  array.each do |a|
    hash[a] = lookup_value a

It bugged me every time, but digging through the Pick Axe never yielded (ahem) a simpler solution. What I wanted to do is this:

def map_something(array)
  array.to_h do |a|
    lookup_value a

But of course you’d need Array#to_h. Here’s the cleverest implementation I could think of.

class Array
  def to_h(default=nil)
    Hash[ *inject([]) { |a, value| a.push value, default || yield(value) } ]

A pointless example:

a = [1, 2, 3]
a.to_h do |v|
  [v * 2, v * 3]
> {1=>[2, 3], 2=>[4, 6], 3=>[6, 9]}

I love Array#inject!

Categories: Uncategorized Tags:

How to Build Apt Repositories

April 10th, 2007 No comments

Go to /var/cache/apt/archives and copy your debian packages to a folder of your choice, for example, /home/$username/repository
Cd into the directory and generate a Packages.gz file like this:

sudo dpkg-scanpackages .   /dev/null | gzip -9c > Packages.gz

Add the following line to your apt sources file (/etc/apt/sources.list)

deb file:/home/$username/repository/disk_1 /

Remember to replace $username with your username
Reload your package index like this:

sudo apt-get update

And you’re done.

Categories: Uncategorized Tags:

Use Manifest to Gain Admin Rights

April 6th, 2007 No comments

Microsoft recommend that all executables, such as Setup programs (which need access to protected areas of Windows), should be marked as requireAdministrator. This is achieved by using a manifest file (embedded or external).

You can try this yourself. Below is a valid manifest file. To mark a file “Fred.exe” as requireAdministrator, save the text below to the file “Fred.exe.manifest” in the same folder as “Fred.exe”. When “Fred.exe” is run under Vista User logon you will see the customary Admin approval window appear.

Manifest file

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">      <assemblyIdentity version="" 	processorArchitecture="X86" 	name="ExeName" 	type="win32"/>  <description>elevate execution level</description>     <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">       <security>          <requestedPrivileges>             <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>          </requestedPrivileges>       </security>    </trustInfo> </assembly>
Categories: Uncategorized Tags:

How to Remaster Ubuntu Dapper Drake

April 3rd, 2007 No comments

How to remaster Ubuntu Dapper Drake

Categories: Uncategorized Tags: