Warning: this is a htmlized version!
The original is across this link. |
####### # # E-scripts on modem/fax stuff. # # 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/modem.e> # or at <http://angg.twu.net/e/modem.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/>. # ####### Pgrep m/fax/i Pgrep m/fax/i | grep Package: addressbook lg-issue25 lg-issue28 mgetty mgetty-fax mgetty-viewfax blinkd efax hylafax-client hylafax-doc hylafax-server tkhylafax xli efax qpage apti lg-issue25 lg-issue28 apti efax # (find-vldifile "" "efax") # (find-vldifile "efax.list") # (find-fline "/usr/doc/efax/") # (find-vldifile "lg-issue25.list") # (find-fline "/usr/doc/lg-issue25/") # (find-vldifile "lg-issue28.list") # (find-fline "/usr/doc/lg-issue28/") # (find-fline "~/bin/inx.dip") port ttyS2 speed 115200 init ATL3&A3&B1&H1&R2&S0=0X3 dial T///5406880 if $errlvl > 1 goto error wait rname: 10 send edrx\r wait ord: 10 send xxxxxxxx\n wait PPP default mode PPP exit error: print Failed. exit modem.002 'at$' 'at&$' 'ats$' | tr -d \\r | grep -v 'Strike a key' > ~/o # (find-fline "~/o") strace -f -o ~/s minicom l ~/s ##### # # Connecting patna to angg via ppp # 99aug?? # ##### # «patna_to_angg» # (find-fline "~/EXPECT/modem.002") # O que recebe (angg): # cp -v ~/.zshrc /patna/home/root/ cp -dpvR ~/EXPECT/modem.002 /patna/home/root/EXPECT/ # modem.002 : mint 'ATZ' 'ATL3&A3&H1&R2X3' 'ATS0=1' 'ATS1=0' : mint \ && echo PPP server... \ && /usr/sbin/pppd 10.0.2.1:10.0.2.2 crtscts modem \ < /dev/modem > /dev/modem # O que disca (patna): # modem.002 : mint 'ATZ' 'ATL3&A3&B1&H1&R2X3' 'ATS0=0' \ : 'set timeout 50' 'ATDT//2863160' : mint \ && echo PPP client... \ && /usr/sbin/pppd defaultroute noipdefault crtscts modem \ < /dev/modem > /dev/modem # (find-fline "/var/log/") # (find-fline "/var/log/syslog") # (find-fline "/patna/var/log/") # (find-fline "/patna/var/log/syslog") # (find-fline "/patna/etc/hosts") # Tirei os "-detach"es. Não fez diferença... As instruções são meio longas... o cara tem que ter ppp/options sem o auth, tem que ter um sistema telneteável (onde é que setei isso?) tem que ter /modem e o modem num estado razoável, além de ter o expect; é bom que ATL3&A3&B1&H1&R2&S0=0X3 Ln n=0 Low Speaker Volume n=1 Low Speaker Volumee n=2 Med Speaker Volumee n=3 Hi Speaker Volumee &An n=0 Disable /ARQ Result Codes n=1 Enable /ARQ Result Codes n=2 Enable /Modulation Codes n=3 Enable /Extra Result Codes &Bn n=0 Floating DTE Speed n=1 Fixed DTE Speed n=2 DTE Speed Fixed When ARQ &Hn n=0 Disable TX Flow Control n=1 CTS n=2 Xon/Xoff n=3 CTS and Xon/Xoff &Rn n=1 Ignore RTS n=2 RX to DTE/RTS high S0 Ring to Answer ON Xn n=0 Basic Result Codes n=1 Extended Result Codes n=2-4 Advanced Result Codes # run minicom and... (stty < /dev/modem stty -a < /dev/modem ) |& tee ~/o [-]raw Same as -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -opost -isig -icanon -xcase min 1 time 0 ##### # # dip source # ##### apti liblockdev0g-dev # (find-vldifile "liblockdev0g-dev.list") # (find-fline "/usr/doc/liblockdev0g-dev/") # (find-fline "/usr/include/lockdev.h") # (code-c-d "dip" "/usr/src/dip-3.3.7p/") rm -Rv /usr/src/dip-3.3.7p/ pdsc /big/slinks2/dists/slink/main/source/net/dip_3.3.7p-2.dsc cd /usr/src/dip-3.3.7p/ debian/rules CC="gcc -g" |& tee odrb # (gdb "gdb /usr/src/dip-3.3.7p/dip") # (find-dipfile "") # (find-dipfile "modem.c") # (find-dipfile "tty.c") # (find-dipfile "debian/rules") # (find-dipfile "Makefile") ###### # # chat # ###### # (find-k2file "drivers/net/dummy.c") setserial /dev/ttyS2 irq 5 uart 16550A insmod slhc insmod ppp ifconfig dummy down cat > ~/.dunc/options <<'EOF' defaultroute crtscts modem proxyarp EOF # removed: -am -mru lock cat > ~/.dunc/chatfile <<'EOF' "" "ATL3&A3&B1&H1&R2&S0=0X3" OK atdt////512-6880 CONNECT "" rname:--rname: \qedrx ord: snobol78 "" EOF /usr/sbin/pppd -d -d -d file /home/root/.dunc/options \ connect "/usr/sbin/chat -v -t 60 -f /home/root/.dunc/chatfile" /dev/ttyS2 38400 & tail -f /var/log/ppp.log kill $(ps ax | grep pppd | awk '{print $1}') cd /var/log/ l ppp.log kern.log daemon.log ##### # # stuff # ##### # (find-fline "~/bin/inx.dip") # (find-fline "~/bin/inx-up") # (find-fline "~/bin/novanet.dip") # (find-fline "~/bin/novanet-up") # (find-fline "/etc/resolv.conf") # (find-fline "/var/log/") # (find-fline "/etc/syslog.conf") # (find-fline "/etc/syslog.conf") ifconfig route lo Link encap:Local Loopback inet addr:127.0.0.1 Bcast:127.255.255.255 Mask:255.0.0.0 UP BROADCAST LOOPBACK RUNNING MTU:3584 Metric:1 RX packets:18 errors:0 dropped:0 overruns:0 frame:0 TX packets:18 errors:0 dropped:0 overruns:0 carrier:0 Collisions:0 Internexus: # ppp0 Link encap:Point-to-Point Protocol inet addr:200.240.18.26 P-t-P:200.240.18.4 Mask:255.255.255.255 UP POINTOPOINT RUNNING MTU:1500 Metric:1 RX packets:6 errors:1 dropped:1 overruns:0 frame:0 TX packets:7 errors:0 dropped:0 overruns:0 carrier:0 Collisions:0 Memory:15d8038-15d8c04 # Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface arpoador.inx.co * 255.255.255.255 UH 0 0 0 ppp0 localnet * 255.0.0.0 U 0 0 3 lo default arpoador.inx.co 0.0.0.0 UG 0 0 0 ppp0 Novanet: # ppp0 Link encap:Point-to-Point Protocol inet addr:200.255.172.113 P-t-P:200.255.172.139 Mask:255.255.255.255 UP POINTOPOINT RUNNING MTU:1500 Metric:1 RX packets:21 errors:2 dropped:2 overruns:0 frame:0 TX packets:22 errors:0 dropped:0 overruns:0 carrier:0 Collisions:0 Memory:298f038-298fc04 # Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface orion4.novanet. * 255.255.255.255 UH 0 0 0 ppp0 localnet * 255.0.0.0 U 0 0 3 lo default orion4.novanet. 0.0.0.0 UG 0 0 1 ppp0 ###### # # pppd # ###### pdsc /big/slinks1/dists/slink/main/source/base/ppp_2.3.5-2.dsc pdsc /big/slinks2/dists/slink/main/source/net/dip_3.3.7p-2.dsc # (code-c-d "ppp" "/usr/src/ppp-2.3.5/") # (code-c-d "dip" "/usr/src/dip-3.3.7p/") # (find-pppfile "") # (find-dipfile "") # (find-dipfile "ppp.c") gcc -E ppp.c | tail -n 30 > do_ppp.E # (find-dipfile "do_ppp.E") Invoking PPPD with "debug -detach defaultroute noipdefault crtscts modem" /usr/sbin/pppd pppd debug -detach defaultroute noipdefault crtscts modem debug /usr/sbin/pppd pppd -detach defaultroute noipdefault crtscts modem egrep "detach|defaultroute|ipdefault|crtscts|modem|debug" /etc/ppp/options /usr/sbin/pppd -detach defaultroute noipdefault # (find-fline "~/bin/inx.dip") 5406880 C-a O <Modem and dialing> <M - Dial time> 70 <A - Init string> ^MATL3&A3&B1&H1&R2&S0=0X3^M C-a O <Filenames and paths> <E - Kermit program> /usr/sbin/pppd -detach defaultroute noipdefault C-a K # run kermit ##### # # etc # ##### xisp # (find-vldifile "ppp.list") # (find-fline "/usr/doc/ppp/") # (find-fline "/etc/ppp/") # (find-fline "/etc/ppp/options") # (find-fline "/etc/chatscripts/") # (find-fline "/etc/init.d/ppp") apti doc-linux-text # (find-fline "/usr/doc/HOWTO/PPP-HOWTO.gz") # (find-fline "/usr/doc/HOWTO/PPP-HOWTO.gz" "Other Useful/Important Documents") # (find-fline "/usr/doc/HOWTO/PPP-HOWTO.gz" "9.3. Configuring your modem") # (find-fline "/usr/doc/HOWTO/PPP-HOWTO.gz" "(which looks like garbage)") # (find-fline "/usr/doc/HOWTO/PPP-HOWTO.gz" "ATHO") # (find-fline "/usr/doc/HOWTO/PPP-HOWTO.gz" "port specific option files") # (find-fline "/usr/doc/HOWTO/PPP-HOWTO.gz" 2068) # (find-fline "/usr/doc/HOWTO/PPP-HOWTO.gz" "26. Setting up a PPP server") # (find-fline "/usr/doc/HOWTO/PPP-HOWTO.gz" "<local IP>:<remote IP>") # (find-fline "/usr/doc/HOWTO/Serial-HOWTO.gz") # (find-vldifile "doc-linux-html.list") # (find-fline "/usr/doc/doc-linux-html/") lynx /usr/doc/HOWTO/PPP-HOWTO.html lynx http://summer.snu.ac.kr/~djshin/linux/mail-list/index.shtml lynx http://www.in.net/info/modems/index.html # (find-fline "/usr/doc/HOWTO/mini/SLIP-PPP-Emulator.gz") # (find-vldifile "pppconfig.list") # (find-fline "/usr/doc/pppconfig/") # (find-fline "/usr/sbin/pppconfig") apti doc-linux-fr lynx /usr/doc/LANG/fr/HOWTO/mini/PPP-over-minicom.html lynx /usr/doc/LANG/fr/HOWTO/mini/PPP-over-minicom-2.html#ss2.2 strace -q -f -o ~/osm minicom ##### # # minicom source (slink) # 99nov17 # ##### # «minicom» pdsc /big/slinks1/dists/slink/main/source/comm/minicom_1.82-3.dsc cd /usr/src/minicom-1.82/ etags $(find * -name '*.[ch]') agrep -i 'leave without reset' $(find *) agrep -i NORESET $(find *) # (code-c-d "mi" "/usr/src/minicom-1.82/") # (find-mifile "") # (find-mifile "src/minicom.c" "Leave without reset?") # (find-mifile "src/minicom.c" "quit != NORESET") # (find-k22file "include/linux/tty_driver.h") ##### # # An expect script to connect to an ISP # 99dec04 # ##### # (find-es "mail" "mauricio_99nov27") # (find-fline "~/bin/inx.dip") # (find-fline "~/bin/inx-up") # «expect_isp» cat > /etc/resolv.conf <<'---' search . nameserver 200.240.18.1 --- expect -c ' source $env(HOME)/.passwds.tcl set phones {5406880 5126880 5126881 5126882 5126883 5126884 5126889 5126890 5126891 5126892 5126896 5126897 5126898 5126899 5126904 5126905 5126906} spawn minicom interact { -re {~d([0-1][0-9])} { set phone [lindex $phones $interact_out(1,string)] send atdt//$phone\r } "~u" {send edrx\r} "~p" {send $passwd(inx)\r} "~\r" {send \001q\r} -o rname: {send edrx\r} ssword: {send $passwd(inx)\r} eof {return} } puts "minicom done" ' alias c1='/usr/sbin/pppd -d -detach defaultroute /dev/ttyS2 115200 &' alias c2='ifconfig; route' c1 ping 200.240.18.4 route del 200.240.18.4 print -l 5406880 512688{0,1,2,3,4,9} 512689{0,1,2,6,7,8,9} 512690{4,5,6} > ~/o # (find-fline "~/o")