speed up firefox

Alot of people I know dont like firefox because its slow. after following my insteructions here, firefox will be anything but slow:

  1. Type "about:config" into the address bar and hit return. Scroll down and look for the following entries:

    network.http.pipelining

    network.http.proxy.pipelining

    network.http.pipelining.maxrequests

    Normally the browser will make one request to a web page at a time. When you enable pipelining it will make several at once, which really speeds up page loading.

  2. Alter the entries as follows:

    Set "network.http.pipelining" to "true"

    Set "network.http.proxy.pipelining" to "true"

    Set "network.http.pipelining.maxrequests" to some number like 30. This means it will make 30 requests at once.

  3. Lastly right-click anywhere and select New-> Integer. Name it "nglayout.initialpaint.delay" and set its value to "0". This value is the amount of time the browser waits before it acts on information it receives.

    If you're using a broadband connection you'll load pages MUCH faster now!"

I love “myisamchk -r”

This weekend I had some major problems with my web server. Here is a brief log of events.

Saturday 07/16/2006

  • 3:00pm: I try to go to one of my sites, "can not connect to database". It seems that all of the connections are in use. Weird. I check the server… 500 open db connections? I reboot the mysql server, things seem like they are working.
  • 4pm – 5pm: I go out to eat with my friends. Using my phone, and a ssh client, I check the database server, things seem to be ok. (damn im a nerd! im checking my linux database sever via ssh on a cell phone!)
  • 6pm – 7pm: mysql server still running. I look at the message board on notopular.com, "database error". After doing some research, I realize that the harddrive that the databases sit on is 100% full. Not good. Looking at the files, there are a ton of error logs that have been generated. I clear up some room on the drive, reboot the sql server. Sweet now I can write to the DB again.
  • 8pm – 10pm: Looking at my message board, "Cannot connect to DB", some more research, I realize that some of the tables for the forums application are corrupt. great. I break out the good ol' "myisamchk -r" command and get to work. A bunch of the indexes are totally hosed. After everything is done running, I can connect and view the database, I back everything up.
  • 12 midnight – 4am: I check the message boards again. I can view everything, but I cant post to the forums! the table that contains the message text (a HUGE table, 670,000+ records) has something wrong with it, I cant write to it. Again i break out "myisamchk -r" but i get an error. "Please use the -o flag, -r can not repair this table". CRAP! I need this table! its the guts of the message boards!. I know that the -o flag is going to take a while, so I bring down the apache webserver to gain some CPU power, and then run "myisamchk -o" on the table. I figure out how long its going to take… so I reniced the process to turbo charge it, and cut down on the time… by cutting down on the time, I mean its only going to take 3 hours to run!
  • 4am – 5am: The rebuild of the table indexes has worked! All of the records were salvaged! I bring the webserver back up and start checking. Everything is looking good. Back up the database locally and offsite.
  • 5:30am: the sun is coming up. im going to bed.

All in the night of a developer/webmaster/systems administrator

Using PHP and Math To slow down spammers

If you read my blog, you might have noticed a LOT of spam in the comments of the posts. I was getting 100+ a day. Getting you blog on the front page of Digg.com will do that I guess. I got tired of all the spam, so I had the server email me a copy if the comment to my T-mobile MDA phone, If I saw the post was spam, I could kill it right away. This got old because I was getting an email every 5 – 10 minutes, way more then I cared to check.

I know that captcha systems help with keeping spam robots out, but at the same time I find them hard to use so I didnt want to put one up. Also, many spam bots look for captchas and can read them now! I thought there had to an easy way to handle the problem.

Step 1
Rename the file that your form posts to. This will break many of the bots and help cut the spam for a little while.

Step 2
Using some simple php, I decided to make users answer a very simple random math problem before their post could be saved. Here is some sample code on how I set it all up.

click the thumbnail images for a larger view of the code

form.php
form.gif

process.php
process.gif

I realize that there are most likely better ways to solve this problem, like having the random numbers be displayed in images that are dynamically generated, and I will do that If this menthod fails. For right now it seems to be working. I hope that it works for you.

DOWNLOAD THE SOURCE CODE

MythTV vs. MCE 2005 : A fight to the death

I have been running MythTV (knoppmyth) since June 2005. It rules. It was tricky to get set up, I was rusty on my Linux admin skills, its been years since I really used it. There were a few things about myth that I wasn’t really into, but I lived with.

  • couldn’t get my 802.11g nic card to work in Linux
  • I had a hard time playing video files over the network from my windows 2000 computer up stairs
  • Couldn’t get the build in media player to play work that well (mplayer)
  • NES emulation wasn’t that great
  • Hard to get the Hauppauge 350 remote to work
  • I had to hard time redirecting the output of the media player to the Hauppauge 350 audio out
  • Difficult redirecting the output of the computer to always go to the TV

I’m not complaining, it was fun to figure this stuff out. It took a really long time, and some of it I never
really figured out. My MythTv setup was awesome for recording TV. I’m proud of it, and I love it.

Earlier this month a guy at my work is a Microsoft die hard (he runs a .Net developers group) he got me a demo copy of windows media center 2005 to check out. I figured what the hell, I had some extra money (my wife just started working as a registered nur$e), I'll build a fairly simple MCE box and put it up against my mythTV.

To make this interesting, I decided to make this interesting, After install and testing, the winner computer stays, the losers OS gets flipped. I was willing to put my myth system on the line and check it out against "windows media center 2005 roll up 2" (damn that’s a long name).

Here is the cheap machine that I built for the MCE

  • ECS P4M800-M7 Motherboard
  • Intel Pentium 4 511 Processor (2.8 ghz)
  • 1 gig DDR400
  • pny GeForce 6200 (crt, dvi, s-video, component)
  • Hauppauge WinTV-PVR-150 MCE-Kit (tv tuner + MS remote)
  • A random left over 20 gig IDE Maxtor hard drive
  • A stray IDE-to-SATA adaptor
  • A spare dvd drive rom drive
  • A dusty old computer case in my garage

So for about $400 and some old parts I hacked together an ugly machine, but hey it booted, and that’s what counts.

Installing:

Windows MCE 2005 is a full install of windows, so it took a while. Much slower then installing knoppMyth (it took me 15 minutes to get knoppMyth installed the first time). WINNER knoppMyth

Set Up:

knoppMyth required me to signup with a company called zaptoit.com to get a channel listing. The software didn’t tell me to do this, I had to find out about it through message boards and a wiki. MCE asked me my zip code, then it asked what cable company I had. Then it programmed my tuner, and downloaded the TV listing guide.
WINNER MCE

Remote Control:



The mythTV uses a Hauppauge 350 remote, which isn’t bad. The MCE uses the Microsoft 2005 remote. The Microsoft controller wins hands down. The shape of it is much nicer, its balance is good. The mce receiver seems better then the 350 receiver. The mce remote also has dedicated buttons for jumping around in the mce application, there is also a button to launch the mce application if its not running or is minimized. I wish all my remotes were this nice.

WINNER MCE

Live TV:

I’m going to give this one to myth for ease of set up, but overall go with a tie. To get the MCE running, I had to download a mpeg 2 decoder. That was pretty painless, but I had to dig through some websites to figure out why the hell it wasn’t showing TV. The mythTV was great because I was using hardware based decoding that came with the pvr-350 TV tuner. Once I got MCE up and running, there was little difference between them. MCE did change channels faster then the myth though.
TIE

Recorded TV:

I like the myth interface for showing what shows I have recorded, but I like MCE better for setting up recordings. MCE has an option that allows you to start the recording a few minutes early and end it a few minutes late, WHEN AVALIABLE, just to make sure that you get the whole show (some times channels don’t start and stop exactly on time). If you have 2 shows back to back, it won’t record the overhang. If you have any overhang on the myth, it will report a conflict, and not record the second show. This has bitten me several times with the myth
WINNER MCE

Video Files:

I’m going with MCE on this one. It plays wmv, mpg, and avi files without any trouble. To get QuickTime working, all I had to do was download the QuickTime alternative and change one registry key. Now basically any video file I throw at it plays full screen and looks great. Myth on the other hand, I had a hard time getting videos to play. wmv files and avi still look like garbage. I had to modify a bunch of things to get the video and audio to play through the pvr-350, only to marginal satisfaction.
WINNER MCE

Audio player:

If you’ve seen one, you’ve scene them all. There isn’t a huge difference in these.
TIE

Interface:

MCE looks a lot cleaner then myth. If anything, Myth tries to copy MCE in many aspects but falls short. Something that MCE has that myth does not is the ability to shrink down the video that is currently playing, and continue to navigate through MCE, until you select something else to watch. Its just more polished and refined. It looks better when its up on your screen.
WINNER MCE

MCE Bonus Features:

"movies": MCE will look at the guide and see what movies are currently playing across all the channels that you get. It goes out to the internet and pulls down artwork and a synopsis of the movie. This is an awesome and impressive feature in my opinion. You can then watch, record, or drill deeper into information on the movie. You can see what actors are in the movie, you can see what other movies they were in, you can see when those movies come on, and set up a recording for them.

MythTV Bonus Features:

"games emulation": I loved the fact that I could play all of my old NES roms. The emulation was a bit slow and laggy, but it was awesome to play them again. I didn’t use this feature as much as I anticipated.

The Winner in My Eyes:

OVER ALL WINNER : MCE

Based on my experience of running knoppmyth next to MCE 2005, I'm going to have to go with the MCE as the over all winner. It’s not often that I back a Microsoft product over an open source project. What can I say though? Microsoft has done their homework and has put out a pretty solid application that does what I want it to, in a clean way that even my wife can use. Hopefully in time as mythTV matures and grows, I will switch back to it. Until then I'm going to run stick with my Windows MCE 2005

L 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99

To most of you out there, the above string of numbers mean nothing, to me, and the others who find this post through search engines, this is a horrible thing to see on your computer screen. but I have found a fix for it, so don't worry!

In my living room I have a machine running windows MCE 2005. I like it. After installing some patches from Microsoft and doing some minor work to the computer, It started acting funny. The TV output would flicker, so I would have to reboot the computer.

When the computer was booting, after the POST, I would get "L 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99" on the screen, and the computer would halt. What an awesome and useful error message!

I found a temporary way around the problem. During boot, I could go into the BIOS, and hit "save and exit", and I was good for one boot. But that's not a solution, that's a hack!

After looking around online, I found that the problem comes from a damaged Master Boot Record (MBR). It can be fixed by booting up from a Windows 2000, or Windows XP CD, going into the Repair Console, and running the "FIXMBR" command.

After I did that, I was able to boot up like normal. I fixed my MCE video flicker problem by updating my NVIDIA Drivers. It feels good to figure things like this out; it makes me feel like I'm actually winning, for a change.