Skip to main content.
January 18th, 2012

Dolby Digital Through SPDIF on My MythBox

Ever since an upgrade, I’ve been having problems with the sound on one of  my MythBoxes. It was so bad I was forced to fall back to analog stereo. So today I resolved that I was going to fix the issue. After all I knew it could be done, I had Dolby Digital working before.

After playing for about an hour and reading all I could online, it seemed as though I was going to have to monkey around with the asound.conf file, something that I shouldn’t have to do this day and age, plus I never could get anything to work that way before. Luckily I found this post on Ubuntu Forums that explained the exact setting the person used for Myth 0.23. (I’m running Myth .23 on a 10.04.3 LTS box). Most people have passed 0.23 and gone onto .24 which seems to have a different configuration for sound.

Here’s the simple settings that got me Dolby Digital again:

Alsa:default
5.1

Best
Alsa;iec958:{aes0 0×02}
dolby digital and dts checked

Use internal volume controls off

Posted by benjamen as linux, Lucid Lynx, mythtv at 5:06 PM CST

No Comments »

December 16th, 2011

Finding Twitter RSS Feeds

Steve Gibson of Security Now fame just created a new twitter account (@SGreads) for posting the stories he finds interesting. Now I could follow him on Twitter, but that is pretty useless. Trying to follow somebody on Twitter is like trying to drink out of a fire hose — most of the posts miss your eyes. People who infrequently post well thought out tweets are missed in the torrent of useless blabbering of people who tweet what they had for supper. To follow people I really like I use Google Reader.

To add a twitter stream to Google Reader used to be as easy as entering the persons twitter handle, but for some reason that just isn’t working anymore. So after a few wild goose chases on Google, I finally found this site that showed my how to get a working rss feed from somebodies twitter stream.

You just enter a URL of this pattern in you address bar:

http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=xxxxx

Where xxxxx is the users twitter name. in this case I used SGreads like this:

http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=SGreads

When you verify that this brings you to an rss feed, enter this address into the subscribe box in Google Reader. Be sure to use http:// because https:// doesn’t seem to work right.

Posted by benjamen as twitter at 7:59 PM CST

2 Comments »

November 1st, 2011

Creating an RSS Feed for Your Google +1′s

This week Google dropped the ability to share items within Google Reader, instead they added way to +1 a story and/or share it in Google+. Unfortunately this broke another website I run, I previously used the shared items RSS feed to get a list of these shared stories on website. There is now no easy way to do this.

Of course there are several methods to create an RSS feed of my public post on Google+, so why didn’t I just do that? Well, for one thing I don’t post everything publicly, and two I don’t want to auto-spam everybody that has me circled with articles I’m interested in.

That left the +1 method. The stories you +1 in Google Reader show up nicely in your profile under the +1 tab. That is about all they do. +1 seem to be Google’s bastard child. You can’t get them through any API’s  or any other easy method. You’d think if there was a natural use for RSS it would be for +1s. So I decdied to figure out how to create the missing RSS feed for my (or anybody elses) public +1s.

While I could have tried coding something in PHP, I thought I’d try using a HMTL to RSS service instead and save myself some time. I remembered one such service that let you specify text delimiters for a specific items on a page and even break those items into text chunks that could be mapped to a title, a description, etc. After a long search I finally found the service I was looking for:  Feed43.

When you get to the site, go ahead and click the “Create your own feed link” on the right and follow these steps:

  1. Enter the address of your +1s in your Google+ profile,For instance mine is https://plus.google.com/u/0/110925720791814066383/plusones. You can ignore the box that is labeled encoding. Once you click reload, the site pulls up the worst looking HTML I’ve ever seen, fear not, you can ignore this. I used firebug to parse the feed instead, but if you don’t plan on making any changes you can just keep following the steps.
  2. In the box labeled Globel Search Pattern enter:

    {%}

    In the box labeled Item (repeatable) Search Pattern:

    (Sorry about the image, but if I put HTML into the post it won’t show correctly

    If all goes OK you’ll get green text saying (OK # items found)

  3. In this step you take the elements you extracted and create your feed, for instance this is how I chose to format my RSS feed:

    Clicking on preview will show you what your feed will look like.
  4. Once you’re happy with the way the feed looks, you can grab your new feed URL.

Update: 

In step 2, the expression needs to be updated to <div {*} class=”gr”… Google decided to add the aria-hidden=”true” property before the class definition and it screwed up the filter. I’d never seen any aria- properties before, evidently they have to do with accessibility.  Basically ARIA extends html to allow you to create elements other elements that you normally wouldn’t be able to tab to — allowing you to navigate more effectively with the keyboard.

Posted by benjamen as Google at 10:06 PM CST

1 Comment »

July 23rd, 2011

Applying CSS to Google Calendar Embedded in an iframe

On a Drupal  site I am developing, I wanted to embed a Google calendar agenda view into a sidebar block. There are no reliable modules that do this for version 7, so I just used Google’s method. They make this quite simple all you do is visit your calendar page click on the little down arrow on a public calendar and select settings. Google gives you the embed code right on the setting page, they even allow you to customize the view.

So I embedded an agenda view of a calendar in the sidebar, but discovered that the event titles just ran off the side of the sidebar, they didn’t wrap. This made it really hard to read the calendar. It turns out that Google sets a CSS property “white-space” to “no-wrap.” Using Firebug in Firefox, I set the property to “normal” and the titles wrapped the way the should.  The problem is that you can’t apply CSS to content in an iframe from another domain.

Searching the web I found one solution: Customising an embedded google calendar, that looked promising. Basically use wget to capture the page that is returned in the embeded code and host that on your site, then you point the link in the embedded code to your saved page instead of Google. After following instructions I could get the calendar to show up, but it wasn’t importing any events. Back to searching Google.

Next I found this site: Easy Color Customization for Embedded Google Calendars. Even though it wasn’t exactly what I wanted to do, I knew it must have something to do with manipulating the CSS of the embedded calendar, so maybe I could adapt it to change other CSS properties. What he did was create a custom PHP script that pulls the data from the embedded Google link and allows you to manipulate it before displaying it. Then all you need to do is call the php script in the embed code.

It worked beautifully, but I discovered that the script needs to be in the website root directory or the page tries to download the script instead of running it. Based on the php script, I know I could probably create a custom module for Drupal and integrate the calendar properly, but it isn’t worth the time.

Update:

Oops, I figured out the script doesn’t have to be in the website root, it just has to be in a directory where the .htaccess file doesn’t block scripts from executing.

Posted by benjamen as Drupal, Google, PHP, web at 11:28 AM CST

5 Comments »

May 18th, 2011

Netflix Not Working on iPhone or Pod? Here’s a Fix

I don’t watch much TV, but as of late I started biking while re-watching Buffy the Vampire Slayer. I find it hard to watch new programs while exercising, so I wanted something familiar yet with a lot of action. After finishing the first season box set, I was going to purchase the second season (the only one I don’t own), but decided to see if Netflix offered Buffy for watching instantly. When I found out they did, I activated my free trial and set up my Wii to start watching.

Since I now had a Netflix account I wanted to try it out on my iPod Touch 4G. I downloaded the app, logged in, picked an instant movie, and it would think for a while then kick me back to the movie information page. After scouring the Neflix site and searching Google for about an hour I finally found the solution in the Apple Support Communities.

User sriramk wrote:

I spoke to Netflix support and they helped me fix this issue.

Solution: Switch from your automatic DNS settings to Google’s DNS server. General->Network->Configure TCP/IP->Manual and pick 008.008.008.008.

Now, I was stumped a bit since I have an XBox 360 on the same network with no issues. The support guy said that Apple TV connects to their licensing servers a bit differently so this should fix the issue.

I was a bit skeptical when I read this, why should a different DNS server make any difference, but I was desperate to get it to work so I changed the DNS setting to 8.8.8.8 in my wifi settings on my iPod. Low-and-behold a movie actually started playing when I tried it again.

I found this fix also worked on my daughter’s iPod touch 1st Gen.

Posted by benjamen as iPhone/iPod Touch, video at 8:48 AM CST

5 Comments »

March 4th, 2011

Enabling Trim Support in (K)ubuntu

I have purchased two SSDs so far. The first, an Intel X25-V series, was somewhat of a performance disappointment.  It really didn’t perform much better than a good 7200RPM drive. To replace this drive I bought an OCZ Agility 2 which has not disappointed me so far. I dropped the old Intel X25-V into my netbook and have seen a insignificant performance over the slow hard drive that came with it.

Since I actually saw an increase in performance by the OCZ drive, I didn’t want to lose that over time as sectors get used up and aren’t zeroed out.  The time lost comes when new writes have to wait for the sectors to be zeroed before they can be written. The TRIM command is supposed to fix that by zeroing sectors as they are freed.

I found instructions on how to enable TRIM on AskUbuntu. What follows is the steps I followed, in case the original article ever disapears.

First you have to make sure the drive you want to use is formatted with EXT4. you can check this by looking in the /etc/fstab file. For example here is the line that describes my SSD:

UUID=13d165a1-ec32-42ce-bb58-10911e907ce1 / ext4 errors=remount-ro 0 1

Notice how after the mount point of “/” is specified the next parameter says ext4. To enable TRIM you simple need to add “discard” to the list of options like so:

UUID=13d165a1-ec32-42ce-bb58-10911e907ce1 / ext4 discard,errors=remount-ro 0 1

Then reboot.

The next step is to verify that TRIM is indeed working. The way that you demonstrate this is pretty neat; it shows you exactly what TRIM does. Basically you create a file filled with random data on the root of the SSD. Then you find the starting sector of the file you just created and read some raw data from the file. Then you remove the file and read the data from the sector again. Without TRIM, you’d see the same data, with TRIM you’ll see all zeros.

benjamen@lisa:~$ cd /
benjamen@lisa:/$ sudo dd if=/dev/urandom of=tempfile count=100 bs=512k oflag=direct
[sudo] password for benjamen:
100+0 records in
100+0 records out
52428800 bytes (52 MB) copied, 10.92 s, 4.8 MB/s
benjamen@lisa:/$ sudo hdparm --fibmap tempfile

tempfile:
filesystem blocksize 4096, begins at LBA 2048; assuming 512 byte sectors.
byte_offset begin_LBA end_LBA sectors
0 13706240 13707263 1024
524288 13730816 13731839 1024
1048576 13748224 13750271 2048
2097152 13711360 13715455 4096
4194304 13772800 13867007 94208
benjamen@lisa:/$ sudo hdparm --read-sector 13706240 /dev/sda

/dev/sda:
reading sector 13706240: succeeded
1228 8669 f83b a5aa 73cf a136 966a bc25
cdfb 8745 7f5d d4fc 5dbe 39c1 a30d a127
f8b6 74cd 648a b3d4 96d1 2421 691f e4eb
b81a ce47 d934 1f32 c99d ebb8 a7e3 03f5
b384 3321 6473 cc88 0f81 8f76 80f0 de6a
49e4 be9f 3095 de58 fd8f 1a0d 86a0 a27d
8c7f b98c 8bba 68e4 b12a 1fbb d899 2a55
82a7 07df 43db a95e 75d5 9460 3dc8 dd9f
7dfc c420 0b08 670b be78 9ca8 25ec 921d
f9d4 9ea7 2f35 9802 091f e2fc 912b e572
d24d 858e 1847 e01b 577c 8dcc 8cd1 3c0e
03f3 f5d8 d789 5431 36cf 2d9f 3b6d 68c4
365d a2e8 c987 c07c d389 4ca1 c3fc 70d3
65fd 1c97 c335 e332 f7b7 c791 27ec 5f14
50cb c804 114d 6379 6876 97df 8693 72e4
edbc a50f 5a9b 5c4f d028 0bb3 1327 2318
7292 884e 3494 4b99 46fd 0259 fe76 d9a6
e7a1 2ec5 131d 8d69 2a28 2f8a add4 2541
b953 06bc ba90 8f1e 7505 6baa 0bc2 f704
4e63 2dea 4c88 8f31 6971 c5d5 d2e5 7f7f
6ae4 e8dd c3cb d289 b1a6 f571 15c3 c944
e077 e4b3 141b 4db5 a5ec 76dc ef82 5ae0
8770 620e 9df7 b1a2 c40e a305 1272 19e0
c5f8 0fe7 dbe8 1b91 2556 8c22 a195 8d26
a297 baad 8b3b 53b5 8ce0 f408 bcd7 200b
553b 6121 9f2c 7fcd bc4e 874e 6955 a1ee
3a93 a3c1 75ad a987 a597 e6bf 25f8 3ad7
5b86 0b38 6747 61d5 2c9a 2ae3 e775 4283
e81f cb20 df29 de08 0c01 0d39 9b0c ccb4
cf95 a77a 564b 583d bc60 dd4d 70ff 8653
8f18 0f53 1476 4a27 1c4c 0b58 7109 4456
b65a c374 d399 eb08 6a4f caf6 f9f5 24f1
benjamen@lisa:/$ sudo rm tempfile
benjamen@lisa:/$ sync
benjamen@lisa:/$ sudo hdparm --read-sector 13706240 /dev/sda

/dev/sda:
reading sector 13706240: succeeded
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
benjamen@lisa:/$

One thing that I’m not sure about is what happens if you have the SSD drive partitioned. So to keep it simple my advice is to format the whole SSD as one partition.

Posted by benjamen as Kubuntu, linux at 1:55 PM CST

No Comments »

February 21st, 2011

Adding a Cord Wrapper to an iPod Touch Case

When I bought my 1st Generation iPod touch I found what I thought was the perfect case: the DLO Jam Jacket. It let me get a grip on my slippery iPod, its bulging corners kept the screen off the table so it didn’t get scratched, it protected the iPod from falls, and it managed headphone cord so that it didn’t make a mess in my pocket.

When I bought my iPod touch 4th Generation, the first thing I looked for was a similar case.  Unfortunately DLO doesn’t make any cases for the 4th Gen iPod Touch and I couldn’t find a case from another company that even came close to matching the functionality of the DLO Jam Jacket. So I did what any good maker does, I modified the best case I could find to meet my needs.

After some searching I found the FlexGrip Action from Griffin. This case is even more rugged than my DLO Jam Jacket was, but lacked any cord management. For that I bought the Belkin Ear bud Clip Cable Manager. It is simply a wide spindle to wrap the ear bud cable around with a rubber cover that keeps the cable in place. I figured that If I could marry these to items together I’d get a crude approximation of what I needed.

Onto my mod…

The first thing I needed to do was to get rid of the clip on the back of the Belkin cable manager. Two molded plastic prongs held the clip in place so I bent them until the clip popped out. Then I had to remove the plastic prongs so the back of the cord manager would sit flat on the back of the case. First I removed the rubber cover by sticking a screwdriver underneath the plastic strip that says Belkin and prying upward. Then after the rubber cover was off, I cut the prongs off with a hobby knife and sanded the back flat.

At first I tried to use some double sided tape to hold the cable manager to the case, but that only lasted for half a day before it came apart. The rubber case just didn’t stick well to the adhesive. So I needed to find another way to attach the cable manager. I finally decided to tie it on with some 30ga wire.  I drilled four holes into the back of the cord manager to run the wire through.

Then I lay the cord manager back on the back of the case and centered it. To transfer the hole locations I used a stick pin, but the rubber closed back around the hole quickly after I removed it. So I needed to thread the wire through the hole as soon as I removed the stick pin. I used a piece of wire for the top and one for the bottom and twisted them as tight as I could inside the back of the case.

All that was let to do was trim the excess wire and snap the rubber cord keeper over the back. I plugged in the headphone cord and wrapped the cord around the cord keeper leaving enough of a loop so that there wasn’t too much pressure on the headphone plug.

My FlexGrip Action case probably already saved my iPod touch. I was getting out of my truck and my iPod slipped out of my hands, dropped five feet onto sand and salt covered asphalt, and landed screen down. I shudder to think what would have happened if I didn’t have it in its case.

Of course when I was grabbing the links for this writeup I found out Griffin makes another case that is almost exactly what I’m looking for: the FlexGrip Wrap. Too bad my case modification has held up so well.

Posted by benjamen as electronics, iPhone/iPod Touch at 8:44 PM CST

1 Comment »

January 10th, 2011

Choose Your Windshield Washer Fluid Wisely

I ran out of windshield wash in my truck last week, so I refilled the reservoir with a jug of fluid I had sitting in the garage.  I never thought to check the jug to see if it was rated for cold weather.  I didn’t even realize that was a problem.  I thought all windshield fluid had anti-freeze or alcohol in it.  Boy was I wrong.

The next day when I was out with the truck, the wiper fluid worked fine for a few squirts then stopped.  Annoyed, I dealt with the crap on the windshield when I got to my destination by rubbing some snow on the warm windshield.  When I got home I took a look at the jug of fluid I’d used and was surprised to see +32ºF on the bottle.

I figured I could unfreeze the lines and or reservoir by getting both the truck and the jeep engines warmed up and then shutting them in the garage (ignition off of course).  I also bought some “Ultimate” fluid to fill the remaining space in the reservoir, figuring it would mix with the fluid already in there.  Between the warm garage and the anti icing agents in the new fluid I figured the ice didn’t stand a chance.

It worked and when I got the fluid flowing I pumped about half of the reservoir onto the floor.  I should have emptied the entire reservoir!  The next day the wiper fluid was still flowing fine when I backed out of the garage, but then it froze up on me again few miles down the road.  The jeep wasn’t home and it was a colder day so I shut the garage, opened the door to the house, and cranked the thermostat.  I figured the furnace would heat the garage enough to unfreeze the fluid and I was right.

I tried the knob for the windshield wash, something was wrong.  I could hear fluid spilling onto the ground, but nothing was coming out of the wipers.  I checked under the hood, a rubber coupling had come undone and wiper fluid was shooting into the engine compartment.   It actually was a lucky break.  Rather than pump fluid onto the floor, I put the free end of the plastic washer fluid hose into a bottle and pumped the washer fluid out until it was purple (the color of the new fluid).  Then I reconnected the line and refilled the reservoir with the correct fluid.

This seemed to have done the trick.  I haven’t had a problem with my windshield wiper fluid since.

Posted by benjamen as truck at 7:13 PM CST

1 Comment »

December 1st, 2010

VirtualBox Network Drivers Crap Out After Kernel Upgrade

It never fails, I need to fire up VirtualBox to do something in Windows and I get a dialog box about it not being able to find the right driver.  I know exactly what the problem is — the kernel was upgraded and the VirtualBox network drivers are out of date — I just always forget what to do about it, so I have to search for 15 minutes to 1/2 an hour to find somebody who wrote down the procedure.

I’m writing it down this time for when it eventually happens again.  Then I can reference this post (if I remember I wrote it) and be back up and running in a few minutes rather than a half an hour.

Run this from the command line:

sudo /etc/init.d/vboxdrv setup

Reference:
How to rebuild vboxdrv on Arch Linux

Posted by benjamen as Kubuntu, VirtualBox, Windows at 4:27 PM CST

1 Comment »

Recycling #4 Plasctic

Photo Credit Wikipedia.org

After buying toilet paper today, I realized companies waste a lot of plastic wrapping every 6 rolls together then wrapping 6 of those together to make a larger bundle.  Even though it’s quite compressible, it’s the kind of garbage that expands to fill whatever garbage can you put it into, making it seem fuller than it really is.

Looking at the plastic wrapping, I noticed it was #4 plastic, LDPE.  Although the feel is different, I wondered if it was the same kind of plastic that they use in grocery bags.  Then I could recycle it at the grocery store along with all the other plastic bags.  Checking a grocery bag, sure enough it was #4.

Still to be sure, I searched online and found two sites that explained what you were allowed to recycle in those plastic bag take-back bins.  The list of things you could actually recycle besides grocery bags surprised me:  bread bags, those heavy plastic salt bags (sans handles), newspaper bags, stretch wrap, shrink film, paper product wrappers, and dry cleaner bags.  What isn’t allowed is rigid plastic, bubble wrap, or dirty bags.

We’ve always recycled plastic bags in our own way.  We use them to line garbage cans which keeps them clean.  Plus we don’t have to reach into the can to grab the icky, stuck kleenex on the bottom.   Now in the closet next to the plastic bags we re-purpose as trash bags, I have an extra bag I’ll fill with the other #4 plastic waste and odd-shaped bags that aren’t useful for trash.

References:
Plastic Shopping Bags — Rethink Recycling
Plastic Bags — Anoka County Website

Posted by benjamen as garbage, plastic, recycling at 4:17 PM CST

1 Comment »