Friday, November 06, 2009
Ozone mobile web browser
Tuesday, October 06, 2009
How to (easily) mount a CDROM in Solaris
for device in `ls /dev/dsk`; do mount -F hsfs -o ro /dev/dsk/$device /mnt/cdrom; done
Thursday, September 24, 2009
Convert p4 cygwin commands to p4 win commands
Here’s a simple little script which allows me to use p4.exe from cygwin. Perforce actually releases a p4.exe for cygwin, but I wanted my p4win and p4.exe to be able to use the same client spec. This isn’t possible when one requires a root starting with “C:\” and the other requires “/cygdrive/c/”.
This script works by expanding and window-izing all arguments after the p4 command.
Here is a series which shows the transformation.
- p4 edit README
- p4 edit /home/gwarner/foo/README (where foo is a symbolic link)
- p4 edit /cygdrive/c/perforceRoot/blah/blah/blah/README
- p4 edit C:\perforceRoot\blah\blah\blah\README
Ta da!
1. #!/usr/bin/python
2. import sys
3. from subprocess import *
4.
5. def win32Path(path): path = path.replace('/cygdrive/c/','C:\\')
6. path = path.replace('/','\\')
7. return '"%s"' % path.strip()
8. if __name__ == '__main__':
9. p4command = sys.argv[1]
10. fullFiles = []
11.
12. for file in sys.argv[2:]:
13. fullPath = Popen(['readlink.exe -f ' + file], stdout=PIPE, shell=True).communicate()[0]
14. fullFiles.append(win32Path(fullPath))
15.
16. newCommand = 'p4 %s %s' % (p4command, ' '.join(fullFiles))
17.
18. print newCommand
19. check_call(newCommand, shell=True)
20. print 'done.'
Wednesday, September 02, 2009
The Trickyness that is called xhost, xauth, and X in general
Tuesday, August 25, 2009
1776
Monday, August 24, 2009
Move /var to its own (logical) partition in LVM
- Boot off of the installation cd using "linux rescue"
- Unmount all of the drives in /mnt/syslinux
- Note: Before unmounting /mnt/syslinux itself, you must unmount all of the mountpoints within it.
- $ resize2fs /dev/VolGroup00/ 5G
- ... boot back into regular linux ...
- $ lvreduce -L 6GB /dev/VolGroup00 (answer yes)
- $ lvcreate -L 10G -n var VolGroup00
- ... boot back into rescue mode ...
- mkdir /mnt/var
- mkfs -t ext3 /dev/VolGroup00/var
- mount -t ext3 /dev/VolGroup00/var/ /mnt/var
- mv /mnt/syslinux/var* /mnt/var
- (edit fstab so that it mounts the new logical volume to /var)
- resize2fs /dev/VolGroup00/LogVol00 (remember how I made this 5Gb when the LV was 6GB?)
- reboot!