Categories

Categories

Archives

Timestamp in Linux using ftime for millisecond timing

I am working on an embedded project at the moment that prints debug messages to a serial console. ?Interestingly, it seems that some of the prints are arriving out order from the actual flow of the software when they originate from the same thread.

To debug the printing problem and to add another, better layer, of debugging to the project I added a time stamp to a preprocessor definition for the existing printf() macro.

Here is the existing print macro:

#define debug_print(fmt, arg) printf (fmt, arg) To add a time stamp we need to use the timeb struct from sys/timeb.h. Since a struct is used, we need to give it

[Continue reading]

How to: Make a cheap monitor stand

A while ago, I picked up a several 17″ LCD monitors for pocket change. They were old monitors from a school district in the Seattle area that had upgraded their computers. The only problem with the screens was that they didn’t have any stands. I’ve had the screens for almost a year and I haven’t used them solely because I haven’t found a stand for them. Today, I finally gave up finding cheap stands and just made some. The following is a quick how to make a LCD monitor stand.

Materials: acrylic sheet (anything larger than 32cm x 12cm and 0.23622 cm thickness) aluminum foil ruler drill drill bits screws

[Continue reading]

Eric's got new swag!

Although I cannot compete with Brian’s pinball repair, I do have some of my own that I should post one of these days. However, since I’m too busy playing my Night Rider it’ll be a rainy day when I do post something about it. Instead I’d like to offer a beginners guide to lighting an MSR Whisperlite liquid gas stove. For those of you who know me, yes I have all of my fingers and toes but an appropriate quote would be from Adam Savage “Am I missing an eyebrow?”

Back in the 20th century, when I was a boy scout, I recall going on back-packing trips and someone always

[Continue reading]

Using cloop in FreeBSD

There are lots of Linux distributions that have a ‘Live CD’ that allow you to rescue your system or try before you bu… install.

Let’s take a look at Knoppix. It is one of the most popular Live CD’s. In the CD structure of Knoppix there is a file that contains the root file system (rootfs). That file is a cloop image file. Each block is compressed individually which allows decompression on the fly or at a specific point in the file.

This allows a rootfs to be about 1 GB in actual size but compressed it will fit into about 700 MB.

When a system boots from this CD

[Continue reading]

Dead iPod

It really sucks when all of a sudden your digital music player just goes belly up.

My iPod mini did just that Friday evening. It had a good life from 8th June 2005 until 16th February 2007. Of course, I’m pretty sure that I was the direct cause of its demise.

I had the mini in my back pocket and I sat down. The hold switch was activated so that the key press wouldn’t stop the music. When I removed the mini from my pocket, the forward and play/pause buttons where stuck in the ‘pressed’ position. It seemed that the buttons were caught on the aluminum case. I gently taped

[Continue reading]

X forwarding – my reminder

Every once and a while, I have a brain lapse.

A long time ago, my father showed me how to forward X applications from another system to my localhost with Cygwin.

Unfortunately, between that time and now, I had forgotten what he had showed me.

So, as a reminder for myself, here’s how:

The classic is assumed here:

Cygwin is installed with X. Putty Remote system with X utilities

On the localhost: Start Cygwin then type

$ X -multiwindow & $ export DISPLAY=127.0.0.1:0.0

Start putty:

Under Connection -> SSH -> X11 -> Forwarding Check the ‘Enable X11 forwarding’ In the ‘X display location’, enter: 127.0.0.1:0.0

Open the connection to the

[Continue reading]

Making RAID array in Slackware (because it’s easy as pie!)

Let’s say that you needed to store a large amount of data in a central location (I.E. directory) but the largest drive that you can afford and find for a reasonable price is a 400GB Seagate SATA drive.

Unlike other OSes that I have used, Slackware has an awesome ‘autoraid’ capability that is idiot proof. Believe me! I’m not only the president, I’m also a client!

In four easy steps you too can have a RAID 0, 1, or 5 setup.

Step 1: Use fdisk to prepare the disk

# fdisk /dev/sda # sd just happens to be the SCSI/SATA controller on my system

Disk /dev/sda: 400.0 GB, 400088457216 bytes

[Continue reading]