REO (Rear Equipment Officer)
Posted December 20th at 8:38pm by Kyle
mage@prometheus:~/bin$ cat reo
XINITRC=/home/mage/.xinitrc.reo xinit
mage@prometheus:~/bin$ cat /home/mage/.xinitrc.reo
vncviewer -passwd /home/mage/.vnc/passwd localhost:1 -fullscreen
Figured out a one-liner:
xinit `which vncviewer` -passwd /home/mage/.vnc/passwd localhost:1 -fullscreen
different port for ssh
Posted August 12th at 10:57pm by Kyle
ssh -p 999 host is annoying to remember
in ~/.ssh/config one can specify directives for a host, like so:
host S
user bob
hostname somewhere.com
port 1234
They don't inherit down, so this doesn't work:
host S
hostname somewhere.com
host somewhere.com
port 1234
go with that and ssh S will connect to somewhere.com on port 22 while ssh somewhere.com connects to that on port 1234
Minicom in a busybox environment
Posted August 17th at 5:31pm by Kyle
needed a /etc/passwd, and /lib/libnss_files.so.2 for minicom to not tell me "you don't exist. go away."
Notepad
Posted November 5th at 10:30pm by Kyle
For personal reference really.
Header: &f
Footer: Page &p
Wordwrap sucks if the file size is like 4kb
Linksys WET-11
Posted November 5th at 4:52pm by Kyle
Posted on seattlewireless wiki:
I've been looking at the web admin system for the WET-11 and it seems to use JavaScript? to do most of the processing of information, status.html requests two javascript files that seem to be encoded sections of the WET-11's ram. The reason I know this is because I wanted my WET11 to be accessable from my lan's web page. -Kyle Kienapfel
Answering Machine/Fax System
Posted September 5th at 8:59pm by Kyle
Krista took her answering machine so I thought I would solve the little problem with recieving faxes by having my server do both. Only issue is that when a voicemail or fax comes in, it needs to be converted for use on the computer.
Faxes are in a format called "Group 3 FAX" which ImageMagick thankfully can handle
convert g3:/var/spool/fax/incoming/fnf593db8S0.01 fnf593db8S0.01.gif
Voicemail are more complicated to convert, here's the script used.
mage@prometheus mage $ cat /etc/mgetty+sendfax/new_voice
#!/bin/bash
# new_voice
# converts the raw voicemail to wav files and throws them into a directory
#
VOICE_NAME=$1
TIMESTAMP=`date +%F-%H.%M`
rmdtopvf $VOICE_NAME | pvfspeed -s 8000 | pvftowav > /home/mage/voicemail/$TIMESTAMP.wav
chown mage /home/mage/voicemail/$TIMESTAMP.wav
rm -f $VOICE_NAME
exit 0
##########################################################
The next step in this system will be to write a php script that lists the documents and lets them be viewed, deleted, and maybe eventually described.
lrzsz <- sz rz, etc
I've noticed that the check method for seeing if vgetty is active thats been suggested is useless, I have a crontab job that runs every 5 mins, and once it emailed me an error because it was processing a fax that was being recieved.
prometheus root # cat process_faxes
#!/bin/bash
ps -a > /tmp/omg
if grep -q ttyS0 /tmp/omg; then
exit 0
else
for ITEM in `find /var/spool/fax/incoming -type f -name "fnf*"`; do
convert g3:$ITEM gif:/home/mage/voicemail/`basename $ITEM`.gif
if [ $? -eq 0 ]; then
rm $ITEM
fi
chown mage /home/mage/voicemail/`basename $ITEM`.gif
chgrp users /home/mage/voicemail/`basename $ITEM`.gif
chmod 666 /home/mage/voicemail/`basename $ITEM`.gif
done
# good time to clean out the incoming voicemail directory?
fi
###
I suspect I'll run process_faxes out of the new_fax script as it seems to be running these days.
Another thing for the todo list
Posted June 3rd at 9:54pm by Kyle
From slashdot comments:
register_globals was never a good idea. That's why it's been off by default for the past several releases. Unless you're using placeholders in your SQL, nearly every Web app has the potential to be susceptable to bad things:
/* SQL injector's dream */
$db->execute("SELECT * FROM my_table WHERE id = $userInput");
vs.
/* The only way to fly */
$db->execute('SELECT * FROM my_table WHERE id = :?', $vars);
Buddy Zoo generated SVG files
Posted April 22nd at 1:05pm by waffle
I figured out why batik doesn't like to parse the SVG, there is a close root tag too early. You just have to delete it and rename the id's of the elements after it. Now I have a huge png.
mIRC alias that worked first time
Posted March 28th at 10:43pm by Kyle
friends { if ($1!="") { say WHO ARE YOUR FRIENDS $upper($1) $+ ? } else { say WHO ARE YOUR FRIENDS FNOR? } }
Quoting in php and perl
Posted March 19th at 2:39pm by Kyle
Perl:
$blah = qq| stuff here weooo weeooo "*uNF*" etc etc |;
Php:
$blah =<<<_END_
dooodooodooo more "quotes" etc etc
_END_;
/calc Alias
Posted March 10th at 10:46pm by Kyle
mIRC: calc aecho $1- = $calc($1-)
X-Chat: calc exec echo '&2' = `echo '&2' | bc -l`
I don't need single quotes AKA commas in maths so it's okay to use the single quotes, otherwise I'd use double quotes
Spinner
Posted February 17th at 7:56pm by Kyle
while [ 1 ]; do for x in "-" "\\" "|" "/"; do echo -ne "\b${x}"; sleep 0.11; done; done