hack
Videos Freezing After 2 Seconds
Posted by HokieTux on January 22, 2009 in Hacks
Two work-arounds in one day!
Today, my Flash player seemed to stop working while trying to watch a YouTube video. It would play two seconds (without audio), and then freeze. If I skipped ahead in the video, it would simply play the next two seconds (again, without audio), and freeze.
Googling around, there are a bunch of fixes including re-installing Firefox, deleting & re-installing Flash, and a few others even more drastic including re-installing all media codecs.
I’m still not sure what the problem is, but I think it is in Firefox. All I did to fix it was completely close firefox (I even issued a $ sudo pkill firefox to make sure), reopen Firefox, and told it NOT to reload tabs. Sure enough, video playback was fixed.
If anyone has more information as to what is causing this, please post it!
Firefox version: 3.0.5
Cheers!
Xorg 1.5 & Device Detection
Posted by HokieTux on January 22, 2009 in Hacks
Apparently the Xorg developers have added some sort of device autodetection in one of the recent releases of Xorg server v1.5+
Unfortunately, this seems to be breaking a lot of system configurations – mine included. I have been using HAL and evdev to detect and configure my system input devices, and as soon as I updated xorg to the new release things started breaking. If you are experiencing any of the following:
- Wrong keyboard layout / keymap
- Xorg freezing on startup
- Black screen
- Mouse won’t respond
- Keyboard doesn’t respond
- Mouse actions seem to be really, really sped up (this is a strange one, and seems to only happen in composite window managers)
… then this might be your problem! Here’s the fix:
Head to /etc/X11/xorg.conf, and find the “Server Flags” section. If for whatever reason you don’t have a “Server Flags” section, add it just under the “Module” Section. Now, add the “AutoAddDevices” “false” option (ignore the “Xinerama” option – that was put there by nvidia-xconfig):
Section "ServerFlags"
Option "Xinerama" "0"
Option "AutoAddDevices" "false"
EndSection
Hold onto your helmet and restart X11 – hopefully, things work.
If you are still having problems, feel free to post here and I’ll help if I can!
Cheers!
HowTo: Fix OS X’s self-assigned IP Problem
Posted by HokieTux on August 4, 2008 in Hacks
I recently came back to my old man’s place for a couple of days before we headed out on a vacation, and quickly discovered that my Macbook wouldn’t play nicely with his wireless network. My sister has an iMac that she struggled to make work with the wireless, but had forgotten what she had done to get it up and running.
The issue was that when I connected to the network, I had no actual internet access. I had an IP, and I could ping the router, but I couldn’t get anywhere else. Looking in network preferences, it said:
Airport has a self-assigned IP address and may not be able to connect to the internet.
I spent a good amount of time searching around online and digging through forums for a good fix. There seem to be a lot of different solutions out there, each of which work for a small percentage of the people with this problem.
The fix that ended up working for me was thus:
Add a ‘$‘ to the beginning of the WEP password.
No joke. I deleted the wireless network from the Airport preferences, reconnected to it, and prefaced the password with a dollar-sign… and it worked.
I hope this fix works for someone else out there with this problem. I also hope that Apple gets their shit together and fixes their broken network stack. OS X’s networking stack has always been weak, and Leopard was supposed to change all of that. I love my Mac, but come’on Apple – you can do better than this.
Helpful Threads If This Didn’t Work:
- http://forums.macrumors.com/showthread.php?t=429435
- http://discussions.apple.com/thread.jspa?threadID=1111788&tstart=0
- http://ryanjbonnell.com/journal/self-assigned
HowTo: Alpha Centauri on Linux
Posted by HokieTux on July 21, 2008 in Guides, Hacks
For the unacquainted, Alpha Centauri is one of the most acclaimed turn-based strategy games of all time. Released in 1999, it revolutionized strategy gaming and is still considered one of the best games ever made (look at any top 100 games of all time list, and you will likely see AC appear).
Before they shut their doors, Loki Software ported Alpha Centauri and it’s expansion, Alien Crossfire, to the Linux platform. Unfortunately, due to some library compatibility issues, the old release of Alpha Centauri will no longer work out-of-the-box on Linux. I discovered this when, feeling somewhat nostalgic, I decided to install it and fire it up. After a lot of searching and tinkering, I got it up and running almost perfectly. I still experience a little buzzing in the sound… but otherwise it’s excellent. Here is what I had to do to get it up and running:
Installing Alpha Centauri Planetary Pack
1) Obviously, make sure you have a copy of Loki Software’s Alpha Centauri Planetary Pack (ACPP) for Linux. These haven’t been in production for years, and are nearly impossible to find on the web. Indeed, I’ve seen them sell for hundreds of dollars on eBay… so if you don’t already have one (and since I’m in no way recommending any sort of illegal activity), you are probably shit-out-of-luck.
2) Install ACPP by running their installer script. When asked if you want to install the Loki Updater, say no (it doesn’t work). You will also be asked if you want to install the Loki Uninstaller… I haven’t tested this, so I have no idea whether or not it works. I’m not sure why it wouldn’t, but why bother? AC is bloody awesome. Also, make sure you install all content so you don’t need to have the CD in your machine to play (this came before all that shitty anti-piracy software).
3) Install the smac-6.0b-x86 patch. You can find it here: http://filebox.vt.edu/users/bhilburn/Public/smac-6.0b-x86.run. Just download it, set the executable flag with:
$ chmod +x smac-6.0b-x86.run
And then run it (as root):
# sh smac-6.0b-x86.run
4) Next, you will need to download and put the ‘Loki Compatible Libraries’ somewhere where AC can see them. You can find them on the Gentoo wiki, or here is a direct link: loki_compat_libs-1.3.tar.bz2. Unless you changed something, ACPP likely installed to /usr/local/games/smac. I recommend putting the ‘Loki_Compat’ directory that comes out of that tarball in that directory so you don’t lose track of it. So, for example, do:
$ tar jxvf loki_compat_libs-1.3.tar.bz2 # mv Loki_Compat /usr/local/games/smac
5) You likely need to change the ownership of your personal Loki directory since the installer likes to install it with root as the owner. This should do the trick:
# chown -R <your username> ~/.loki
6) Now, you can’t run the game…
HowTo: rtorrent & SSL certificates
Posted by HokieTux on July 13, 2008 in Hacks
Since Comcast decided to shove their heads up their fourth point-of-contact and muck with all torrent traffic (apparently not realizing that there are many legitimate uses for the protocol despite what the MPAA/RIAA would have everyone believe), using HTTPS announces with trackers has become a necessity if you are stuck with Comcast as an ISP. Unfortunately, getting this running with many clients isn’t always as easy as it should be. This post will focus on getting SSL certs working with rtorrent.
I’ve now run into problems with SSL certificates and rtorrent twice, and it has been a little different both times due to changing versions of rtorrent and the libraries it depends on. The first time I hit a problem, the error message was:
Peer certificate cannot be authenticated with known CA certificates
The second time, the error was:
problem with the SSL CA cert (path? access rights?)
Regardless, the fix was mostly the same. First, you need to get the SSL certificate from your tracker. You can use this bit of code to do the job:
# openssl s_client -connect <your tracker.com>:443 </dev/null 2>/dev/null | sed -n '/BEGIN CERTIFICATE/,/END CERTIFICATE/p' >> /etc/ssl/certs/ca-certificates.crt
You will need to put that all on one line in your terminal. Also, remember to replace <your tracker.com> with the base URL of your tracker. Also, if you run into an error where ca-certificates.crt doesn’t already exist, just use one ‘>’ near the end of that code line instead of ‘>>’ (the difference being that ‘>>’ appends to an already existing file, and ‘>’ will create the file).
Now, you need to rehash your certificates. Run:
# c_rehash
from your /etc/ssl/certs directory. You should be all set now. Verify that everything is working properly using curl:
$ curl -I --capath /etc/ssl/certs https://your_tracker.com
The next time you fire up rtorrent, you shouldn’t have any problems. If you do, then try starting rtorrent like this:
$ rtorrent -o http_capath=/etc/ssl/certs
If you still have problems, post a comment here and I will try to help you out. If you use Arch, you can also post there. Here are a couple of threads you might find useful:
- rtorrent error & ca certificate
- rtorrent certificates problem (this is actually a thread I started the first time I had the problem)
Thanks to the fellow Arch users out there (especially those in that first thread) that helped me figure this out, and happy torrenting! Cheers!