Warning: this is a htmlized version!
The original is across this link.
#######
#
# E-scripts on maintaing my home page.
#
# 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/page.e>
#           or at <http://angg.twu.net/e/page.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/>.
#
#######




#####
#
# Uploading the full page
# 99dec12
#
#####

#  «twu_99dec12»
# make the bundle, upload to twu, generate things there

rm /tmp/page.tgz
make -f ~/TH/Makefile /tmp/page.tgz

anonftp angg.twu.net 'lcd /tmp' 'put page.tgz' 'quit'
# Always update ~/pagetwu.tgz after a full upload
cp /tmp/page.tgz ~/pagetwu.tgz


#  «twu_make_page»
# At twu (with zsh; use sshtwu and eevt):

rm -fRv ~/public_html/
mkdir   ~/public_html/
cd      ~/public_html/
tar -xvzf ~/page.tgz
touch $(find * -type f)

# Do I need this hack?
echo -n > a/s/Makefile.auto
sleep 2
touch a/s/Files.tcl

make DOREMOTE=1 THDIR=a/s -f a/s/Makefile makefile all	|& tee ~/om
cp -v ~/page.tgz ~/public_html/a/s/page.tgz





# On errors...

cd      ~/public_html/
echo '-------' >> ~/om
make DOREMOTE=1 THDIR=a/s -f a/s/Makefile makefile all	|& tee -a ~/om

# (find-twufile "om")
# (find-twufile "public_html/a/s/map.th")

rm -fRv ~/public_html/

# Some hacks that I'm no longer using.

# twu has no expect, so:
#cd ~/public_html/a/s
#grep -v /usr/bin/expect Generate > Generate_tclsh
#mv Generate_tclsh Generate
#chmod 755 Generate
#cd      ~/public_html/

# Another hack: twu's Tcl is 7.6 and search.th breaks, so...
#cat > a/s/search.th <<'---' 
#htmlize {Links on search engines} {
#  [P (temporarily broken on twu due to incompatibilities between Tcl
#  7.6 and Tcl 8.0, sorry...)]
#}
#---




#####
#
# Partial uploads
# 99dec27
#
#####

#  «upload_changes»

rm /tmp/page.tgz
rm -Rv /tmp/oldpage/
rm -Rv /tmp/newpage/

cd ~/TH/L/
make -f ~/TH/Makefile /tmp/page.tgz

mkdir  /tmp/oldpage/
cd     /tmp/oldpage/
tar -xvzf ~/pagetwu.tgz

mkdir  /tmp/newpage/
cd     /tmp/newpage/
tar -xvzf /tmp/page.tgz

# Delete the files that haven't changed:
cd     /tmp/newpage/
for i in $(find * -type f); do
  cmp $i ../oldpage/$i && rm -v $i
done

# Pack the changed files and upload them.
cd /tmp/newpage/
tar -cvzf /tmp/pagechanges.tgz $(find * -type f)
laf /tmp/pagechanges.tgz
anonftp angg.twu.net 'lcd /tmp' 'put pagechanges.tgz' 'quit'



#  «twu_big_remake»

# Way 1, remaking everything.
# At twu, with sshtwu, we do:
#
rm -fRv ~/public_html/
mkdir   ~/public_html/
cd      ~/public_html/
tar -xvzf ~/page.tgz
tar -xvzf ~/pagechanges.tgz
tar -cvzf ~/newpage.tgz $(find * -type f)
touch $(find * -type f)
#
echo -n > a/s/Makefile.auto
sleep 2
touch a/s/Files.tcl
#
make DOREMOTE=1 THDIR=a/s -f a/s/Makefile makefile all	|& tee ~/om
cp -v ~/newpage.tgz ~/public_html/a/s/page.tgz
mv -v ~/newpage.tgz ~/page.tgz


#  «twu_minimal_remake»

# Way 2, "non-destructive".
# We just change some files and remake.
# At twu, with sshtwu:
#
cd      ~/public_html/
tar -xvzf ~/pagechanges.tgz
touch $(tar -tzf ~/pagechanges.tgz)
make DOREMOTE=1 THDIR=a/s -f a/s/Makefile makefile all	|& tee ~/om
make DOREMOTE=1 THDIR=a/s -f a/s/Makefile /tmp/page.tgz
mv -v /tmp/page.tgz ~/page.tgz
cp -v ~/page.tgz ~/public_html/a/s/page.tgz



# After doing things by way 1 or way 2, we do, at angg:
laf ~/pagetwu.tgz /tmp/page.tgz
mv /tmp/page.tgz ~/pagetwu.tgz





#####
#
# upload my page to angelfire, from twu
# 00jan12
#
#####

# (find-fline "~/.netrc
# (find-fline "edrx@angg.twu.net:.netrc")

# at angg:

cd
grep angelfire ~/.netrc | tee ~/o
anonftp angg.twu.net 'put .netrc' 'chmod 600 .netrc' 'quit'

# at twu:
# twu doesn't have expect, so I can't use my anonftp script

cd ~/public_html/
(echo hash on
 echo prompt off
 find * -type d | awk '{print "mkdir ", $1}'
 find * -type f | sort | awk '{printf "!echo %s :\nput %s %s\n", $1, $1, $1}'
) > ~/o

ftp ftp.angelfire.com < ~/o |& tee ~/o2




#####
#
# upload the PUC mirror (from twu)
# 00jan12
#
#####

# with sshsucuri:

cd; wget http://angg.twu.net/a/s/page.tgz
mv page.tgz.1 page.tgz
makepage




#####
#
# Making a bundle to upload and testing it
# 99dec06
#
#####

# (find-fline "~/TH/")
# (find-fline "~/TH/Makefile")
# (find-fline "~/.zshrc" "makeR")

rm -Rv /tmp/tmppage
mkdir  /tmp/tmppage
cd     /tmp/tmppage
rm /tmp/page.tgz
make -f ~/TH/Makefile /tmp/page.tgz	|& tee ~/omp

# (find-fline "~/omp")

# As edrx:
rm -fRv ~/public_html/
mkdir   ~/public_html/
cd      ~/public_html/
tar -xvzf /tmp/page.tgz
make DOREMOTE=1 THDIR=a/s -f a/s/Makefile makefile all	|& tee ~/om

# Check broken local links:
rm -Rv /tmp/dlpage/
mkdir  /tmp/dlpage/
cd     /tmp/dlpage/
wget -r -np -nv http://127.0.0.1/~edrx/	|& tee ~/ow
egrep ':($| )' ~/ow > ~/ow2
egrep ':$' ~/ow > ~/ow3
egrep ':$' ~/ow | sort | uniq > ~/ow4

cd ~edrx/public_html/
find * -type f | sort > ~/o1
cd /tmp/dlpage/127.0.0.1/~edrx/
find * -type f | sort > ~/o2
cd
diff o1 o2 | tee ~/o3

# (find-fline "~/ow")
# (find-fline "~/ow2")
# (find-fline "~/ow3")
# (find-fline "~/ow4")
# (find-fline "~/o3")

# Hunt the errors by hand.
lynx http://127.0.0.1/~edrx/






#####
#
# Fixing search.th, that broke on Tcl7.6
# 99dec18
#
#####

# (find-fline "~/TH/search.th")
# (find-fline "~/TH/L/a/s/search.th")

cd ~/TH/L/
tcl7.6 /home/root/TH/Generate search.html a/s/search.th







htmlize {foo} {


[HLIST1 {Shortcuts for power searches (ugly outside lynx!!!):}
  [J <form action=\"http://www.deja.com/qs.xp\" method=get>
    <input type=hidden name=\"ST\" value=\"PS\">
    <input type=hidden name=\"svcclass\" value=\"dnyr\">
    [HLIST2 {DejaNews power search}
      [J Keywords:
         <input type="text" name="QRY" size="30" value="">
         <input type="submit" value="(search now)">
        ]
      [J Match [SELECT defaultOp 1  AND all  OR any] keywords
        ]
      [J Archive:
          [SELECT DBS 1  1 complete  2 standard  3 adult  4 jobs  5 {for sale}]
        ]
      [J Results type:
        [SELECT OP 1
          dnquery.xp discussions
          ratesearch.xp ratings
          commsearch.xp communities
          CLASSIC {Deja Classic}
          ]
        ]
      [J Language:
        [SELECT LNG 1
          ALL any
          chinese Chinese
          danish Danish
          dutch Dutch
          english English
          finnish Finnish
          french French
          german German
          hungarian Hungarian
          italian Italian
          japanese Japanese
          korean Korean
          norwegian Norwegian
          portuguese Portuguese
          polish Polish
          russian Russian
          spanish Spanish
          swedish Swedish
          vietnamese Vietnamese
          ]
        ]
      [J Subject (example: FAQ or (frequently asked questions)):
        <input type=text name=subjects size=30>
        ]
      [J Forum (example: alt.tv.x-files or *x-files*)
        <input type=text name=groups size=30>
        ]
      [J Author (example: demos@deja.com)
        <input type=text name=authors size=30>
        ]
      [J From (example: Apr 1 1997):
        <input type=text name=fromdate size=12>
        ]
      [J To (example: Apr 5 1997):
        <input type=text name=todate size=12>
        ]
      [J Sort by
        [SELECT showsort 1
          score confidence
          subject subject
          newsgroup forum
          author author
          date date
          ]
        ]
      [J Results per page:
        [SELECT maxhits 1  25 25  50 50  100 100]
        ]
      [J <input type=\"submit\" value=\"Search\">
        ]
      ]
    </form>
    ]
}
















#####
#
# Notes on making
# 99sep15
#
#####

# (find-fline "~/om")
# (find-fline "~/.zshrc" "makeL=")
# (find-fline "~/TH/Makefile.th")

# (find-node "(zsh)Conditional Expressions" "-nt")
# (find-node "(zsh)Alternate Forms For Complex Commands")

# (find-fline "~/.zshrc" "makepage")
# (find-fline "~/TH/")
# (find-fline "~/TH/Makefile.L")
# (find-fline "~/TH/Makefile.L.auto")
# (find-fline "~/TH/Htmllib.tcl")
# (find-fline "~/TH/Files.tcl")
# (find-fline "~/TH/Generate")





#####
#
# Extracting e-scripts descriptions
#
#####

# (find-node "(gawk)Top")
# (find-node "(gawk)If Statement")
# (find-node "(gawk)String Functions" "substr(")

cd $ES/
for i in *.e; do
  echo -n "$i: "
  awk '{if ($0=="#") {if (n==1) exit; else n+=1}
        else if (n==1) print substr($0, 3)
       }' $i
done | tee ~/o




######
#
# vcsa2pnm (screenshots of vts; Icon version)
# 99sep15
#
######

#  «vcsa2pnm_icon»
# (find-fline "~/ICON/vcsa2pnm.icn")

cd ~/ICON/
icont -s vcsa2pnm
# vcsa2pnm > /tmp/v.pnm
vcsa2pnm /home/root/C/math1.8 2 > /tmp/v.pnm
display /tmp/v.pnm

cd ~/ICON/
icont -s vcsa2pnm

~/ICON/vcsa2pnm /home/root/C/math1.8 2 \
  | convert - /tmp/v.png
laf /tmp

cd /tmp
zgv

# (find-vldifile "pnmtopng.list")
# (find-fline "/usr/doc/pnmtopng/")




######
#
# vcsa2pnm (mktclapp version)
# 99oct04
#
######

#  «vcsa2pnm»
# (find-fline "~/MTA/vtutil.tcl")
# (find-fline "~/.emacs")
# (find-fline "/etc/inittab" "kbrequest")
# (find-fline "~/bin/kbrequest")

cd ~/MTA/
vtutil vcsa2pnm  /dev/vcsa1  256 8 math1.8  /tmp/1.pnm
convert /tmp/1.pnm /tmp/1.png
laf /tmp/1*

# Timing:
cd ~/MTA/
time  vtutil vcsa2pnm  /dev/vcsa1  256 8 math1.8  /tmp/1.pnm
time  pnmtopng /tmp/1.pnm > /tmp/1.png
time  pnmtopng < /tmp/1.pnm > /tmp/1.png
time  convert /tmp/1.pnm /tmp/1c.png
laf /tmp/1*
# "convert" is faster and compresses color output better.


# 99dec06: but when I tried to use these pngs in netscape I noticed
# that it (netscape 4.5) really really really doesn't like the pngs
# generated by convert; so, use the one created by pnmtopng for
# anything serious.


# Old command line (obsolete):
# ./vtutil.tcl vcsa2pnm math2.8 8 /dev/vcsa1 /tmp/1.pnm





#####
#
# Binding Alt-Up to a screen-capture script
# 99dec06
#
#####

#  «capture_screen»

# (find-fline "/etc/inittab" "kbrequest")
# (find-fline "~/bin/kbrequest")

if [[ -e /tmp/ncaptures ]]; then
  N=$(</tmp/ncaptures)
else
  N=0
fi
N=$[$N+1]
echo $N > /tmp/ncaptures
cd /home/root/MTA/
./vtutil.tcl vcsa2pnm math2.8 8 /dev/vcsa1 /tmp/$N.pnm
/usr/X11R6/bin/convert /tmp/$N.pnm /tmp/$N.png
rm /tmp/$N.pnm

exit






######
#
# old notes on converting vcsas into pngs
# 99sep14
#
######

# (find-vldifile "imagemagick.list")
# (find-fline "/usr/doc/imagemagick/")

# (* (* 80 8) (* 50 8) 3)
# -> 768000

pdsc /big/slinks1/dists/slink/main/source/graphics/netpbm-free_19940301.2-7.dsc
cd /usr/src/netpbm-free-19940301.2/
# man2t pbm/pbm.5 | l
# man2t pgm/pgm.5 | l
man2t pnm/pnm.5 | l
man2t ppm/ppm.5 | l




#####
#
# Condensing forms
#
#####

#  «condensing_forms»

# (find-enode "Regexps")
# (find-fline "~/TH/search.th")

(query-replace-regexp
  "^<option value=\\(\"\\([^\"]*\\)\"\\|\\([^ >]*\\)\\)\\( selected\\)?>"
  "\\2\\3 ")

(query-replace-regexp
  "^<select name=\\(\"\\([^\"]*\\)\"\\|\\([^ >]*\\)\\) size=\\([^>]*\\)>"
  "[SELECT \\2\\3 \\4")

# Test on this:

Language:
<select name="LNG" size=1>
<option value=ALL selected>any
<option value=chinese>Chinese
<option value="danish">Danish
<option value=dutch>Dutch
</select>




#####
#
# html.007: converting .ths from the old format
# 99sep??
#
#####

# (find-fline "~/.zshrc" "getstrings")
# (eeman "perlop" "REPLACEMENT")
# (eeman "perldata" "hash literal")

# Tool to help me select which "$..."s to replace
#
cd $PAGE
for i in *.th; do
  perl -ne 'while ( m/(\$[0-9A-Za-z_]+)( |$)/gc ) { print $1, "\n"; }' < $i
done | sort | uniq

# Convert (partially) most of the old pages to the new format
#
cat > /tmp/p <<'---'
%a = ( '$ANGG' => 'ANGG', '$E' => 'ES', '$L' => 'L', '$L2' => 'L',
'$LR' => 'LR', '$Ldir' => 'L', '$Loc' => 'LOC', '$bf' => 'BF', '$h3'
=> 'H3', '$hlist1' => 'HLIST1', '$hlist2' => 'HLIST2', '$href' =>
'HREF', '$ifLR' => 'IFLR', '$it' => 'IT', '$j' => 'J', '$li' => 'LI',
'$list1' => 'LIST1', '$p' => 'P', '$pre' => 'PRE', '$q' => 'Q', '$t'
=> 'T', '$t0' => 'T1', '$tt' => 'TT' );
s/(\$[0-9A-Za-z_]+)( |$)/($a{$1}||$1).$2/eg;
print $_;
---
# perl -nl /tmp/p < $PAGE/ebabble.th
for i in crashco debian ebabble escripts files forth haskell html icon \
  index linux logic math music other perl redhat0 tcltk tese tex \
  unclassified; do
    echo $i.th
    perl -nl /tmp/p < $PAGE/$i.th > ~/TCL/PAGE2/$i.th
done




# (find-fline "~/TCL/PAGE/")
# (find-fline "~/TCL/PAGE2/")

cd ~/TCL/PAGE2/
make




#####
#
# angelfire
# 99oct08
#
#####

#  «angelfire»

# (find-es "http" "tcl_http")
# (find-fline "$S/http/www.angelfire.com/or2/edrx/")
psne https://www.angelfire.com/or2/edrx/
lynx https://www.angelfire.com/or2/edrx/

ftp ftp.angelfire.com
cd incoming

cd $ES

cd ~/TH/L/
anonftp ftp.angelfire.com 'cd incoming' 'put index.html edrxindex.html'


# (find-fline "~/.psne.log")
find $S/http/www.angelfire.com/
find $S/http/help.angelfire.com/

cd $S/http/www.angelfire.com/cgi-bin/
getforms < bedit.html
cp bedit.html /tmp
edrxnetscape /tmp/bedit.html

A=$S/http/help.angelfire.com/bin/help
cd $A
rm -v $(find * -type l)
for i in $(find * -type f); do ln -s $(basename $i) $i.html; done

A=$S/http/help.angelfire.com/bin/help
lynx -force_html $A/B-Homepage_Building_Help/G-Uploading
lynx -force_html $A/B-Homepage_Building_Help/A-Web_Shell
lynx -force_html $A/A-General_Questions/A-About_Angelfire_Membership

grep angel ~/.psne.log

# (find-fline "$S/http/www.angelfire.com/cgi-bin")
# (find-fline "$S/http/www.angelfire.com/cgi-bin/_webshell.html")




http://help.angelfire.com/bin/help/B-Homepage_Building_Help/G-Uploading
http://help.angelfire.com/bin/help/A-General_Questions/A-About_Angelfire_Membership
https://www.angelfire.com/cgi-bin/register
http://help.angelfire.com/bin/help/B-Homepage_Building_Help/A-Web_Shell
https://www.angelfire.com/doc/ftpupload.html