Warning: this is a htmlized version!
The original is across this link. |
####### # # E-scripts on keeping my local "mirror" of parts of the internet # (on /snarf). # # Note 1: use the eev command (defined in eev.el) and the # ee alias (in my .zshrc) to execute parts of this file. # Executing this file as a whole makes no sense. # # Note 2: be VERY careful and make sure you understand what # you're doing. # # Note 3: If you use a shell other than zsh things like |& # and the for loops may not work. # # Note 4: I always run as root. # # Note 5: some parts are too old and don't work anymore. Some # never worked. # # Note 6: the definitions for the find-xxxfile commands are on my # .emacs. # # Note 7: if you see a strange command check my .zshrc -- it may # be defined there as a function or an alias. # # Note 8: the sections without dates are always older than the # sections with dates. # # This file is at <http://angg.twu.net/a/e/snarf.e> # or at <http://angg.twu.net/e/snarf.e.html>. # See also <http://angg.twu.net/emacs.html>, # <http://angg.twu.net/a/.emacs[.html]>, # <http://angg.twu.net/a/.zshrc[.html]>, # <http://angg.twu.net/escripts.html>, # and <http://angg.twu.net/>. # ####### ##### # # psne # ##### # (find-fline "~/.zshrc" "function psne") # (find-fline "~/.psne.log") # (find-fline "$S/.psne.log") # (find-es "net" "wget_patch") ##### # # Removing empty dirs # ##### cd /snarf # find * -type d | perl -nle 'print ":$_:";' find * -type d -depth | perl -nle 'rmdir && print $_;' ##### # # Updating ~/osnl # ##### find /snarf/ -type f -or -type l | sort > ~/osnl # (find-fline "~/osnl") ##### # # exile # ##### # (find-fline "~/TCL/exile") proc readfile {fname} { set channel [open $fname r]; set bigstr [read $channel]; close $channel return $bigstr } proc writefile {fname bigstr} { set channel [open $fname w]; puts -nonewline $channel $bigstr; close $channel } proc sys {args} { puts [join $args]; puts [eval exec -- $args] } set lines [split [read stdin] "\n"] foreach line $lines { if [regexp "^ " $line] { if [regexp "^ /snarf/(.*)/(.*)\$" $line {} pdir fname] { sys mkdir -p /esnarf/$pdir/ sys mv -fv /snarf/$pdir/$fname /esnarf/$pdir/ } else { puts "??: $line" } } } agrep '^ ' ~/osnl | eet # (find-fline "~/osnl" "danu") # (find-fline "~/osnl" "bliss") ###### # # freshmeat # ###### (for i in 0{1,2,3,4,5,6,7,8,9} {1,2}{1,2,3,4,5,6,7,8,9} 3{0,1}; do psne http://ct.us.mirrors.freshmeat.net/news/1999/05/$i/ done) |& tee o cd $S/http/www.freshmeat.net/news/1999/05/ for i in $(find * -type f | grep '\.html$'); do echo $i unhtml < $i > $i.txt done cd $S/http/www.freshmeat.net/news/1999/05/ agrep -i blade $(find * -type f | grep '\.html.txt$' | sort -r) ###### # # debian # ###### # (find-es "net" "netselect") # (find-es "net" "debian_mirrors") mynetselect $(cat /usr/doc/netselect/examples/debian-ftp-mirrors) # (find-fline "~/o2") psne $FDEBIAN_CDROM/ls-lR.gz cd $SDEBIAN gzip -dv ls-lR.gz ~/ICON/lslR2find < ls-lR > ls-lR.i