For details, see Ubuntu docs here.
- mkdosfs /dev/sdc1 – replace sdc with usb stick device
- syslinux /dev/sdc1
- may need to install-mbr /dev/sdc
- find hd-media files for distro and copy to first usb partition
- create syslinux.cfg with:
default vmlinuz
append initrd=initrd.gz ramdisk_size=12000 root=/dev/rd/0 rw
- copy Ubuntu iso (apparently any will work)
- boot from stick
Note: syslinux.cfg as described in the docs does not work – removing the “init=/linuxrc” fixes the problem.
From PC-Week: check this out.
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.
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
a = [1, 2, 3]
Hash[*a.collect { |v| v, v*2].flatten]
or from something Ryan Carver was trying to do:
Array#to_h
I found myself writing something like this far too often:
def map_something(array)
hash = {}
array.each do |a|
hash[a] = lookup_value a
end
hash
end
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
end
end
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) } ]
end
end
A pointless example:
a = [1, 2, 3]
a.to_h do |v|
[v * 2, v * 3]
end
> {1=>[2, 3], 2=>[4, 6], 3=>[6, 9]}
I love Array#inject!
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.
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="1.0.0.0" 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>
|
How to remaster Ubuntu Dapper Drake
Recent Comments