Recently in Technology Category

I've been working with variations of Unix for a long time now and thought I'd jot down some of my favorite tips and tricks. They are mostly OS/distribution/shell/language independent (unless I indicate otherwise...)

  1. Get rid of blank lines in a file
    grep . inputfile > outputfile
    This matches (and thus prints) only lines that contain some text, not blank (empty) lines.

  2. comm
    Many people never cross paths with the comm command, but it is very useful. I works similarly to diff, but outputs the contents of two compared files into three columns. The first column is content only in the first file, second column is content only in the second file, and third column is content that is in both files (matches between the two files.) While this may not seem useful at first, you can select which columns to output, so if you only want to know what is in both file1 and file 2 (column 2) you'd suppress columns 1 and 2, by running:
    comm -12 file1 file2
    Don't forget that your input files must be sorted.

  3. paste
    Systems administrators frequently use the cut> command to parse files, but many people I run into have never used the paste command. The paste command will concatenate two files line by line (as opposed to file by file, like cat.)

  4. less instead of more
    This is not available on all Unix-based OSes, but the less command works very similar to more, but will let you move through a file forwards and backwards more easily. Want to jump to the end of the file, type Shift-G Depending on the version of less you are running, it will provide context highlighting when you search for a pattern.

  5. Jump to vi from more
    While paging through a file in more, press "v" to jump to editting the file in vi at the current position in the file.

  6. Jump to a line number when editing a file with vi
    vi +linenumber filename
    will open up the file with the cursor automatically moved down to the specified line. This is useful when you get an error that indicates "syntax error on line 2047." You can jump straight to the problem without fumbling around.

  7. Invisible characters become visible
    Sometimes you'll end up with carriage returns on each line in a file originally created on a DOS/Windows system, or filenames with spaces, tab, or other control characters in them, but you can't see them typically.
    The cat command provides three useful options -v, -e, and -t that will let you understand these invisible characters
    -v (displays non-printing characters)
    -e (prints a "$" at the end of each line to indicate a NL character)
    -t (prints "^I" for each Tab in the file)
    cat -vet filename |more

  8. Remove DOS ^M from ends of lines
    The "^M" characters are visible when editing in vi but here are two approaches to remove the characters.
    sed 's/<Ctrl-V><Ctrl-M>//g' -i filename

    or in vi: <Esc>:%s/<Ctrl-V><Ctrl-M>//g

If you ever do end up with me interviewing you, I'll likely work one or two of these into the discussion to explore your level of knowledge about Unix. If you need more information, remember: man pages are your friend.

This one is for you Charter (and every other cable company I've ever had.) Why can't the cable companies normalize the volumes of all their channels? I know there are variations between programming and advertising volumes, but when I switch from channel to channel, I typically either can't hear the channel or get blared out. I'm not typically sensitive to these changes, but I hate when I'm watching a program at night (kids sleeping) and I change the channel only to find myself in the middle of an action sequence in a movie with the volume suddenly twice as loud.

I know some TVs had volume normalization features (including automatically turning down the volume during noisy commercials) a couple years back, but why not eliminate the problem? Why not pick a volume range or maximum peak volume and adjust channels to the standard at the cable company's end of the technology before re-broadcasting the signal down their network?

Cost of living: June 2008

| | Comments (0)

Hard drive storage: $0.14/GB
(Seagate Barracuda 7200.11 500GB 7200RPM/32MB for $69.99 via TigerDirect on June 17, 2008)

Solid-state hard drive storage: $15.63/GB
(OCZ 64GB SATA-300 2.5" Solid State Drive for $999.99 via ZipZoomFly on June 17, 2008)

Flash memory: $2.81/GB
(Patriot 16GB SDHC Card for $44.99 via ZipZoomFly on June 17, 2008)

Highest interest rate savings with minimal deposit requirements: 3.50%
(HSBC Bank via money-rates.com on June 17, 2008)

Loaf of white bread: $1.37

Pound of ground chuck: $2.80

Gallon of gas: $4.07
(US National Average, pulled from Gas Buddy on June 17, 2008)

now, check a news wiki (Wikinews or Wikipedia)

within a couple minutes, check a news website (Drudge Report or CNN or Fox News)

within a couple hours, listen to radio news (1440 WLWI-AM)

within a half day, check television news (BBC or ABC or CBS or NBC on TV)

within a day or two, try the newspaper (Montgomery Advertiser)

within a week, try the weekly newspaper (Prattville Progress)

My first PC

| | Comments (0)

My first real IBM PC-compatible computer was an IBM PS/2 Model 50. It was purchased sometime around the summer of 1987. I was about 12 years old and about to enter middle school. I'd previously had a Coleco Adam (which was sort of an Apple IIe mixed with a gaming console.)

It had a 10Mhz Intel 80286 processor, 1 MB of RAM, a 20MB hard drive, a 1.44MB floppy drive, 4 MCA slots (they all went unused), a IBM 8514 VGA Monitor, an IBM 5842 2400bps modem and a IBM 5201 dot matrix printer.

The original IBM PS/2 mouse.The fact that it had 1 MB of RAM was a bit of an early confusion to me as DOS could only use 640Kb until memory manager and extended memory utilities became available.

I remember distinctly saying that I'd never be able to fill up the 20MB hard drive. A little research lists a replacement 20MB drive for the system at $795 (~$40/MB) at today's market rates (cost/MB) that drive would cost approximately three tenths of one cent (.003 dollars) These days my digital camera takes 10MP RAW photos that are almost 20MB each. A 1TB drive (which are available for approximately $200) holds 50,000 times as much data as that 20MB drive. I've long since stopped saying that I'd never fill up a give hard drive...

I remember running IBM DisplayWrite 4, Harvard Graphics, Deluxe Paint (DPaint), F-19 Stealth Fighter. I briefly ran a couple of starup BBSs using Renegade and Wildcat! that never amounted to much. It was mostly an outgoing BBS terminal with occasional application distractions here and there.

I had a 2400bps modem, but all the BBS were 1200bps in town. I used to call long-distance (remember that?) to take full advantage of my modem's speed for the first couple months. The phone bills hurt.

I made the mistake of using DoubleSpace disk compression for the first and only time on this system.

This computer ran MS-DOS (3.0 - 6.22), PC-DOS, DR-DOS, GEOS, Windows 3.0, OS/2 (1.something.) I cut my teeth on BASIC, Turbo Pascal, REXX

Now my computers(!) run at multiple gigahertz with multiple processor cores, have gigabytes of system RAM, and terabytes of storage. I can't wait to see what happens in the next 20 years...

I was contemplating how much filter factor (light cutoff) I get with a cheapo Quantaray Circular Polarizing filter that I inherited when I bought my Canon 50mm f1.8 second-hand. It finally occurred to me that I could switch over to M (Manual) mode on my camera, aim it at something, dial in an exposure (I happened to set it to '0'), then drop the filter over the lens and watch the exposure level indicator ( -2..1..0..1..+2 ) adjust (usually downward) and note how many stops the exposure dropped. The camera focuses and meters through-the-lens (TTL) (and thus through-the-filter), so it takes this into consideration anyway when metering a scene.

For my 52mm Quantaray Circular Polarizing filter, the exposure drops 1 1/3 stops. I'd been working with the filter on most of the time, not realizing that I was losing 1 1/3 stops unintentionally, turning the "nifty fifty" f/1.8 effectively into a f/2.8. Oops, lesson learned, check your filters out.

I got a Canon Rebel XTi (400D) several months back and I'm immensely enjoying expanding my knowledge and horizons. I moved to the XTi from my 3.3MP Sony Mavica MVC-CD300 workhorse point and shoot camera. Despite being quite comfortable with the Sony (and its limitations) I have frequently said that I felt like a complete beginner again when staring through the viewfinder of my Canon.

I was contemplating all the different settings on the XTi that can be chosen for each shot the other day and I decided to toss them in a table:

Setting   Options
Modes12 (P, A, S, M, Auto, Creative)
Shutter Speed55 (54 increments (1/4000 - 30sec in 0.3EV increments) + Bulb)
Aperture40 stops (f1 to f91 in 0.3EV increments (depends on lens))
Image Size8 (S/Normal, M/N, L/N, S/Fine, M/F, L/F, JPEG+RAW, RAW)
Picture Style9 (6 preset + 3 custom)
Custom Picture Style4,096 options
Mono Picture Style26 options
Auto Focus2 (Auto/Manual)
Auto Focus Mode3 (One Shot, AI Focus, AI Server)
Focal Point10 (9 points + full auto)
Metering3 (Evaluative, Partial, Center-weighted)
ISO6 (Auto, 100, 200, 400, 800, 1600)
White Balance9 (8 presets + Auto)
White Balance Correction361 options
Color Space2 (sRGB or Adobe RGB)
Flash2 (on + off)
Flash Exposure Adjust17 (-2EV to +2EV in 0.5EV or 0.3EV increments)
Flash Exposure Lock2 (on + off)
Auto Exposure Lock2 (on + off)
Auto Exposure Bracketing17 (-2EV to +2EV in 0.5EV and 0.3EV increments)
Exposure Compensation17 (-2EV to +2EV in 0.5EV and 0.3EV increments)
Red Eye Reduction2 (on + off)
Drive Modes3 (Single, Continuous, Remote/Timer)
Remote Trigger Modes2 (no delay/2 second delay)
Auto Rotation2 (on + off)
Custom Functions46,080 combinations

A little math reveals: 61,749,528,383,550,522,560,348,160,000 combinations! That's 61.8 octillion (a trillion quadrillion or a billion billion billion (those outside the US refer to this to a quadrilliard))! Another way to look at this is 6.1x10^28, estimates of the number of atoms in the observable universe range in the 10^77 to 10^79 range. Those are some big, big numbers! No wonder I feel like a beginner again. Not all the settings will make a viable or desirable image, but there is the big picture math on the issue.

A typical photographer (me) usually only changes a couple of these at a time and usually through a limited range of the settings for each option, so it's not as impossibly complex as it looks. As with all technology, I look forward to seeing where this technology goes in my lifetime. The Canon Rebel XSi is out next month with even more options...

A while back I contacted the top five or so vendors of home weather stations to see if they offered any product that would simply measure various atmospheric variables and allow the home user to poll the station for data via some sort of open API. My search came up empty. Most of the time I felt like I had just asked them if they made pants with four legs.

I know there is a segment of consumers want a weather appliance that sits on their counter and tells them the weather. There is another segment that wants to be able to work with and track the data (for which some vendors provide their own software, usually Windows only.) Still another segments literally wants to just have the information available through an API that I can interact with. That last segment is me; that's what I'm looking for.

If you have a weather station that will:

  • provide basic weather information
    • temperature
    • humidity
    • dew point
    • wind speed
    • wind direction
    • barometric pressure
    • precipitation
  • allow me to poll the weather station
    • when I want
    • for what values I want
    • from on open API from whatever computer OS I want
then I would like to talk to you about purchasing one of your weather stations.

You can reach me at speed-weat@transmit.net.

I recently washed (and dried) an off-brand SD Card full of photos through the washer and drier. To my surprise, all the data was still there, undisturbed and uncorrupted. I'm quite amazed that the technology stood up to that kind of abuse with no glitches. I'm not planning on trying this with my CF cards any time soon, but I wonder how they would fare...

I recently contacted Charter's support chat to see if they offered a reasonable solution to recording HDTV on PVR. The Moxi Box I have now (great, Linux-based solution) only has 80GB of storage, which represents about 6 hours (give or take) of HD programming that can be stored. This past weekend I recorded both Divisional Playoffs on Sunday, then accidentally hit the record button while watching TV later and the Moxi wiped out one game completely to make room to record the current show. I'm ping on the edge of the storage space with nothing but 2 3-hour shows recorded. I've added an external 250GB drive to the Moxi and it worked fine until the drive overheated and died. I don't want to maintain my DVR infrastructure, that's why I effectively rent this solution from Charter with a monthly fee.

Here's the online discussion I had with Charter.


A representative will be with you shortly.
You have been connected to Janet .
Janet : My name is Janet. Thank you for contacting Charter Communications. How may I assist you?
Me: My Moxi box is woefully inadequate for my DVR (esp. HDTV programming) recording needs. Do you offer something with more storage?
Janet : May I please know if your DVR is hd capable?
Me: Yes, it is. I recorded 2 3-hour football games this weekend (in HD) and it wiped out all other programes on the box.. I could've kept some of the programs, but then I couldn't record the games.
Me: I really need to be able to record more than 6 hours of HD programming
Janet : HD
Janet : HD DVR only records short hours.
Janet : If you want longer hours of recording, you may add external drive to your moxi.
Me: I'd prefer not to be in the business of upgrading my infrastructure, that's why I'm paying Charter a monthly fee. Do you offer anything more than the Moxi with 80GB of storage?
Me: I understand that HD requires (drastically) more storage. Is Charter offering any practical solution to this issue?
Janet : Yes, you may add an external hard drive to your moxi.
Janet : That is to have longer hours of recording.
Me: Please take a note for Charter: I'm going to switch to satellite because they will not provide me a more adequate solution for my PVR/DVR needs. I don't want to buy and maintain extra hard drives because Charter isn't keeping up with technological demands. That is why I pay a DVR fee to Charter.

If you are looking at using Charter's cable television services (especially HDTV) beware their DVR solutions are drastically limited on space (while otherwise being a great technological solution.) Expect Charter to not upgrade their infrastructure, but to pass on storage upgrade costs onto you, the consumer, despite you renting the DVR from them in the first place.

That felt good, now I'm off to go shop for a satellite provider...


About this Archive

This page is a archive of recent entries in the Technology category.

Politics is the previous category.

Time is the next category.

Find recent content on the main index or look in the archives to find all content.