Dallas Legan's Greatest Hits
UUASC Orange County
12 Nov 2007
Dallas E. Legan II
http://www.lafn.org/~aw585
mailto:legan@acm.org
--EoP--
--SoP--
1) openssl and passwords
from 'OpenSSL Hacks' by Anthony Strieber
Linux Journal Sat. 2006-07-01
a) generate mailable password hash:
openssl passwd -1
and enter password twice, hash is directly usable in /etc/shadow
best for temporary password, it is still subject to
brute force / dictionary / etc. attacks,
even though it is mailable
from man page:
passwd Generation of hashed passwords.
from /usr/share/doc/openssl/doc/apps/passwd.pod:
-1 Use the MD5 based BSD password algorithm
b) generating great (and hard to remember) passwords
openssl rand 15 -base64
from man page:
rand Generate pseudo-random bytes.
from /usr/share/doc/openssl/doc/apps/rand.pod:
15 Number of bytes to output
-base64 Perform base64 encoding on the output.
--EoP--
--SoP--
2) the Auto login script, I mentioned:
#!/bin/bash
# 'autologin'
# From Feb./1999 Linux Journal, p.93-95
# >Linux Apprentice "The login Process"
# by Andy Vaught
# URL: http://www.linuxjournal.com/article/3121
# chmod a+x autologin
# in /etc/inittab, change (typicly)
# 1:12345:respawn:/sbin/getty 38400 tty1
# to
# 1:12345:respawn:/sbin/autologin tty1 /bin/login -f <userID>
# and <userID> will be automaticly logged in on tty1
exec 0</dev/$1 1>/dev/$1 2>&1
cat /etc/issue
shift
exec $*
--EoP--
--SoP--
Alternatively, you can do as Ubuntu etc. do in /etc/inittab:
N:12345:respawn:/sbin/login -f <userID> </dev/ttyN >/dev/ttyN 2>&1
concrete examples:
1:12345:respawn:/sbin/login -f ubuntu </dev/tty1 >/dev/tty1 2>&1
2:12345:respawn:/sbin/login -f root </dev/tty2 >/dev/tty2 2>&1
--EoP--
--SoP--
3) Another funky thing you can do with PAM
pam_mkhomedir.so module will automaticlly create a new home directory
if one does not already exist.
Linux Magazine, June 2007, Guru Guidance, Roderick W. Smith,
'LDAP Authentication, Part Three', pp. 42-44, p. 44 in particular
--EoP--
--SoP--
4) vi Key Binding
An ~/.exrc file example:
--EoP--
--SoP--
" -- comments begin with a '"'
set ignorecase
" set nows
set ws
set expandtab
:
:map #1 /^--- EOM ---<CR>z<CR>
:map <F2> ?^--- EOM ---<CR>z<CR>
:map #3 /\n\n<CR>z<CR>
:map <F4> /\n\n<CR>
:map #5 :?<[hH][tT][mM][lL]?,/<\/[hH][tT][mM][lL]/write ! w3m -T text/html<CR>
:map <F6> :?^[Rr]eturn-[Pp]ath: ?,.write ! grep -i '^\(From\\|Date\\|Subject\\|Reply-To\): ' \| sort \| w3m -T text/text<CR>
:map <F7> :%!/usr/local/bin/dspamscrub<CR>
:map <F8> :.,/^--- EOM ---/ write ! fmt \| less -i <CR>
:map <F9> :rewind!<CR>
:map <F10> :N!<CR>
:map <F11> :next!<CR>
:map <F12> :.,/^--- EOM ---/ write
:map _ :%write ! grep '^[A-Z][A-Z]' \| less -i <CR>
:map = :%write ! grep -i '^subject: ' \| less -i <CR>
:map \ :% write ! dmail -s 'Apparent Spam' -f 'aw585@lafn.org' -r 'legan@acm.org' spam@postini.com /home/dallas/postini.standard.ltr /dev/stdin<CR>
--EoP--
--SoP--
the dspamscrub utility from above as script example:
#!/bin/sed -f
# $Id: dspamscrub,v 1.3 2007/08/28 17:14:44 root Exp root $
s/^>//
1,/^ *Subject: /d
/^ *MailMan.*Script.*Copyright.*1997 - 1999 Endymion Corporation/,$d
--EoP--
--SoP--
5) Advanced shebang line for Linux
binfmt_misc.so
http://www.tat.physik.uni-tuebingen.de/~rguenth/linux/binfmt_misc.html
http://en.wikipedia.org/wiki/Binfmt_misc
http://en.wikipedia.org/wiki/Shebang_%28Unix%29
Make sure something like this is in /etc/fstab:
--
#
# added per
# http://www.tat.physik.uni-tuebingen.de/~rguenth/linux/binfmt_misc.html
# to register alternative magic numbers and file extensions
# (such as '/*' for psuedocode):
none /proc/sys/fs/binfmt_misc binfmt_misc
--
or mount by hand. Then
#modprobe binfmt_misc
or add permenantly to /etc/modules.X.Y:
binfmt_misc
and:
#echo ':psuedocode:M:0:/*::/usr/bin/psuedocode:' >> /proc/sys/fs/binfmt_misc/register
:name:type:offset:magic:mask:interpreter:flags
name = subdirectory in /proc/sys/fs/binfmt_misc
type = [ M | E ]
M = Magic Number
E = Extension
offset = offset in bytes into file, defaults to 0
magic = magic string or file extension. Can include \xXX hex characters.
interpeter = fully qualified with path interpeter name
flags = [ P | O | C ] see web page for details
Limits:
size( :name:type:offset:magic:mask:interpreter:flags ) <= 255 bytes
offset + size( magic ) < 128 bytes
size( interpeter ) < 127 bytes
--EoP--
--SoP--
6) Process substitution
Notation:
<( <someProcessToStdoutHere> )
>( <someProcessToStdinHere> )
These are treated as files.
Example:
#!/bin/bash
# script to make dual layer dvds, with scattered fragments of
# iso
# $Id: dlwodim,v 1.2 2007/04/12 19:09:51 dallas Exp dallas $
# d.e.l. 11 April 2006
USAGE="${0} [ -h | -f ]" ;
case ${1:0:2} in
-h | -H | -\? | /h | /H | /\? )
echo ${USAGE}
exit
;;
-- )
case ${1:2:1} in
h | H | \? )
echo ${USAGE}
exit
;;
* )
esac
;;
* )
esac
f1='/mnt/hda8/dvd-dl-part.1.iso' ;
f2='/mnt/hda5/dvd-dl-part.2.iso' ;
f3='/home/dallas/dvd-dl-part.3.iso' ;
[ ! -e ${f2} ] && touch ${f2} ;
[ ! -e ${f3} ] && touch ${f3} ;
s1=$( ls -l ${f1} | cut -f 5 -d ' ' ) ;
s2=$( ls -l ${f2} | cut -f 5 -d ' ' ) ;
s3=$( ls -l ${f3} | cut -f 5 -d ' ' ) ;
# fsize=$(( ${s1} + ${s2} + ${s3} )) ;
fsize=$(( s1 + s2 + s3 )) ;
case ${1} in
-f )
sudo nice --20 /usr/bin/wodim -fix \
-v -dao minbuf=25 speed=1 \
dev=/dev/dvd fs=128m driveropts=burnfree ;
;;
* )
sudo nice cat /dev/null ;
# a dummy statement just to prime sudo
sudo nice --18 \
/usr/bin/wodim -nofix \
-v -dao minbuf=55 speed=1 \
dev=/dev/dvd fs=128m driveropts=burnfree \
tsize=${fsize} \
- < <( sudo nice --20 cat ${f1} ${f2} ${f3} ) ;
;;
esac ;
--EoP--
--SoP--
7) Some alias ideas
alias realias='vi ~/.bash_aliases ; source ~/.bash_aliases ' ;
alias refresh='source ~/.bash_aliases ' ;
# - per O'Reilly 'Perl Hacks', hack #4, p. 9
alias canit='mv -t /mnt/imported/.scratch/trash/ '
some Gnu utilities such as mv and cp have the -t switch
allowing reverse of normal order of file specification,
seems convenient for aliases.
--EoP--
--SoP--
8) screen programming
#!/bin/bash
# Script to setup a 'Desktop' via screen, once it is running.
# This version begins to use deeper aspects of screen.
# -- Dallas E. Legan II, 28 Aug. 2006
screen -X title "LAFN / MailMan"
screen -X chdir ~/mail.downloads/
# change the default directory for a few windows
screen -X screen -t '~/mail.downloads'
sleep 1s
screen -X screen -t '~/mail.downloads'
screen -X chdir ~
# revert back to the default directory for remainder of the windows
sleep 1s
# screen -t 'Rolodex'
screen -t 'Rolodex' /usr/local/bin/rolodex
sleep 1s
screen -t 'cdcd'
sleep 1s
screen -t 'FreeNode'
sleep 1s
screen -t 'A/V Workspace'
sleep 1s
screen -t 'Script Doctoring'
sleep 1s
screen -t 'WWW Research'
sleep 1s
screen -t 'man pages'
sleep 1s
screen -X select '.'
# /usr/bin/lynx -book -tna
exec \
/usr/bin/lynx -tna \
-cookie_file=~/.lynx_cookies \
-cookie_save_file=~/.lynx_new_cookies \
file://localhost/home/dallas/.mailman.html
--EoP--
--SoP--
freenode ()
{
# script to login to freenode
# assumes this is run inside a screen session
# 12 Aug. 2007 d.e.l.
local USAGE="freenode [ -h | channel [ nick [ server ] ] ]" ;
# [ '-h' == ${1} ] && echo ${USAGE} && return ;
[[ ${1} =~ [-/][hH?].* ]] && echo ${USAGE} && return ;
WORKFILE=$(mktemp -p /tmp XXXXXXXX) ;
echo -e "\n" > ${WORKFILE} ;
# '-e "\n' added to flush tinyirc minibuffer, if needed
echo -e '/msg NickServ IDENTIFY <MYPASSWORD>' >> ${WORKFILE} ;
[ 0 -eq ${#} ] || echo "/join #${1}" >> ${WORKFILE} ;
IRCNICK="${2:-mr_dallas}"
IRCSERVER="${3:-irc.freenode.net}"
screen -X readbuf ${WORKFILE} ;
rm -f ${WORKFILE} ;
( sleep 2 ; screen -X paste '.' ) &
tinyirc ${IRCNICK} ${IRCSERVER} ;
}
--EoP--
--SoP--
9) Prompt Simplification:
VCSTIME(1) Linux User's Manual VC 09:00:14
NAME
vcstime - Show time in upper right hand corner of the console screen
SYNOPSIS
vcstime
DESCRIPTION
vcstime shows the current time in the upper right-hand corner of the
console screen.
This simple program shows the current time in the corner of the console
screen.
It needs to be run by root, in order to have write permissions to
/dev/vcsa
AUTHORS
vcstime was written by Andries Brouwer, based on a suggestion by
Miguel de Icaza. This manual page was Written by Alastair McKinstry,
Debian, Jan 2003.
Console tools 22 Jan 2003 VCSTIME(1)
Manual page vcstime(1) line 1
mention C-L to 'drill past' vcstime
--EoP--
--SoP--
10) Tools for viewing things in a console
In lynx.cfg:
# these next two seemed to be needed to be added in ~/.mailcap to work right
VIEWER:application/pdf:pdfview %s
VIEWER:Adobie:pdfview %s
VIEWER:application/msword:/usr/local/bin/wordview %s
....
VIEWER:image/*:/usr/bin/zgv %s
VIEWER:video/*:sudo mplayer -vf-clr %s
--EoP--
--SoP--
#!/bin/bash 10:19:41
# per ORA Linux Desktop Hacks #54
# with the following line added to '/etc/mailcap':
# application/msword; /usr/local/bin/wordview '%s'; needsterminal; description=MS Word document; nametemplate=%s.doc
wvWare -x /usr/share/wv/wvHtml.xml ${1} 2>/dev/null |\
w3m -T text/html
--EoP--
--SoP--
#!/bin/bash
# per ORA Linux Desktop Hacks #53
# with the following line added to '/etc/mailcap':
# application/pdf; /usr/local/bin/pdfview '%s'; needsterminal; description=Portable Document Format; nametemplate=%s.pdf
# $Id: pdfview,v 1.3 2007/04/18 18:43:28 root Exp root $
# pdftohtml -q -noframes -stdout ${1} | elinks -force-html
# does not work: pdftohtml -q -stdout ${1} | elinks -force-html
# echo "1:${1}" ;
ABSOLUTE=${1:0:1} ;
# echo "ABSOLUTE:${ABSOLUTE}:"
case ${ABSOLUTE} in
/ )
PREFIX='' ;
echo 'branch a'
;;
* )
PREFIX="${PWD}/" ;
# echo 'branch b'
;;
esac
echo ${PREFIX} ;
WORKFILE="$(mktemp -p /tmp XXXXXXXX).html" ;
while [ -a ${WORKFILE} ]
do
WORKFILE="$(mktemp -p /tmp XXXXXXXX).html" ;
done
# -- apparently pdftohtml requires the file end in '.html'
SOURCEFILE="${PREFIX}${1}" ;
# echo ${WORKFILE} ;
# echo ${SOURCEFILE} ;
# exit ;
# read dummy;
cd /tmp
# pdftohtml -q ${1} ${WORKFILE} ;
# echo "prefix:${PREFIX}:" ;
# echo "${PREFIX}${1}" ${WORKFILE##*/} ;
# read
# echo pdftohtml -q "${SOURCEFILE}" ${WORKFILE##*/} ;
pdftohtml -q -nodrm "${SOURCEFILE}" ${WORKFILE##*/} ;
# view ${WORKFILE} ;
exec elinks -force-html ${WORKFILE} ;
--EoP--
--SoP--
11) HTML Screen Scraping
............
Rant:
There are many ways to render a web page. Leaving aside considerations
like tactile or audio presentation of the data, a few, with possible
gradations between them, are:
1. a simple dump of the html etc.
2. text mode rendering, as in a simple text mode browser
3. text mode rendering with links to images and multimedia content
4. graphical mode rendering the includes images and possibly other media
5. As a checksum to for detecting changes in the content.
6. as a list of links, as Lynx does with '-dump -listonly' or when
'L' (LIST command typically bound to the 'L' key) is pressed.
This view I like to think of as the 'Google' view of a page.
My understanding is that they based their search algorithms on the idea
that this was typically the most important information on a web page,
and this mode instantly renders it.
7. As a listing of the header-metadata in a page. I personally know of no
software that shows this, and am thinking about writing one.
.............
End of rant.
..................
--EoP--
--SoP--
From rant to practice:
dallas@knopper $ lynx -dump -listonly http://www.lafn.org/admin/newsletter.html Warning: User-Agent string does not contain "Lynx" or "L_y_n_x"!
References
1. http://www.adobe.com/
2. http://www.lafn.org/admin/newsletter/newsletter010.pdf
3. http://www.lafn.org/admin/newsletter/newsletter009.pdf
4. http://www.lafn.org/admin/newsletter/newsletter008.pdf
5. http://www.lafn.org/admin/newsletter/newsletter007.pdf
6. http://www.lafn.org/admin/newsletter/newsletter006.pdf
7. http://www.lafn.org/admin/newsletter/newsletter005.pdf
8. http://www.lafn.org/admin/newsletter/newsletter004.pdf
9. http://www.lafn.org/admin/newsletter/newsletter003.pdf
10. http://www.lafn.org/admin/newsletter/newsletter002.pdf
11. http://www.lafn.org/admin/newsletter/newsletter001.pdf
--EoP--
--SoP--
Why?
http://www.where_ever.com/Known_part_of_URL?Unknown_part_of_URL
'Known_part_of_URL' is 'grep'able
can manipulate page 'representation' with standard Unix tools
or any desired scripting language,
extracting 'Unknown_part_of_URL' as needed
Oblivious to HTML considerations, such as link arrangement on the page
Almost dealing directly with CGI scripts
Can only be broken by minimum of changes to file structure of CGI
--EoP--
--SoP--
Practice:
#!/usr/bin/psuedocode
/* third cut at advanced LAPL summary program
$Id: laplsum,v 1.8 2007/08/01 22:56:33 dallas Exp dallas $
*/
CALL BlockData ;
PARSE VALUE ,
'lynx'( "-term=vt100 -dump -listonly "target.1" | grep -i "gtarget.1 ) ,
WITH . '.' target.2 ;
/* grepping a line out of a 'refresh' page: */
PARSE VALUE ,
'lynx'( "-term=vt100 -dump -listonly '"target.2"' | grep '"gtarget.2"'" ) ,
WITH . '.' target.3 ;
/* - this is actually the login page */
PARSE CASELESS VAR target.3 . '?' sessionkey '+patronlogin' . ;
/* - and the sessionkey is extracted */
/* For Debug:
"lynx -term=vt100 -dump '"target.3"'" ;
RETURN ;
*/
/* apparently need to download target.3 or operations to login chokes.
So ..... */
"lynx -term=vt100 -dump '"target.3"' > /dev/null" ;
target.4 = ,
"'http://catalog1.lapl.org/cgi-bin/cw_cgi?processPatronLogin+"sessionkey"'" ;
/* For Debug:
DO I = 1 TO 4
SAY 'target.'I' = 'target.I ;
END I ;
SAY 'sessionkey = 'sessionkey ;
RETURN ;
*/
tackons.0 = 2 ;
tackons.1 = 'ServiceCode=1' || ,
'&id0='userid || ,
'&id1='password || ,
'&rem=off' || ,
'&SinglePage=true' ;
tackons.2 = '---' ;
/* For debug:
DO i = 1 TO tackons.0
say "tackons."I" = "tackons.i ;
END ;
RETURN ;
*/
ADDRESS SYSTEM ,
'lynx -term=vt100 -post_data 'target.4 ,
WITH INPUT STEM tackons. ,
OUTPUT STEM listsummary. ;
/*
Examples:
Refresh link:
http://catalog1.lapl.org/cgi-bin/timeout?index.html+8334
Redisplay (seems to default to 180 sec. inactivity):
http://catalog1.lapl.org/cgi-bin/cw_cgi?8334+REDISPLAY
Help:
http://catalog1.lapl.org/help/BigDoc.html#patron
for session key 8334:
Patron Summary:
http://catalog1.lapl.org/cgi-bin/cw_cgi?patronSummary+8334+LAPL_CARD_NO_HERE
Renewall:
http://catalog1.lapl.org/cgi-bin/cw_cgi?RenewAll+8334+LAPL_CARD_NO_HERE
checked out:
http://catalog1.lapl.org/cgi-bin/cw_cgi?patronDetail+8334+100+LAPL_CARD_NO_HERE+8
number of items checked out -----*
checked out, sorted by date:
http://catalog1.lapl.org/cgi-bin/cw_cgi?patronDetail+8334+100+LAPL_CARD_NO_HERE+8\
+S3
S0 - by Author
S1 - by Title
S2 - by Status
S3 - by Due Date
on hold:
http://catalog1.lapl.org/cgi-bin/cw_cgi?patronDetail+8334+500+LAPL_CARD_NO_HERE+2
+S0 sorted by Author
+S1 sorted by Title
+S2 sorted by Status
(+2 probably the number of items on hold.)
fines:
http://catalog1.lapl.org/cgi-bin/cw_cgi?patronDetail+8334+600+LAPL_CARD_NO_HERE+2
+S0 sorted by Author
+S1 sorted by Title
+S2 sorted by Status
(+2 probably the number of items with fines.)
fines:
http://catalog1.lapl.org/cgi-bin/cw_cgi?patronDetail+8334+600+LAPL_CARD_NO_HERE+2
logout:
'http://catalog1.lapl.org/cgi-bin/cw_cgi?exit+8334+0+-1+1177208514'
***********
this is apparently
simply a UNIX sec.
from 'millenium'
time.
*/
/* For debug:
DO I = 1 to listsummary.0
SAY listsummary.i ;
END I ;
RETURN ;
*/
actions.display = ,
"http://catalog1.lapl.org/cgi-bin/cw_cgi?"sessionkey"+REDISPLAY" ;
actions.relogin = ,
"http://catalog1.lapl.org/cgi-bin/cw_cgi?patronSummary+" || ,
sessionkey"+"userid ;
DO i = 1 TO listsummary.0
listsummary.i = Strip( listsummary.i ) ;
/* this would be a good point to do a taint check/strip */
SELECT
/* between the 'VALUE ... WITH' is the best place
to add any modifying tackons for the action. URLs.
*/
WHEN InsideI( '+100+', listsummary.i ) THEN
PARSE VALUE listsummary.i || '+S3' WITH ,
. '.' actions.checkedout . ;
WHEN InsideI( '+500+', listsummary.i ) THEN
PARSE VALUE listsummary.i || '+S2' WITH ,
. '.' actions.holds . ;
WHEN InsideI( '?exit+', listsummary.i ) THEN
PARSE VALUE listsummary.i || '' WITH ,
. '.' actions.exit . ;
OTHERWISE
NOP ;
END ;
END i ;
'lynx -term=vt100 -dump -nolist ' ,
"'"actions.display"'" ,
" | sed '1,/Renew All/d;/submit (privoxy)/,$d' " ,
" | mailx -s 'LAPL / "chronation" / Overview' "eddress ;
IF '' < actions.checkedout THEN
'lynx -term=vt100 -dump -nolist ' ,
"'"actions.checkedout"'" ,
" | sed '1,/____/d;/submit (privoxy)/,$d' " ,
" | mailx -s 'LAPL / "chronation" / checkout summary' "eddress ;
IF '' < actions.holds THEN
'lynx -term=vt100 -dump -nolist ' ,
"'"actions.holds"'" ,
" | sed '1,/____/d;/submit (privoxy)/,$d' " ,
" | mailx -s 'LAPL / "chronation" / hold summary' "eddress ;
'lynx -term=vt100 -dump -nolist ' ,
"'"actions.exit"'" ,
" > /dev/null " ;
/* For Debug, verify logout:
'lynx -term=vt100 -dump -nolist ' || ,
"'"actions.relogin"'" ;
*/
RETURN ;
Inside:
PROCEDURE ;
parse ARG needle , . (needle) +0 haystack ;
RETURN '' << haystack ;
InsideI:
PROCEDURE ;
parse CASELESS ARG needle , . (needle) +0 haystack ;
RETURN '' << haystack ;
ValidURL:
PARSE ARG theurl ;
PARSE UPPER ARG theucurl ;
IF 0 < Verify( theurl, unallowables, 'm', 1 ) THEN
DO
NOP ;
END ;
RETURN ;
Compress:
PROCEDURE ;
/* This was in Apsuedocode, available as an Apsuedocode_BOFS in REGINA
It always removes leading and trailing spaces of
variable 'string'.
If 'list' (of characters) is not specified, it removes
internal spaces in 'string'.
Otherwise it removes characters specified in 'list'
from 'string'.
Perhaps better names for this routine might be:
squash
squeeze
squish
extract
condense
distill
concentrate
*/
parse ARG string , list ;
SELECT
WHEN '' == list THEN
RETURN SPACE( string, 0 ) ;
WHEN 0 < POS( ' ', list ) THEN
/* spaces definitly to be stripped out */
RETURN Space( Translate( string , '', list , ' ' ), 0, ' ' ) ;
WHEN 0 = POS( ' ', string ) THEN
/* no spaces in string,
can safely translate to them as intermediate step
*/
RETURN Space( Translate( string , '', list , ' ' ), 0, ' ' ) ;
OTHERWISE
/* spaces are inside string and must be preserved */
string = Strip( string, B, ' ' ) ;
/* first strip out leading and trailing spaces,
as this function always does.
This is done on the other branches by their call to Space()
If this is sufficient, the below DO Loop will be skipped,
and outstring will be directly RETURNed.
*/
PARSE VAR string front ' ' +0 string ;
outstring = Compress( front, list ) ;
DO WHILE '' << string
cutpoint = Compare( '', string, ' ' ) ;
/* on average, simple tests seem to indicate that Compare
is slightly faster than using WordIndex() to
locate the first non-space character.
*/
PARSE VAR string blanks =(cutpoint) front ' ' +0 string ;
outstring = outstring || blanks || Compress( front, list ) ;
END
END ;
RETURN outstring ;
BlockData:
/* RFC 3696 allowable characters: */
lowers = Xrange( 'a', 'i' ) || Xrange( 'j', 'r') || Xrange( 's', 'z' ) ;
/* - See daney, this is to make lowers ASCIT/EBCDIC independent */
PARSE UPPER VAR lowers uppers ;
alphas = lowers || uppers ;
digits = Xrange( '0', '9' ) ;
alphanumerics = alphas || digits ;
/*
From RFC 3696:
reserved = gen-delims / sub-delims
gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
/ "*" / "+" / "," / ";" / "="
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
(and also '%' for encoding)
*/
allowables = alphanumerics || "%-._~:/?#[]@!$&'()*+,;=" ;
unallowables = Compress( Xrange( '00'x , 'FF'x ), allowables ) ;
/* For Debug:
SAY allowables ;
SAY unallowables ;
EXIT ;
*/
chronation=Date() ;
userid = 'LAPL_CARD_NO_HERE' ;
/* password = '90063' ; */
password = '<PASSWORD>' ;
eddress = 'dallas.legan@gmail.com' ;
keystrokes. = '' ;
keystrokes.0 = 0 ;
summary. = '' ;
listsummary. = '' ;
possibilities = 'checkedout holds exit' ;
actions. = '' ;
fieldnumber. = '' ;
field. = '' ;
target. = '' ;
target.1 = "'<A HREF="http://www.lapl.org">http://www.lapl.org</A>'" ;
gtarget.1 = "'patronlogin'" ;
gtarget.2 = '\.' ;
RETURN ;
--EoP--
--SoP--
12) Network Attached TV (The Rant in context)
http://www.lafn.org/~aw585/usnatch.html
I'm sending this to several public forums, (and several
private individuals) but not by CC: to avoid crosspost
message bounce hell.
As a courtesy to everyone to let them know where I'm sending this:
Lynx-dev:
mailto:lynx-dev@nongnu.org
http://lists.nongnu.org/mailman/options/lynx-dev/
Mplayer-users:
mailto:mplayer-users@mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
Rexx Language Association:
mailto:members@rexxla.org
http://www.rexxla.org
(for nonmembers perhaps, news://comp.lang.rexx)
(Los Angeles) LAMP SIG:
mailto:lamp-user@maillist.lampsig.org
http://www.lampsig.org/
Feel free to forward this to any other place you want.
The purpose of this message is to announce a Rexx
script, 'usnatch' downloadable from:
http://www.lafn.org/~aw585/usnatch
This announcement is online at:
http://www.lafn.org/~aw585/usnatch.txt
This script is used in conjunction with the Lynx text mode
browser as an 'EXTERN', and with mplayer allows the user
to play videos from several sites such as www.youtube.com, video.google.com
and such, with mplayer, all as a convenience to the user,
trying to avoid roadblocks created by javascript.
If their mplayer is configured to use drivers
such as svga, vesa, aalib, nvidia console driver, or even null
(in some cases the most important one),
the user can play the videos without a GUI.
It can be run from the command line, and though not tested,
I see no reason it can't be run from other browsers.
(Let me know about any success or problems with that)
It can probably be adapted to use other video players
with little trouble if desired.
The user must choose to run the EXTERNAL program,
deciding if he trusts the media source, and activating the
default EXTERNAL (if only one is defined), or the EXTERNAL menu
(if more than one EXTERNAL program is configured) for the URL type,
by typically pressing the ',' (for the current page) or '.'
(for the current link) keys.
From the command line the program might typically be run by:
$usnatch 'http://www.youtube.com/watch?v=zAGylaoBt6M' -i -p
or inside the Lynx config file:
EXTERNAL:http:usnatch %s -i -a:TRUE
The program started out as a late night hack to scrape
the actual flash video (.flv) link from the http://videodownloader.net
page in the backend and then play the video.
It has since been expanded to scrape directly from
www.youtube.com when appropriate, using the algorithm from
the youtube-dl program (http://www.arrakis.es/~rggi3/youtube-dl/),
or from http://KeepVid.com,
or even try a few guesses that have sometimes worked in the past
if nothing else works.
The main point of the program is to handle the
interactions of URLs found using lynx,
the getting of video URLs from the download helper sites,
and mplayer, all as a convenience to the user.
I first used some of the screen scraping techniques in it
when fixing a program to email my L.A. public library
account summaries nightly.
Two weeks after writing this script, I ran into another fellow Lynx user
at a local LUG meeting. Especially as this gentleman is totally blind,
a news junky and there being so much content on sites such as Youtube,
that he had no access to, Usnatch quite fits the bill.
Rant:
There are many ways to render a web page. Leaving aside considerations
like tactile or audio presentation of the data, a few, with possible
gradations between them, are:
1. a simple dump of the html etc.
2. text mode rendering, as in a simple text mode browser
3. text mode rendering with links to images and multimedia content
4. graphical mode rendering the includes images and possibly other media
5. As a checksum to for detecting changes in the content.
6. as a list of links, as Lynx does with '-dump -listonly' or when
'L' (LIST command typically bound to the 'L' key) is pressed.
This view I like to think of as the 'Google' view of a page.
My understanding is that they based their search algorithms on the idea
that this was typically the most important information on a web page,
and this mode instantly renders it.
7. As a listing of the header-metadata in a page. I personally know of no
software that shows this, and am thinking about writing one.
This last item is starting to drift off into semantic web concerns,
where probably they have dealt with it.
End of rant.
Some observations:
The build for some 'Red Hat' derived Linux systems don't seem to have
the Lynx '-listonly' switch by default (this is easily worked around,
but awkward). Odd, because some people think of Lynx first
when trying to extract URLs from html.
Apparently the default Lynx build for some BSD systems
do not have EXTERNAL capability.
It would be nice for some people if wget had an odometer style download
progress report mode, like Lynx's, with capability somewhere between no
progress report and the 'dot' character graphic report.
Prehaps a switch for Lynx could be added, '-odometer', for use
with '-source' or '-dump', to send a progress report to standard error?
Not sure how practicle that would be, it's just an idea.
It would also be good if the Lynx EXTERNAL menu was brought
into line with the download and print menus, and allow using
a discriptive comment instead of just the literal commands
of the menu.
I respectfully dedicate the program usnatch to the memories
of H.G. Wells, and Jorge Luis Borges.
And don't forget all the people who don't know how or for some
reason can't use simple HTML links for their media content,
without whom the program wouldn't be needed.
Dallas E. Legan II / legan@acm.org / dallas.legan@gmail.com / aw585@lafn.org
--EoP--
--SoP--
13) Hacking reality
Alternative explination of "Two Slit" Experiment of Quantum Mechanics
William Duane (Harvard U.), Proc. Nat. Acad. Sci. 1, 158 (1923);
&delta E * &delta t = nh - Max Planck
&delta L * &delta phi = nh - Niels Bohr
&delta p * &delta x = nh - William Duane
--EoP--
--SoP--
And to make sure you get something that might actually save you
some time / money from this presentation, unclogging the commode
with a hack, possibly saving a call to the plumber:
Preconditions to work
a) classic American household commode
b) still some, however slow, flow - not totally stopped up.
So just:
a) take lid off the reservouir tank
b) shove the float (typically the big 'copper' ball) underwater
c) let up as needed to avoid overflow of toilet bowl
Ideally would find an equilibrium point,
where you don't have to let up to avoid overflow.
d) let it undergo sustained 'power flush' for a few minutes,
*may* break up obstruction.
--EoP--
--SoP--
13) To infinity and beyond....
(or least a bit outside the box)
a) "The Microcosmic God" Theodore Sturgeon
Referenced in "Shamans of Small", Graham P. Collins,\
Scientific American, Sept. 2001
b) Stanislaw Lem
Frequent Nobel Prize Nominee
"The Cyberiad"
c) Jorge Luis Borges
Frequent Nobel Prize Nominee
"The Circular Ruins"
http://www.acsu.buffalo.edu/~jatill/175/CircularRuins.htm
"The Library of Babel"
http://jubal.westnet.com/hyperdiscordia/library_of_babel.html
"The Lottery of Babylon"
"The Analytical Language of John Wilkins"
http://www.alamut.com/subj/artiface/language/johnWilkins.html
http://www-groups.dcs.st-and.ac.uk/~history/Mathematicians/Wilkins.html
"Everyone and No One" / "Everything and Nothing"
"The Aleph"
("Midnight by the Morphy Watch" by Fritz Leiber)
"The Zahir"
d) Olaf Stapledon
Inspiration for above writers
"Last and First Men"
"Starmaker"
"Sirius"
Home Page
mailto:aw585@lafn.org