####### # # E-scripts on printing. # # 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 # or at . # See also , # , # , # , # and . # ####### # «.a2ps-cp850» (to "a2ps-cp850") # «.cups-sweetjane» (to "cups-sweetjane") # «.enscript» (to "enscript") # «.print-tmp.dvi-dvired» (to "print-tmp.dvi-dvired") # «.cups-at-omnisys» (to "cups-at-omnisys") # «.lpr-and-lpr-orig» (to "lpr-and-lpr-orig") # «.lpq-and-lprm» (to "lpq-and-lprm") # «.lpr-for-cups» (to "lpr-for-cups") ##### # # foomatic # 2003mar19 # ##### # (find-status "foomatic-bin") # (find-vldifile "foomatic-bin.list") # (find-fline "/usr/doc/foomatic-bin/") # (find-fline "/usr/doc/foomatic-bin/README.gz" "directomatic") # (find-fline "/usr/doc/foomatic-bin/USAGE.gz") foomatic-configure foomatic-configure foomatic-configure -s direct foomatic-configure -h foomatic-configure -O # (find-progoutput "foomatic-configure -O" "HP-DeskJet_640C") # (find-progoutput "foomatic-configure -h") # # (find-progoutput "foomatic-configure -h") # (find-fline "/etc/foomatic/") echo -n > /tmp/o.pdj foomatic-configure -n dj640 \ -s direct -c file:/tmp/o.pdj \ -o Quality=0 \ -d hpijs -p HP-DeskJet_640C # # (find-fline "/usr/doc/foomatic-bin/README.gz" "directomatic") # (find-fline "/usr/doc/foomatic-bin/USAGE.gz") # (find-fline "/usr/doc/foomatic-bin/USAGE.gz" "\nAdding a queue") # (find-fline "/usr/doc/foomatic-bin/USAGE.gz" "foomatic-printjob") # (find-fline "/usr/doc/foomatic-bin/USAGE.gz" "\n- Direct, spooler-less") echo -n > /tmp/o.pdj directomatic -P dj640 -o docs /tmp/tmp.red.ps laf /tmp/ echo -n > /tmp/o.pdj directomatic -P dj640 /tmp/tmp.red.ps laf /tmp/ # rm -fv {~/LATEX,/tmp}/tmp{,.red}{.ps,.pdj} cd ~/LATEX/ make tmp.red.pdj # make /tmp/tmp.red.ps # # (find-man "1 foomatic-printjob") # (find-progoutput "foomatic-printjob -h") foomatic-printjob -i -sdirect /tmp/tmp.red.ps laf /tmp sleep 1; laf /tmp # # (find-man "1 lpq") # (find-man "1 lprm") lpq -a lprm lpq -a # # (find-status "foomatic-db") # (find-vldifile "foomatic-db.list") # (find-vldifile "foomatic-db.list" "printer/HP-DeskJet_640C.xml") # (find-fline "/usr/share/foomatic/db/source/printer/HP-DeskJet_640C.xml") # (find-fline "/usr/share/foomatic/db/source/driver/hpijs.xml") # (find-man "1 foomatic-compiledb") # (find-man "1 foomatic-configure") # (find-man "1 foomatic-datafile") # (find-man "1 foomatic-gswrapper") # (find-man "1 foomatic-perl-data") # (find-man "1 foomatic-printjob") # (find-man "1 directomatic") # (find-man "1 foomatic-combo-xml") # (find-man "8 foomatic-fix-xml") # (find-man "8 foomatic-kitload") # (find-man "8 foomatic-ppdload") # (find-man "8 foomatic-preferred-driver") # (find-man "8 lpdomatic") # (find-man "8 foomatic-addpjloptions") # (find-man "8 foomatic-getpjloptions") # (find-fline "/usr/bin/foomatic-gswrapper") # (find-fline "/usr/bin/foomatic-printjob") # (find-fline "/usr/bin/foomatic-configure") # (find-fline "/usr/bin/foomatic-combo-xml") # (find-fline "/usr/bin/foomatic-perl-data") # (find-fline "/usr/bin/directomatic") # (find-fline "/usr/bin/foomatic-datafile") # (find-fline "/usr/bin/foomatic-compiledb") # (find-fline "/usr/sbin/foomatic-kitload") # (find-fline "/usr/sbin/foomatic-ppdload") # (find-fline "/usr/sbin/foomatic-getpjloptions") # (find-fline "/usr/sbin/foomatic-addpjloptions") # (find-fline "/usr/sbin/foomatic-preferred-driver") # (find-fline "/usr/sbin/foomatic-fix-xml") # (find-fline "/usr/sbin/lpdomatic") # (find-fline "/etc/foomatic/") ##### # # something for a2ps (I forgot what) # ##### # (find-node "(a2ps)Top") # (find-node "(a2ps)Some Encodings") # (find-fline "/usr/share/a2ps/encoding/") # (find-node "(a2ps)Sheets Options") # (find-lynxfile "src/LYCharSets.c") # (find-lynxfile "src/chrtrans/dmcs_uni.tbl") # (find-lynxfile "src/LYCharSets.c") # (find-lynxfile "test/iso8859-1.html") # (find-lynxfile "test/ISO_LATIN1_test.html") # (find-lynxfile "test/sgml.html") agrep atilde \ src/LYCharSets.c \ src/chrtrans/dmcs_uni.tbl \ src/LYCharSets.c \ test/iso8859-1.html \ test/ISO_LATIN1_test.html \ test/sgml.html export A=(src/LYCharSets.c src/chrtrans/dmcs_uni.tbl src/LYCharSets.c test/iso8859-1.html test/ISO_LATIN1_test.html test/sgml.html) agrep 198 $A a2ps -o ~/o.ps -X ibmpc ~/AGENDA/telefones a2ps -o ~/o.ps -X ibmpc \ --columns=2 --rows=1 --major=columns --portrait --medium=A4dj \ ~/AGENDA/telefones cd rm o.p[0-9][0-9] gs -sDEVICE=djet500 -r300 -sOutputFile=o.p%02d -dNOPAUSE -dBATCH o.ps rm o.zip; zip o.zip o.p0? laf o.zip ##### # # Expect papers # ##### cd /snarf/http/expect.nist.gov/doc/ A=(tcl-debug.ps seminal.ps scripts.ps bgpasswd.ps kibitz.ps regress.ps sysadm.ps expectk.ps seven-years.ps) for i in $A; do gv $i &; done gv /snarf/http/www.cica.indiana.edu/cica/faq/tcl/p1.ps & function pspack { S=0.55; H0=-16; H1=257; V0=434; V2=50 S=0.47; H0=-16; H1=257; V0=434; V2=50 # pstops -d 4:0@$S($H0,$V0)+1@$S($H1,$V0)+2@$S($H0,$V2)+3@$S($H1,$V2) # psresize -Pletter -pA4 cat } rm -Rv ~/ps mkdir ~/ps cd ~/ps A=(tcl-debug.ps seminal.ps scripts.ps bgpasswd.ps kibitz.ps regress.ps sysadm.ps expectk.ps seven-years.ps) for i in $A; do pspack < /snarf/http/expect.nist.gov/doc/$i >$i; done gv bgpasswd.ps cd /snarf/http/www.cica.indiana.edu/cica/faq/tcl/ # S=0.5; H0=24; H1=297; V0=434; V2=50 S=0.55; H0=-16; H1=257; V0=434; V2=50 cat book.p1.ps | pstops -d 4:0@$S($H0,$V0)+1@$S($H1,$V0)+2@$S($H0,$V2)+3@$S($H1,$V2) > p1.ps cat book.p2.ps | pstops -d 4:0@$S($H0,$V0)+1@$S($H1,$V0)+2@$S($H0,$V2)+3@$S($H1,$V2) > p2.ps cat book.p3.ps | pstops -d 4:0@$S($H0,$V0)+1@$S($H1,$V0)+2@$S($H0,$V2)+3@$S($H1,$V2) > p3.ps cat book.p4.ps | pstops -d 4:0@$S($H0,$V0)+1@$S($H1,$V0)+2@$S($H0,$V2)+3@$S($H1,$V2) > p4.ps cd /snarf/http/www.cica.indiana.edu/cica/faq/tcl/ gv -media a4 -scale -2 p1.ps gv -media a4 -scale -2 p2.ps gv -media a4 -scale -2 p3.ps gv -media a4 -scale -2 p4.ps cd /snarf/http/www.cica.indiana.edu/cica/faq/tcl/ tar -cvzf ~/tb.tgz p?.ps zip ~/tb.zip p?.ps ##### # # printer irq # ##### # (eeman "perlfunc" " ioctl") # (eeman "perlfaq8" "include files to do ioctl") # (find-k2file "include/linux/lp.h" "LPSETIRQ") perl -e ' open LP, "/dev/lp1" or die "Cant open lp1\n"; $a = ioctl LP, 0x605, 7; print "$a\n"; ' # (find-zshnode "Variables Index") # (find-zshnode "Parameters Set By The Shell" "`!'") cat > /dev/lp1 & cat /proc/interrupts kill -9 $! ##### # # Impressora da sala dos anões da PUC # ##### # (find-vldifile "libpaperg.list") # (find-vldifile "ppd-gs.list") # (find-fline "/usr/share/ppd/en/") # (find-knuthfile "tex/texbook.tex" "{units of measure, table}") # pt point (baselines in this manual are 12 pt apart) # pc pica 1 pc = 12 pt # in inch 1 in = 72.27 pt # bp big point 72 bp = 1 in # cm centimeter 2.54 cm = 1 in # mm millimeter 10 mm = 1 cm # dd didot point 1157 dd = 1238 pt # cc cicero 1 cc = 12 dd # sp scaled point 65536 sp = 1 pt # As unidades do PostScript são big points (cf. blue book, p. 18). # (find-fline "/usr/lib/ghostscript/5.10/gs_statd.ps" "/a4 {") # a4 = 595bp x 842bp # letter = 612bp x 792bp # (defun bp2in (nbp) (/ nbp 72.0)) # (defun bp2cm (nbp) (* 2.54 (/ nbp 72.0))) # (mapcar 'bp2in '(595 842)) # (mapcar 'bp2in '(612 792)) # 1bp =~ 0.35mm. # a4 =~ 21cm x 29.704cm. # letter =~ 21.59cm x 27.94cm # a4 =~ 8.264in x 11.695in # letter =~ 8.5in x 11.0in # (bp2cm (- 842 792)) -> 1.764 (cm) # (- 29.5 8.2) -> 21.3 (mm) # Nos Tcl papers o topo do "T" nas páginas pares (de trás) está a # 29.5mm do topo da página, e nas páginas ímpares (da frente) a 8.2mm. 8.2mm 29.5mm # (find-fline "/usr/bin/paperconf") # (find-fline "/usr/sbin/paperconfig") # (find-vldifile "psutils.list") # (find-fline "/usr/bin/fixfmps") man pstops man epsffit man psnup man psresize man psmerge man fixscribeps man getafm man fixfmps man fixmacps man fixpsditps man fixpspps man fixtpps man fixwfwps man fixwpps man fixwwps man extractres man showchar man psbook man psselect man fixdlsrps man includeres dvips -o /tmp/o.ps $S/http/www.sato.kuis.kyoto-u.ac.jp/~takeuti/art/param.dvi cat /tmp/o.ps | pstops 2:0(0,0),1(0,-1in) > /tmp/o2.ps function moveps () { echo ' puts $argv foreach {xl xr yl yr} {0 0 0 0} {} foreach {tag val} "in 1 cm [expr 1/2.54] raise {y 1} lower {y -1} moveright {x 1} moveleft {x -1}" { set T($tag) $val } proc add {xory sign sides n unit} { global T set d [expr $sign*$n*$T($unit)] if {$sides!="right"} {upvar #0 ${xory}l v; set v [expr $v+$d]} if {$sides!="left"} {upvar #0 ${xory}r v; set v [expr $v+$d]} } set r {^(raise|lower|move(right|left))_?(left|right)?_?([0-9.-]+)(cm|in)$} foreach command $argv { if [regexp $r $command {} com {} side n unit] { # puts "$ok:$com:$side:$n:$unit" eval add $T($com) [list $side] $n $unit } else { puts "Bad command: $command" # exit 1 } } puts "2:0(${xl}in,${yl}in),1(${xr}in,${yr}in)"' | \ tclsh -f - $* } function moveps () { pstops $(~/TCL/pstopsargs $*) } dvips -o /tmp/o.ps $S/http/www.sato.kuis.kyoto-u.ac.jp/~takeuti/art/param.dvi moveps raise_left_1in moveright_right_1in < /tmp/o.ps > /tmp/o2.ps laf /tmp gv /tmp/o.ps & gv /tmp/o2.ps & ##### # # psutils at boto # ##### pdsc /debian/dists/slink/main/source/text/psutils_1.17-6.dsc cd /usr/src/ tar -cvzf /tmp/p.tgz psutils-1.17/ cd /tmp/ laf ftpboto 'put p.tgz' 'lcd ~' 'put .zshrc' 'mkdir TCL' 'put TCL/pstopsargs' 'chmod 755 TCL/pstopsargs' 'quit' # On boto: cd rm -Rv ~/psutils-1.17/ tar -xvzf ~/p.tgz cd ~/psutils-1.17/ make pstops |& tee omp make pstops.1 |& tee omm cp -v pstops pstops.1 ~/bin/ # (find-fline "/debian/dists/slink/main/source/text/") # (find-fline "/debian/dists/slink/main/source/text/psutils_1.17-6.diff.gz") moveps raise_left_1in moveright_right_1in cat /tmp/o.ps | pstops 2:0(0,0),1(0,-1in) > /tmp/o2.ps moveps raise_left_5.08cm moveright_-0.4in # (find-fline "~/TCL/pstopsargs") | tclsh -f - raise_left_5.08cm moveright_-0.4in raise_left_2.5cm moveright_-0.4in forach {odd_dn even_dn} $argv {} proc cm2in {nbp} {expr puts 2:0(0,[expr - function lower_safo () { RAISE_ODD= cd /snarf/http/www.cica.indiana.edu/cica/faq/tcl/ # S=0.5; H0=24; H1=297; V0=434; V2=50 S=0.55; H0=-16; H1=257; V0=434; V2=50 cat book.p1.ps | pstops -d 4:0@$S($H0,$V0)+1@$S($H1,$V0)+2@$S($H0,$V2)+3@$S($H1,$V2) > p1.ps man paperconf man papersize man paperconfig man systempapersizefile man defaultpapersizefile man paperinfo man paperwithsize man paperfirst man papernext man paperprev man paperlast man paperinit man paperdone man systempapername man defaultpapername # (find-fline "/usr/share/a2ps/ppd/") ##### # # ghostscript at a new HP printer # 2000apr12 # ##### # (find-vldifile "gs.list") # (find-fline "/usr/doc/gs/") # (find-fline "/usr/doc/gs/devices.txt.gz") # (find-fline "/usr/doc/gs/devices.txt.gz" "cdj550") # (find-fline "/usr/doc/gs/unix-lpr.txt.gz") /usr/doc/HOWTO/Hardware-HOWTO.gz") # (find-vldifile "doc-linux-text.list") # (find-fline "/usr/doc/doc-linux-text/") # (find-fline "/usr/doc/HOWTO/en-txt/Hardware-HOWTO.txt.gz" "HP DeskJet") # I guessed that cdj550 would work with my father's HP DJ610C... # and it worked. ##### # # cp850 encoding for a2ps # 2000jul07 # ##### # «a2ps-cp850» (to ".a2ps-cp850") # (find-es "charsets") # (find-fline "/usr/share/a2ps/encoding/ibm-cp850.edf") # (find-fline "/usr/share/a2ps/encoding/ibm-cp437.edf") # (find-node "(a2ps)Top") # (find-node "(a2ps)Encoding Files") # (find-node "(a2ps)Concept Index") # (find-status "a2ps") # (find-vldifile "a2ps.list") # (find-udfile "a2ps/") # (find-node "(a2ps)Encoding Description Files" "`#'") # (find-node "(gawk)Regexp Usage") # rm -Rv ~/.a2ps/ mkdir ~/.a2ps/ awk '{print; if ($0 ~ /tilde/) exit}' \ < /usr/share/a2ps/encoding/ibm-cp850.edf > ~/.a2ps/ibm-cp850.edf cat >> ~/.a2ps/ibm-cp850.edf <<'---' Ccedilla udieresis eacute acircumflex adieresis agrave aring ccedilla ecircumflex edieresis egrave idieresis icircumflex igrave Adieresis Aring Eacute ae AE ocircumflex odieresis ograve ucircumflex ugrave ydieresis Odieresis Udieresis cent sterling yen .notdef florin aacute iacute oacute uacute ntilde Ntilde ordfeminine degree questiondown .notdef logicalnot onehalf onequarter exclamdown guillemotleft guillemotright .notdef .notdef .notdef .notdef .notdef Aacute Acircumflex Agrave .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef atilde Atilde .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef Ecircumflex .notdef Egrave .notdef Iacute .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef alpha germandbls Gamma pi Sigma sigma mu tau phi theta Omega delta infinity oslash epsilon intersection equivalence plusminus greaterequal lessequal integraltp integralbt divide approxequal degree dotaccent dotaccent radical .notdef twosuperior .notdef .notdef --- # # (find-fline "~/.a2ps/ibm-cp850.edf" "ordfem") # (ascstr 160 255) # (find-node "(a2ps)Input Options" "--encoding=KEY") # (find-node "(a2ps)Some Encodings") # (find-fline "~/.a2ps/") ##### # # cp850 encoding for a2ps via ogonkify # 2000jul07 # ##### # (find-fline "/usr/share/ogonkify/ibmpc.enc") # (find-fline "/usr/share/ogonkify/allchars.ps") # (find-fline "/usr/share/ogonkify/compose.ps") # (find-fline "/usr/share/ogonkify/helper.ps") # (find-fline "/usr/share/ogonkify/printenc.ps") # (find-fline "/usr/share/ogonkify/README") # (eeman "1 ogonkify") # (find-node "(ogonkify)Top") # (find-node "(ogonkify)Ghostscript") # (find-node "(ogonkify)genscript") # (find-node "(ogonkify)Composite background") # (find-node "(ogonkify)Generated fonts") # (find-node "(ogonkify)Composite usage") # (find-node "(ogonkify)Composite example") ##### # # a2ps source # 2000jul20 # ##### # (code-c-d "a2ps" "/usr/src/a2ps-4.13/") # (find-a2psfile "") # (find-a2psfile "etc/a2ps_cfg.in" "netscape") # (find-status "a2ps") # (find-vldifile "a2ps.list") # (find-fline "/usr/doc/a2ps/") pdsc $SDEBIAN/dists/potato/main/source/text/a2ps_4.13-2.dsc cd /usr/src/a2ps-4.13/ # (find-fline "/etc/a2ps.cfg" "netscape") # The commands resulting from a netscape delegation are like these: netscape -noraise -remote 'openfile(/home/root/TH/L/files.html)' netscape -noraise -remote 'saveas(/tmp/a2_SOvH7a,postscript)' cat /tmp/a2_SOvH7a | psnup -2 -q -d -w595 -h842 # But they're just beeping on my machine! # (find-fline "/usr/X11R6/bin/netscape") sh -x /usr/X11R6/bin/netscape \ -noraise -remote 'openfile(/home/root/TH/L/files.html)' |& tee ~/o # Beep! # (find-fline "~edrx/o") ##### # # cups # 2004sep27 # ##### # (find-sh "dpkg -l") # (find-status "cupsys") # (find-vldifile "cupsys.list") # (find-udfile "cupsys/") # (find-sh "sudo cat /etc/cups/cupsd.conf") # (find-sh "sudo cat /etc/cups/cupsd.conf" "LogLevel") hp deskjet 640c: