bumble.sf.net language and parsing

plain text

The Notes Folder

This folder contains quick notes written about various subjects

...

getting a page via an authenticating proxy server

 curl -x proxy.utas.edu.au:8080 -U bobj http://www.server.net 

getting a page via an authenticating proxy server as user 'bobj' with password 'asecret'

 curl -x proxy.utas.edu.au:8080 -U bobj:asecret http://www.server.net

Supplying the password in this manner is possibly not a good idea from a security point of view

a function which prints its own name

 test () { echo "$FUNCNAME"; }

a function which prints its own name

 test () { [ -z "$1" ] && echo "$FUNCNAME: parameter needed" && return 1; }

download a text file through a proxy and edit it with vim function edn { curl -x proxy.utas.edu.au:8080 -U bishop:secret http://bumble.sourceforge. href="net/notes/index.txt">net/notes/index.txt -o ~/notes.txt vim ~/notes.txt } ,,,

upload some file to a webserver cgi script which has http authententication through a proxy function up { [ -z "$1" ] && echo 'no parameter' && return 1; curl -F name='../htdocs/notes/'$1 -F contents='<'$1 -u user:upass -x proxy.utas.edu.au:8080 -U bob:proxypass http://www.server. href="net-bin/save.cgi">net-bin/save.cgi }

upload data from the file 'list.txt' to a webserver

 curl -F comment=<~/docs/list.txt www.server.net/cgi-bin/save-comment.pl
The curl line above is equivalent to the user filling out a web form and posting it. The form would look like

 

upload the file 'notes.txt' with curl through a proxy server to a server cgi script

 curl -F filename='../htdocs/notes/index.txt' -F filecontents='

Utas stuff


I have being trying to get curl to work

trying to upload a file 'notes.txt' with curl through the proxy server

 curl -F filename='../htdocs/notes/index.txt' -F filecontents='

a simple bashrc file for utas to allow me to edit stuff # I like this for big edits set -o vi

# I wonder if this is persistent on the server alias al='vim ~/.bashrc; source ~/.bashrc'

alias sn="curl -F filename='../htdocs/notes/index.txt' -F filecontents='">http://bumble.sourceforge.net/cgi-bin/save.x.cgi"

function edn { curl -x proxy.utas.edu.au:8080 -U mjbishop: http://bumble.sourceforge. href="net/notes/index.txt">net/notes/index.txt -o ~/notes.txt vim ~/notes.txt }

,,,

Old notes


play a random wav file in the current folder

 mjbishop$ f=$(ls *.wav | head -$[$RANDOM%$(ls | wc -l)] | tail -1); afplay "$f"

slightly shorter way to do the same

 mjbishop$ f=$(ls *.wav | sed -n "$[$RANDOM%$(ls | wc -l)]p" ); afplay "$f"

an even shorter way to do the same thing but wont work if some filenames have spaces

 a=($(ls)); afplay "${a[$RANDOM%${#a}]}" 

display the fifth file in the current folder

 a=($(ls)); echo ${a[5]}

display a random file in the current folder

 a=($(ls)); echo ${a[$RANDOM%${#a}]}

an interpreting loop which breaks when the user enters 'q'

 while true; do read a; echo $a; [ "$a" = "q" ] && break; done