This commit is contained in:
madsenco committed 2011-01-10 16:11:31 +01:00
commit ebffcbed5b
34 files changed
+1437

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/kermit +
set line /dev/ttyS0
set speed 115200
set flow none
set modem none
set carrier-watch off
show communications
connect
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
##
# $Id$
# (C) Copyright 2009 Amplex, fm@amplex.dk
#
# ABSTRACT: Global grep with prebuilt index
##
Dir=$(pwd)
while [ "$Dir" ] ;do
[ -f $Dir/.glimpse_index ] && break
Dir=${Dir%/*}
done
[ "$Dir" ] || { echo "No glimpse index in this directory branch" ; exit 1; }
echo "-- Paths relative to: $Dir"
exec glimpse-tt -y -H $Dir "$@"
// vim: set sw=3 sts=3 et:
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
exec make $CROSS_COMPILE_MAKE_ARGS $TOOLCHAIN_MAKE_ARGS "$@"
+45
View File
@@ -0,0 +1,45 @@
#!/bin/bash
Dir=.
[ $# -gt 0 ] && Dir=$1
cd $Dir
rm -f .glimpse_filenames .glimpse_filenames_index .glimpse_filetimes \
.glimpse_index .glimpse_messages .glimpse_partitions .glimpse_statistics
find . \
-name .svn -prune -o -name rootdisk -prune -o -name shadows -prune -o -name \*-pak -prune -o \
-name doxygen -prune -o -type f -print | cut -c3- \
| /bin/grep -v -E '^tags$|\.glimpse_|\.pdf$|\.o$|\.so$|\.so\.|\.a$|/mapfile$' \
| while read L ;do
read -n4 T < "$L"; [[ $T != ?ELF && $T != BZh* && $T != $'\x1f\x8b\x08'* ]] && echo "$L"
done \
| glimpseindex-tt -n -F -H $Dir | awk '!/^Indexing /'
echo -n "Creating tags ... "
ctags --recurse --exclude=.svn --exclude=rootdisk --exclude=\*-pak \
--sort=no --links=no --excmd=number -f - --extra=+fq --totals=yes \
| { X=$(mktemp); rm -f $X; ctags -f $X /dev/null; cat $X -; rm -f $X; } \
| gawk -F '\t' '
/^!_TAG_FILE_SORTED/ {sub(/[0-9]/, "2")}
{print}
$NF == "F" && $1 ~ /\.h$/ {
file = $2
#print "Searching " file " .." >"/dev/stderr"
lno = 0
while (getline l <file) {
lno++
if (l ~ /^MessageNodeType\(/) {
split(substr(l, 17), arg, ",")
tag = gensub(/^ */, "", 1, arg[1])
print tag "\t" file "\t" lno " \"\tt"
#tags=tags " " tag
extra++
}
}
}
$NF == "f" && $1 ~ /:/ && $2 ~ /\.lua$/ {
npath = split($1, pth, ":")
print pth[npath] "\t" $2 "\t" $3 "\tf"
}
END {print extra+0 " extra tags added" tags >"/dev/stderr"}
' > tags
LC_ALL=C sort --ignore-case -o tags tags
echo done
Executable
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
# Mkp - Makepkg front for easy cleanup
#
mkdir -p BUILD
cp `ls -1 | grep -v '^BUILD$'` BUILD
(cd BUILD; makepkg "$@"; rm PKGBUILD)
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
for DEV in "TPPS/2 IBM TrackPoint" "Synaptics Inc. Composite TouchPad / TrackPoint" ;do
xinput set-int-prop "$DEV" "Evdev Wheel Emulation" 8 1
xinput set-int-prop "$DEV" "Evdev Wheel Emulation Button" 8 2
xinput set-int-prop "$DEV" "Evdev Wheel Emulation Axes" 8 6 7 4 5
done
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
declare -a BACKUP=( ampdev0 Backup )
if [[ $1 == "restore" ]] ;then
fname=$(cut -d: -f1 <<< $2)
pattern=$(cut -d: -f2 <<< $2)
ssh ${BACKUP[0]} "cd ${BACKUP[1]}; cat b-$fname.cpio.lzo" | lzop -d | cpio -ivBdum $pattern
exit 0
fi
#eval $(keychain --eval --quiet)
BackupName=$1
cd ~/amplex
for Dir in */backmeup */*/backmeup ;do
Dir=${Dir%/*}
[[ -d $Dir ]] || continue
FDir=${Dir//\//_}
(cd $Dir
svn status | grep '^[AM]' | cut -c9- > /tmp/fn$$
cat /tmp/fn$$ | cpio -o --quiet | lzop \
| ssh ${BACKUP[0]} "cd ${BACKUP[1]}; cat >b-$FDir-$BackupName.cpio.lzo"
scp -q /tmp/fn$$ ${BACKUP[0]}:${BACKUP[1]}/i-$FDir-$BackupName
rm -f /tmp/fn$$
)
done
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env lua
function system(command)
local fd = io.popen(command, "r")
string = fd:read("*all")
fd:close()
return (string.gsub(string, "\n$", ""))
end
amppath = os.getenv("AMPROOT") or error("AMPROOT not defined")
print((string.gsub(arg[1] or system("pwd"), "^"..amppath, "")))
Executable
+78
View File
@@ -0,0 +1,78 @@
#!/bin/sh
#
# This script is intended to be run as '~+flashboot.cu <args> from inside cu(1)
#
# Contact the debug port with 'cu -s 115200 -l /dev/ttyS0' or equivalent
# You will of course need the cu(1) program (may be part of uucp).
# You will need chat (from ppp), lsx (lrzsz) and gkermit too.
# Devdump (for sn.txt) is in arm9/utils/devdump
#
# The file boot.bin must be in the current directory.
# Copy the 'Files' directory from the AUTester to support bootstrap mode.
# Create the file sn.txt as 7 numbers to have the serialnumber block programmed.
#
TT=/opt/toolchain/utils/flash-scripts/files
say() { echo "$@" 1>&2; }
die() { say "$@"; exit 1; }
say "Checking for bootstrap mode ..."
if chat -t 3 -e CCC '\c' ;then
[ -f loader.bin ] && P="" || P="$TT/"
[ -f ${P}loader.bin ] \
|| die "Board is in bootstrap mode but no boot files here!"
# Prepare for uboot
lsx ${P}loader.bin
[ -f u-boot.bin ] && P="" || P="$TT/"
[ -f ${P}u-boot.bin ] \
|| die "Board is in bootstrap mode but no boot files here!"
# Send uboot.
chat -t 5 -e CCC '\c' || die "Loader did not load"
lsx ${P}u-boot.bin
chat -e 'autoboot: ' '\rversion' || die "U-boot did not load"
fi
[ "$1" = "boot" ] && exit 0
chat -t 10 -e '' 'blah' 'boot>' 'loadb' || die "Not in u-boot mode"
gkermit --x -s boot.bin
# Remove write protection for boot area in the flash chip
chat -t 10 -e 'boot>' "protect off 10000000 10003fff" \
'boot>' "erase 10000000 10003fff" \
'Erasing' '\c' ECHO OFF \
'Erased' '\c' ECHO ON ' 2 sectors' '\c' \
|| die "Could not erase flash sectors"
# Copy boot.bin from SDRAM to flash. 0x21000000 ==> 0x10000000, 0x3D00 bytes
chat -t 10 -e 'boot>' "cp.b 21000000 10000000 3D00" \
' done' '\c' \
|| die "Could not write to flash"
snSize=1c
if [ -f sn.txt ] ;then
# The sn.txt file is five decimal integers in 1 or more lines
dumpdev -if sn.txt -iformat D4 -of sn.bin -bs 28
if [ -f eth.txt ] ;then
# The eth.txt file is six hex bytes in 1 or more lines
dumpdev -if eth.txt -iformat H1 -bs 6 >> sn.bin
snSize=22
fi
fi
if [ -f sn.bin ] ;then
# Program the serial number block too (34/0x1C bytes)
chat -t 10 -e 'boot>' 'loadb' || die "Missing u-boot prompt ?!"
gkermit --x -s sn.bin
chat -t 10 -e 'boot>' "cp.b 21000000 10003D00 $snSize" \
' done' '\c' \
|| die "Could not write to flash"
fi
# Reprotect the boot sectors in flash
chat -t 10 -e 'boot>' "protect on 10000000 10003fff" \
'Protected 2 sectors' 'blah' \
|| die "Could not reprotect flash"
#
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh -x
/usr/share/wicd/scripts/50-wicd-suspend.sh
killall vpnc
/etc/rc.d/dnsmasq stop
rm -f /var/run/resolvconf/interfaces/*
echo -n mem >/sys/power/state
/etc/rc.d/dnsmasq start
/usr/share/wicd/scripts/80-wicd-connect.sh
sleep 2
/etc/rc.d/tpfand restart
sh -c 'sleep 10 ; /home/fm/bin/unbind-ultranav-touchpad' &
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
awk '$1 >= T1+0 && $1 <= T2+2' T1=`date -d "$1" +%s` T2=`date -d "$2" +%s` $3
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
##
# $Id$
# (C) Copyright 2006 Amplex, fm@amplex.dk
#
# ABSTRACT: Nice formatted hex dump in bytes, hex & ascii
##
exec hexdump -e '"%08.8_Ax\n"' \
-e '"%08.8_ax " 8/1 "%02x " " " 8/1 "%02x "' \
-e '" |" 16/1 "%_p" "|\n"' \
"$@"
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
cd
WINEPREFIX="/home/fm/.ies4linux/ie6" wine "/home/fm/.ies4linux/ie6/drive_c/Program Files/Internet Explorer/IEXPLORE.EXE" "$@"
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
export SSH_ASKPASS="/home/fm/bin/gksupass"
#export SSH_ASKPASS=/usr/bin/gnome-ssh-askpass2
export DISPLAY=:0
keyFile=$HOME/.ssh/id_dsa
leaveTime=19:00:00
leastMins=120
if [[ ! -f ~/.keychain/`uname -n`-lockf &&
`/usr/bin/xscreensaver-command -time 2>&1` == *non-blanked* ]]
then
eval $(keychain --eval -q)
if [[ `ssh-add -l` != *$keyFile* ]] ;then
#mins=$(((($(date -d $leaveTime +%s) - $(date +%s)) / 60)))
[[ $mins -lt $leastMins ]] && mins=$leastMins
#keychain --lockwait 1 --quiet $keyFile --timeout $mins >/dev/null 2>&1
keychain --lockwait 1 --quiet $keyFile >/dev/null 2>&1
fi
fi
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
LUADIR=${LUA_CPATH%/?.so}
LUADIR=${LUADIR##*;}
EXEC $VALGRIND ${LUADIR}/lua-agent "$@"DIR
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
grep -v ^time $1 | awk -F $'\t' '{print strftime("%d-%m-%y %T", $1), "\t", $0}' | cut -d$'\t' -f1,3-
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
kfmclient openURL "$@"
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
enscript --columns=2 --landscape --borders --highlight "$@"
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
dcop kded wmiface findAllWindows '' Thunderbird-bin '' '' '' 0 \
| xargs -l dcop kded wmiface forceActiveWindow
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
VENDOR=06cb
PRODUCT=0009
IF=1.0
while read VENDOR PRODUCT ;do
for i in /sys/bus/usb/devices/* ; do
if [ -e $i/idVendor ] && [ `cat $i/idVendor` = $VENDOR ] && \
[ -e $i/idProduct ] && [ `cat $i/idProduct` = $PRODUCT ] && \
[ -e $i\:$IF/driver/unbind ]
then
echo -n `basename $i`\:$IF > $i\:$IF/driver/unbind
break
fi
done
done << EOF
06cb 0009
0002 0007
EOF
+65
View File
@@ -0,0 +1,65 @@
#!/bin/bash
HTTOOLS=$HOME/amplex/ampep/HtTools
runBS() {
BSSERVER=$1 $HTTOOLS/bsTest $HTTOOLS/bsh/$2.bsh
}
mkTemp() {
mktemp /tmp/.updssh-tmp.XXXXXXXXXX
}
getList() {
local F=`mkTemp`
runBS $1 listBoxes > $F
if grep --silent ANNOT: $F ;then
awk '/\t/' $F | sort
else
return 1
fi
rm $F
}
updFile() {
local Ip=`au-sshgw $1 hostip`
local F=`mkTemp`
[[ $1 == *-stg ]] && Ip=${Ip}:8000
echo -n "Updating list for $1 ($Ip) ... "
if getList $Ip > $2.tmp ;then
mv -f $2.tmp $2
echo 'DONE'
else
rm -f $2.tmp
echo 'FAILED'
fi
}
if [[ ! $1 ]] ;then
echo 'Usage: upd-ssh-boxlists {<Server-list>|UPDATE}' 1>&2
exit
fi
if [[ $1 == UPDATE ]] ;then
#sudo vpnc-disconnect
#sudo vpnc amp-ae
for i in `au-sshgw gwlist | grep ^ad-` ;do
File=/opt/toolchain/utils/sshgw/files/boxes-${i}.db
[[ -f $File ]] && updFile $i $File
done
#sudo vpnc-disconnect
#sudo vpnc amp-ain
for i in `au-sshgw gwlist | grep ^ain-` ;do
File=/opt/toolchain/utils/sshgw/files/boxes-${i}.db
[[ -f $File ]] && updFile $i $File
done
svn st /opt/toolchain/utils/sshgw/files
#sudo vpnc-disconnect
exit
fi
for i ;do
getList $i
done
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
exec valgrind --db-attach=yes --db-command='clewn -ga "%f %p"' "$@"
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
exec valgrind --db-attach=yes --db-command='ups %f %p' "$@"
+1
View File
@@ -0,0 +1 @@
/usr/bin/gvim
+1
View File
@@ -0,0 +1 @@
/usr/bin/gvim
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env lua
local function copyrec(s, d)
d = d or {}
for k,v in pairs(s) do d[k] = v end
return d
end
local function findandset(line, pattern, ret)
local t = { line:find(pattern) }
return t[1] and copyrec({ start = t[1], stop = t[2], select(3, unpack(t)) }, ret)
or nil
end
local function regsub_s(t, reg, sub)
local num
t.s, num = string.gsub(t.s, reg, sub, 1234567890)
return num > 0
end
local line,file,modified,pid,running
local pids = {}
local fd = io.popen("sh -c 'vi -r 2>&1'", "r")
while true do
local t = {}
line = fd:read("*line")
if not line then break end
if findandset(line, "^ *In directory (.*)", t) then
io.write(t[1].."\n")
elseif findandset(line, "^ *file name: (.*)", t) then
file = t[1]
elseif findandset(line, "^ *modified: (%a*)", t) then
modified = t[1] ~= "no"
elseif findandset(line, "^ *process ID: (%d*)(.*)", t) then
pid = t[1]
tty = { s = "" }
if string.find(t[2], "(still running)", 1, true) ~= nil then
if pids["pid-"..pid] then
tty.s = pids["pid-"..pid]
else
local ifd = io.popen("ps --no-headers --format tty --pid " .. pid, "r")
tty.s = ":" .. ifd:read("*line")
ifd:close()
if regsub_s(tty, "tty", "") then
elseif regsub_s(tty, "pts/", "pt") then
elseif regsub_s(tty, "tts/", "t") then
end
pids["pid-"..pid] = tty.s
end
end
if file and modified ~= nil then
io.write(string.format("%s %5d%-5s %s\n", modified and "+" or "-",
pid, tty.s, file))
end
line,file,modified,pid,running = nil
end
end
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
exec ck-launch-session startxfce4