Spotify on Linux: Easy Edition
Here’s a script I just wrote that installs Spotify on Linux with Wine. Works great with Wine 1.3.24 on Gentoo Linux x86_64 with PulseAudio (which works great and isn’t choppy or anything).
P.S. In the Spotify installer, don’t tell it to start when done.
#!/bin/sh # Download spotify and winetricks wget http://download.spotify.com/Spotify%20Installer.exe -O /tmp/spotify.exe wget http://winetricks.org/winetricks -O /tmp/winetricks chmod +x /tmp/winetricks # Configure $WINEPREFIX export WINEPREFIX="$HOME/.wine-spotify" wineboot # Set some various registry keys (Spotify recommends you use 44100/Emulation) wine reg add HKEY_CURRENT_USER\\Software\\Wine\\Drivers /v Audio /t REG_SZ /d pulse /f wine reg add HKEY_CURRENT_USER\\Software\\Wine\\DirectSound /v DefaultSampleRate /t REG_SZ /d 44100 /f wine reg add HKEY_CURRENT_USER\\Software\\Wine\\DirectSound /v HardwareAcceleration /t REG_SZ /d Emulation /f # Install some required packages (IE6 may provide WinInet, if so then it's safe to remove that) /tmp/winetricks wininet ie6 corefonts tahoma winhttp wmp10 secur32 # Copy the WMP10 MP3 decoder on top of Wine's, tell Wine to use it instead. cp -fv $WINEPREFIX/drive_c/windows/system32/l3codecp.acm $WINEPREFIX/drive_c/windows/system32/winemp3.acm wine reg add HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides /v winemp3.acm /t REG_SZ /d native,builtin /f # Install Spotify. wine /tmp/spotify.exe # Remove temporary files rm /tmp/spotify.exe rm /tmp/winetricks
Screw you, Shell!
I wrote in to Shell Customer Care to attempt to find if they have any premium Diesel in Tulsa, since I can’t get biodiesel in the “Oil Capital”. Shell does have premium Diesel - you can get it at several stations in Fort Smith, AR (one I know of for sure is the Massard Rd Shell across from Wal-Mart on Zero St). Premium Diesel costs 8-12 cents more than regular Diesel, but I get a lot more miles per gallon (42-48 vs 34-37).
Since premium Diesel is slightly obscure, it would make sense that their retail location locator doesn’t have an option for it (it doesn’t have E85 either). QuikTrip’s locator doesn’t even have Diesel as a filter option. The difference is that QuikTrip’s support people gave me a list of locations when I wrote in. Here’s what I wrote Shell to attempt to get QuikTrip-like service in determining what (if any) stations offer premium Diesel:
Hello,
I’m trying to see if Shell Premium Diesel is available in or around Tulsa, OK (ZIP 74112). I believe this is branded as V-Power Diesel.
Thanks!
I’m pretty sure that the people they pay to answer questions understand about 6 words in English, and around 30 words in any language, because they replied with this:
Dear KEITH GABLE,
Thank you for taking the time to contact the Shell Customer Care Center.
This is in response to your request for assistance in locating Shell branded retail stations. Locations can be found on our website: www.localshell.com. Please check the diesel box and add the city and state or zip code for the list of Shell station who serves diesel.
If you need to plan a trip, please utilize the route planner option on the left side of the screen at www.localshell.com. With this function you may locate all the Shell stations along your route.
We thank you for your patronage. If you need further assistance please contact our Shell Solutions Center at 1-888-GO-Shell (1-888-467-4355).
Sincerely, Shell Customer Care
Thanks for reading my e-mail, guys! I wrote you guys after spending quite a bit of time searching your site, and already came across that locator. So, I wrote them back and told them that. Then they replied:
Dear KEITH GABLE:
Thank you for your communication.
This is in response to your email regarding your inquiry of the Shell Staion in Tulsa OK that offers Premium Diesel.
Please be advised that due to system limitation our www.localshell.com can only provide you with stations that offers Diesel.
We appreciate the opportunity to serve you in this matter and look forward to providing you with quality Shell branded products and service in the future. If you have need further assistance, please contact Shell Solutions Center at 1-888-GO-SHELL (1-888-467- 4355).
Sincerely, Shell Customer Care
In other words, “if we can’t find it on the same site you can find it on, then we’re not going to ask someone to look it up for you”. Thanks for the fucking effort. I’m sure the station owner likes that you guys aren’t sending business to them as well. Seriously, how do these miserable assholes become customer support specialists? Someone at QuikTrip should either school these guys, or decide to offer premium Diesel. Of course, my real preference would be for CountryMark to open some locations in Oklahoma, but that’s never going to happen :)
A Letter to the City of Tulsa
I just sent this letter to the City of Tulsa via their contact form. This snow and lack of anyone doing anything about it is really driving me nuts.
I hope this doesn’t sound too rude, but I feel like I have to say something. Why are none of the streets sanded and salted for the pending snow storm? Why weren’t they last week? I’m not sure how much salt and sand cost, but I’m sure if you were to compare the cost of salt and sand to lost tax revenue due to businesses not being able to be open, it would be cheaper to actually buy salt and sand. And that’s leaving out the part that there are a lot of people who aren’t going to be paid for this time off.
The purpose of a government is to protect its citizens. It seems that by choosing not to adequately prepare for these storms – the worst in decades – that the City of Tulsa is choosing not to protect its citizens. I want to know why. What is more important? Whose budget is more important than the safety and financial security of the citizens of this city?
Think the City of Tulsa can do better? Join the Facebook page someone set up for it.
WekeRoad Ink for Visual Studio with Ruby in Steel
Just started playing with Ruby in Steel and I had to add some styles for Ruby/Rails to the WekeRoad Ink theme. Here they are:
<Item Name="Ruby Constant" Foreground="0x00AF912B" Background="0x02000000" BoldFont="No"/>
<Item Name="Ruby Method Def" Foreground="0x02000000" Background="0x02000000" BoldFont="No"/>
<Item Name="Ruby Method Call" Foreground="0x02000000" Background="0x02000000" BoldFont="No"/>
<Item Name="Ruby Symbol" Foreground="0x00FFFF00" Background="0x02000000" BoldFont="No"/>
<Item Name="Ruby IVar" Foreground="0x003248DA" Background="0x02000000" BoldFont="No"/>
<Item Name="Ruby GVar" Foreground="0x02000000" Background="0x02000000" BoldFont="Yes"/>
<Item Name="Ruby CVar" Foreground="0x003248DA" Background="0x02000000" BoldFont="Yes"/>
<Item Name="Ruby Class Def" Foreground="0x006DC6FF" Background="0x02000000" BoldFont="No"/>
<Item Name="Ruby Module Def" Foreground="0x00AF912B" Background="0x02000000" BoldFont="No"/>
<Item Name="Ruby Regular Expression" Foreground="0x00FF1CFF" Background="0x00000000" BoldFont="No"/>
<Item Name="Rails Attribute Name" Foreground="0x02000000" Background="0x02000000" BoldFont="No"/>
<Item Name="Rails Attribute Value" Foreground="0x005CC2A5" Background="0x02000000" BoldFont="No"/>
<Item Name="Rails Element Name" Foreground="0x006DC6FF" Background="0x02000000" BoldFont="No"/>
<Item Name="Rails Entity" Foreground="0x000000FF" Background="0x02000000" BoldFont="No"/>
<Item Name="Rails Server-Side Script" Foreground="0x00BB9768" Background="0x02000000" BoldFont="No"/>
<Item Name="Rails Tag Delimiter" Foreground="0x00FFFFFF" Background="0x02000000" BoldFont="No"/>Accessibility Issues You Wouldn't Think About
When you write web pages, accessibility should be a key issue on your mind. Everyone should be on the alt bandwagon, and hopefully thinking about how someone with an aural or a visual disability might parse your web page. But there are some things you just don’t even think about and anyone pointing it out would just be helping you, right? :)
The issue I’m speaking of is writing content with phrases in it that require aural or visual ability. For example:
Please look around on our site.
Can you look around a site if you can’t see it? I wouldn’t think so. “Please browse our site” might make a little more sense but it has a separate issue of basically begging your visitor to browse your page without giving them any information as to what they’re browsing to. Give them a short list of awesome things you can do: “You can learn about X, Y, and Z on our site.”
Click here.
If a tree falls in a forest and nobody’s around, does it make a sound? If you press a mouse button and can’t hear it make a sound, does it click? Well, no. You should always link to a phrase or word that makes sense. “Click here to schedule a tour.” is inferior compared to “Schedule a tour today to learn about X, Y, and Z.”
Another thing I’ll bring up is the Oxford comma. Growing up, they taught us to always use an Oxford comma, so pardon me if I sound biased. Anyways, I always say to include it because screen readers are stupid and won’t put the right emphasis on a list consistently unless you explicitly delineate the list. Plus, the US government printing office requires it, so that seems like a good enough reason to include it in sentences.
WTF. 1

How is it that Word with one document open is using more RAM than Photoshop with like 10 images open?
Praise Google!
After literally hours of scouring the web trying to find a solution to a SIMPLE problem, I finally came across it.
What’s the problem you ask? Well, I have a Mongrel application server running a Rails application. We’re authenticating to this application using mod_auth_sspi in Apache. This is fine, but it doesn’t permit the application to know who is on the other end (and we can’t rely on the Authorization header). So finally, I googled the right thing, and came up with this post on CRAZ8 that they implemented as a plugin. Here’s the bit I care about:
RewriteEngine On
RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule .* - [E=RU:%1]
RequestHeader add REMOTE_USER %{RU}eTo quote CRAZ8:
Here’s what this Rewrite-fu does:
Line 2: Use lookahead access to get REMOTE_USER set by authentication module Line 3: Transfer the results of line 2 into an environment variable called RU Line 4: Set a Request header to the environment variable from line 3.
Thanks!
Howto: Use GNOME media keys with Amarok 2.0
Actually, this will work for anyone, regardless of desktop environment. GNOME users are the most affected, because GNOME doesn’t send keys to Amarok for it to process.
Anyway, this is really simple. First you need to know what your media keys are. I have a Das Keyboard Professional so it lacks media keys; I use Meta and the numberpad to control my media stuff.
First, install xbindkeys. You probably already have it. Next, turn off Caps Lock, Numlock, and Scroll Lock, then use xbindkeys --key and press the key or key combination you want. You will likely get a name for the key like XFMediaPlayPause. Failing that, you’ll get a code. Either will work. Copy the code or better yet the name.
Edit ~/.xbindkeys. Make yours like this:
"amarok --play-pause"
Mod4 + KP_Multiply
"amarok --next"
Mod4 + KP_Add
"amarok --previous"
Mod4 + KP_SubtractFirst line isn’t indented and is the command to execute. Second is indented two spaces and the code you got previously.
Add xbindkeys to ~/.xinitrc (you may need to create it, chmod +x it, and put #!/bin/bash at the beginning of the file).
Hopefully that helps!
Fix: Dolphin hijacks the GNOME Places menu
I had a problem where items in the GNOME Places menu were opening in Dolphin (and weren’t working). Somehow Dolphin hijacked the file:// protocol. The fix is simple though is something I just found by looking around in GConf Editor.
Why would I have Dolphin installed in GNOME you ask? Amarok 2.0 needs it. By the way it’s nice.
Do this as your normal user (not root):
gconftool-2 --set --type=string /desktop/gnome/url-handlers/file/command 'nautilus "%s"'
gconftool-2 --set --type=bool /desktop/gnome/url-handlers/file/enabled true
gconftool-2 --set --type=bool /desktop/gnome/url-handlers/file/need-terminal falseHopefully other users find this through Google, because having the GNOME Panel’s Places menu launch Dolphin instead of Nautilus sucks, and this fixes it! :) (that’s a paragraph of keywords, folks)
(If you use a different file manager, replace the command as needed)
My Deinterlacing and Post-Processing Scripts
At work, we put up a lot of Flash video. I use On2 Flix Pro for the Flash encoding part. But I get the content in a variety of formats. Perhaps the most common format we get is 480i MPEG-2 video interleaved. I’m encoding on a Mac, and QuickTime cannot correctly feed the audio stream into Flix Pro because it’s interleaved in the video stream. Also, Flix Pro’s deinterlacer sucks. So, I use mplayer and mencoder to fudge the video around and deinterlace it. It’s working very well. Oh yeah, you’ll need Perian.
Read it after the break.