From e66045c03c6f26ae5d601601acc90cd37642c129 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 12 Apr 2011 11:10:31 -0400 Subject: [PATCH 1/5] add install-files script --- install-files | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 install-files diff --git a/install-files b/install-files new file mode 100755 index 0000000..610862f --- /dev/null +++ b/install-files @@ -0,0 +1,22 @@ +#!/bin/sh + +here="$(dirname $0)" + +function install_file() +{ + source="${here}/$1" + dest="${HOME}/$2" + if [ -f "$dest" ]; then + echo "Skipping $1" + else + echo "Installing $1" + mkdir -p $(dirname "$dest") + cp "$source" "$dest" + fi +} + +install_file bash_aliases .bash_aliases +install_file vimrc .vimrc +install_file inputrc .inputrc +install_file screenrc .screenrc +install_file ir_black.vim .vim/colors/ir_black.vim From 86ed22d3d6f8f69fda0debbee8c30a1eaf8e2ffd Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 12 Apr 2011 12:56:55 -0400 Subject: [PATCH 2/5] April 2011 Gentoo installation updates --- gentoo-install.txt | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/gentoo-install.txt b/gentoo-install.txt index b49129f..65d7d10 100644 --- a/gentoo-install.txt +++ b/gentoo-install.txt @@ -1,18 +1,18 @@ # Josh's Gentoo Install Guide -# Last Updated 2010-07-15; last run July 2010 +# Last Updated 2011-04-12; last run April 2011 -network: [modprobe], [pcmcia start], [net-setup] -[/etc/init.d/sshd start; passwd; screen] # ssh in, screen -xr to remote setup -fdisk, mkfs.ext2 for boot, mkfs.ext4 for root/home, mkswap, swapon -mount root, boot, [home] +network: [modprobe], [pcmcia start], [/etc/init.d/net.eth0 start] date MMDDhhmmYYYY +[/etc/init.d/sshd start; passwd; screen] # ssh in, screen -xr to remote setup +fdisk, mkfs.ext4, mkswap, swapon +mount root [,boot] [,home] cd /mnt/gentoo links2 http://www.gentoo.org/main/en/mirrors.xml; #get stage3*bz2 tar -xvjpf stage?-*.tar.bz2 [cd /mnt/gentoo/usr] # speed up first rsync with [tar -xvjpf portage-*.tar.bz2] # snapshot if slow connection nano /mnt/gentoo/etc/make.conf # FEATURES="parallel-fetch" -cp /etc/resolv.conf /mnt/gentoo/etc +cp -L /etc/resolv.conf /mnt/gentoo/etc mount -t proc none /mnt/gentoo/proc cd /; chroot /mnt/gentoo /bin/bash env-update @@ -24,14 +24,16 @@ emerge -av gentoo-sources syslog-ng vixie-cron grub [slocate] [dhcpcd] [vim] cd /usr/src/linux make menuconfig make && make modules_install -cp arch/i386/boot/bzImage .config /boot +cp arch/x86_64/boot/bzImage .config /boot vim /etc/fstab vim /etc/conf.d/hostname -vim /etc/conf.d/net # config_eth0=("dhcp") \n dhcpcd_eth0="-N" +vim /etc/conf.d/net # config_eth0=("dhcp") vim /etc/hosts # add hostname after localhost vim /etc/rc.conf vim /etc/modules.autoload.d/kernel-2.6 vim /etc/conf.d/clock +vim /etc/locale.gen # uncomment en_US* +vim /etc/etc-update.conf # remove those pesky -i's [cd /etc/init.d; ln -s net.lo net.eth1] # if you have a second NIC rc-update show -v rc-update add net.eth0 default # [net.eth1] also for a second NIC @@ -40,11 +42,12 @@ rc-update add vixie-cron default rc-update add numlock default # unless you're on a laptop :) [rc-update add sshd default] # if you want remote access vim /boot/grub/grub.conf -grub # (root (hd0,0) \n setup (hd0) \n quit) -useradd -m -s /bin/bash john # omit -m if you have a homedir already +grub # root (hd0,0) \n setup (hd0) \n quit +useradd -m -s /bin/bash john passwd passwd john vim /etc/group +[emerge -auvDN world; etc-update] # or update later exit cd /; umount /mnt/gentoo{/proc,/boot,} reboot From f307e3d2566732271b69452cd53c71d2f8fceec7 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 13 Apr 2011 08:43:15 -0400 Subject: [PATCH 3/5] jsvn: add 'watch-lock' subcommand for notification when file is unlocked --- jsvn | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/jsvn b/jsvn index 493341a..07bae44 100755 --- a/jsvn +++ b/jsvn @@ -30,6 +30,7 @@ import sys import os import re +import time from subprocess import * PATH = os.environ['PATH'].split(os.pathsep) @@ -180,6 +181,47 @@ def merge(argv, svn): root + '/branches/' + argv[1] + path, '.']).wait() return 0 +def watch_lock(argv, svn): + if len(argv) < 2: + return -1 + path = argv[1] + if os.path.exists(path): + # Get the repository URL of the file being watched + p = Popen([svn, 'info', path], stdout=PIPE) + lines = p.communicate()[0].split('\n') + for line in lines: + m = re.match(r'URL: (.*)', line) + if m is not None: + path = m.group(1) + break + + last_lock_owner = '' + while 1: + lock_owner = '' + p = Popen([svn, 'info', path], stdout=PIPE) + lines = p.communicate()[0].split('\n') + for line in lines: + m = re.match(r'Lock\sOwner:\s*(.*)', line) + if m is not None: + lock_owner = m.group(1) + break + if lock_owner == '': + break + if lock_owner != last_lock_owner: + sys.stdout.write('Locked by: %s\n' % lock_owner) + last_lock_owner = lock_owner + time.sleep(60) + + sys.stdout.write(''' + _ _ _ _ _ _ +| | | |_ __ | | ___ ___| | _____ __| | | +| | | | '_ \| |/ _ \ / __| |/ / _ \/ _` | | +| |_| | | | | | (_) | (__| < __/ (_| |_| + \___/|_| |_|_|\___/ \___|_|\_\___|\__,_(_) + +''') + return 0 + def main(argv): realsvn = findInPath('svn') colorsvn = findInPath('colorsvn') @@ -218,6 +260,9 @@ def main(argv): sys.stdout.write(getSVNRoot(realsvn) + '\n') return 0 + if argv[0] == "watch-lock": + return watch_lock(argv, realsvn) + if argv[0] in ('st', 'status', 'log', 'up', 'update') \ and colorsvn != '': realsvn = colorsvn From 179898e95767a330410b0dccdd7d28e4be33f56d Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 14 Apr 2011 12:05:25 -0400 Subject: [PATCH 4/5] add standard gitignore --- gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 gitignore diff --git a/gitignore b/gitignore new file mode 100644 index 0000000..19d839b --- /dev/null +++ b/gitignore @@ -0,0 +1,4 @@ +*.pyc +.*.swp +*.o +.sconsign.dblite From b451fcea5e92b35991398242ab3df5d1f4bd96b4 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 14 Apr 2011 12:05:48 -0400 Subject: [PATCH 5/5] install_files: install gitignore --- install-files | 1 + 1 file changed, 1 insertion(+) diff --git a/install-files b/install-files index 610862f..c7f204a 100755 --- a/install-files +++ b/install-files @@ -20,3 +20,4 @@ install_file vimrc .vimrc install_file inputrc .inputrc install_file screenrc .screenrc install_file ir_black.vim .vim/colors/ir_black.vim +install_file gitignore .gitignore