Wed Jan 25 00:42:37 HKT 2012 From /weblog/unix/script
xdotool
Simulate user input - http://pratyeka.org/fake-x-input/
(google search) (amazon search)
|
|
download zip of files only Wed Jan 25 00:42:37 HKT 2012 From /weblog/unix/script xdotoolSimulate user input - http://pratyeka.org/fake-x-input/ (google search) (amazon search) Sat Oct 08 19:01:24 HKT 2011 From /weblog/unix/script sedhttp://www.catonmat.net/blog/worlds-best-introduction-to-sed/ (google search) (amazon search) Sat Sep 03 11:37:14 HKT 2011 From /weblog/unix/script sortSort by column - http://javarevisited.blogspot.com[..]/unix-sort-command-example-tutorial.html (google search) (amazon search) Thu Aug 25 02:16:44 HKT 2011 From /weblog/unix/script webserverCreate webserver with nc using bash http://www.linuxscrew.com[..]07/09/06/web-server-on-bash-in-one-line/ http://paulbuchheit.blogspot.com/2007/04/webserver-in-bash.html (google search) (amazon search) Tue Jul 12 01:11:20 HKT 2011 From /weblog/unix/script loophttp://www.thegeekstuff.com/2011/07/bash-for-loop-examples/ (google search) (amazon search) Thu Jul 07 23:54:28 HKT 2011 From /weblog/unix/script useful example of shell scriptxmlwf, need to know if a XML document is well formed? (A configuration file maybe..) mkfifo is the coolest one. Sure you know how to create a pipeline piping the output of grep to less or maybe even perl. nl, add number for every line of a file http://bashcurescancer.com[..]/10-linux-commands-youve-never-used.html http://www.thegeekstuff.com/2010/11/50-linux-commands/ ======================================create real player song list #!/bin/sh win_path=C:/tools linux_path=/mnt/disk/winapp for file in `find $1 -type f`; do if(`/bin/cat $file | grep $win_path`); then echo $file;fi; done; /usr/bin/find $MUSIC_SRC -type f -exec /bin/echo file://{} \; > $TMPDIR/tmp.rm while read i ; do /bin/echo "$RANDOM $i" ; done < $TMPDIR/tmp.rm | /bin/sort -n | /bin/sed 's/^[0-9]* //' > $TMPDIR/tmp1.rm /bin/cat $TMPDIR/tmp1.rm |/bin/sed -e 's/file:\/\///' >$HOME/mplayer.list /bin/cat $TMPDIR/tmp1.rm |/bin/grep -vi wma >$HOME/real.rm /bin/cat $TMPDIR/tmp1.rm |/bin/sed -e 's/file:\/\/\/var\/www\/html/http:\/\/www.carfield.com.hk/'>/var/www/html/.secure/media/music/live.rm ======================================remove log for file in `find -type f|grep website.|grep -v lck`;do rm -f $file;done ======================================for loop for((a = 1; a <10; a++)); do wget -b "http://www.thai.net/ferrari545/bbs_series/ku_bbs_000$a.jpg";done ======================================resize photo for i in *.jpg; do convert -geometry 1024x768 $i newdir/$i ; done ======================================basic calculation i=1;find|grep -v zng|grep -v avi|while read file;do mv "$file" $i.jpg;i=$((i+1));done ======================================# Make 3 a copy of 1 (stdout) exec 3>&1 result="$(command to generate stream \ | tee /dev/fd/3 \ | command to process stream)" # Now work with $result # The original stream also went to the console http://binkley.blogspot.com[..]5/getting-more-from-streams-in-bash.html (google search) (amazon search) Mon Mar 21 10:57:59 HKT 2011 From /weblog/unix/script find exampleAn question about how to remove unused package from MacOSX turn out to be an example of "find" command: http://forums.osxfaq.com/viewtopic.php?p=57887#57887 http://www.osxfaq.com/tips/unix-tricks/week98/tuesday.ws http://javarevisited.blogspot.com[..]find-command-in-unix-examples-basic.html File Search tips in Linux - http://discuss.joelonsoftware.com[..]iscussTopicParent=18272&ixDiscussGroup=3 Another search tip, example of find base on time and size, and how to compare with other files - http://viralpatel.net[..]e-useful-unix-file-finding-commands.html (google search) (amazon search) Wed Jan 05 00:13:55 HKT 2011 From /weblog/unix/script stringhttp://www.thegeekstuff.com/2010/07/bash-string-manipulation http://www.thegeekstuff.com/2010/11/strings-command-examples/ http://www.thegeekstuff.com[..]/01/regular-expressions-in-grep-command/ (google search) (amazon search) Fri Aug 06 00:54:21 HKT 2010 From /weblog/unix/script bashHow to use eval, hash, readonly, shift, getopts, set, unset, let and shopt - http://www.thegeekstuff.com/2010/08/bash-shell-builtin-commands Sample bash completion SSH_COMPLETE=( $(cut -f1 -d' ' ~/.ssh/known_hosts |\ tr ',' '\n' |\ sort -u |\ grep -e '[:alpha:]') ) complete -o default -W "${SSH_COMPLETE[*]}" ssh http://kasparov.skife.org/blog/stuff/starting-a-meme.html Check history statistic - brianm@binky:~$ history | awk {'print $2'} | sort | uniq -c | sort -k1 -rn | head 164 svn 52 cd 42 ssh 32 sudo 22 git 16 ls 16 for 14 echo 13 man 10 curl brianm@binky:~$ http://bluebones.net/2008/04/history-meme/ (google search) (amazon search) Fri Feb 05 13:12:38 HKT 2010 From /weblog/unix/script awk10 awk tips - http://www.catonmat.net/blog/ten-awk-tips-tricks-and-pitfalls/ 8 Powerful Awk Built-in Variables – FS, OFS, RS, ORS, NR, NF, FILENAME, FNR - http://www.thegeekstuff.com[..]iables-fs-ofs-rs-ors-nr-nf-filename-fnr/ (google search) (amazon search) Wed Feb 11 18:55:55 HKT 2009 From /weblog/unix/script testhint of using test - http://www.ibm.com/developerworks/linux/library/l-bash-test.html http://binkley.blogspot.com/2009/02/speeding-up-cygwin-login.html (google search) (amazon search) Thu May 08 14:00:20 HKT 2008 From /weblog/unix/script dateA working date calculation script http://www.unix.com[..]s/4870-days-elapsed-between-2-dates.html (google search) (amazon search) Thu Nov 15 01:31:37 HKT 2007 From /weblog/unix/script Convert PDF to set of image as slide show - http://ejohn.org/blog/easy-pdf-sharing/ (google search) (amazon search) Thu Jul 05 01:38:01 HKT 2007 From /weblog/unix/script developmentA bash debugger - http://bashdb.sourceforge.net/ (google search) (amazon search) Fri Jun 16 21:37:41 HKT 2006 From /weblog/unix/script check exit statusNeed to check #? and PIPESTATUS http://www.mattryall.net/article.cgi?id=247 (google search) (amazon search) Sun May 28 18:31:46 HKT 2006 From /weblog/unix/script Batch renameScript of batch rename at unix system http://mattfleming.com/node/110 http://stuart.woodward.jp/?p=279 (google search) (amazon search) Tue Nov 08 14:33:09 HKT 2005 From /weblog/unix/script Unix KornShell Quick Referencehttp://www.maththinking.com/boat/kornShell.html (google search) (amazon search) Tue Oct 04 11:58:05 HKT 2005 From /weblog/unix/script safer rmA number of tips to make rm command safer http://www.macosxhints.com[..]le.php?story=20050928082624470&lsrc=osxh (google search) (amazon search) Wed Jul 06 11:40:45 HKT 2005 From /weblog/unix/script find deleteuse 'find' to delete branch of file: http://keithdevens.com/weblog/archive/2005/Jul/05/find.rm (google search) (amazon search) |