daily.0 daily.1
daily.1 daily.2
daily.2 daily.3
daily.3 daily.4
daily.4 daily.5
daily.5 daily.6
daily.6 weekly.0
weekly.0 weekly.1
weekly.1 weekly.2
weekly.2 weekly.3
weekly.3 weekly.4
weekly.4 weekly.5
weekly.5 weekly.6
weekly.6 weekly.7
weekly.7 weekly.8
weekly.8 weekly.9
weekly.9 weekly.10
weekly.10 weekly.11
weekly.11 weekly.12
weekly.12 weekly.13
weekly.13 weekly.14
weekly.14 weekly.15
weekly.15 weekly.16
weekly.16 weekly.17
weekly.17 weekly.18
weekly.18 weekly.19
weekly.19 weekly.20
weekly.20 weekly.21
weekly.21 weekly.22
weekly.22 weekly.23
weekly.23 weekly.24
weekly.24 weekly.25
weekly.25 weekly.26
weekly.26 weekly.27
weekly.27 weekly.28
weekly.28 weekly.29
weekly.29 weekly.30
weekly.30 weekly.31
weekly.31 weekly.32
weekly.32 weekly.33
weekly.33 weekly.34
weekly.34 weekly.35
weekly.35 weekly.36
weekly.36 weekly.37
weekly.37 weekly.38
weekly.38 weekly.39
weekly.39 weekly.40
weekly.40 weekly.41
weekly.41 weekly.42
weekly.42 weekly.43
weekly.43 weekly.44
weekly.44 weekly.45
weekly.45 weekly.46
weekly.46 weekly.47
weekly.47 weekly.48
weekly.48 weekly.49
weekly.49 weekly.50
weekly.50 weekly.51
weekly.51 weekly.52
weekly.52 weekly.53
weekly.53 weekly.54
weekly.54 weekly.55
weekly.55 weekly.56
weekly.56 weekly.57
weekly.57 weekly.58
weekly.58 weekly.59
weekly.59 weekly.60
weekly.60 weekly.61
weekly.61 weekly.62
weekly.62 weekly.63
weekly.63 weekly.64
weekly.64 weekly.65
weekly.65 weekly.66
weekly.66 weekly.67
weekly.67 weekly.68
weekly.68 weekly.69
weekly.69 weekly.70
weekly.70 weekly.71
Tuesday, June 29, 2010
Wednesday, June 23, 2010
comp_dirs
#!/bin/sh
#originally yoinked from #awk
#remove the trailing /'s
#while test $# -gt 0; do
case $1 in
--command | --cmd | --c | -c | -cmd )
shift
CMD=$1
# printf "%q " $1
# CMD="$VAR"
shift
;;
esac
one=$1
two=$2
echo "----------"
printf -v VAR "%q " $CMD
echo "----------"
dir1="${one/%\//}"
dir2="${two/%\//}"
echo "cmd=$CMD"
echo "vvv=$VAR"
echo "dir1=$dir1"
echo "dir2=$dir2"
TEMPDIR=${HOME}/tmp
FOO=$(cd ${dir1} && $CMD)
BAR=$(cd ${dir2} && $CMD)
seperator=":===============:"
echo "$FOO" > ${TEMPDIR}/foo.txt
echo "$BAR" > ${TEMPDIR}/bar.txt
#/* /^$seperator$/ {dir++; next}; */
echo -en "$seperator\n$FOO\n$seperator\n$BAR\n" > ${TEMPDIR}/foobar.txt
echo -en "$seperator\n$FOO\n$seperator\n$BAR\n" | awk -v "dir1_n=$dir1" -v "dir2_n=$dir2" -v "seperator=$seperator" '
$0 == seperator {dir++; next};
/^$/ {next};
1==dir{dir1[$0]++; next};
2==dir{dir2[$0]++; next};
END{
fmt = "%s\t%s\n";
printf fmt, dir1_n "/:", dir2_n "/:";
for (i in dir1) if (i in dir2) {delete dir1[i]; delete dir2[i]; printf fmt, i, i}
else {printf fmt, i, ""};
for (i in dir2) printf fmt, "", i}'
#originally yoinked from #awk
#remove the trailing /'s
#while test $# -gt 0; do
case $1 in
--command | --cmd | --c | -c | -cmd )
shift
CMD=$1
# printf "%q " $1
# CMD="$VAR"
shift
;;
esac
one=$1
two=$2
echo "----------"
printf -v VAR "%q " $CMD
echo "----------"
dir1="${one/%\//}"
dir2="${two/%\//}"
echo "cmd=$CMD"
echo "vvv=$VAR"
echo "dir1=$dir1"
echo "dir2=$dir2"
TEMPDIR=${HOME}/tmp
FOO=$(cd ${dir1} && $CMD)
BAR=$(cd ${dir2} && $CMD)
seperator=":===============:"
echo "$FOO" > ${TEMPDIR}/foo.txt
echo "$BAR" > ${TEMPDIR}/bar.txt
#/* /^$seperator$/ {dir++; next}; */
echo -en "$seperator\n$FOO\n$seperator\n$BAR\n" > ${TEMPDIR}/foobar.txt
echo -en "$seperator\n$FOO\n$seperator\n$BAR\n" | awk -v "dir1_n=$dir1" -v "dir2_n=$dir2" -v "seperator=$seperator" '
$0 == seperator {dir++; next};
/^$/ {next};
1==dir{dir1[$0]++; next};
2==dir{dir2[$0]++; next};
END{
fmt = "%s\t%s\n";
printf fmt, dir1_n "/:", dir2_n "/:";
for (i in dir1) if (i in dir2) {delete dir1[i]; delete dir2[i]; printf fmt, i, i}
else {printf fmt, i, ""};
for (i in dir2) printf fmt, "", i}'
Tuesday, June 22, 2010
pkginfo
#!/bin/sh
# stuart powers
# list the files installed from a specific package or all
# packages which match /pattern/ # one line of output per file:
# [exe|dir|pipe|etc] $PACKAGE $FILE
#to see all the executable files from libwww-perl:
#stu@sente ~ $ pkginfo.sh libwww-perl | grep ^x | cut -f3
# /usr/bin/lwp-download
# /usr/bin/lwp-mirror
# /usr/bin/lwp-rget
# /usr/bin/lwp-request
# /usr/bin/GET
# /usr/bin/POST
# /usr/bin/HEAD
#list installed apache packages:
#stu@sente ~ $ pkginfo.sh apache | cut -f2 | uniq
# apache2
# apache2-utils
# apache2.2-common
# libapache2-reload-perl
#show which packages have the most executables:
#stu@sente ~ $ pkginfo.sh | grep ^x | cut -f2 | uniq -c | sort -nr |head -5
# 131 git-core
# 96 coreutils
# 87 mailman
# 82 hal
# 70 texlive-base-bin
parm=$1
test -z $1 && parm=.
dpkg --list |
grep '^ii' |
grep -E "$parm" |
awk '{print $2}' |
while read package; do
dpkg -L $package |
while read file; do
#skips directories -- we only want files
# test -f "$file" || continue;
#if the file is executable, 'x', else 'f'
dest=
flag=
if [ -d "$file" ]; then
flag="dir"
elif [ -x "$file" ]; then
flag="exe"
fi
if [ -L "$file" ];
then flag="lnk"
fi;
if [ -L "$file" ];
then flag="lnk"
dest=$(readlink -e "$file")
fi;
if [ -L "$file" ];
then flag="pipe"
fi;
echo -e "$flag\t$package\t$file\t$dest";
done;
done
# stuart powers
# list the files installed from a specific package or all
# packages which match /pattern/ # one line of output per file:
# [exe|dir|pipe|etc] $PACKAGE $FILE
#to see all the executable files from libwww-perl:
#stu@sente ~ $ pkginfo.sh libwww-perl | grep ^x | cut -f3
# /usr/bin/lwp-download
# /usr/bin/lwp-mirror
# /usr/bin/lwp-rget
# /usr/bin/lwp-request
# /usr/bin/GET
# /usr/bin/POST
# /usr/bin/HEAD
#list installed apache packages:
#stu@sente ~ $ pkginfo.sh apache | cut -f2 | uniq
# apache2
# apache2-utils
# apache2.2-common
# libapache2-reload-perl
#show which packages have the most executables:
#stu@sente ~ $ pkginfo.sh | grep ^x | cut -f2 | uniq -c | sort -nr |head -5
# 131 git-core
# 96 coreutils
# 87 mailman
# 82 hal
# 70 texlive-base-bin
parm=$1
test -z $1 && parm=.
dpkg --list |
grep '^ii' |
grep -E "$parm" |
awk '{print $2}' |
while read package; do
dpkg -L $package |
while read file; do
#skips directories -- we only want files
# test -f "$file" || continue;
#if the file is executable, 'x', else 'f'
dest=
flag=
if [ -d "$file" ]; then
flag="dir"
elif [ -x "$file" ]; then
flag="exe"
fi
if [ -L "$file" ];
then flag="lnk"
fi;
if [ -L "$file" ];
then flag="lnk"
dest=$(readlink -e "$file")
fi;
if [ -L "$file" ];
then flag="pipe"
fi;
echo -e "$flag\t$package\t$file\t$dest";
done;
done
pylons
# run these commands to install/configure/test a pylons app
# test the app by going to http://localhost:5000
virtualenv --no-site-packages pyenv_quickwiki
. ./pyenv_quickwiki/bin/activate
easy_install Distribute
easy_install pip
pip install QuickWiki
paster make-config QuickWiki test.ini
paster setup-app test.ini
paster serve test.ini
# test the app by going to http://localhost:5000
virtualenv --no-site-packages pyenv_quickwiki
. ./pyenv_quickwiki/bin/activate
easy_install Distribute
easy_install pip
pip install QuickWiki
paster make-config QuickWiki test.ini
paster setup-app test.ini
paster serve test.ini
Subscribe to:
Posts (Atom)