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

Fix your ipod by spanking it?

Follow me on twitter for more great tips. CLICK HERE – twitter.com/JoshHighland

Its common knowledge that you dont want to drop / slam / or hit your expensive electronics, you might break them. Well, what if your expensive electronics is already broken?

I’m writing this in response to the hundreds of comments I received on my blog post about replacing a broken ipod hard drive.

It seems that there is a very unconventional way to fix your broken iPod, without having to open it or spend any money…. beat your ipod up! You heard me right, Slap your iPod!

How to do this:

Hold your iPod so the screen faces the palm of your hand and slap the back of it a few solid times. That’s it.

I personally haven’t tried this, but based on the response to my previous blog post, its worked for over 100 people so far.

Why does spanking your iPod fit it?

Here are a few of my thoughts on why this might work.

  1. Your iPod might have stopped working if the hard drive connection came lose. Slapping the iPod might jar the connection back into place.
  2. The hard drive arm might have gotten stuck for some reason. Spanking the iPod might free up that hard drive arm.
  3. It might just be magic!

I really don’t know why it works but I guess it does. If you have any experience with this post a comment.

Follow me on twitter for more great tips. CLICK HERE – twitter.com/JoshHighland