From: Chris Koeritz Date: Wed, 25 Jan 2012 07:37:52 +0000 (-0500) Subject: nicely rearranged into a meaningful examples folder, which now provides X-Git-Tag: 2.140.90~1656^2~21 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=a1f3c65741691541c269f9e74626ac764e27cc03;p=feisty_meow.git nicely rearranged into a meaningful examples folder, which now provides a good storage area for the example custom scripts. whew. trying to override a .gitignore in a subdirectory may be possible, but i couldn't find out how. luckily this is a better organization structure anyhow. --- diff --git a/scripts/bashisms/fred_techniques.txt b/scripts/bashisms/fred_techniques.txt deleted file mode 100644 index c841a89c..00000000 --- a/scripts/bashisms/fred_techniques.txt +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -############## -# Name : fred_techniques -# Author : Chris Koeritz -# Rights : Copyright (C) 2010-$now by Author -############## -# Copyright (c) 2010-$now By Author. This script is free software; you can -# redistribute it and/or modify it under the terms of the simplified BSD -# license. See: http://www.opensource.org/licenses/bsd-license.php -# Please send updates for this code to: fred@gruntose.com -- Thanks, fred. -############## - -# this script is a collection of helpful bash practices that unfortunately -# sometimes slip my mind when i need them. it's intended to collect all the -# good bits so they don't slip away. feel free to re-use them in your own -# code as needed. - -############## - -# clean for loops in bash: - -for ((i=0; i < 5; i++)) do - echo $i -done - -############## - -# removing an array element -# --> only works on arrays that have no elements containing a space character. - -# define a 5 element array. -arr=(a b c d e) - -# remove element 2 (the 'c'). -removepoint=2 - -# set the array to slices of itself. -arr=(${arr[*]:0:$removepoint} ${arr[*]:(($removepoint+1))} ) - -# show the new contents. -echo ${arr[*]} -# shows: a b d e - -############## - -# store to a variable name by derefercing it. - -# shows how you can store into a variable when you are given only its name. -function store_to_named_var() -{ - local name="$1"; shift - eval ${name}=\(gorbachev "perestroikanator 12000" chernenko\) -} - -declare -a ted=(petunia "butter cup" smorgasbord) -echo ted is ${ted[@]} -store_to_named_var ted -echo ted is now ${ted[@]} - -############## - diff --git a/scripts/bashisms/qs_handy_unix_examples.sh b/scripts/bashisms/qs_handy_unix_examples.sh deleted file mode 100644 index 5293f3bb..00000000 --- a/scripts/bashisms/qs_handy_unix_examples.sh +++ /dev/null @@ -1,220 +0,0 @@ -#!/bin/bash - -# -# these great examples of handy unix tidbits were donated by "q. black". -# - -# list a directory tree -ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' - -# list directory sizes (biggest first) -du -h $(du -s * |sort -nr|awk '{print $2}') - -# this will sort a date field of the form: DD-MON-YYYY HH:MM:SS -sort +0.7 -1 +0.3M -0.6 +0 -0.2 +1 - -# this will sort a date field of the form: MON DD HH:MM:SS YYYY -sort +3 -4 +0M +1n - -# this will sort a date field of the form: MON DD HH:MM:SS -sort +0M +1n - -# this will sort a date field of the form: Date: Tue Feb 3 09:17:58 EST 2004 -sort +6 -7 +2M +3n +4 - -# display all lines from a certain line onward -start_line=132 -|awk "{if (NR >= ${start_line}){print \$0}}" - -# display all lines after a token -sed '1,/CUT HERE/d' - -# print the first and last lines -sed -n '1,1p;$,$p' - -# signal bash about a window size change -kill -winch $$ - -# show the date 1 year, 2 months and 3 days ago -date -v -1y -v -2m -v -3d - -# set the date back 1 year -sudo date $(date -v -1y +%Y%m%d%H%M) - -# output the standard date format for setting the time -# get the date -date -u +%Y%m%d%H%M.%S -# set the date -date -u (cut and paste from above) - -# convert one date format to another (output is in the current time zone) -old_date="Aug 27 15:24:33 2005 GMT" -new_date=$(date -j -f "%b %e %T %Y %Z" "${old_date}" +%D) -echo ${new_date} -# returns "08/27/05" - -# output the modification time of a file in different format -file= -date -j -f "%b %e %T %Y" "$(ls -lT ${file} |awk '{print $6,$7,$8,$9}')" - -# output the number of days until a certain date -target_date="Sep 2 15:20:20 2005 GMT" -target_seconds=$(date -j -f "%b %e %T %Y" +%s "${target_date}" 2>/dev/null) -diff_seconds=$(expr ${target_seconds} - $(date +%s)) -diff_days=$(expr ${diff_seconds} / 86400) -echo "${diff_days} day(s)" - -# these commands can be used to fill in missing times in a "uniq -c" count -# of times. -# output 24 hours in one minute increments -for h in $(jot -w %02d - 0 23 1); do - for m in $(jot -w %02d - 0 59 1); do - echo " 0 ${h}:${m}" - done -done -# sort them together, and remove any 0 counts if an count already exists -sort +1 +0rn out1 out2 |uniq -f 1 - -# output with w3m to get basic html word wrap -w3m -T "text/html" -dump -cols 72 < - This test verifies basic networking and that the ${product_short_name} - can reach it's default gateway. -EOF - -# another way to format text for output -fmt 72 <used = %ld\n", msg->used); -BIO_write(sc->log, jkwbuf, strlen(jkwbuf)+1); -free(jkwbuf); -} - -# rolling diff of a list of files (diff a & b, then b & c,...) -last= -for i in $(ls -1rt); do - if [ ! -z "${last}" ]; then - diff -u ${last} ${i} - fi - last=${i} -done - -# clearing and restoring chflags -file= -old_chflags=$(ls -lo ${file}|awk '{print $5}') -chflags 0 ${file} -# do whatever -if [ ."${old_chflags}" != ."-" ]; then - chflags ${old_chflags} ${file} -fi - -# way to do standard edits to files -file= -{ - # append line(s) after a line, "i" to insert before - echo '/www_recovery/a' - echo 'mithril ALL = (root) NOPASSWD: /usr/local/libexec/destroyer' - echo '.' - # modify a line - echo 'g/^xntpd_program=/s,^xntpd_program=.*$,xntpd_program="ntpd",' - # delete a line - echo 'g/^controls key secret =/d' - echo 'x!' -} | ex - ${file} - -# how to search for errors in the last 24 hours -# note that this command does not work quite right. The sort is off early -# in the year because the dates do not have the year. -# Also sed never sees the /CUT HERE/ when it is the first line. -(echo "$(date -v-24H "+%b %e %H:%M:%S") --CUT HERE--"; \ - zgrep -h "cookie" /var/log/messages*)|sort +0M| \ - sed '1,/CUT HERE/d' -# This version fixes those problems. It adds the file year to the date -# and puts a marker at the start of the list. -(echo "$(date -j -f "%s" 0 "+%Y %b %e %H:%M:%S") --ALWAYS FIRST--"; \ - echo "$(date -v-24H "+%Y %b %e %H:%M:%S") --CUT HERE--"; \ - for i in /var/log/messages*; do - year=$(ls -lT ${i}|awk '{print $9}') - zgrep -h "cookie" ${i}|while read line; do - echo "${year} ${line}" - done - done)|sort +0n +1M| sed '1,/CUT HERE/d' - -# process a list of quoted values -{ - # It tends to be easiest to use a 'here-document' to feed in the list. - # I prefer to have the list at the start instead of the end - cat </dev/null) - if [ ${#any_there[*]} -gt 0 ]; then - (( last = ${#any_there[@]} - 1 )) - JAVA_HOME="${any_there[$last]}" - fi - if [ ! -d "$JAVA_HOME" ]; then - # if no jdk, try a jre. - declare -a any_there=$(find "/c/Program Files/java" -type d -iname "jre" 2>/dev/null) - if [ ${#any_there[*]} -gt 0 ]; then - (( last = ${#any_there[@]} - 1 )) - JAVA_HOME="${any_there[$last]}" - fi - fi -fi -# this should go last, since it changes the bin dir. -if [ ! -d "$JAVA_HOME" ]; then - # if that didn't work, try the location for mac os x. - JAVA_HOME=/Library/Java/Home - JAVA_BIN_PIECE=Commands -fi -# last thing is to tell them we couldn't find it. -if [ ! -d "$JAVA_HOME" ]; then - intuition_failure JAVA_HOME - unset JAVA_BIN_PIECE -fi - -############################ - -# intuit where we have our local eclipse. -if [ ! -d "$ECLIPSE_DIR" ]; then - export ECLIPSE_DIR=/usr/local/eclipse_jee -fi -if [ ! -d "$ECLIPSE_DIR" ]; then - ECLIPSE_DIR=$HOME/eclipse -fi -if [ ! -d "$ECLIPSE_DIR" ]; then - ECLIPSE_DIR=$HOME/apps/eclipse -fi -if [ ! -d "$ECLIPSE_DIR" ]; then -#uhhh, default on winders? - ECLIPSE_DIR="/c/Program Files/eclipse" -fi -if [ ! -d "$ECLIPSE_DIR" ]; then - ECLIPSE_DIR="/c/tools/eclipse" -fi -if [ ! -d "$ECLIPSE_DIR" ]; then - ECLIPSE_DIR="/d/tools/eclipse" -fi -if [ ! -d "$ECLIPSE_DIR" ]; then - ECLIPSE_DIR="/e/tools/eclipse" -fi -# final option is to whine. -if [ ! -d "$ECLIPSE_DIR" ]; then intuition_failure ECLIPSE_DIR; fi - -############################ - -# use the variables we just set in our path, and try to make them override -# any other paths to different versions. - -if [ ! -z "$JAVA_HOME" ]; then - export PATH=$JAVA_HOME/$JAVA_BIN_PIECE:$PATH -fi -if [ ! -z "$ECLIPSE_DIR" ]; then - export PATH=$ECLIPSE_DIR:$PATH -fi - - diff --git a/scripts/custom/examples/readme.txt b/scripts/custom/examples/readme.txt deleted file mode 100644 index e8e14a5c..00000000 --- a/scripts/custom/examples/readme.txt +++ /dev/null @@ -1,15 +0,0 @@ - - -this folder has some examples of how various people (or one person right now) -do their custom scripts. - -the scripts often have the same name as the main script's name, but with -a "c_" in front. ones understood currently are: - c_common_aliases.txt - c_sh_aliases.txt - c_variables.sh - -when you have some custom scripts you want to use, copy them from your own -folder to the scripts/custom directory. be careful though, because these -will never be checked into the repository from there. - diff --git a/scripts/examples/bashisms/fred_techniques.txt b/scripts/examples/bashisms/fred_techniques.txt new file mode 100644 index 00000000..c841a89c --- /dev/null +++ b/scripts/examples/bashisms/fred_techniques.txt @@ -0,0 +1,62 @@ +#!/bin/bash + +############## +# Name : fred_techniques +# Author : Chris Koeritz +# Rights : Copyright (C) 2010-$now by Author +############## +# Copyright (c) 2010-$now By Author. This script is free software; you can +# redistribute it and/or modify it under the terms of the simplified BSD +# license. See: http://www.opensource.org/licenses/bsd-license.php +# Please send updates for this code to: fred@gruntose.com -- Thanks, fred. +############## + +# this script is a collection of helpful bash practices that unfortunately +# sometimes slip my mind when i need them. it's intended to collect all the +# good bits so they don't slip away. feel free to re-use them in your own +# code as needed. + +############## + +# clean for loops in bash: + +for ((i=0; i < 5; i++)) do + echo $i +done + +############## + +# removing an array element +# --> only works on arrays that have no elements containing a space character. + +# define a 5 element array. +arr=(a b c d e) + +# remove element 2 (the 'c'). +removepoint=2 + +# set the array to slices of itself. +arr=(${arr[*]:0:$removepoint} ${arr[*]:(($removepoint+1))} ) + +# show the new contents. +echo ${arr[*]} +# shows: a b d e + +############## + +# store to a variable name by derefercing it. + +# shows how you can store into a variable when you are given only its name. +function store_to_named_var() +{ + local name="$1"; shift + eval ${name}=\(gorbachev "perestroikanator 12000" chernenko\) +} + +declare -a ted=(petunia "butter cup" smorgasbord) +echo ted is ${ted[@]} +store_to_named_var ted +echo ted is now ${ted[@]} + +############## + diff --git a/scripts/examples/bashisms/qs_handy_unix_examples.sh b/scripts/examples/bashisms/qs_handy_unix_examples.sh new file mode 100644 index 00000000..5293f3bb --- /dev/null +++ b/scripts/examples/bashisms/qs_handy_unix_examples.sh @@ -0,0 +1,220 @@ +#!/bin/bash + +# +# these great examples of handy unix tidbits were donated by "q. black". +# + +# list a directory tree +ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' + +# list directory sizes (biggest first) +du -h $(du -s * |sort -nr|awk '{print $2}') + +# this will sort a date field of the form: DD-MON-YYYY HH:MM:SS +sort +0.7 -1 +0.3M -0.6 +0 -0.2 +1 + +# this will sort a date field of the form: MON DD HH:MM:SS YYYY +sort +3 -4 +0M +1n + +# this will sort a date field of the form: MON DD HH:MM:SS +sort +0M +1n + +# this will sort a date field of the form: Date: Tue Feb 3 09:17:58 EST 2004 +sort +6 -7 +2M +3n +4 + +# display all lines from a certain line onward +start_line=132 +|awk "{if (NR >= ${start_line}){print \$0}}" + +# display all lines after a token +sed '1,/CUT HERE/d' + +# print the first and last lines +sed -n '1,1p;$,$p' + +# signal bash about a window size change +kill -winch $$ + +# show the date 1 year, 2 months and 3 days ago +date -v -1y -v -2m -v -3d + +# set the date back 1 year +sudo date $(date -v -1y +%Y%m%d%H%M) + +# output the standard date format for setting the time +# get the date +date -u +%Y%m%d%H%M.%S +# set the date +date -u (cut and paste from above) + +# convert one date format to another (output is in the current time zone) +old_date="Aug 27 15:24:33 2005 GMT" +new_date=$(date -j -f "%b %e %T %Y %Z" "${old_date}" +%D) +echo ${new_date} +# returns "08/27/05" + +# output the modification time of a file in different format +file= +date -j -f "%b %e %T %Y" "$(ls -lT ${file} |awk '{print $6,$7,$8,$9}')" + +# output the number of days until a certain date +target_date="Sep 2 15:20:20 2005 GMT" +target_seconds=$(date -j -f "%b %e %T %Y" +%s "${target_date}" 2>/dev/null) +diff_seconds=$(expr ${target_seconds} - $(date +%s)) +diff_days=$(expr ${diff_seconds} / 86400) +echo "${diff_days} day(s)" + +# these commands can be used to fill in missing times in a "uniq -c" count +# of times. +# output 24 hours in one minute increments +for h in $(jot -w %02d - 0 23 1); do + for m in $(jot -w %02d - 0 59 1); do + echo " 0 ${h}:${m}" + done +done +# sort them together, and remove any 0 counts if an count already exists +sort +1 +0rn out1 out2 |uniq -f 1 + +# output with w3m to get basic html word wrap +w3m -T "text/html" -dump -cols 72 < + This test verifies basic networking and that the ${product_short_name} + can reach it's default gateway. +EOF + +# another way to format text for output +fmt 72 <used = %ld\n", msg->used); +BIO_write(sc->log, jkwbuf, strlen(jkwbuf)+1); +free(jkwbuf); +} + +# rolling diff of a list of files (diff a & b, then b & c,...) +last= +for i in $(ls -1rt); do + if [ ! -z "${last}" ]; then + diff -u ${last} ${i} + fi + last=${i} +done + +# clearing and restoring chflags +file= +old_chflags=$(ls -lo ${file}|awk '{print $5}') +chflags 0 ${file} +# do whatever +if [ ."${old_chflags}" != ."-" ]; then + chflags ${old_chflags} ${file} +fi + +# way to do standard edits to files +file= +{ + # append line(s) after a line, "i" to insert before + echo '/www_recovery/a' + echo 'mithril ALL = (root) NOPASSWD: /usr/local/libexec/destroyer' + echo '.' + # modify a line + echo 'g/^xntpd_program=/s,^xntpd_program=.*$,xntpd_program="ntpd",' + # delete a line + echo 'g/^controls key secret =/d' + echo 'x!' +} | ex - ${file} + +# how to search for errors in the last 24 hours +# note that this command does not work quite right. The sort is off early +# in the year because the dates do not have the year. +# Also sed never sees the /CUT HERE/ when it is the first line. +(echo "$(date -v-24H "+%b %e %H:%M:%S") --CUT HERE--"; \ + zgrep -h "cookie" /var/log/messages*)|sort +0M| \ + sed '1,/CUT HERE/d' +# This version fixes those problems. It adds the file year to the date +# and puts a marker at the start of the list. +(echo "$(date -j -f "%s" 0 "+%Y %b %e %H:%M:%S") --ALWAYS FIRST--"; \ + echo "$(date -v-24H "+%Y %b %e %H:%M:%S") --CUT HERE--"; \ + for i in /var/log/messages*; do + year=$(ls -lT ${i}|awk '{print $9}') + zgrep -h "cookie" ${i}|while read line; do + echo "${year} ${line}" + done + done)|sort +0n +1M| sed '1,/CUT HERE/d' + +# process a list of quoted values +{ + # It tends to be easiest to use a 'here-document' to feed in the list. + # I prefer to have the list at the start instead of the end + cat </dev/null) + if [ ${#any_there[*]} -gt 0 ]; then + (( last = ${#any_there[@]} - 1 )) + JAVA_HOME="${any_there[$last]}" + fi + if [ ! -d "$JAVA_HOME" ]; then + # if no jdk, try a jre. + declare -a any_there=$(find "/c/Program Files/java" -type d -iname "jre" 2>/dev/null) + if [ ${#any_there[*]} -gt 0 ]; then + (( last = ${#any_there[@]} - 1 )) + JAVA_HOME="${any_there[$last]}" + fi + fi +fi +# this should go last, since it changes the bin dir. +if [ ! -d "$JAVA_HOME" ]; then + # if that didn't work, try the location for mac os x. + JAVA_HOME=/Library/Java/Home + JAVA_BIN_PIECE=Commands +fi +# last thing is to tell them we couldn't find it. +if [ ! -d "$JAVA_HOME" ]; then + intuition_failure JAVA_HOME + unset JAVA_BIN_PIECE +fi + +############################ + +# intuit where we have our local eclipse. +if [ ! -d "$ECLIPSE_DIR" ]; then + export ECLIPSE_DIR=/usr/local/eclipse_jee +fi +if [ ! -d "$ECLIPSE_DIR" ]; then + ECLIPSE_DIR=$HOME/eclipse +fi +if [ ! -d "$ECLIPSE_DIR" ]; then + ECLIPSE_DIR=$HOME/apps/eclipse +fi +if [ ! -d "$ECLIPSE_DIR" ]; then +#uhhh, default on winders? + ECLIPSE_DIR="/c/Program Files/eclipse" +fi +if [ ! -d "$ECLIPSE_DIR" ]; then + ECLIPSE_DIR="/c/tools/eclipse" +fi +if [ ! -d "$ECLIPSE_DIR" ]; then + ECLIPSE_DIR="/d/tools/eclipse" +fi +if [ ! -d "$ECLIPSE_DIR" ]; then + ECLIPSE_DIR="/e/tools/eclipse" +fi +# final option is to whine. +if [ ! -d "$ECLIPSE_DIR" ]; then intuition_failure ECLIPSE_DIR; fi + +############################ + +# use the variables we just set in our path, and try to make them override +# any other paths to different versions. + +if [ ! -z "$JAVA_HOME" ]; then + export PATH=$JAVA_HOME/$JAVA_BIN_PIECE:$PATH +fi +if [ ! -z "$ECLIPSE_DIR" ]; then + export PATH=$ECLIPSE_DIR:$PATH +fi + + diff --git a/scripts/examples/custom_overrides/readme.txt b/scripts/examples/custom_overrides/readme.txt new file mode 100644 index 00000000..d7ab4c64 --- /dev/null +++ b/scripts/examples/custom_overrides/readme.txt @@ -0,0 +1,15 @@ + + +this folder has some examples of how various people (or one person right now) +do their custom scripts. + +the scripts often have the same name as the main script's name, but with +a "c_" in front. ones understood currently are: + c_common_aliases.txt + c_sh_aliases.txt + c_variables.sh + +when you have some custom scripts you want to use, copy them from your own +folder to the scripts/custom directory. be careful though, because they +will never be checked into the repository from there. + diff --git a/scripts/examples/example_registry_ops.sh b/scripts/examples/example_registry_ops.sh deleted file mode 100644 index 3480d948..00000000 --- a/scripts/examples/example_registry_ops.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# an example of using the reg.exe tool on windows to find some things in -# the registry. -# this happens to look in the registry for PuTTY keys for a set of named -# displays. - -declare ip_array=(zorba-1 zorba-2 zorba-3 zorba-4 zorba-5) - -for i in ${ip_array[*]}; do - target=${i} - echo "display is $target" - reg query 'HKCU\Software\SimonTatham\PuTTY\SshHostKeys' /v "rsa2@22:$target" -done - - diff --git a/scripts/examples/feisty_meow_startup/bashrc_grover b/scripts/examples/feisty_meow_startup/bashrc_grover new file mode 100644 index 00000000..ddc86621 --- /dev/null +++ b/scripts/examples/feisty_meow_startup/bashrc_grover @@ -0,0 +1,8 @@ +export LC_ALL=C +alias mc='mc -a' + +export PATH=$PATH:/home/QtPalmtop/j2me:/home/QtPalmtop/j2me/bin + +alias fredme='export HOME=/home/zaurus/fred ; export TMP=$HOME/.tmp ; source $HOME/yeti/scripts/core/profile.sh ; cd ' + + diff --git a/scripts/examples/feisty_meow_startup/bashrc_root b/scripts/examples/feisty_meow_startup/bashrc_root new file mode 100644 index 00000000..7aaafb91 --- /dev/null +++ b/scripts/examples/feisty_meow_startup/bashrc_root @@ -0,0 +1,4 @@ +# added to root's ~/.bashrc, the yetime macro enables all the yeti tools. + +alias yetime='source $HOME/yeti/scripts/core/profile.sh' + diff --git a/scripts/examples/feisty_meow_startup/bashrc_user b/scripts/examples/feisty_meow_startup/bashrc_user new file mode 100644 index 00000000..3e5f4a91 --- /dev/null +++ b/scripts/examples/feisty_meow_startup/bashrc_user @@ -0,0 +1,22 @@ + +# in addition to the .bashrc code that the operating system gives you, +# you can add this file to your ~/.bashrc if you want the YETI scripts +# to be loaded up automatically. +# +# this is for normal users, not the root user! + +# note: it is useful to set your own NAME variable to identify who you are. +# the yeti scripts will set up a bogus one for you otherwise. in your home +# directory's .bashrc, you could add something like this, for example: +# export NAME='Doodmodeus Q. Nornberton' + +# don't bother running our stuff for a dumb terminal since any echo +# can mess with an sftp connection, apparently. +if [ ${TERM} != "dumb" ]; then + # make sure yeti code hasn't been explicitly disabled. + if [ -z "$NO_YETI" ]; then + # sets up the yeti scripts, using the default locations for all scripts. + source $HOME/yeti/scripts/core/profile.sh + fi +fi + diff --git a/scripts/examples/feisty_meow_startup/bashrc_user_windoz b/scripts/examples/feisty_meow_startup/bashrc_user_windoz new file mode 100644 index 00000000..df6df726 --- /dev/null +++ b/scripts/examples/feisty_meow_startup/bashrc_user_windoz @@ -0,0 +1,25 @@ + +# in addition to the .bashrc code that the operating system gives you, +# you should added this file to your ~/.bashrc if you want the YETI scripts +# to be loaded up. +# +# you also must run bootstrap_shells.sh if you've never used YETI before. + +# note: it is useful to set your own NAME variable to identify who you are. +# the yeti scripts will set up a bogus one for you otherwise. in your home +# directory's .bashrc, you could add something like this, for example: +#export NAME='Curmudgeon J. Wankslausteen' + +export TMP=/h/tmp + +# add in some useful paths for the local machine. +export PATH=/bin:$PATH:/c/utilities/emacs-23.2/bin:/c/tools/cvsnt:/c/utilities/Vim/vim71:/c/system/Perl/site/bin:/c/system/Perl/bin:/c/tools/doxygen/bin:/c/tools/graphviz/Graphviz/bin + +export REPOSITORY_DIR="$HOME/hoople2" + +if [ -z "$NO_YETI" ]; then + # sets up the yeti scripts, using the default locations for all scripts. + source $HOME/yeti/scripts/core/profile.sh +fi + + diff --git a/scripts/examples/os_related/example_registry_ops.sh b/scripts/examples/os_related/example_registry_ops.sh new file mode 100644 index 00000000..3480d948 --- /dev/null +++ b/scripts/examples/os_related/example_registry_ops.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# an example of using the reg.exe tool on windows to find some things in +# the registry. +# this happens to look in the registry for PuTTY keys for a set of named +# displays. + +declare ip_array=(zorba-1 zorba-2 zorba-3 zorba-4 zorba-5) + +for i in ${ip_array[*]}; do + target=${i} + echo "display is $target" + reg query 'HKCU\Software\SimonTatham\PuTTY\SshHostKeys' /v "rsa2@22:$target" +done + + diff --git a/scripts/examples/script_location.sh b/scripts/examples/script_location.sh deleted file mode 100644 index bdae0fc7..00000000 --- a/scripts/examples/script_location.sh +++ /dev/null @@ -1,7 +0,0 @@ - -# find out the location where this script is running from. this will not -# work properly in a bash script that is included via 'source' or '.'. -# the first letter of each command is escaped to eliminate the danger of -# personal aliases or functions disrupting the results. -ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && \pwd )" -