Advertise here!



Linux Web Server Hack - How to Write Automated Load Balancing Script!

Posted in A+Featured Hacks, Blog, Consumer, Cool, DoItYourself!, Educational, HOWTO, Hack, Web, Wordpress by max on the September 23rd, 2008 at 9:15 am

Well, I have been manually managing the dedicated server for this site for last 2 years or so but I found a better way to automate the server so it doesn’t ever go down due to overload.

One of the common problems in dedicated servers is the fact that load can go out of control and your web server along with it, causing you to hard-restart the server.

A better way to deal with this over-load problem is to shut down the HTTPD server (web server) before your server load gets to something around 2 to 5.

When the server load drops under 2, the script then can restart the server.

By doing this, you save a lot of headaches especially if you get “digged” or simply need the site up as much as possible.

Believe it or not, there’s no script that does this available free online so I made one for all you webmasters:


#!/bin/bash
loadavg=`uptime | awk ‘{print $9}’`
RESTART=”/sbin/service httpd restart”
# bash doesn’t understand floating point
# so convert the number to an interger
thisloadavg=`echo $loadavg|awk -F \. ‘{print $1}’`
if [ "$thisloadavg" -ge "5" ]; then
echo “Busy - Load Average $loadavg ($thisloadavg) “
httpd -k stop
elif [ "$thisloadavg" -le "2" ]; then
echo “Okay - Load Average $loadavg ($thisloadavg) “
pgrep httpd
if [ $? -ne 0 ] # if apache not running
then
# restart apache
$RESTART
echo “restart!”
else
echo “no restart!”
fi
else
echo “waiting…!”
fi

Save this code somewhere such as /root/checkload.sh.

Then add the following to your cron job.  (/etc/cron.d/sa-update for Fedora Linux)

*/1 * * * * root sh /root/checkloadsh

This will run the script every 1 minute to check the load and if load is too high, web server will be turned off, if it’s lower than 2 and web server is off, it will turn the web server on.

There’s a lot of things that can go wrong with your web server whether from extra traffic or whatnot, but this script will be handy and I do recommend it to anyone who’s having trouble with high-load web servers that go down often. (like this blog)

Now, go install this script, you will never have to worry about your web server dying from high load ever again.

You can also change the value of “2″ in the code to something higher such as 5 or 10, which will wait longer to shut the web server off if load goes high.

I didn’t write the code from scratch, I took 2-3 different scripts and mixed it up so here’s the resources I used for the code:

Load Average Script - This one is the main skeleton I used

Check/Restart HTTPD Script - This one I used to check HTTPD server before trying to restart it.

Cron Task Scheduler - I keep forgetting that the most left number is the minutes, darn.

NOTE - This is a simple solution to keep your dedicated server running on 1 server (like this one), if you can afford more servers, you will need to resort to load balancing the “servers”, load balancing here refers to balancing within 1 server.

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
1 Star2 Stars3 Stars4 Stars5 Stars (7 votes, average: 2.43 out of 5)
Loading ... Loading ...


Watch Videos on the iPhone while Driving!(reflected off the dashboard of course)

Posted in Auto, Cars, Consumer, Cool, Gadgets, Video, cell phones, iPhone, iPhone 3G by max on the August 20th, 2008 at 8:02 pm

Click Here to View in Full Screen Mode

Here’s a great idea for watching movies while driving using the iPhone.  Of course, if you get in an accident while doing so, don’t blame me.  I only told you that you “could”, but not that you “should” do that.

Now, it might be a good idea to use GoogleMaps on that dashboard if you don’t want to watch movies but drive efficiently to your destination.

Why don’t I feel better because he usually only uses his headset in one ear “so that I can hear the traffic and whatnot?”

via popgadget, bookofjoe

, , , , , , , , , , , , , , , , , , , , , , , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...


DIY - How to Make Ultrasonic Bat Goggles!

Posted in Animals, Audio, Consumer, Cool, DoItYourself!, Educational, Entertainment, Gadgets, Projects, Video by max on the May 28th, 2008 at 3:55 am

DIY - How to Make Ultrasonic Bat Goggles!

Click Here to View in Full Screen Mode

Here’s an interesting experiment where a Bat Goggles are used to allow the user to experience bat’s auditory cues.

Please do not wear these in hazardous environments or in traffic! These goggles are for educational purposes only and meant for controlled environments since they are intended to block your peripheral vision and regular vision so you are more reliant on auditory cues.

I am not responsible for any injuries as a result of wearing these goggles! Thanks!

Since this is based on Arduino, you could easily add a Zigbee or blueSMIRF module to interfaces these with computers wirelessly. Future work might be adding a dial to adjust the sensitivity and adding a on/off switch.

via instructables

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...


GooHack of the Day!

Posted in Consumer, Cool, DoItYourself!, Entertainment, Funny, Gadgets, HOWTO, Video by max on the May 13th, 2008 at 9:14 pm

Well, I did a search on “sleep” today over at GooHack.com and found some interesting DIY:

How to make sleep glasses so your boss doesn’t see you sleeping.

So, it’s only January and you are already sick and tired of your responsibilities. Ever WonderHowTo get out of doing the things you don’t want to do? Work, relationships,or simply driving in traffic can make you so tired that you are asleep on your feet. Not any more! Our new “Sleep-glasses” invention will shield your eyes so you can tune out and sleep the days away without anyone busting you. Enjoy! WonderHowTo.com The Video Guide For a Curious World.

Click Here to View in Full Screen Mode

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...


Video Interview at AdTech 2008 with John Chow - 18 Secrets about Blogging and the Internet

Posted in Cool by max on the April 15th, 2008 at 11:15 am

JohnChow is evil

Click Here to View in Full Screen Mode

Hi All,

I was over at AdTech 2008 today in Moscone Center, San Francisco. Guess who I ran into? Well, it was kinda planned but at the last minute, I figured to get some advice from one of the world’s top blogger, John Chow, and share some of his secrets with you.

Since he was featured on Entrepreneur magazine couple months ago and he is making $30K+ per month from his blog, I figured I couldn’t lose by asking him couple questions. And of course, share all that great knowledge with you, my readers!

I mean I have read his blog and all, but I think I learned a lot more from asking the questions I had in mind than simply reading his blog. I had a lot of clutter that was kept in my mind cleared away, thanks John!

From what I’ve heard from him today, I think I can start turning this blog into a cash-cow from what is now $1000/month to hopefully around $10K/month by next year. (Hey, Zedomax.com is getting 4000-5000 uniques per day too, maybe it’s time I focused more on RSS instead of simply traffic.)

(If you haven’t subscribed to Zedomax.com via e-mail, do it now!)

via SiteHoppin

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...


Yahoo’s version of Digg - Yahoo Buzz!

Posted in Social Networking, Web, Yahoo by max on the March 4th, 2008 at 4:57 pm

Yahoo’s version of Digg - Yahoo Buzz

Lol…it looks like Yahoo is trying to get a share of the social networking market. Check out Yahoo Buzz, it could create a lot of traffic for your site if you become a publisher.

Check out the About page, sorta very similar to Digg huh? Remember AOL try to do the same thing with Netscape? I think Yahoo would do a little better, possible better than Digg. With all the black market for Diggs, Stumbles, and what not, Yahoo could prove to be the winner in the long run.

Go Yahoo!

  • The buzz can be about anything - a great story on a major news site, an extraordinary bit from an obscure site, an intriguing video, or a fantastic blog that shouldn’t be missed.
  • Instead of editors, people like you determine the top-rated stories.
  • A story is ranked based on its Buzz Score. The score is derived from search term popularity, the number of times a story is emailed from Buzz, and the number of votes a story receives.
  • Stories with the highest Buzz Scores may be published on the Yahoo! home page - you can impact what millions will see on Yahoo!
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...


DIY Linux HACK - HOW TO optimize your Wordpress Blog, MediaWiki, or any other high load website with Compression!

Posted in Blog, CPU, Computer, Linux, Ubuntu, Web, WebApp, Wordpress by max on the February 24th, 2008 at 6:37 pm

Well, we did a lot of server hacking before with some MySQL, eAccelerator, and httpd.

There’s a lot of major blogs out there I have checked using Web Page Compression Tool that are not using compression. (For one, I checked John Chow’s blog)

Try to check one of your posts instead of checking your main URL as the tool is funky with root domains. (e.g. Check http://zedomax.com/blog/2008/02/23/never-give-up-especially-your-blog-dude/ instead of http://zedomax.com)

Here’s a screenshow of compression test I did for one of John Chow’s posts:

a

As you can see, John Chow’s blog does not use compression. As a result, he’s losing out on almost 5 times of bandwidth!!!

With level 9 compression, his site could be loaded on your web browser at 21K instead of the whopping 100K.

Now the compression might not be for all of you with slow CPUs. Our Zedomax.com runs on Quad-CPU server which has a lot of CPU processing power.

Here’s a screenshow of my server under normal load:

DIY HACK - HOW TO optimize your Wordpress Blog, MediaWiki, or any other high load website with Compression!

As you can see, most of the time, my CPU is idling at 80.8%! That means my CPU is pretty much sitting on its ass instead of doing work for me.

Now, if you have a similar situation, compression will help your site load faster and also bring your load down so you can handle more traffic.

Here’s how to enable compression if you have a dedicated or access to root on your server:

(Most servers have zlib installed, if you don’t have zlib installed, you will have to install that first, you can check it by making a test file and putting <?php phpinfo() ?> and search for zlib)

Add the following lines to your /etc/php.ini:

zlib.output_compression = on
zlib.output_compression_level = 5

and then restart apache! (of course):

httpd -k restart

Now, go check one of your posts on the Compression Test Tool here.

b

As you can see above, I just compressed one of my blog posts by a whopping 76.1%!

If you are using Super Cache plugin for Wordpress, make sure to go to options and do this too:

Enable Super Cache Compression

Now, your server will run faster since there’s less data being transmitted to your visitors, meaning you save bandwith, time, and most importantly, the ability to handle more traffic.

At 70% increase in bandwidth, that could translate to that many more visitors too as bandwidth is directly proportional to amount of time a visitor stays on your site. (Yes, I did take Calculus in college, I failed miserably before passing.) The less time a visitor takes to load a page on your blog or your site, the more time and bandwidth you have for other visitors.)

I was searching through the web for many ways to use compression for server optimization but I couldn’t find any so I sort put everything together here.

Hopefully, it helps you.

And one more thing, you can also check out this great tutorial on your httpd.conf setup.

You can always check out HOWTO decrease load on your server by 5 times also.

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...


The biggest pyramid “splog” scam in this world today - StumbleUpon =Spambleupon

Posted in AOL, Blog, Google, Social Networking, Web, Wordpress, Yahoo by max on the February 4th, 2008 at 9:34 pm

Okay, I will have to tell you the truth tonight about one of the biggest social networking sites, SpambleUpon, or most people call it, StumbleUpon.

They are making so much money off bloggers, basically StumbleUpon “scrapes” bloggers’ content and makes millions of dollars off you!  Even though no one has really “sued” them, they are in big trouble if bloggers start sueing them one by one.

Google should really ban them for “splogging”, every one of SU users’ blogs are “splogs” made up of content written by bloggers like you and me. (My traffic actually boosted after SU banned me, I think I was getting penalized for duplicate content by using SU.  Besides, don’t rely on backstabbing social networks who make millions dollars off your content and simply ban you later for “spamming”???  Are you kidding?  Go look at my DIYs, they are all original.  Lol…at least my blog isn’t full of splogs.  Here’s a post you can read about how to protect yourself against splogs although it won’t work with SU.)

Why?

Well, every “blog”, they say, is a “splog”, every image consisting of an image scraped off a “copyright protected” blog (Mind you, every “blog” is actually naturally protected from scraping, this site has about 10 other sites’ images w/o their written permission) . So, we simply took at the most top-left blog on their “Top Stumbler” list.

Well here it is:

SpambleUpon

As you can see, the image is “scraped” off another “original” blog. If you go to any of their “splogs”, the results is the same. They almost store 0% of their “splogs” images on their servers and simply scrape and live off other blogsSU is like a real big mosquito that lives off your blood, your blog post that “you” wrote and uploaded images. Their future will only rely on other bloggers’ content and NEVER their own.

So, what can you do?

You can always file a “copyright enfrigement” notice and lawsuit to SU, which their headquarters addresses I couldn’t even find, AND uninstall that hideous toolbar that takes too much of your life, time, and 50 pixels of height on your browser. (Most of their admins are “fake” people behind stupid 50×50 pixel images. They “pretend” they created a special technology when I could re-create a similar service within days.)

Then, simply head over to SiteHoppin, where every site is not “splogged” and is simply “bookmarked”.

Okay, here’s the 5 second wrap up:

1. Every blog on StumbleUpon is a “splog” made up of scraped images and text from other blogs

2. The only reason they don’t get sued is because they send websites traffic and a lot of website owners are happy about that.

3. Every blog in the world has now a “copyright enfringement” against SpambleUpon. If your content is on SU, you deserve the right to sue them for scraping your content.

Now, we don’t have to sue them. You do. So, in all, just stay away from these SpambleUpon guys and stick with the American Dream, SiteHoppin, where “real” developers develop w/o scraping bloggers’ content.

Now maybe we may be a little bitter but at least we fight for our right to be conscious about the “real truth” behind everything. Yeah, SU fucked up this time bad….real bad…let the truth be known even if you do continue to use SU, you will remember this when you get banned.

Here’s the address to send your copyright infringement letters about their “Splogs”: (This is the only real contact info you can find on their site baby)

StumbleUpon, Inc.
Attn: Copyright Agent
StumbleUpon, Inc.
140 Second Street, 3rd Floor
San Francisco, CA 94105
phone: 415-979-0640
fax: 415-896-2600
email: copyright AT stumbleupon.com

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...


SiteHoppin’ hops like crazy over BlogRush in pageviews!

Posted in Business, Web by max on the January 26th, 2008 at 10:33 pm

Wow, check this out:

SiteHoppin’ hops like crazy over BlogRush in pageviews!

Remember our post on why SiteHoppin’ will exponentially grow and BlogRush will die? Yey, today we proved it.

We are still behind in numbers of reach but we are not too worried, we got some new features that will hoppity go hoppin’ crazy a little more. :)

Anyways, thanks for everyone who has been hoppity hoppin’ and supporting zedomax! :)

, , , , , , , , , , , , , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...