BagWhiz,一個袋子Blog關於豪華提包發射了!

Yey,我們發射了另一blog從我們 Zedomax Blog網絡 叫 BagWhiz一blog關於豪華提包。
為什麼?
很好,袋子是一個偉大的適當位置為blogging,您可能聞悉我的適當位置blogging的戰略在我 Adsense優化Blog在這. 我寫着短期叫的一本書, 「如何掙金錢與Adsense和Blog網絡」,因此提防那。 我應該賣它為少許金錢或為自由給它作為e書。
我是否是袋子上癮者?
噢沒有,但我做了這blog為袋子上癮者。 如果您是袋子上癮者,請檢查我們新的blog并且按書簽它或至少告訴您的女朋友對此。
BagWhiz一blog關於豪華提包和袋子回顧,通過我們的blog網絡發射。
您將發現有趣的材料像 教練袋子, Fendi袋子, LV袋子和更多。
您能也發現為時10崗位聚焦袋子Blog或中的任一我們的其他blogs在這頁底端。 (方式在底部!)
如何掙金錢與adsense, interesting stuff, Make Money Online, optimization, Web, Wordpress, writing a book
Linux Web Server Hack - How to Write Automated Load Balancing Script!
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.
Google Chrome Tips and Hacks Re-cap #3!

If you haven’t been following our latest Google Chrome Tips and Hacks, you will need to check out the following two posts:
Recap of Google Chrome Tips and Hacks #1
Recap of Google Chrome Tips and Hacks #2
Here’s the re-cap of Google Chrome Tips and Hacks #3:
Chrome Tips - How to install Greasemonkey scripts in Google Chrome - This is a simple howto for enabling your Greasemonkey scripts from Firefox.
Firefox Hack - Chromi Fox Theme for Firefox - You can install the Chromi theme for Firefox to make your Firefox look like Google Chrome browser.
Google Chrome Wordpress Blog Theme - Someone has created a Google Chrome theme for your Wordpress blog. Go knock yourself out.
Google Chrome still leads by over 50% on Google Chrome Hacks Tips blog
Google Chrome Comic sold for $372! - Can you believe it? Someone bought the Chrome Comic book for $372!
Firefox and IE copies Chrome’s “Incognito” mode - Wow, this was a simple but surprising feature recognized by all major browser makers.
Chrome Hack - How to update your Google Chrome browser to the latest version! - Yes, this one is actually a hidden feature on the Google Chrome’s about page.
Chrome Tips - Learn how to add GMail Bookmark to your Chrome! - Yes, this bookmark allows you to jump straight to “Compose Mail” section of GMail on Chrome.
Did you know Google Chrome’s Address Bar is also a Google Search Bar? - Yes, Google did monopolize the search section and I am glad since I don’t use Wikipedia, Amazon, and the other stuff that much on Firefox.
Chrome Hacks - How to run Java and Java applets on your Google Chrome browser - You need to download a beta-version of the JRE (Java Runtime Environment) in order to run Java on Chrome.
Microsoft Office Live doesn’t support Chrome browser at all, go figure.
Check out more from the Google Chrome Tips and Hacks Blog:
- Chrome About Hacks
- Chrome CSS
- Chrome Development
- Chrome Features
- Chrome News
- Chrome Resources
- Chrome Rumors
- Chrome Security Flaws/Bugs
- Chrome Speed Tests
- Chrome Stats
- chrome themes
- chrome tips
- Chrome Videos
- Google Chrome Hacks
Subscribe to this blog or the Chrome Hacks Blog to stay updated on the latest Google Chrome Tips and Hacks news!
Memcached, MediaWiki, and MySQL for optimizing Database

Today, I saw that Hackszine’s Jason Striegel has postsed a blog post about Memcached and MySQL.
Well, basically Memcached is an open-source software for your web server that allows you to cache almost any MySQL query.
In other words, it caches your MySQL queries. But to do this, you do need to check the Memcached cache before doing the actual MySQL query.
So what’s the point?
Well, certain Wiki softwares like MediaWiki already comes with built-in support for Memcached. I have used a similar strategy for one of my custom sites, SiteHoppin.com.
Memcached is also designed for server-farming, meaning you are only limited by number of servers and gigs of ram.
Unlike PHP accelerators, Memcache is really a database cache, thus can give you some extra performance if you implement it right.
Now if the developers at Wordpress started implementing Memcache, that’d do a lot of good for bloggers.
That said, if you want to explore Memcached, you can check out Jason post over at Hackszine.
For MediaWiki implementations, you will have to digg a little deeper. (You can start here) You can buy this book called Wiki Professional.
Other Resources:
Strategies for Using Memcached and MySQL Better Together
Memcached and MySQL tutorial (PDF)
Linux Server Hack - How to setup a Shell Script to Auto Restart Apache Httpd Server!
Well, I have been struggling with one of my dedicated servers and just found this cool script that will auto-restart the Apache httpd server if it goes out.
Save the following as restart.sh:
#!/bin/bash # Apache Process Monitor # Restart Apache Web Server When It Goes Down # ------------------------------------------------------------------------- # Copyright (c) 2003 nixCraft project <http://cyberciti.biz/fb/> # This script is licensed under GNU GPL version 2.0 or above # ------------------------------------------------------------------------- # This script is part of nixCraft shell script collection (NSSC) # Visit http://bash.cyberciti.biz/ for more information. # ------------------------------------------------------------------------- # RHEL / CentOS / Fedora Linux restart command RESTART="/sbin/service httpd restart" # uncomment if you are using Debian / Ubuntu Linux #RESTART="/etc/init.d/apache2 restart" #path to pgrep command PGREP="/usr/bin/pgrep" # Httpd daemon name, # Under RHEL/CentOS/Fedora it is httpd # Under Debian 4.x it is apache2 HTTPD="httpd" # find httpd pid $PGREP ${HTTPD} if [ $? -ne 0 ] # if apache not running then # restart apache $RESTART fi
Then setup a cron job like this: (usually in your sa-update file under /etc/cron.d)
*/5 * * * * root /root/restart.sh >/dev/null 2>&1
There’s also a program called Monit that will do more automation.
MySQL HACK - MySQL Performance Tuning
If you are a webmaster and you run a dedicated server, you might want to watch this video and learn some insights into MySQL performance tuning.
Jay Pipes, MySQL employee and co-author Pro MySQL, gave a great presentation to Google employees which covers a number of techniques for tuning performance on MySQL. His examples include debugging and analyzing problems as well as best practices for table and index design, query and join operations, and server variable adjustments.
- catonmat
SiteHoppin Toolbar Private Beta Launched and Invites for Zedomax.com readers!
Hi All,
We just launched private beta testing of SiteHoppin Toolbar.
You can e-mail me at zedomax [at] gmail.com to get a private beta invitation code then go here.
Remember, we are only looking for 1,000 beta testers at this point so I highly suggest you get in early as the doors will close within couple days.
Here’s a screenshot of the new SiteHoppin Toolbar:

Basically, it let’s you surf the web, bookmark sites, and hop them really really really fast. And also, private beta testers will become the “power” users, just like power users on Digg…
Cheers~
Max
Snap.com offering publisher revenues to bloggers and alike @ Web 2.0 Expo 2008 SF
Click Here to View in Full Screen Mode
I had a chance to stop by Snap’s booth AGAIN after seeing them AdTech. So, I finally got Brendon to talk to me about their new publisher program that pays you for using Snap.com on your site.
Btw, Snap.com is a free service that gives you a snapshot of the hyperlinked URL when you hover over it.
I had this on some of my “failed” social networking sites over here.
By using their publisher program (which I believe is by invitation only), you can get a share of their ad revenue from those snap shots. Of course, you need some good quality content and minimum traffic of 250,000 views or more per month.
I will be e-mailing Brendon soon and try out the publisher program to see if I can get better results than I am with my other advertisers. I will have another review in about a month to tell you how it worked so make sure to subscribe to Zedomax!
(Thanks again Brendon, for the explanation of your new program!)
Wordpress HACK - How to widgetize your theme!
Well, I had to widgetize my old theme today but it was pretty simple:
Make a file called functions.php in your theme directory. (if you don’t have one yet)
Add the following code and save the file:
if ( function_exists(’register_sidebar’) )
register_sidebar(array(
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ‘‘,
‘after_title’ => ‘‘,
));
?>
Then add the following anywhere you want to add dynamic widgets:
<?php if ( !function_exists(’dynamic_sidebar’)
|| !dynamic_sidebar() ) : ?><?php endif; ?>
You can actually put your existing code within the if loop OR you can also put it before or after.
Since I didn’t want to widgetize all existing stuff, I simply put it after all my existing code in my sidebar.
You can also create multiple dynamic widget locations simply by add numbers to the code like this:
<?php if ( !function_exists(’dynamic_sidebar’)
|| !dynamic_sidebar(1) ) : ?><?php endif; ?>
Other Online Resources:



