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




#####
#
# Select a fast Debian mirrors using netselect
# 00jan12
#
#####

#  «debian_mirrors»

psne $FDEBIAN/README.CD-manufacture
psne $FDEBIAN/README.mirrors.html
psne $FDEBIAN/README.mirrors.txt
psne $FDEBIAN/README.non-US

getlinks < $SDEBIAN/README.mirrors.html \
  | grep ^ftp \
  | sort | uniq \
  | tee /tmp/debian-mirrors

cat /tmp/debian-mirrors \
  | perl -nle 'm%^ftp://(.*?)/% && print $1' \
  | sort | uniq \
  | tee /tmp/debian-mirrors-

# (find-angg ".zshrc" "netselect")

mynetselect $(</tmp/debian-mirrors-)
tac < ~/o2 > /tmp/debian-mirrors-scores

# (eeman "perlfaq5" "<OLD>")
perl -e '
  open(A, "< /tmp/debian-mirrors");
  while (<A>) {
    if (m|^ftp://(.*?)(/.*)\n|) {
      $path{$1} = $2;
    }
  }
  open(B, "< /tmp/debian-mirrors-scores");
  while (<B>) {
    if (m|\[(.....)\](.....) ms (...) hops.*  ...% ok \((..)/10\) ([!-~]*)|) {
      print "[$1]$2 ms$3 hops $4/10 pkts $5$path{$5}\n"
    }
  }
' | tee /tmp/debian-mirrors2
head /tmp/debian-mirrors2

cp /tmp/debian-mirrors2 ~/odebian-mirrors
# (find-fline "~/odebian-mirrors")

# (find-fline "/tmp/debian-mirrors-scores")
# (find-fline "/tmp/debian-mirrors2")

# (find-fline "~/o2")
# (find-fline "/tmp/debian-mirrors")
# (find-fline "/tmp/debian-mirrors" "internap")
# (find-fline "/tmp/debian-mirrors" "ssc")





#######
#
# netselect (old notes)
#
#######

#  «netselect»

# (find-vldifile "netselect.list")
# (find-fline "/usr/doc/netselect/")
# (find-fline "/usr/doc/netselect/README.gz")

# Debian mirrors:
#
cd /usr/doc/netselect/examples/
netselect -vvv $(cat debian-ftp-mirrors)	|& tee ~/o
agrep ' ok ' < ~/o \
  | awk '{printf "%s %s %s\n",
            substr($0, 73), substr($0, 39, 33), substr($0, 1, 37)}' \
  | sort -r \
  | tee ~/o2

# (find-fline "~/o2")
# (find-fline "/usr/doc/netselect/examples/debian-ftp-mirrors")
# (find-fline "/big/slinkb1/README.mirrors.txt")

# CPAN mirrors:
#
getlinks < $S/http/www.perl.com/CPAN/SITES.html |& tee ~/o3
perl -nle 'm%.*://([.0-z-]+)/.*% && print $1' < ~/o3 | sort | uniq > ~/o2
netselect -vvv $(<~/o2)	|& tee ~/o
agrep ' ok ' < ~/o \
  | awk '{printf "%s %s %s\n", substr($0, 73), substr($0, 39, 33), substr($0, 1, 37)}' \
  | sort -r \
  | tee ~/o2

# (find-fline "~/o2")
# (find-fline "~/o3")

ftp://ftp.cdrom.com/pub/perl/CPAN/



pdsc /debian/dists/slink/main/source/net/netselect_0.2-3.dsc
cd /usr/src/netselect-0.2/
make |& tee om
# Uh-oh - it's suid root, can't install it at my university account


# Novo esquema:
# (find-fline "~/.zshrc" "netselect")
mynetselect $(cat /usr/doc/netselect/examples/debian-ftp-mirrors)

# (find-fline "/big/slinkb1/README.mirrors.txt")





#####
#
# potato snapshot
# 00jan??
#
#####

# To make a machine at my university download a potato snapshot...

anonftp ftp-mirror.internap.com 'cd pub/debian' \
  'cd dists/potato/main/binary-i386'
anonftp debian.ssc.com 'cd pub/debian' \
  'cd dists/potato/main/binary-i386'

(wget -nv -r -l 20 \
  ftp://ftp-mirror.internap.com/pub/debian/dists/potato/main/binary-i386/ \
  |& tee ~/ow)

(wget -nv -r -l 20 \
  ftp://ftp-mirror.internap.com/pub/debian/dists/potato/main/binary-all/ \
  |& tee ~/ow2)

(I=ftp://ftp-mirror.internap.com/pub/debian
  wget -nv -r -l 20 $I/dists/potato/main/disks-i386/2.2.4-2000-01-03/ \
  |& tee ~/ow3)

# How much space would it take? Make an educated guess:

cd $SDEBIAN/
cat ls-lR.i | grep dists/potato/main/binary-i386 \
  | nolinks | grep -v '^        ' | tee ~/o
awk '{total += $1}
     END {print total}' < ~/o






#######
#
# dip + expect
#
#######

# (find-fline "~/bin/inx.dip")
# (find-fline "~/EXPECT/inx")

  port ttyS2
  speed 115200
  netmask 255.255.255.0

  reset

# Meu string de inicializacao para o USR Sportster 14400:
#
  send ATL3&A3&B1&H1&R2&S0=0X3\r
  wait OK 1
  send ATDT///////5126882\r

#  inx:	512-688[012349]
#	512-689[0126789]
#	512-690[456]

  wait CONNECT 60
  if $errlvl != 0 goto error

login:
  wait rname: 10

edrx:
# wait 1
# send spg\r
  send edrx\r
  if $errlvl != 0 goto error

  wait ord: 10
  if $errlvl != 0 goto error
  send xxxxxxxx\n

  wait ing\sPPP
  if $errlvl != 0 goto error

  done:
  print CONNECTED $locip ---> $rmtip

loggedin:
  default

done:
  print CONNECTED to $remote with address $rmtip
  mode PPP
  exit

error:
  print PPP to $remote failed.




#############
#
# Uploading my page
#
#############

cd ~/ZHTML/
make clean
make rmt
mv rmt.tgz ..
make clean

cd ~/ZHTML/
make

cd
ftp $SACI <<EOF
  hash on
  put rmt.tgz
  quit
EOF

#
# to be run on boto:
#
rm -Rv ~/public_html/*
cd ~/public_html/
tar -xvzf ~/rmt.tgz
mv -v escripts/secret.e ..
ln ../xaster-1.00.tar.gz .


# (find-fline "~/ZHTML/Makefile")
# (find-fline "~/ZHTML/")
#
function T () {
  rm -v ~/ZHTML/$1
  cp -s $2 ~/ZHTML/$1
}
T configs/.emacs		~/.emacs
T configs/.fvwmrc		~/.fvwmrc
T configs/.mapleinit		~/.mapleinit
T configs/.xinitrc		~/.xinitrc
T configs/.zshrc		~/.zshrc
T configs/XF86Config.angg	~/XF86Config.angg
T configs/defkeymap850b.map	/home/replace/defkeymap850b.map
T configs/rc.local		~/bin/rc.local
T emacs/bucket.el		~/CRIM/bucket.el
T emacs/gslab.el		~/CRIM/gslab.el
T icon/dednat.icn		~/ICON/dednat.icn
T icon/gsops.icn		~/ICON/gsops.icn
T icon/header.icn		~/ICON/header.icn
T icon/sne.icn			~/ICON/sne.icn
T icon/zhtml.icn		~/ICON/zhtml.icn
T icon/zinc.icn			~/ICON/zinc.icn
T icon/zlib.icn			~/ICON/zlib.icn





########
#
# Testing it
#
########

rm -Rv ~/oo
mkdir ~/oo
cd ~/oo
wget -R gz -r http://www.mat.puc-rio.br/~edrx/ |& tee o
# (find-fline "~/oo/o")

rm -Rv ~/oo



#######
#
# wget 1.5.2
#
#######

cd /usr/src/
rm -Rv wget-1.5.2/
tar -xvzf /snarf/http/sunsite.auc.dk/ftp/pub/infosystems/wget/wget-1.5.2.tar.gz
cd /usr/src/wget-1.5.2/
./configure --disable-nls --prefix=/usr |& tee oc
#
# lynx doesn't like "~" as "%7E", remove it from URL_UNSAFE
# (find-fline "/usr/src/wget-1.5.2/src/url.c" "URL_UNSAFE")
#
make |& tee om
cd /usr/src/wget-1.5.2/
make install |& tee omi

# (find-wgfile "src/url.c" "convert_links")





#######
#
# wget 1.5.2: bug on RH, "Cannot determine user-id."
#
#######

cd /usr/src/wget-1.5.2/src/
gcc -I. -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/etc/wgetrc\" -DLOCALEDIR=\"/usr/share/locale\" -Wall -Wno-implicit -E host.c > host.E
# (find-wgfile "src/host.E" "Cannot")
# (find-wgfile "src/utils.c" "pwd_cuserid")


cd ~/C/
cat > pwuid.c <<'---'
#include <pwd.h>
#include <sys/types.h>
#include <stdio.h>
main() {
  struct passwd *pwd;
  pwd = getpwuid (getuid ());
  printf("%d\n", pwd);
  if (!pwd || !pwd->pw_name)
    exit(1);
  printf("%s\n", pwd->pw_name);
}
---
gcc -o pwuid pwuid.c
./pwuid




#######
#
# wget 1.5.3 (on boto)
#
#######

psne ftp://sunsite.auc.dk/pub/infosystems/wget/wget-1.5.3.tar.gz

cd $USRC/
rm -Rv wget-1.5.3/
tar -xvzf $S/ftp/sunsite.auc.dk/pub/infosystems/wget/wget-1.5.3.tar.gz
cd $USRC/wget-1.5.3/
./configure --disable-nls --prefix=/usr |& tee oc
#
# lynx doesn't like "~" as "%7E", remove it from URL_UNSAFE
# (find-fline  "$USRC/wget-1.5.3/src/url.c" "URL_UNSAFE")
# (find-fline "$BUSRC/wget-1.5.3/src/url.c" "URL_UNSAFE")
#
cd $USRC/wget-1.5.3/
make |& tee om

cp src/wget ~/bin-Linux/




######
#
# wget 1.5.3 (slink) - hacking
#
######

#  «wget_hacking»

# The basic patch is at:
# (find-es "slink" "wget_patch")

# Check that apt installed the patched version.
# (find-fline "/usr/src/.debs/")
# (find-vldifile "wget.postinst")

# How I got the input for "patch":
#cd /usr/src/wget-1.5.3/src/; cp -iv url.c url.c~
# lynx doesn't like "~" as "%7E", remove it from URL_UNSAFE
# (find-wgfile "src/url.c" "URL_UNSAFE")
#diff url.c~ url.c | tee ~/o

#
# Now for some heavier debugging.
#

# (find-fline "~/GDB/.gdbinit.wget")
# (gdb "gdb -x ~/GDB/.gdbinit.wget")

cd /snarf/http/
wget -r -nc -k http://hypatia.dcs.qmw.ac.uk/html/authors.html

# (find-wgtag "convert_links")
# (find-wgtag "convert_all_links")




#######
#
# urlget 3.12
#
#######

cd /usr/src/
rm -Rv urlget-3.12/
tar -xvzf /snarf/http/www.inf.ufrgs.br/~sagula/urlget-3.12.tar.gz
cd /usr/src/urlget-3.12/
make |& tee om




#####
#
# ssh
# 99dec04
#
#####

#  «ssh»

psnedebfrom $FNUDEBIAN <<'---'
   31708 dists/slink/non-US/source/ssh_1.2.26-1.2.diff.gz
     578 dists/slink/non-US/source/ssh_1.2.26-1.2.dsc
 1005284 dists/slink/non-US/source/ssh_1.2.26.orig.tar.gz
---

pdsc $SNUDEBIAN/dists/slink/non-US/source/ssh_1.2.26-1.2.dsc
cd /usr/src/ssh-1.2.26/
debian/rules binary	|& tee odrb

mv -v /usr/src/ssh*.deb /usr/src/.debs/
apt-update
apti ssh ssh-askpass

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

# (find-sshfile "")
# (find-sshfile "odbp")
# (find-sshfile "debian/")
# (find-sshfile "README")

# (eeman "ssh" "third authentication method")
# (eeman "ssh-agent")
# (eeman "ssh-add")
# (eeman "make-ssh-known-hosts")




#####
#
# The dummy net device
#
#####

# (find-k22file "Documentation/Configure.help" "Dummy net driver")
# (find-k2file "drivers/net/loopback.c")
# (find-k2file "drivers/net/dummy.c")

insmod $MODULES/dummy.o
ifconfig dummy 33.44.22.11 up

ifconfig dummy down

route add -net 99.0.0.0 netmask 255.0.0.0 dev lo

route add 99.0.0.0 netmask 255.0.0.0 gw localhost dev lo
route del 99.0.0.0


/etc/init.d/netstd_init	stop
/etc/init.d/netbase	stop
/etc/init.d/netstd_misc	stop

/etc/init.d/netstd_init	start
/etc/init.d/netbase	start
/etc/init.d/netstd_misc	start




######
#
# News
#
######

(load-library "gnus")
# (find-node "(gnus)Summary Post Commands")
# (find-node "(gnus)Article Caching")
# (find-efile "gnus.el")
# (find-efile "nntp.el")

cd /usr/share/emacs/19.34/lisp/
agrep '^\(' nntp.el

# (find-fline "/snarf/ftp/rtfm.mit.edu/pub/usenet/news.software.readers/")
# (find-fline "/snarf/ftp/rtfm.mit.edu/pub/usenet/news.software.readers/Gnus_(Emacs_Newsreader)_FAQ" ": Q1.12")




######
#
# Sending mail with the correct "from" field
#
######

sendmail -fFritz.Cohen@somewhere.zz -Fedrx edrx@mat.puc-rio.br <<'EOF'
blip blip
poo
EOF

(find-efile "sendmail.el")
(find-enode "Sending Mail")
(find-etag "mail-send")
(find-etag "sendmail-send-it")



#######
#
# sendmail configuration (RedHat; old)
#
#######

#  «sendmail_conf_rh»

# I use "DMmat.puc-rio.br"

# (find-fline "/etc/sendmail.cf" "my official domain name")
# (find-fline "/etc/sendmail.cf" "\nDM")
# (find-fline "/big/a42/live/usr/doc/sendmail/RELEASE_NOTES" "masq")
# (find-sendmfile "cf/README" "who I claim to be")
# (find-sendmfile "cf/README" "TION To M4")
# (find-sendmfile "src/conf.c")
# (find-sendmfile "src/macro.c" "DEFINE --")
# (find-sendmfile "src/main.c" "\ninitmacros")

groff -Tascii -me /big/a42/live/usr/doc/sendmail/doc/op/op.me | l

/etc/rc.d/init.d/sendmail.init stop
/etc/rc.d/init.d/sendmail.init start





#######
#
# sendmail configuration (Slink)
# 00jan11
#
#######

#  «sendmail_conf»

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

# (find-fline "/usr/share/sendmail.cf/feature/")

# *ARGH*, I lost fetchmail'ed mail due to a misconfigured sendmail!
# I have to be much more careful the next time...

# (find-vldifile "s






########
#
# Sniffit 0.3.5
#
########

cd /usr/src/
rm -Rv sniffit.0.3.5/
tar -xvzf /snarf/http/reptile.rug.ac.be/~coder/sniffit/files/sniffit.0.3.5.tar.gz
cd sniffit.0.3.5/
tar -xvf /snarf/http/reptile.rug.ac.be/~coder/sniffit/files/sniffit.0.3.5.p1.tar
patch < sniffit.0.3.5.patch.1 |& tee op
cp -v sniffit.5 /usr/man/man5/
cp -v sniffit.8 /usr/man/man8/
cp -iv /home/root/config.cache .
./configure |& tee oc
make |& tee om

# using:
# (find-fline "/usr/src/sniffit.0.3.5/README.FIRST" 160)
# (find-fline "/usr/src/sniffit.0.3.5/PLUGIN-HOWTO" 155)

sniffit -t @ -a -b -d -x	|& tee o
sniffit -t @ -a -b		|& tee oasc
sniffit -M1 -N -P UDP -t @





#######
#
# old java links
#
#######

http://www.blackdown.org/java-linux.html
http://www.blackdown.org/java-linux/docs/faq/FAQ-java-linux.htm
http://www.cs.utsa.edu/research/plss.html
http://www.redhat.com/linux-info/jolt/
http://www.transvirtual.com/kaffe/
http://www.transvirtual.com/kaffe/faq.html
http://www.webteacher.com/javatour.htm
http://www.best.com/~pvdl/javafaq.html

http://www.lesstif.org/
http://www.bcpl.lib.md.us/~jspath/usenet-newbie.html





##########
#
# ppp over minicom
#
##########

(find-fline "/usr/doc/HOWTO/mini/PPP-over-minicom" 107)
(find-fline "/etc/ppp/options")

(write-heredoc "/etc/ppp/mini_options")
asyncmap 0
lock
defaultroute
noipdefault
crtscts
modem
EOF

# Why? Well, strace'ing dip we see this:
#
# execve("/usr/sbin/pppd", ["pppd", "-detach", "defaultroute",
# "noipdefault", "crtscts", "modem"], [/* 38 vars */]) = 0
#
# which, by the way, corresponds to this source line:
#
# (find-fline "/usr/src/redhat/BUILD/dip-3.3.7o/ppp.c")
#
# I don't remember where did I get the asyncmap/lock lines from, maybe
# (find-fline "/c1/home/root/Tips/PPP-Client-HOWTO-11.html" 118)
# (find-fline "/c1/home/root/Tips/PPP-Client-HOWTO-14.html" 71)
# (find-fline "/c1/home/root/Tips/PPP-Tips-7.html")
# (find-fline "/usr/doc/HTML/ldp/PPP-HOWTO-12.html")
# (find-fline "/usr/doc/HTML/ldp/PPP-HOWTO-13.html" 52)
# (find-fline "/usr/doc/HTML/ldp/PPP-HOWTO-26.html" 118)
# (find-fline "/usr/doc/HTML/ldp/ISP-Hookup-HOWTO-6.html" 31)


/usr/sbin/pppd file /etc/ppp/mini_options < /dev/cua2 > /dev/cua2 &

laf -R /var/lock /var/run


Esse é o do INX:

(write-heredoc "/etc/resolv.conf")
search .
nameserver 200.240.18.1
EOF


Esse é o do Plugue:

(write-heredoc "/etc/resolv.conf")
search .
nameserver 200.255.50.117
nameserver 200.255.253.241
EOF

cd /etc/rc.d/init.d/

/etc/rc.d/init.d/inet stop
/etc/rc.d/init.d/inet start

smtp mail.plugue.com.br
pop  mail.plugue.com.br





###########
#
# netscape 3.01 gold, a.k.a. "Bus Error"
#
###########

# It's silly to unpack the netscrap binaries in the /usr/src/
# directory, but I put everything there, so...

# ftp://archive.netscape.com/archive/index.html

rm -Rv /usr/src/netscape
mkdir /usr/src/netscape/
cd /usr/src/netscape/
tar -xvzf /snarf/ftp/archive.netscape.com/archive/navigator/gold/3.01/unix/unsupported/netscape-v301-export.x86-unknown-linux-elf.tar.gz

mkdir ~/.netscape/
ln -s /usr/src/netscape/java_301 ~/.netscape/

# (find-fline "$HAI/../../Contents")
cd ~/HASH
dpkg -i libc5 xlib6
dpkg -i xpm4.7




############
#
# grail 0.3
#
############

cd /usr/src/
rm -Rv grail-0.3/
tar -xvzf /snarf/http/monty.cnri.reston.va.us/grail-0.3/source/grail-0.3.tar.gz





######
#
# less (at saci)
#
######

mkdir -p ~/ftp/prep.ai.mit.edu/pub/gnu
cd       ~/ftp/prep.ai.mit.edu/pub/gnu
wget     ftp://prep.ai.mit.edu/pub/gnu/
wget     ftp://prep.ai.mit.edu/pub/gnu/less-332.tar.gz

rm -Rv ~/less-332
cd ~
tar -xvzf ~/ftp/prep.ai.mit.edu/pub/gnu/less-332.tar.gz
cd ~/less-332/
./configure |& tee oc
make |& tee om

cp -iv less ~/bin-AIX/




#########
#
# apache-1.3.0 (with -g)
#
#########

debsource /debian/main/source/web apache 1.3.0 -2
# (find-apafile "debian/rules")
# find * -type f | glimpseindex -H . -F

make -f debian/rules stamp-configure		|& tee omsc
make LDFLAGS_SHLIB="-Bshareable -lc" OPTIM="-g"	|& tee om
debian/rules binary				|& tee odrb

# Parece que o debhelper stripa os binários...
# (find-apafile "odrb" "dh_strip")
# (find-fline "/usr/doc/debhelper/")

# Só que eu me lembrei que os cgis não podem ser owned by root, e isso
# resolve o problema. O debugamento fica para outro dia.

# (find-apafile "src/main/http_protocol.c" "You don't")
# (find-fline "/usr/doc/lsof/")
# (find-fline "/usr/doc/lsof/00QUICKSTART.gz" "\n13.")
# (find-fline "/var/run/")
# (find-fline "/var/run/apache.pid")
ps ax --sort=pgrp
pstree -pu

mycat /var/lib/dpkg/info/apache.*

# (find-fline "/usr/doc/apache/examples/")
# (find-fline "/var/log/apache/error.log")





########
#
# devinfo
#
########

# (find-fline "/snarf/http/sunsite.unc.edu/pub/Linux/ls-lR" "devinfo.tar.gz")
# (find-fline "$SUNSITE/ls-lR" "devinfo.tar.gz")

rm -Rv /usr/src/devinfo/
cd /usr/src/
tar -xvzf $SUNSITE/system/network/misc/devinfo.tar.gz
cd /usr/src/devinfo/
gcc -o devinfo devinfo.c
gcc -o gethost gethost.c
gcc -o netmath netmath.c
cp -v *.8 /usr/man/man8/
cp -v devinfo gethost netmath /usr/bin/





########
#
# configuring hostname, ip address, etc
#
########

man ifconfig
man route
man netstat

# (find-fline "/etc/rc.d/init.d/network")
# (find-fline "/etc/sysconfig/network")

find /etc/rc.d/ /etc/sysconfig/ -type f

man init

# (find-fline "/etc/inittab" "si::")
#   (find-fline "/etc/rc.d/rc.sysinit")
#     (find-fline "/etc/sysconfig/network")
#     (find-fline "/var/log/dmesg")
#   (find-fline "/etc/rc.d/rc3.d/")
#     (find-fline "/etc/rc.d/init.d/network")
#       (find-fline "/etc/sysconfig/network-scripts/")
#       (find-fline "/etc/sysconfig/network-scripts/ifup")
#     (find-fline "/etc/rc.d/init.d/inet")
#       (find-fline "/etc/rc.d/init.d/functions")
#       (find-fline "/etc/sysconfig/network")

#       (find-fline "/etc/rc.d/init.d/network")

# (find-node "(zsh)Array Parameters")

F=(`find /etc/rc.d/ /etc/sysconfig/ -type f`)
agrep route $F
agrep ifconfig $F
agrep netstat $F

agrep -l 'ifconfig|netstat|route' $F





#####
#
# plip device
#
#####

# O que é o tal do device plip0? É um symlink?

cd /cdrom/
cp -diPv $(<<'---'
debian/main/source/base/makedev_1.6-32.diff.gz
debian/main/source/base/makedev_1.6-32.dsc
debian/main/source/base/makedev_1.6.orig.tar.gz
---) /
debsource /debian/main/source/base makedev 1.6 -32

# (find-k2file "Documentation/devices.txt")
# (find-k2file "include/linux/major.h")
# (find-fline "/etc/devinfo")
# (find-fline "/etc/makedev.cfg")
man devinfo
man makedev.cfg

# (find-k2file "drivers/cdrom/mcd.c" "MAJOR_NR")
# (find-k2file "drivers/cdrom/mcd.c" "register_blkdev(")
# (find-k2tag "register_blkdev")




#######
#
# cipe
#
#######

# (find-fline "/etc/cipe/")
# (find-fline "/etc/cipe/options")

cd /proxy/home/var/src/cipe-1.0.0/
insmod cip3b

cd ~/cipe-1.0.0/
ciped

telnet 10.0.1.1 12345

telnet 10.0.1.88

ps ax | grep cipe

# (find-fline "/proxy/home/var/src/cipe-0.5.3/")
# (code-c-d "cipe" "/proxy/home/var/src/cipe-0.5.3/" "/proxy/home/var/src/cipe-0.5.3/cipe")

# (find-cipenode "Top")
# (find-cipenode "insmod")

cd ~
rm -Rv cipe-1.0.0/
tar -xvzf /proxy/home/var/src/cipe-0.5.3/cipe-1.0.0.tar.gz
cd ~/cipe-1.0.0/
make |& tee om



cd /
tar -cvzf ~/r2hsep3.tgz /proxy/etc/cipe /etc/cipe ~/CRIM/009ideas \
  /proxy/home/var/src/cipe-0.5.3/cipe-1.0.0.tar.gz


Problemas: não sei usar o kerneld, o msdos.o depende de um monte de
módulos, não sei configurar o empilhamento automático, etc.

O apache está reclamando de estar proibido de rodar os cgis.

Quero ser capaz de carregar arquivos dos CDs da Debian mais
facilmente. Quero ser capaz de mudar o repeat rate do teclado.

O samba depende de uns pacotes básicos, como pam0 e libc5; quando eu
tento intalá-lo eu me embaralho. Qual o modo standard? Dar um jeito de
lidar com as dependências.

Apagar as coisas desnecessárias da Debian do amendoim.




######
#
# cipe at angg
#
######

rm -Rv /usr/src/cipe-1.0.0/
cd /usr/src/
tar -xvzf ~/cipe/proxy/home/var/src/cipe-0.5.3/cipe-1.0.0.tar.gz
cd /usr/src/cipe-1.0.0/

# (find-fline "/usr/src/cipe-1.0.0/")
# (find-fline "/usr/src/cipe-1.0.0/Make")
# (find-node "(make)Top")
# (find-node "(make)Overriding")
# (find-fline "/etc/cipe/options")

make MODVERSIONS= |& tee om
cp cipe.info /usr/info/

#
# Esses são os que funcionam (ou pelo menos funcionaram na terça na raven):
#
telnet 200.240.24.219 12345
telnet 200.240.24.209 12345

kill $(ps ax | grep 'cip[e3]' | awk '{print $1}')
rmmod cip3b

ifconfig
route
ps ax | grep 'cip[e3]'

cd /usr/src/cipe-1.0.0/
insmod cip3b.o
ciped

ping 10.0.1.1

cd /var/log/
cat daemon.log kern.log messages syslog | grep -i 'cip[e3]' |
  sort | tail -n 100

perl 

# (find-k2file "Documentation/Configure.help")

CONFIG_IP_FORWARD
CONFIG_NET_IPIP



# (find-fline "~/cipe/proxy/etc/cipe/")
# (find-fline "/etc/cipe/")
# (find-fline "/etc/cipe/options")

# (find-fline "/var/log/daemon.log" "ciped")
# (find-fline "/var/log/kern.log")
# (find-fline "/var/log/messages")
# (find-fline "/var/log/syslog")

# (find-fline "/usr/src/cipe-1.0.0/ciped.c" "kxchg: recv")


cd /var/log/
grep -i 'cip[e3]' daemon.log
grep -i 'cip[e3]' kern.log
grep -i 'cip[e3]' messages
grep -i 'cip[e3]' syslog



telnet 209.130.76.158 12345
telnet 209.130.17.167 12345

route del 10.0.1.88
route del 10.0.1.99
  route add 10.0.1.88 cip3b0
# route add 10.0.1.99 cip3b0
ping -c 5 10.0.1.88
ping -c 5 10.0.1.99

# (find-node "(cipe)Top")
# (find-fline "/etc/cipe/options")

cd /usr/src/cipe-1.0.0/
insmod cip3b.o
ciped

ps ax | grep ciped
cat /proc/modules
sleep 2
ifconfig
route



lynx http://209.130.76.158/
lynx http://209.130.17.167/

telnet ol24-219.openlink.com.br 12345
telnet 10minutos.openlink.com.br 12345

# ol24-219.openlink.com.br:  200.240.24.219  <- maus
# 10minutos.openlink.com.br: 209.130.17.167
























#######
#
# wwwoffle
#
#######

# (find-fline "/var/lib/dpkg/info/wwwoffle.list")
# (find-fline "/usr/doc/wwwoffle/")
# (find-fline "/etc/wwwoffle.conf")
# (find-fline "/var/spool/wwwoffle/")

pdsc /debian/main/source/web/wwwoffle_2.1c-1.dsc
cd /usr/src/wwwoffle-2.1c/
etags *.[ch]

# (code-c-d "wo" "/usr/src/wwwoffle-2.1c/")
# (find-wotag "main")
# (find-wofile "wwwoffled.c")
# (find-wofile "upgrade-cache.c")

# (find-fline "~/.zshrc" "wwwoffle")
export http_proxy=http://localhost:8080/
export ftp_proxy=http://localhost:8080/

        Set the environment variables http_proxy and ftp_proxy to
        http://localhost:8080/


# (find-fline "/var/lib/dpkg/info/lynx.list")
# (find-fline "/usr/doc/lynx/")


# (find-fline "~edrx/.netscape/preferences.js")
user_pref("network.proxy.http", "localhost");
user_pref("network.proxy.http_port", 8080);


mail majordomo@gedanken.demon.co.uk <<'---'
subscribe wwwoffle-users
---

mail majordomo@gedanken.demon.co.uk <<'---'
auth 68101fda subscribe wwwoffle-users edrx@inx.com.br (Eduardo Ochs)
---



#####
#
# Links between dirs of Debian mirrors
# (old)
#
#####

ftp://riksun.riken.go.jp/pub/Linux/debian/debian
ftp://riksun.riken.go.jp/pub/Linux/debian/debian-non-US

psne ftp://riksun.riken.go.jp/pub/Linux/debian/debian-non-US/ls-lR.gz

function mksymlink () {
  mkdir -p $1 && cd $1 && [[ ! -e $2 ]] && ln -s $3 $2 && echo ok. && laf
}
mksymlink $S/ftp/riksun.riken.go.jp/pub/Linux/debian debian \
	  $S/ftp/ftp.debian.org/debian
mksymlink $S/ftp/riksun.riken.go.jp/pub/Linux/debian debian-non-US \
	  $S/ftp/ftp.debian.org/debian-non-US
mksymlink $S/ftp/slug.ctv.es debian \
	  $S/ftp/ftp.debian.org/debian

psne $FDEBIAN/ls-lR.gz

cd $SDEBIAN
gzip -dv ls-lR.gz
~/ICON/lslR2find < ls-lR > ls-lR.i
agrep non-free ls-lR.i | nolinks > ls-lR-nf.i






#######
#
# weblint
#
#######

#  «weblint»
# (find-es "net" "latte")

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

cd ~/latte/
weblint out/*.html

cd ~/latte/
weblint out/




#######
#
# linbot
#
#######

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

lynx /usr/doc/linbot/index.html



#######
#
# allowing anonymous ftp
#
#######

# (eeman "ftpd" "authenticates")
rm -Rv /home/ftp
mkdir /home/ftp
cd /home/ftp
mkdir bin etc pub lib
cd /home/ftp/bin
ln -v /bin/ls /sbin/ldconfig .
cd /home/ftp/lib
ln -v /lib/libc.so.6 /lib/libc-2.1.1.so .
ln -v /lib/ld-linux.so.2 /lib/ld-2.1.1.so .
cd /home/ftp/etc
cp -iv /etc/passwd /etc/group .

chroot /home/ftp /bin/ldconfig /lib
chroot /home/ftp /bin/ls

~/EXPECT/anonftp 127.0.0.1 dir quit

# (find-fline "/etc/passwd" "ftp")




#####
#
# libpcap
#
#####

apti libpcap0 libpcap-dev
# (find-vldifile "libpcap0.list")
# (find-vldifile "libpcap-dev.list")
# (find-fline "/usr/doc/libpcap0/")
# (find-fline "/usr/doc/libpcap-dev/")

pdsc /big/slinks2/dists/slink/main/source/libs/libpcap_0.4a6-2.1.dsc
cd /usr/src/libpcap-0.4a6/




#####
#
# ppp to the same machine
# 99sep27
#
#####

#  «ppp_to_the_same_machine»

# (find-es "modem" "patna_to_angg")

# (find-k2file "Documentation/")
# (find-k2file "Documentation/devices.txt" "pty")

expect -c '
  set timeout -1
  spawn /usr/sbin/pppd 10.0.2.1:10.0.2.2 crtscts noproxyarp
  set serv $spawn_id
  spawn /usr/sbin/pppd defaultroute noipdefault crtscts noproxyarp
  set client $spawn_id
  interact {
    -input $serv -output $client
    -input $client -output $serv
    -input $user_spawn_id
      "ii" {spawn ifconfig; expect eof}
      "ps" {send_user [exec ps ax | grep ppp]\n}
      "qq" {exit}
  }
'

# Aaargh, it's complaining about a loopback

pdsc /big/slinks1/dists/slink/main/source/base/ppp_2.3.5-2.dsc
cd /usr/src/ppp-2.3.5/
agrep 'Serial line is looped back' $(find *)

# (find-fline "/usr/src/ppp-2.3.5/FAQ" "Serial line is looped back")
# (find-fline "/usr/src/ppp-2.3.5/pppd/lcp.c" "Serial line is looped back")

# (find-fline "/var/log/" "ppp")
# (find-fline "/var/log/ppp.log")





About PPPing to the same machine

Hi,

  I'm trying to devise a simple way to let people connect to the same
machine using PPP to let them experiment with access permissions,
firewalls, sniffers, etc, without requiring them to have more than one
physical machine. But -- as always -- I'm running on lots of problems.
I'm using ppp-2.3.5 on Linux, with kernel 2.0.37; I'm using the Debian
2.1 distribution.

First problem: about 50% of the time PPP aborts with the error (of
level LOG_NOTICE, which goes to /var/log/ppp.log on my system) "Serial
line is looped back" when I run the expect script below.

expect -c '
  set timeout -1
  spawn /usr/sbin/pppd 10.0.2.1:10.0.2.2 crtscts noproxyarp
  set serv $spawn_id
  # Do I need this sleep? It doesnt change the probabilities much anyway.
  sleep 0.5
  spawn /usr/sbin/pppd defaultroute noipdefault crtscts noproxyarp
  set client $spawn_id
  #
  # Main loop: connect the two ppps, send a copy of all traffic to
  # stdout, and accepts three commands from the user: if the user types
  # "qq", leave; if "ii", run "ifconfig" and continue; if "ps", display
  # which processes have "ppp" in their names and continue.
  interact {
    -input $serv -output $client  -output $user_spawn_id
    -input $client -output $serv  -output $user_spawn_id
    -input $user_spawn_id
      "ii" {spawn ifconfig; expect eof}
      "ps" {send_user [exec ps ax | grep ppp]\n}
      "qq" {exit}
  }
'

Second: /sbin/route hangs when I run it after the connection is made;
cat /proc/net/route is ok. This isn't very important, I think, and I
haven't tried to trace this error very far.

Third:

tcpdump
lynx
ftp
telnet