I'm Gonna Be A Dad!

Due date:September 6,2008

Whoo hoo!

It's Coming:Fedora 9

Gear Head Quick WebCam Basic (WC330I) Review

While at my local MicroCenter,I noticed this cheap ($15) webcam being sold. It said nothing of Linux support,but I had read that in the past couple years there were alot of cheap Chinese-made webcams that gained support in Linux. I figured I’d give it a shot,and if it worked out,I’d pick up a handfull more for my ZoneMinder system at home.

Now,I should say that I run Windows XP on my work workstation,and I just wanted to get a feel for the quality of the cam before I did anything more with it,so I plugged it in and installed the drivers. I have to say before I go any further:The pictures speak for themselves…

Sample 1
Sample 2

Horrible. Muddy. Overcompressed. Dark.

The poor quality of this cam really just defies words. I guess what expect I’d hear after making these statements is "What did you expect for $15?". Something other than absolute crap I suppose.

Just in case you have further interest in this product and it’s support in linux,the USB device ID is 093A:2460 and appears to have some sort of support in linux (http://www.qbik.ch/usb/devices/showdev.php?id=3144). If you choose to buy one of these,good luck with it.

I’ll be returning mine as soon as possible.

The MYTH About Oil

http://www.popularmechanics.com/science/earth/4254875.html

The basis of the article "The stark reality is that the supply is finite."is false. How long will it take before people come to grips with the fact that petroleum is NOT a "fossil fuel". Oil is produced by the earth by constant biochemical reactions,whether in the oceans or deep below the surface. Oil is not finite,in the sense of a single pie,it’s infinite,in the same sense as any other "renewable resource".

"The Truth About Oil"scarcity is not geophysical,but rather geopolitical. It’s about modern socialists (ie,Liberals) trying to gain control over our lives by demonizing capitalists and regulating of every facet of your life.

You want to stop $100/bbl oil? Open ANWR. Allow new refineries to be built. Deregulate oil. Stop perpetuating the lies.

Need more info? http://www.google.com/search?hl=en&q=fossil+fuel+myth

The Amazing,Walking,Talking,Human Vegetable!

To quote my wonderful wife,"This is why we don’t take ‘brain dead’people off life support."

Four months after he was declared brain dead and doctors were about to remove his organs for transplant,Zach Dunlap says he feels "pretty good."

Vegetables never felt so good.

Ben Stein:Expelled

I’ve been told to shut up a few times myself. That’s how these people operate:If you disagree with me,you should be silenced. For more info on this movie and for theatre times and locations,go to http://www.expelledthemovie.com

Greasemonkey:2002 Ford Explorer –Electrical Issues

I don’t really know if this is worth posting about. The solution seems rather obvious,but just in case someone find this useful,I’ll post it anyhow.

This weekend,while in the midst of a 6-hour drive to the in-laws,the truck’s ABS light started flashing. "Odd"I thought "I guess we’ll have to get that fixed when we get back". Minutes later,the red battery indicator started flickering,and then went on solid. Oh crap. The voltage indicator was practically pinned on "L". Minutes after that,the dash went completely dark. No speed,no RPM,no lights,no nothing. But the truck was still running. Thank God we managed to make it a few more minutes to a parts store at the next exit.

After some conversation with the parts store employees and a physical inspection of the battery,it became pretty clear that the battery needed to be replaced. It was,according to the clerk,the original battery for that model. So the battery is/was about 6 years old. Some bulging had started to occur,possibly due to freezing. However,after some testing with the new battery in the truck,he was uncertain if the problem had been resolved,or if the alternator needed replacing. His suggestion was to drive around for an hour and see if the meter continues to drop. As I had quite a few hours ahead of me,and the next parts store was about an hour away,I figured we should just continue on our way.

Sure enough,about an hour out,it became evident that the battery was losing juice. After running around to a few parts stores,and yet again barely making to the final store (dash went black),I had a replacement alternator. Beleive it or not,an alternator is easy enough to replace. Assuming it’s not crammed underneath the engine somewhere,or in an impossibly tight space,it’s something that can be replaced in under a half hour with the right tools. You may need a metric wrench for some of the bolts involved. In my case,I needed a 13mm metric wrench for the mounting bolts. The socket for the positive connection nut was easy to find in the standard imperial sizes. Finally,and most importantly,you’ll need a serpentine belt wrench. This tool has a square socket post on the end of a 2-3′flat-bar. This inserts into a spring-loaded tensioning arm with a pully on it,usually near the alternator. This arm keeps the belt tight,and the spring is quite strong. It’s nearly impossible to move it without the serpentine wrench.

Anyhow,as I said,the repair is pretty straightforward. Once I had the proper tools,I was able to replace it in the parking lot of the parts store in about 30 minutes,and back on our way.

Yotta,Kilo,Bits,&Bytes

From XKCD:

Now I just need a table explaining the variances of "gigabarts"and the difference between hertz and bytes:-)

A Simple Uptime Output Method

If you’ve ever tried to parse the output of "uptime",you know it can be complicated. There’s a simpler solution:Use the raw numbers from /proc/uptime. Here’s a simple script that spits out the days and remaining time in digital clock format:

   cat /proc/uptime | awk ‘{printf "%d%s%.2d%s%.2d%s%.2d%s",$1/86400 ,"days,",$1%86400/3600 ,":",$1%86400%3600/60 ,":",$1%86400%3600%60 ,"\n"}’

Note that the output can be changed to your needs. See the AWK Tutorial for more info on using modulus (%) in calculations,and string formatting (i.e.,%d and %s)

Recovering from a dd_rhelp add_chunk error

If you’ve got a crashed disk,dd_rhelp is a very
useful tool for quickly recovering a large amount of data from just
about any failed disk. I used it earlier this week to help recover a
160GB linux LVM group member drive. Unfortunately,after a while of
running,it hit this error:

   dd_rhelp:error:add_chunk:invalid argument ’0-(info)’(is not correctly formatted as number:number)

Here’s
how you get past that. The problem is that dd_rhelp was not able to
determine the size of your hard disk automatically,so it is scanning
beyond the actual size,which of course fails. We need to tell it our
disk size manually.

First,make a backup of your logfile,for example:
   cp -rp sdb.log sdb.log.bad-eof
That way you can start over if you mess up.

Go to the first line in the original log file that states:
   dd_rescue:(warning):/dev/sda (282662620.0k):No space left on device!
Or something similar. Scroll up to the next line before that that reads:
   === COMPUTED VERSION OF LOG:
Delete all lines including and following this line,then save your file.

Obtain your filesystem size with fdisk:
   # fdisk -l /dev/sda
   
   Disk /dev/sda:160.0 GB,160000000000 bytes
   and so on…

In this case,your filesystem size would be 160000000000 bytes,or 160000000 kbytes.

Next,
change all the lines in the file stating "eof:nothing"to
"eof:160000000". Use your fs size in replacement of 160000000 kbytes.
You can quickly do this using sed:
   sed ‘s/eof:nothing/eof:160000000/g’-i sdb.log

Now re-run your dd_rhelp command. It should now continue to recover as normal!

Thanks to Valentin from dd_rhelp and "Master One" for leading me in the right direction.

UPDATE:
It seems that after a short time,I ran into the same error again. My
solution was to open the dd_rhelp script,look for the line that says:
   eof="nothing"
and change it to
   eof="160000000"
(of course,substituting your disk size in kb)

Re-do the cleanup above and re-run.

UPDATE 2:So I’ve found that dd_rhelp is slow,or at least,it’s slow on my damaged disk. I suggest trying ddrescue instead (not to be confused with dd_rescue from above). It seems to be much more efficient at sidestepping bad data and gives a more concicse summary of recovery progress. This includes how much data has been recovered so far,lost so far,number of total errors,and transfer rates. For more info on the design differences between ddrescue and dd_rhelp,see the SpinRite wikipedia entry.

How to Use a Neti Pot

Because you should know:

Whisky optional.

Enabling AVCHD MTS/M2T/M2TS Video File Thumbnails in Explorer

Assuming you have a codec installed that allows you to view AVCHD files in Windows Media Player (such as CoreAVC),here’s how you can get those videos’thumbnails into the Explorer thumbnail view. I wholly admit I stole this info from some forum somewhere,but most of my searches turned up some lamer’s warning about using regedit,and a refusal to post the fix because of it. So I’m going to post it again in a concise article.

Don’t freak out. Regedit isn’t that damaging. In fact in the 12+ years I’ve been working with Windows,I don’t think I’ve ever seen a computer explode due to a change in regedit,especially when you follow directions.

Anyhow,open Notepad and copy in the following:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.mts\ShellEx\{BB2E617C-0920-11D1-9A0B-00C04FC2D6C1}]
@="{c5a40261-cd64-4ccf-84cb-c394da41d590}"

[HKEY_CLASSES_ROOT\.m2t\ShellEx\{BB2E617C-0920-11D1-9A0B-00C04FC2D6C1}]
@="{c5a40261-cd64-4ccf-84cb-c394da41d590}"

[HKEY_CLASSES_ROOT\.m2ts\ShellEx\{BB2E617C-0920-11D1-9A0B-00C04FC2D6C1}]
@="{c5a40261-cd64-4ccf-84cb-c394da41d590}"

Save this as "AVCHD Thumbnails.reg"and run it. Accept the merge. You may or may not need to reboot to apply the change. Hit F5 in your Explorer window to check.

Enabling Input Audio Monitoring on Dell Latitude D820

I recently re-installed XP on my Dell Latitude
D820 for the third time in 2 years and ran into a familiar problem:My
line-in audio was not being played through the speakers. By default,
the Dell driver,R171789 (SIGMATEL STAC 92XX C-Major HD Audio) does not
come with the input monitor enabled. You can modify the driver INI
file(s) manually to enable this and other related options.

Backup these files (make a copy in the same directory named 92XXM2-2.INI.orig):
   C:\DELL\drivers\R171789\WDM\92XXM2-2.INI
   C:\Program Files\SigmaTel\C-Major Audio\WDM\92XXM2-2.INI
   C:\Program Files\SigmaTel\C-Major Audio\DellXPM_5515v131\WDM\92XXM2-2.INI

Edit each one and change the following settings to reflect what is shown:
   EnableInputMonitor   = hex:1
   DigitalInputMonitor    = hex:1
Additionally you can/should turn on these options that allow for greater control of the sound card options:
   To see all of the config tabs (that I know of):
     Config_Tab = dword:0x000000ff
   To see all of the Advanced config options:
     Config_Adv = dword:0x000fffff
   To allow sample rate adjustment:
     Config_Rates = dword:0x000000ff
   To disable automatic input switching (helps avoid feedback)
     RecordPriority = dword:0xffffffff
   

Here is a copy of my edited 92XXM2-2.INI
file (enables the Levels tab and Automatic Input selection
en/disabling). Alternately,if you are so-inclined,you could open
regedit and
alter these settings manually. However when you do so,the changes get
wiped out by a re-install of the driver,so altering the INI file is
really your best bet.

You
can now uninstall the device you have in device manager and re-install.
Reboot to ensure you apply the change to the Sigmatel chipset.

After
rebooting,plug in your device. A pop-up should prompt you for the
input type. You may choose to tell it to no longer prompt you for this
change. Then,go into the Volume Control,uncheck mute on Input
Monitor,
got to Options,Properties,select Line-in and you should hear your
input. Also,you may choose to drop the volume on the Internal Mic down
to 0%. This will help you avoid horrible feedback should you switch to
the internal mic.

If
you don’t have a D820,it possible that your INI file may be different.
To identify what the proper INI file is, open regedit and search for
this string:
   SigmaTel High Definition Audio CODEC
Look for
the key named "DriverDesc". In this folder/tree you should also see
"IniPath". Open this key and look at the name of the INI file in the
path. This should be the correct INI for your model.

UPDATE 2/11:
If you feel inclined to do so you can change,with a decent amount of
granularity,which options you can see in the Advanced tab. This is
done by flipping individual bits on or off in the Config_Adv registry
setting. Here are the applicable decimal values for each option:

1Power ManagementAmplifier Power Mangement
2Sampling RateSampling Rate adjustment
4SPDIFAC3/PCM en/disable and Rate Adjustment
8SPDIFDigital Out en/disable and Rate Adjustment

16

SPDIF

Digital Out en/disable 

32

Dolby

Dolby Digital Live en/disable 

64

Noise Suppression

Noise Suppression en/disable 

128

ASIO

Latency/Rate adjustment,ASIO monitor en/disable 

256

Pop-ups

Jack reconfiguration pop-up en/disable

512

HDMI

HDMI output en/disable 

1024

Bass Management

Bass Routing and boost dB adjustment 

2048

Microphone Selection

Automatic Microphone Selection en/disable 

4096

Internal Speakers

Internal Speaker Muting options 

8192

Headphone Configuration

Redirected headphone en/disable 

16384

(Unknown)

 

32768

Multi-Streaming

Multi-stream retasking en/disable 

65536

Speaker Mute Controls

Additional internal speaker muting options 

To enable or disable any of these options,just add or subtract it’s
decimal value (shown) from the decimal value you see in regedit (when
the decimal radio is selected). For example,to display configuration
options for Pop-ups,Microphone Selection,and Noise Suppression,just
add 256+2048+64. This gives you 2368,which you can paste into regedit
when you select the decimal radio. This will convert to 940 in hex.

I Have No Party

It’s sad really. Fred Thompson,the only true Conservative in the race for the Republican nomination,dropped out of the race earlier this week. After hearing the news,my thoughts shifted to "Who would I vote for now?". My first priority when wielding my vote is protecting the unborn. Guess what:none of the other candidates are truely pro-life. I’m sick with disgust over the condition of the Republican party. They’ve abandoned their base to woo Liberals who will never vote for Democrat Lite when they have two fine,full-on Democrats of thier own:Obama and Hillary.

So I’ve come to a conclusion:I have no party. I belong to the nonexistent,yet to be established,Conservative party. I’m done with the Republican party as a whole. If they have any good non-Presidential candidates running,I’ll vote for them,but I’m not voting Republican. Not until they get their act together.

I may not vote for President in the 2008 election. I’m that disgusted. In fact,I’m considering voting for Obama just to let him get in office and complete another Carter-esqe presidency. After he’s screwed the country up,hopefuly the American people will wake up,the Republican party will wake up,and we’ll finally get another Reagan back in office to fix this whole Federalism problem.

And yes:That means you can just forget about calling me asking for donations too.

Creating a Hylafax Dropbox (No Email)

The default setup for Hylafax is to drop faxes into an email and send them off to the "FaxMaster". This weekend I needed to stop hylafax from doing that,and instead just drop it into a folder. Best I can tell after a few hours of searching Google and perusing code,hylafax on it’s own does not do this. There appears to be no options for it in faxrcvd.

So instead of searching any longer,I decided to write my own,very simple,yet perfectly funtional faxrcvd script. All it does is take the received TIFF image and converts it to PDF (the preference of my users),and drops it into a specified folder. Here’s the code,feel free to use it:

# Make a backup of the original fax received script (faxrcvd emails faxes).
cp -p /var/spool/hylafax/bin/faxrcvd /var/spool/hylafax/bin/faxrcvd.orig

EDIT:I received a message the other day saying that my script didn’t work. It’s possible some of the code got messed up by Nuke,so I’m just suggesting downloading instead…

# Download the MuchTall faxrcvd code in replacement of the existing code
wget -O –http://muchtall.com/content/faxrcvd >/var/spool/hylafax/bin/faxrcvd

# Edit it with your favorite editor to change the path and permissions
vi /var/spool/hylafax/bin/faxrcvd
   OR
nano -N /var/spool/hylafax/bin/faxrcvd

Change the path and permissions (chmod) to what you want. In my case,I needed to allow all my users R/W access to these faxes.

There you go! Assuming you already have configured hylafax,you should be all set!

Greasemonkey:2001 Chevy Impala –Hard Start

Seems like I run into enough car problems that I should start logging my experiences with them. Thus,I’ll be creating a new section titled “Greasemonkey”with all of my mechanical-repair escapades.

To kick it off,let me tell the story of my wife’s 2001 Chevy Impala recent repair. About 2 months ago it started losing power. Initially it would only show up when using a good deal of throttle,such as when passing or accelerating from a stop. It would never die,but it would sound like it was gasping for air,and huffing in effort. Initially,I thought that the the plugs hadn’t been changed since the car was purchased,and the car now had just under 100K miles on it. So I went out and got new plugs and wires. No change. Then I figured that it wasn’t getting enough fuel,so I replaced the fuel filter. At this point I gave up and brought it into the local auto shop. Diagnosis:Plugged catalytic converter. Fortunately it was covered by something like a 100K mile recall. After replacing that,the car was back in shape.

Fast forward about 2 weeks. The car start having problems starting. It turns,but doesn’t fire off until about 5 seconds into it. After it has been started,you can shut it off and start it right back up again with no problem. This past week it started dying while driving down the road. You could start it right back up in neutral. We just started parking the car in a garage and had noticed after the car had been sitting in there for about 10 minutes,the garage was filled with a gasoline odor. However,there were no evident puddles of gas. I initially suspected a failing fuel pump,but the fuel smell was nagging me. So today,after driving it home,I popped the hood. Low and behold the vacuum tube near the fuel regulator has a wet appearance. I pulled the tube coming from the regulator,and gas started dripping out. I hopped online,did a search for “2001 Impala fuel regulator”and didn’t find much,but about 2 pages into my search I see this link on a different vehicle:GMC Repair:1999 GMC Sierra 1500 5.3L. Still,a GM vehicle,and similar year,but a different vehicle. However,the symptoms are identical. So I run down to the local Checker Auto,grab a new fuel regulator and some spring retainer clip pliers. Here’s what I did:Remove the rubber tubing connector from the regulator. Be sure to drain the pressure from the fuel line. Place some towels around the Schraeder valve and press the pin. Fuel will spray,so be careful. Next,compress the retaining ring with the pliers,being careful to make sure the ring doesn’t spring off and get lost. Finally,pull the top of the regulator off,and remove the screen and rubber gasket if they remain inside. Take the new regulator and push it in place. Replace the clip,tubes,and cap to the valve.

Now,just start it up! In my case it started immediately. However,it’s possible you could have some air in the lines,so just let it turn a bit if it does not. Turn the car off and let it rest for about an hour,then try it again. In my case,it worked like a charm.

Good luck and have fun!

100% / High CPU usage by udev and/or nscd

At work we had an FC3 system that had apparently undergone an abrupt reboot or power outage. After it came back up,the CPU usage was at 100%,so bad that I could not run top. Stopping httpd and nscd seemed to help make the system responsive,though udev kept working hard.

Deleting /var/run/nscd and /var/db/nscd,then rebooting seemed to help. Oddly enough,I restarted nscd after removing these files,and that seemed to have no effect. It wasn’t until I rebooted that everything seemed to go back to normal.

Weird. Just wanted to throw that out to anyone out there having the same problem. Just delete your nscd DB files or folders and re-create the folders if necessary (Fedora’s nscd init script does this automatically),then reboot.

Fred Thompson on Federalism

Everyone needs to understand Federalism for the sake of this country,and Fred Thompson’s got a great handle on that concept:


I'm moving!

Simple HOWTO:Linux Source-Based Routing

At
work we had a network that has no internet access,except what we
provide via their VPN connection that had been allowed through the
firewall. Simple,until a small problem arose where our VPN server,
which is not configured for NAT,has it’s default gateway set for it’s
direct connection to the internet,and not the router which serves as
default gateway for the rest of the network.

Put simply,we
needed to set up a source route on the VPN server that took any packets
coming from 192.168.76.0/24 and redirected them to an alternate default
gateway of 172.16.1.100 on eth1,instead of the default gateway on eth0.

Here’s a quick description on how to do that:

# Create a custom route table
echo 200 remotesite >>/etc/iproute2/rt_tables
# Add your source network
ip rule add from 192.168.76.0/24 table remotesite
# Set the default route
ip route add default via 172.16.1.100 dev eth1 table remotesite
# Flush the route cache to immediately apply the change
ip route flush cache

200 = A table number you come up with (200 is fine,unless you have already created a 200 table)
192.168.76.0/24 = The network from which you want to redirect traffic
172.16.1.100 = The gateway that you wish to send 192.168.76.0/24 traffic to
eth1 = The interface that’s local to 172.16.1.100
remotesite = A table name you come up with

Do this and,tada! You’ve redirected traffic from a specfic network to an alternate network,a.k.a,source-based routing.

Now,before you go,make sure you place these lines (all but the first) in /etc/rc.local to make it persistent across reboots.