Skip to content

Instantly share code, notes, and snippets.

View frogonwheels's full-sized avatar

Michael frogonwheels

  • Perth, Australia
View GitHub Profile
!/bin/bash
# vim: filetype=csh
latest=$(cat /home/backup/latestsnap)
srcdir=/home/built/openwrt/${latest}/x86
owroot=
bootpart=/dev/hda1
kernel=${srcdir}/openwrt-x86-Kontron-vmlinuz
" Make sure trailing spaces are removed before write
fun! s:NoTrail()
let pos=getpos('.')
silent %s/\s\+$//e
call setpos('.',pos)
endfun
au BufWritePre * call <SID>NoTrail()
" vim: ts=2 et sw=2
@frogonwheels
frogonwheels / backup git.bat
Created January 6, 2011 02:40
Backup git repos
@echo off
setlocal ENABLEDELAYEDEXPANSION
rem Search for the backup drive!
set volname=Backup Volumne
set bkd=
for %%i in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
for /f "usebackq tokens=*" %%j in (`vol %%i: 2^>nul`) do (
set msg=%%j#
@frogonwheels
frogonwheels / gist:897695
Created April 1, 2011 03:49
Add a git sign-off message using fugitive
fun! AddGitSign()
let idx=line('$')
while idx > 0 && getline(idx) =~ '^#'
let idx-=1
endwhile
let sign=['Signed-off-by: '.fugitive#buffer().repo().user()]
if idx == 0 || getline(idx) != ''
call insert(sign,'')
endif
call append(idx, sign)
An encrypted file can be recognized by the "file" command, if you add these
lines to "/etc/magic", "/usr/share/misc/magic" or wherever your system has the
"magic" file:
0 string VimCrypt~ Vim encrypted file
>9 string 01 - "zip" cryptmethod
>9 string 02 - "blowfish" cryptmethod
@frogonwheels
frogonwheels / WordCompare.vbs
Created September 30, 2011 01:10
Compare word documents
' Created by: Michael Geddes
' Access to CLI Arguments
Set args = WScript.Arguments
if args.count = 0 then
ShowHelp
WScript.Quit 1
end if
Minecraft 1.2.5 (1333544508000)
Machine A: Amd64 Mythbuntu - Ubuntu 12.04 LTS 3.2.0-25-generic #40-Ubuntu SMP Wed May 23 20:30:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
01:05.0 VGA compatible controller [0300]: Advanced Micro Devices [AMD] nee ATI RS880 [Radeon HD 4250] [1002:9715]
@frogonwheels
frogonwheels / git-incorporate
Created June 29, 2012 01:46
An idea for incorporating a topic branch
#!/bin/bash
gitdir=$(git rev-parse --git-dir)
if [ -z ${gitdir} ] ; then
exit 1
fi
if [ "$1" == "" ] ; then
echo Syntax: incorporate branchname
exit 1
while read line
do
ln -s $line "mydir
done < "myfile"
./t3509-cherry-pick-merge-df.sh -v --debug -i
Cleaning trash directory.t3509-cherry-pick-merge-df
Initialized empty Git repository in c:/Projects/msysgit/git/t/trash directory.t3
509-cherry-pick-merge-df/.git/
expecting success:
mkdir a &&
>a/f &&
git add a &&
git commit -m a