One's and Zero's

Technology at its best and its worst

My Experimental Fix for the “Digg Effect”

October 16th, 2007 by Nate

DiggWith the increase of large social networking sites, like Digg, Slashdot and Reddit popping up all over the web, it’s getting easier for the small-time bloggers to get their often well-deserved hour in the spotlight. All it takes is one interesting blog entry and one of your visitors taking a moment to share it with visitors of one of these bigger sites. What most bloggers don’t realize until it happens to them is an appearance on the front page of any one of these sites (which usually happens due to some sort of proprietary visitor voting system) could make your blog come to a very unexpected and immediate halt.

Some of these large social networking sites are so busy in fact, that often times the very minute your entry appears on the front page, hundreds or even thousands of curious people have already clicked to your blog to read your entry. Most small-time websites aren’t prepared for this kind of influx of traffic.

There are ways to optimize your blog to help remedy this problem, but there is no guaranteed fix short of paying an arm and a leg in extra server costs. So what do you if your blog does end up succumbing to the flood of visitors?

Introducing CoralCDN.

CoralCDN is a decentralized, self-organizing, peer-to-peer web-content distribution network. CoralCDN leverages the aggregate bandwidth of volunteers running the software to absorb and dissipate most of the traffic for web sites using the system. In so doing, CoralCDN replicates content in proportion to the content’s popularity, regardless of the publisher’s resources—in effect democratizing content publication.

In basic terms, CoralCDN can make a copy of your blog entry or web page (including pictures) and host it on these volunteer servers so people can still read your entry! Ideally you would want people to come to your blog directly, but this is the next best thing if your blog does go down.

So how do you use CoralCDN?
To use CoralCDN, a content publisher—or someone posting a link to a high-traffic portal—simply appends .nyud.net:8080 to the hostname in a URL.

By appending .nyud.net:8080 to the end of your host name (i.e. http://www.1s0s.com.nyud.net:8080/your_entry) visitors can reach a copy of that same page. It’s not really important HOW CoralCDN accomplishes this (although if you are interested, you can read more on their website). The important thing is harnessing this awesome service in a useful way.

Enter the unprecedented fix

Okay here’s where we have to get just a little more technical but bear with me and read this part more than once if need be.

On most web servers you can run a command called “uptime”. When you run this command it will return some text to you that will look something like: “09:53:15 up 119 days, 19:08, 10 users, load average: 3.73 7.98 0.50″. It’s at the end of this returned information that that we’re interested in. Load average.

Load average tells you how busy your web site or blog is. The first number, in this case 3.73 indicates how many processes were running (on average) in the last 1 minute. The second number 7.98 indicates the same thing for the last 5 minutes, and the last number indicates the last 15 minutes.

If through some server side code, in our web page, we determined what that first number was (lets say 36.73 for example) and at the same time decided on a maximum load (lets say 30.00 for example as this may be indicative of the “Digg Effect”) we can tell our web page that 36.73 is too high of a server load and that we want to start redirecting the page to the CoralCDN copy! Instead of running hundreds of lines of code, dozens of database calls, loading images, et (as is the case with most blogs), we run just a few lines of code (thus using hardly any resources) and redirect the visitor to CoralCDN (this time using NO resources). The result is your blog has time to catch up to this huge demand of traffic and visitors never get the dreaded “Page has timed out”.

Since PHP is one of the more commonly used languages for blogs and websites I’ll present the code for just such an experiment. This code should be pasted above all other code in your web page. If you are using wordpress, you can place this inside index.php at the very top (just below < ?php ).

-------------------------------

$cpuload = get_cpu_load();
$maxload = 30;
if((float)trim($cpuload[0]) > $maxload && !strstr($_SERVER["HTTP_USER_AGENT"], “CoralWebPrx”)) {
header(”Location: http://” . $_SERVER["SERVER_NAME"] . “.nyud.net:8080″ . $_SERVER["REQUEST_URI"]);
exit;
}

function get_cpu_load() {
$cpuload = shell_exec(”uptime”); //looks like this 09:53:15 up 119 days, 19:08, 10 users, load average: 3.73 7.98 0.50
$cpuload = explode(”:”, $cpuload);
$cpuload = trim($cpuload[4]); //looks like this 3.73 7.98 0.50
$cpuload = explode(”, “, $cpuload);
return $cpuload; //[0] 1 min [1] 5 min [2] 15 min
}

Posted in Coding, Computer | No Comments »

Compusa Service

July 22nd, 2007 by Nate

Hmmmm, what exactly is Compusa offering here?

Compusa Service

Posted in Computer, Funny | No Comments »

If A Geek Were To Build A Toilet

April 16th, 2007 by Nate

If a geek were to build a toilet, this is what it would look like.

Geek Toilet

I especially appreciate the glass of beer on the side table ready and waiting…

Posted in Computer | 1 Comment »

The 8 Bit Statue

April 3rd, 2007 by Nate

This is a statue in Torin Italy that appears to be in 8 bit resolution:

The 8 Bit Statue

Posted in Computer, Funny | No Comments »

Changing your default DVD player on Windows XP

February 26th, 2007 by Nate

It’s easy enough making your favorite DVD player auto-play DVD’s (that is when you put the DVD into the computer and the DVD player automatically opens to play the DVD). You simply right click on your DVD drive icon, go to properties, select the auto-play tab, and choose your DVD player from the list.

That works fine for that specific situation, but what if you want to watch the DVD later.

You have a few choices here:
1) You could open and close the DVD tray. This would cause the auto-play to kick in again. What a pain!
2) You could click start – programs – (Your DVD Player). Again, who wants to do that?
3) You could make a shortcut to the DVD player on your Desktop. This is better, but is it really necessary?
4) You could open my computer and double click the DVD drive. You know… the intuitive way. That opens a different DVD player you say? Yeah, how annoying.

Here’s how you can change that.

Registry editing time! Click start – run – type in ‘regedit’.

Navigate to:
HKEY_Classes_root\DVD\Shell\Play\Command\

Edit the ‘DefaultValue’ and change to “<path to your dvd player> /DVD “%L”

Close regedit, and give it a try.

Posted in Computer | 3 Comments »

Time For Obedience School…

February 24th, 2007 by Jeff

Puppy & Computer

Is this covered by the warranty?

Posted in Computer, Funny | No Comments »

Don’t Trash That Old Computer! How To Let Your PC Live On

February 12th, 2007 by Jeff

I always think it is such a shame when I see computers being thrown into the trash. It’s pretty common when people purchase a new computer that their old computer ends up getting thrown away and finding its way to the landfill. Even if you no longer need your computer, there are a lot of people and organizations that would likely love to have it. While there is a chance that you may make a small amount of money, you’re more likely to come away with a small tax deduction. In the end, even if you don’t make a cent you’ll be doing the right thing by giving your PC new life rather than place it in a landfill (and give yourself karma points in the process).

There are a large number of charities in both North America and Europe that are interested in your old computer. While most of them aren’t interested in computers older than 5 years old, they are very interested in computers that are less than 5 years old. There are a number of them that take these computers, refurbish them and give them to charities or other organizations that are in need of them:

Give Your Computer To Charity: While you won’t get any money for donating your computer to charity, if the charity is a registered charity, you will be able to claim a tax deduction for your donation. You need to consult with each individual charity to see if your PC donation will qualify for this tax deduction.

  • Another Byte is a service project aimed at area businesses, residents, schools, and nonprofit organizations interested in recycling and reusing computers. The website serves as a regional and nationwide exchange board directly connecting those wishing to dispose of computers and nonprofit organizations that are in need of them. The service is free and simple to use, making it easy to keep good technology out of the waste stream by putting it back into productivity.
  • Share the Technology is a free public-service database to help computer equipment donors connect with nonprofit organizations and individuals with disabilities seeking donations. It’s been in operation since 1996.
  • World Computer Exchange is an international educational nonprofit focused on helping the world’s poorest youth to bridge the disturbing global divides in information, technology and understanding. They give new life to your donated computers by helping poor youth in Africa, Asia, and Latin America gain access to the Internet. There is also a Canadian division that now has charitable status.
  • National Cristina Foundation is a computer technology and solutions organization to give people with disabilities, students at risk and economically disadvantaged persons the opportunity, through training, to lead more independent and productive lives. In addition to computers, they also accept software and peripherals.
  • Computers for Youth is a program with the mission to close the learning gap between low-income children and their more affluent peers by improving the home learning environment. They only accept donations of 50 or more computers at a time from businesses.
  • Literacy 4 Kids: is a San Francisco Bay Area program to help place computers in high schools. It provides donated computers, hardware, and software directly to the youth and uses donated money entirely to purchase computer-related items needed by the youths. No member, including the Board of Directors, is allowed to take any salary.
  • Youth For Technology: (PDF Format) helps young people achieve goals through technology. It’s a non-profit organization registered as a charity in the United States and in Nigeria. Their specific needs change, but are currently in need of 3 laptop computers.
  • Free Geek: Any computer equipment, working or not, can be donated to Free Geek where it will be repaired and reused whenever possible. Non-functioning computers and scrap are recycled responsibly. They do ask for donations for older computers to help with the cost of scrapping and $10 for monitors. The main headquarters is in Oregon with branches in Arkansas, Chicago, Columbus, Michiana (South Bend, Indiana) and Vancouver BC
  • ReBoot Canada: It’s a non-profit organization providing computer hardware, training and technical support to charities, non-profits and people with limited access to technology.
  • DonateAPC (United Kingdom) is a service for individuals and organisations to donate computer hardware (computers, printers, etc) to UK charities, not-for-profit organisations and educational establishments.
  • Computers for Charities (United Kingdom) is a registered charity that offers IT support to charities and volunteer organizations. They refurbish some computer hardware for reuse at these institutions.

More Options To Keep PCs Out Of The Landfill

  • Inner City School: If you have an older computer that still works, but isn’t a version that charities will accept, consider donating it to an inner city school. Due to extremely limited budgets, inner city schools will usually accept any computer as long as it is in working condition and it would of course be a hugely valuable tool for any school that could get it. You would need to contact schools in your area directly.
  • Craig’s List: This free service is an excellent place to dispose of a computer. There are plenty of people who would love to have an older computer that is still in working condition and it should be not problem finding someone to take it if it is offered for free. If you have a newer computer, you can probably sell it for a bit.
  • Freecycle is another community where it is relatively easy to get rid of any computer hardware or software. Simply say what you have and there will likely be someone at your door within the week to take it away.
  • eBay: Even if your computer is rather old, you may find someone willing to pay for it on eBay. Many people have older computers themselves and can use the parts for their own computer. If it is a newer version, it should sell rather easily in this platform.
  • Leave It Outside: If you live in a large city, all you may have to do is leave it outside with a “Free” sign on it. In many places your computer will be claimed by someone within a couple of hours without the hassle of having to arrange meeting times or other logistics.
  • Recycle Your Computer: There are a wide variety of companies that recycle computers. While this keeps them out of landfills, there is usually a cost associated with disposing your computer this way.

Keep these other alternatives in mind before simply dumping your old computer into a landfill. Not only will using one of the above methods make the planet a bit greener, in many cases the computer you no longer need will become a valuable asset to someone else who will greatly appreciate the opportunity to use it.

Posted in Best of Web, Computer | No Comments »

Every Geek’s Dream! USB Bra Keyboard

January 30th, 2007 by Jeff

We kid you not. A Japanese costume company (Angel Kitty) has done wonders to show the full potential of what can be done with a USB powered keyboard when incorporated into a bra (dare we call it a wonderbra?) and placed on top of one of their models wearing a Kitty Waitress costume.

USB Bra Keyboard

USB Bra Keyboard

The back of the USB keyboard has a thick layer of silicon to protect the wearer’s “assets” should the costume ever need to be removed for non computer related reasons. While we don’t imagine that many of the geeks out there would have a woman willing to don this piece and let them type away without some serious money exchanging hands, it does allow us to dream a bit now, doesn’t it?

Posted in Computer, Worst of Web | No Comments »