On Mon, 18 Feb 2002, Paul M Foster wrote:
> On Mon, Feb 18, 2002 at 07:17:19AM -0500, Ronald KA4INM Youvan wrote:
>
> <snip>
>
> > Does any connection test/s come to mind (for this) that I can
> > put in my boot up procedures to send me an alarm, being a HAM
> > these are sent through the speakers in Morse code, so there's
> > no chance I will miss it/them.
>
> Okay, I just gotta ask: What code do you use to send Morse to speakers?
> It's an interesting idea.
Here you go:
1. Get a working beep tool:
has sources
bash-2.05$ gcc -o beep beep.c
bash-2.05$ ./beep
ioctl: Operation not permitted
bash-2.05$ sudo ./beep
Password:
(it beeps -=- so there is a permissions issue)
bash-2.05$ sudo ./beep -help
Usage:
./beep [-f freq] [-l length] [-r reps] [-d delay] [-D delay]
[-s] [-c]
./beep [Options...] [-n] [--new] [Options...] ...
bash-2.05$ sudo ./beep -f 440 -l 200
bash-2.05$ sudo ./beep -f 440 -l 600
2. Now we can do dots and dashes
bash-2.05$ sudo chown root.root beep
bash-2.05$ sudo chmod 755 beep
bash-2.05$ sudo chmod u+s beep
bash-2.05$ ls -al beep
-rwsr-xr-x 1 root root 18199 Feb 18 19:46 beep
bash-2.05$ ./beep
(now it beeps for end users -- it is running suid root)
bash-2.05$ sudo scp beep /usr/local/bin
(we install it preserving ownership and SUID bit)
bash-2.05$
3. Make a translation table:
a:.-
b:-...
c:-,-,
and so on
3. Write a parser to peel off std in, one character at a
time, and expand it
(see attachment)
4. Test it:
echo "cqcq de wb8sky" | ./morse-it
...-.-
-- Russ
This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:20:04 EDT