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!
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.
Wait, how do you get mplayer and mencoder on a Mac? mplayer is included in MPlayer OSX. Show Package Contents, Resources, External_Binaries, mplayer, Show Package Contents, MacOS, and bam, your binary for mplayer is in there. mencoder, on the other hand, is hard to find. I ended up using ffmpegX’s mencoder, which is “MEncoder dev-CVS-060307-04:23-4.0.1”, compared to my mplayer which is “MPlayer dev-SVN-r25648-4.0.1” and way newer.
First, I have to strip the MP3 audio stream and the MPEG-2 video stream, into separate files. I have my video rips folder set up with a “scripts” subfolder and a “work” subfolder. Here is my script to dump both streams:
#!/bin/bash
# Takes $1 and dumps it into two files in work/
./scripts/mplayer "$1" -dumpvideo -dumpfile work/dump.m2v
./scripts/mplayer "$1" -dumpaudio -dumpfile work/dump.mp3Next, I run cropdetect, which is a stupid script to save me typing:
#!/bin/bash
# Runs crop detect on the stream we dumped.
./scripts/mplayer work/dump.m2v -vf cropdetect -vo null -ao nullNext, I run a deinterlacing and cropping filter. And postprocessing maybe, but I’m not even sure if it works in mplayer like it works in mencoder. I’m sure the latest mencoder can let me combine this step with the next one. But as it stands I need to do this in two steps.
#!/bin/bash
# Takes work/dump.m2v and applies the crop in $1
# and deinterlaces, outputting to work/dump.deint.yuv
./scripts/mplayer work/dump.m2v -vf crop=$1,pp=de,yadif=0 \
-vo yuv4mpeg:file=work/dump.deint.yuvFinally, I put both streams together, doing final postprocessing. I also convert it to HuffYUV because QuickTime can play it with Perian. Again, I think the latest mencoder has the yadif deinterlacer, which would let me combine the previous script and current script in one step. BTW - A/V sync gets off if you leave out harddup.
#!/bin/bash
# Takes files in work and compiles them into work/output.avi
# $1 if specified is a list of additional filters to apply.
if [ "x$1" == "x" ]; then
./scripts/mencoder work/dump.deint.yuv -noskip -vf harddup,pp=de -ofps 30000/1001 -ovc lavc \
-lavcopts vcodec=huffyuv:format=422p -audiofile work/dump.mp3 -oac copy -o work/output.avi
else
./scripts/mencoder work/dump.deint.yuv -noskip -vf harddup,pp=de,$1 -ofps 30000/1001 -ovc lavc \
-lavcopts vcodec=huffyuv:format=422p -audiofile work/dump.mp3 -oac copy -o work/output.avi
fiAlso, if you noticed, the previous script lets me specify additional filters on the command line if I want. Usually I have to run hqdn3d, but not always.
Oh, and this will use about 1 GB per minute of content, times two because it’s creating an uncompressed file twice (the final AVI and the intermediate .deint.yuv). Don’t run yourself out of disk space! :)
Windows + Apache + SSPI + SSL + NTLM + IE + POST data got you down? 1
For some reason, when using NTLM authentication on Apache through the mod_auth_sspi module (combined with SSL, but that might not be a requirement), Internet Explorer will refuse to send POST data along with a request at random points in time. It will still send a POST request, but it just doesn’t send data.
This seems to only affect IE users on domains with Integrated Windows Authentication (IWA). My CrossOver-emulated IE6 works fine with Basic authentication over the secure site we have set up doing IWA (of course I have to type in my credentials). But my Windows machine authenticating using IWA drops POST data!
After tireless Googling, I think I have a solution. It sucks, but it’s the best I can do. Suggestions welcome:
SetEnvIf User-Agent ".*MSIE.*" ssl-unclean-shutdown
MaxKeepAliveRequests 1What this does is for MSIE, it tells mod_ssl to uncleanly shutdown. And it makes KeepAlive/HTTP Pipelining on, but only for one request. With KeepAlive turned off, IE doesn’t work at all. It gives a “Page Cannot be Displayed” error… probably because it’s attempting to NTLM authenticate, lost the socket, and dies.
What’s this mean for everyone else that follows the rules? They don’t get any benefit from HTTP pipelining. Which totally sucks. So hopefully you don’t have this problem…
Lockdown browsers are fun! 2
(code is past the break)
# Need: Ruby, this browser,
# and SysInternals Process Explorer
# Start Process Explorer, configure for always on
# top and only allow single instance, close it.
require 'win32ole'
BROWSER_PATH = ""
PROCEXP_PATH = ""
puts "Starting the lockdown browser"
shell = WIN32OLE.new('Shell.Application')
shell.ShellExecute(BROWSER_PATH, '', '', 'open', '1')
puts "Giving the lockdown browser time to breathe..."
sleep 10
puts "=> Ctrl-C to stop <="
while true do
shell = WIN32OLE.new('Shell.Application')
shell.ShellExecute(PROCEXP_PATH, '', '', 'open', '1')
sleep 20
endI’m posting this because that browser frustrates me. I have to boot into Windows to use it. This makes me feel better about having to use it. Cheating or doing anything that might get you or me in trouble is a bad idea.
Plus, if you can figure out this program, you probably feel my pain :)
LG Vu (CU920) Hacks 44
I recently purchased an LG Vu, and I’m always into making phones operate like I want to, remove all of the built in crap, and so on. If you read the rest of this post, I’ve got tons of stuff that I’ve been working on. It all requires BitPim, which I just emerge‘ed in Gentoo. Install it however you need to. You have to tell BitPim that you have an LG VX-8700. I will leave it as an exercise to the reader to know to back up the files on their expensive piece of equipment before altering them…
1. LG Java Security Hack
This hack is the same on most every LG phone. Use BitPim to browse to /LGAPP/Media/Java/cert/. Save the .pol file in that directory. Open it in your favorite editor and find your provider’s “Trusted Root CA” in the list of domains. It’ll look like a LDAP distinguished name because that’s what it is. Copy and paste all of the lines in that section, and paste them on top of the lines in the “domain: untrusted” section. Put that file back on your phone and you will be able to use all new applications without constantly authorizing network access. Currently installed applications will have to be reinstalled!
2. Remove Demo Applications
Browse to /LGAPP/Media/Java/ams/. Delete all of the Mxxx directories (for me, I stopped at M0012) and _folder_db_. Then, reboot the phone. Thanks to this forum for this tip.
3. Edit System Menus
Since I had just deleted Mobile E-Mail, I needed to get it off of the main screen or it would bug me. This turned out to be easy. Browse to /LGAPP/Media/Flash/ and download T1_en-UK.xml and T2_en-UK.xml. Open them in your favorite editor and remove the “Mobile E-Mail” item. You can delete but not add menu items. You’ll have to reboot the phone to get it to reload the menu.
4. More
I’ll be updating this blog post as I figure more stuff out about my phone.
Random Tip: Stuck Oil Filter 2
I change my own oil, not because it’s cheaper, but because then I know what kind of work goes into it, and if there are other issues I need to be aware of. So I was out there and got to needing to get the oil filter off. It’s a no-go. It won’t come off. I tried everything. I tried three filter wrenches, a pair of huge channel locks, nothing helped. Although the channel locks did severely warp the can. Which actually looked kind of cool. So then I used my computer smarts… When there’s something wrong with my computer, what do I do? Google it! One of the first things that came up was a link to Jim’s Garage. Apparently, and I would have never thought of this, but if you get a really long screwdriver and jam it into the can and hammer it in all the way through, your oil filter just got a nifty handle. So keep that in mind if you ever get into that kind of situation. Though you might want to hammer slowly until the oil gets out of the filter, or you’ll have a nasty mess.
So, maybe that’ll help someone :).
Wii Homebrew Channel + Case Is Here 3
Also, my Evolve Black Katana case is here. It’s pretty cool looking, but the paintjob looks just a tad better than something I could do myself. It’s still pretty good. I give it 3 out of 5.
Super Smash Bros. Brawl + WiiKey = Bad Medicine 5
I bought Super Smash Bros. Brawl. I expected it to run on my drivechipped Wii (chipped for homebrew btw). Well, it’s the first Wii game that’s dual layer, and the WiiKey incorrectly assumes that all dual layer discs are GameCube multi-game discs. Great assumption, as it was true. Now it’s not. And unfortunately, WiiKey’s Website is showing the default RHEL test page and apparently has been for some time now.
Shit.
So Googling around, I found out that the WiiKey is compatible with the OpenWii firmware. Great! Except the sucky part is that OpenWii requires programming the chip directly rather than using a DVD. Not that big of a problem, I guess. The biggest problem I’m going to encounter in swapping my WiiKey to run OpenWii is the fact I have to solder on SMD chips and I don’t have good enough magnification (I could probably use a jewelers magnification thingy). Also my soldering iron tip is quite large and my soldering iron doesn’t really have a selection of bits for it with a finer point than what I have. Meh. Also I have to take apart the Wii again, which is an adventure in itself…
So… What am I going to do? I could just desolder the WiiKey and say “screw it”, but that defeats the purpose of it (especially since huge strides have been made in homebrew). So, I think I’m going to do this:
- Using this guide I’m going to rewire my WiiKey (yes, I’ll take pictures) and put a port on the back of my Wii which will connect to a modified parallel port cable.
- While I have the Wii open, I’ll take it apart the rest of the way and put it in a new awesome case.
- I’ll also install a switch on the Wii so that I can turn off the modchip if needed (this switch would be required because the diagram shows that the WiiKey requires power from the parallel port during programming, and I don’t want the possibility of shorting the Wii - so I’ll probably install two switches, one for programmer power ON/OFF and one for DVDROM power ON/OFF). This will avoid this problem from ever occuring again.
Though, like an idiot, I “quicksoldered” the thing to my Wii. In hindsight, it would have been faster to actually use wire, since I ended up tearing a trace off the drive and had to solder to the actual drive chip (luckily the “debug port” pins that were left on the drive are just shortcuts to the pins on the actual chip).
I’ll keep everyone posted with updates.
The Apple Cinema Display Saga (part 2: Take-Apart Guide) 8
If you missed part 1, you should go back and read it, so you understand why I’m taking apart such an expensive monitor.
Before I cut the end of the cable off, I wanted to know what I was working with. Maybe the cable was simple to replace. Maybe it was something that I could easily find. By following this take-apart guide, you’ll see, the cable is really simple to remove. The Mac mini and Nintendo Wii are much more difficult to open up (though not really that hard).
But a word of warning: After I took apart the monitor, and saw how easy the cable was to replace, I tried to locate one on the Internet. Nobody sells one. So, I went to an Apple store. Evidently, even though the monitor is easy to service, they send the monitor back to China and have the underaged children with small hands refurbish my monitor and they send me another refurbished one. There is a $120-$200 cost for this. Unless, of course, you take it apart first, in which case the refurbishment charge is $800 (for those keeping score, that’s $300 more than I paid for it). Even though the monitor is not under warranty, taking it apart is one of the Seven Deadly Apple Sins. So, don’t do it if you’re in the same boat I am. Unless you have a cable already, in which case, let me know how you got it! :)
So, anyway, on with the guide.
Tools
You’re going to need Allen wrenches. Just get a set. You’ll use like two or three. You’re also going to need a good Torx set. The smaller ones. I ended up using my Console Access Pro Toolkit because my other Torx set didn’t have a Torx bit small enough. You’ll also need a #1 Philips screwdriver, and another Philips screwdriver that is much bigger. The screw is weird though, I couldn’t get it to turn with any of my bigger Philips screwdrivers, so I ended up using a big flathead screwdriver to turn it. You’ll also need a knife or this same flathead screwdriver for prying purposes, and it would really help if you had a magnetic probe. You can get one at AutoZone at the counter where they sell the M&Ms and tire gauges, and you will learn to love it. Perhaps more than yourself or the Weighted Companion Cube.
You might also need a couple pairs of pliers to seperate connectors, but I didn’t (I did on my Nintendo Wii, however).
The Guide
You’re going to start with this:
From there, you need to take the white side panels off. To do this, grab your knife or screwdriver and use it to pry up the white panel from the top. They’re glued on with really strong glue, but if you open them like this, you’ll get them off (pull gently, but don’t be afraid to use a little force!):
On the side of the display with the power button, you’ll have to unplug a small cable. I just pulled the cable out of the socket since I could pull by the connector easily. If you cannot, use pliers. Do not pull by the wire!
Next, remove the base. It’s really rather simple, so I didn’t take pictures of it. Remove four Torx screws from the part of the base where it meets the monitor (you have to look for them a little). Then, you have to remove the big screws on the sides of the base that open with Allen wrenches. They’re silver. Can’t miss them.
After that, you’ll need to remove all of the little screws on the sides of the monitor. Not the two or three bigger ones - don’t mess with those yet.
Next, pull up on the bracket you just unscrewed and remove it. Then remove the topmost big screw on the sides of the monitor (top in relation to the monitor).
You’re almost there! You need to release these.. levers.. that hold it all together. Use pliers, a screwdriver, your finger (if you want it to hurt), or something else to pull the levers. They don’t come out very far. Here’s what they look like:
There’s one on both sides, by the way.
You’ll need to disconnect the status LED. The connector is taped to the screen, remove the tape and disconnect the connector.
Finally, use gravity to your benefit, and ease the screen out of the aluminum casing. You will have to feed the cable through the hole in the back, and you can’t do it at an angle (the screen will only slide out exactly vertically). You’ll end up with this:
From here, remove the tape and unplug the cable, if that’s what you took it apart for. You’ll probably want to mark what went where, just in case.
But, again, remember that even if you have no warranty, this will not be good if you need to order parts and aren’t an Apple Authorized Service Provider…
Liked this story? Digg it!
Older posts: 1 2







