Denny’s OpenBSD Newbies blog

May 10, 2010

Post to Buzz

Filed under: Uncategorized — Tags: , , — denny @ 10:26 am

I know a lot of folks have second thoughts about using Google’s Buzz,
but for those who don’t and are interested in a simple way for others
to post their content to Buzz easily, here’s a javascript button to do it:

Buzz – Stuff

So I’m going to use it here below and see how it turns out. :-)

Cheers!

Post to Buzz

       

May 7, 2010

DuckDuckGo

Filed under: Uncategorized — Tags: — denny @ 10:11 pm

Tried DuckDuckGo tonight. I already like it. You want to find out more about it,
go to:

About Duck Duck Go

Read one what one guy said about it. Something about it reminded him of
Google before it got popular with PPC advertisers. :-) Currently I’m not
logged into my Google account. I tried typing

https://google.com

but wound up at the regular address. OTOH, you can do the same thing
with Duck Duck Go and it works. Lots of other stuff there too. Anyway,
check it out and see how you like it.

Cheers!

April 30, 2010

More On Text Processing

Filed under: openbsd — Tags: , , , , , , , — denny @ 6:57 pm

I kept fooling around with a text file the other night, trying to get an
exact character count. The file had 11 lines and I came up with 436
characters, counting them manually. That included whitespace between
the letters and numbers. I ran wc(1) on it to see what it would say:

$ wc -m file
          447

That was a difference of 11 more than what I had counted. How come?
Turns out it counts line feeds as characters, too. Okay, how can I get
rid of them to get the same count as I had gotten counting manually?
I can use sed(1) to do it:

$ sed -e ’s/.$//’ file |wc -m
            436

Actually, I can do the same without the -e switch on it. It got thrown in
the mix and then I realized I didn’t need it. We usually don’t think of a
whitespace as a character, but it is. To see how many characters there
are minus whitespace, I can use tr(1):

$ tr -d ‘[:blank:]‘ < file | wc -c
         373

I know the total number of characters including whitespace and line feeds
is 447. Okay, bc(1) to the rescue:

$ echo “447-373″ | bc
         74

If I use space instead of blank it takes out the line feeds too:

$ tr -d ‘[:space:]‘ < file | wc -c
         362

You add the original 11 line feeds to that and you’re back at 373.

You can also count the characters minus the line feeds and whitespaces
while editing the file in vim like so:

%s/\S/&/gn

So, the adventures in text processing continue. :-) Any input on these
methods and any additional ones always welcome and appreciated.

Cheers!

April 16, 2010

Partitioning Trick Update

I added some information on some of the new stuff in the OpenBSD
disklabel(8) portion of the installation process on my page at:

Partitioning Trick

There’s a link there, too, to a good write-up on preserving your disk layout:

Preserving an existing OpenBSD partition layout during a re-install

Also picked up on a good way today to rename multiple files using perl:

ls -1 | perl -nle’$o=$_; s/OLDPATTERN/NEWPATTERN/; $n=$_; rename($o,$n)if!-e$n’

Pretty nifty. You can rename any part of the file names.

Cheers

April 3, 2010

The Last Four Months

Filed under: openbsd — Tags: , , , , , , — denny @ 9:03 pm

Four months come and gone. Sick a lot. Not much accomplished
during that time other than upgrading WordPress on the blog and
installing snapshots on my laptop extra hard drive and also on my
old Pentium 4 desktop. I did manage, also, to test a patch on Nut
(Network UPS Tools) for Stuart Henderson of OpenBSD. Got it
built okay, just never really got it running right. Going to install a new
snapshot, update everything on the box and see if I can get it running
correctly.
If you add a user to aliases as root and intend to get root’s mail, be
sure not to leave it commented out. :-) Ran into all sorts of problems
with the email on the P4 until I found my omission and fixed it. Tried to
use qtool.pl to clean /var/spool/clientmqueue but no dice.
Also tried sendmail and mailq but in the end I had to fall back on
good old rm to get rid of the trash.
Learned that wget doesn’t like wildcards, so when downloading
multiple files all on one line, I can do something like:

wget http://somewhere.com/{01.jpg,02.jpg,03.jpg}

Also started doing my rsync backups over ssh like so:

rsync -e ’ssh -ax -p xxx’ -agrtv /adir/ user@somebox:/adir

After installing a snapshot on my laptop I started adding packages
and finally got around to java. I don’t like installing it, I think it’s just
another security risk too, but I need it for some things I do so I don’t
really have a choice. When I installed the snapshot I tried out the new
auto-partitioning. I don’t necessarily like the way it turned out, since it
seems like a lot of drive space got wasted in places in isn’t needed,
like in /var and /tmp. /usr was only given 2G, so when I started
building java I ran out of space pretty quickly. Got around that by
adding some directories on a second hard drive and adding some
settings to /etc/mk.conf:

ACCEPT_JRL_LICENSE=Yes
USE_SYSTRACE=Yes
WRKOBJDIR=/data/mktemp/obj
DISTDIR=/data/mktemp/distfiles
PACKAGE_REPOSITORY=/data/mktemp/packages

The first line lets java know you agree to the JRL licensing.
The second line is to detect misbehaving Makefiles, scripts, etc.
The next three lines simply save space on the /usr partition
by using the directories on the second hard drive instead of the
standard ones underneath /usr.

That’s about it. Hope to get some more work done shortly. Waiting
on my new OpenBSD 4.7 cds to arrive soon. Then there will be
a whole lot of work to be done.

Cheers!

December 1, 2009

bsdtalk180- OpenBSD Enthusiast Girish Venkatachalam

Filed under: openbsd — Tags: , , , — denny @ 10:30 am

Interview with my programmer OpenBSD bud Girish Venkatachalam.

Main Site for bsdtalk
Interview mp3 link
Interview ogg link

November 24, 2009

Absolute Minimal OpenBSD USB Image

Filed under: openbsd — Tags: , — girish @ 4:10 pm

Added another OpenBSD USB bootable image, a very minimal
1GB version without X and without a single package, just the
base install.

Absolute Minimal Version

November 18, 2009

Create Fingerprints Using Cksum

Filed under: openbsd — Tags: , , , , , , , , , , , , , — girish @ 6:39 pm

New article on cksum(1) on the site at: Cksum

November 17, 2009

Interfacing the Medical Transcription
Foot Pedal With Mplayer

Filed under: openbsd — Tags: , , , , — girish @ 12:24 pm

Those of you who are hearing mplayer for the first time
should certainly see this article.

It is the best multimedia application out there and it is
written in pure C. It is amazing stuff. A grand old project
with an amazing cornucopia of features.

Those of you who have not heard of the footpedal do
not need to worry. It is a footrest with three buttons
which you can press with the toe.
Here is a picture.

Foot Pedal

Foot Pedal

It connects via the 9 pin serial connector to the serial port
of the computer. Before we get to the technical details we
do need to know something about the medical transcription
industry.

Every technical problem needs a business goal to meet.
Sometimes it is not very obvious as in the case of academic
UNIX tools, but without having an appreciation of the real
purpose of the project, one cannot do well in business.
Technical solutions do not exist in isolation.

Medical transcription is the process of converting a doctor’s
voice recordings into English text. The doctor would have
spoken at varying speeds and with different accents. A
medical transcriptionist has the job of translating his spoken
words into the written word.

I am sure you can imagine that this is no easy task. The
transcriptionist has to listen to the dictation multiple times
at various speeds to figure out what on earth the doctor is
trying to say.

His/her fingers are typing the message in the audio, and you
wish to be able to rewind, pause/play and fast forward the
recording with the foot. That is where a footpedal comes in.
You can’t use the mouse or keyboard for this since the hands
are busy typing out text.

While the hand is typing the foot will be interacting with the
audio player to help the transcriptionist to accurately translate
the dictation into English text.

The footpedal is a passive device with no power and no moving
parts. There are 3 switches as you can see above. The left pedal
is connected to the DSR pin(8), the middle pedal is connected to
the CTS pin(6), and the right pedal is connected to the DCD pin(1).

I figured this out using a perl script given here.

use Device::Modem;

  my $modem = new Device::Modem( port => ‘/dev/tty00′ );

        /*
        if( $modem->connect( baudrate => 9600 ) ) {
            print “connected!\n”;
        } else {
            print “sorry, no connection with serial port!\n”;
        }
        */

        my %sig = $modem->status();
        for (‘CTS’,'DSR’,'RLSD’)
        {
                if($_ =~ /RLSD/) {
                       print “Signal DCD is: “, ($sig{$_} > 0 ? ‘on’
: ‘off’), “\n”;
                } else {
                       print “Signal $_ is: “, ($sig{$_} > 0 ? ‘on’
: ‘off’), “\n”;
                }
        }

The next thing to do was figure out a way to do this in C.
That was the hard part but I got there. Check out the code
in this page to interface with the serial port on Windows
and OpenBSD to recognize the pedal presses.

Okay now we are halfway through. We can recognize
the pedal presses. But how to interface with the
audio player?

Before that we have an even more important question
to tackle.

Which player should we use?

I started working on audacity but quickly realized that
it does not have the rewind and forward feature. Plus
I realized that most audio players don’t have this at all.
Except of course mplayer. But before that I considered
and rejected sox and vlc.

I looked at the mplayer input.c file, the way it interfaced
with the joystick and LIRC remote control. I know I could
copy the semantics and match it with key presses. I did the
project first on OpenBSD and then got it working under
Windows. It was a great project, I thoroughly enjoyed it.

All the code in beautiful syntax highlighted fashion with
black background is here.

However the work is not over yet. You need to recognize
the pedal presses with more care. Right now it is too
sensitive so to speak. It has to have some back pressure
and hysteresis. I need to understand the needs of the
medical transcriptionist better. I shall finish this project
and add these details later. At the moment, I can say
that the project is nearly over.

November 14, 2009

LiveUSB Image With OpenBSD

Filed under: openbsd — Tags: , — denny @ 2:29 am

My programmer friend in India who is also a co-author on
this blog has created two usb OpenBSD bootable images.
There is a 1Gb image and a 2Gb image. The instructions
and download links are at:

LiveUSB image with OpenBSD

Cheers!

Addendum:
There are 3 images now:

1. Minimal version for 1GB without X
2. Lite version for 1 GB with X
3. Full version for 2 GB

Older Posts »

Powered by WordPress

Rss Feed Tweeter button Facebook button Technorati button Reddit button Myspace button Linkedin button Webonews button Delicious button Digg button Stumbleupon button Newsvine button Youtube button