Kevin Hatfield's Blog

Kevin's blurry train of thought……

Archive for March, 2007

10 Ways being a geek makes you more attractive!

Tuesday, March 27th, 2007

Being a geek in 2007 is nothing to be ashamed of, the stereotype that once existed is long gone and there are several characteristics of geek culture that could almost be considered chic. Consumating, Threadless, or even Apple are pretty good testaments to this fact.

The picture I’m about to paint is of the ideal, I’m not implying that every perl programmer or 15 year kid who plays WoW all day possesses all these qualities.

1. You’re probably very smart.
2. It’s hip to be geek. Everyone is familiar with the stereotype of thick glasses, a pocket protector, an obsession with star trek, and social skills akin to a sack of potatoes. Times have changed: geeks are often fashionable, hip individuals who are very aligned with the trends of their own generation
3. You geek out on more than just your computer. Ever seen the movie collection of a film geek? Ever had an automotive geek work on your car? Ever seen the body of a fitness geek? The tenacity of someone like us, when applied to hobbies outside computers and the like, can yield impressive results.
4. Geek humor is the best humor. This is perhaps a biased opinion, but I’ve never laughed as hard as I have while reading some of the random, funny things that came out of geek culture.
5. You listen to good music. Geeks have access to tools that allow us to hear music that extends well beyond top 40 radio. Want the entire discography of Aphex Twin by tomorrow afternoon? Ask a geek. Not only do they listen to good music, they can find just about anything you’re looking for in a heartbeat.
6. You make good money. If there’s one stereotype about geeks that usually rings true, it’s that they rarely have trouble earning a decent income.
7. You fix stuff. Everyone loves a handyman, especially one that can fix one of the most frustrating devices ever conceived: a personal computer.
8. You’ve got your own stuff going on. You’ll never meet a geek who runs out of things to do, they’ve got lots of hobbies and interests and are more than happy to dive head first into one of those when they’ve got some spare time. In other words: they won’t rely on you to give them a life.

9. You’re very articulate. Compulsively reading a few hundred RSS feeds a day yields a vocabulary that could put most college English majors to shame.
10. You’re passionate. When a geek becomes interested in something, they tend to immerse themselves in it entirely. They’ll strip a new gadget down to nuts and bolts and re-build it with an xhtml compliant grappling gun. This intense passion can extend to many areas of a geek’s life, not just computers and hobbies.

Any others you can think of?

Source: Here

Vulnerability found in BlackBerry devices

Thursday, March 15th, 2007

Don’t freak out just yet, you might be safe. But news is slowly spreading of a “low-risk vulnerability” in some BlackBerry devices, specifically the Pearl and any device running v. 4.2 or earlier. Discovered by an IT security consultant named Michael Kemp, this “vulnerability” occurs when the user tries to access a URL on their mobile browser that’s excessively long – and it often times cannot connect. That’s when the hackers come out to play.

A hacker could exploit this to cause a Denial of Service (DoS) attack when a specially crafted URL is clicked on, causing the affected device to become extremely slow or stop responding altogether. To protect yourself from this vulnerability, you need to install BlackBerry Device Software 4.2 Service Pack 1 (4.2.1).

BlackBerry has provided the following workarounds in the event that your browser or device stops responding.

* Press the Alt and Escape keys simultaneously to switch to another application on the BlackBerry device.

* Perform a hard reset of the BlackBerry device.

* Wait for the BlackBerry device or the BlackBerry Browser to respond. This occurs after a period of time relative to the size of the link that exploited the vulnerability.

HOWTO: PHP/FastCGI on Lighttpd

Thursday, March 8th, 2007

lighttpd is a web server which is designed to be secure, fast, standards-compliant, and flexible while being optimized for speed-critical environments. Its low memory footprint (compared to other web servers), light CPU load and its speed goals make lighttpd suitable for servers that are suffering load problems, or for serving static media separately from dynamic content. lighttpd is free software / open source, and is distributed under the BSD license.

lighttpd is know to be a light and fast server, but you dont appreciate it until you combine php with fastcgi

This is a oriented for Gentoo Linux, but its easy to adapt it to other distros.

Before emerging php, make sure that you have enabled the flag fastcgi and the -apache and -apache2 choose the others as you wish or need.

you can enable individual use flags on the file /etc/portage/package.use with the syntax category/package flag1 flag2

dev-lang/php-5.1.4 use flags:

USE=”bcmath berkdb calendar cdb cgi cli crypt ctype dbase force-cgi-redirect ftp gd imap ipv6 ldap memlimit mysql mysqli ncurses nls pcntl pcre pdo-external pic posix postgres readline reflection sasl session sharedmem soap sockets spl sqlite ssl truetype xml xmlrpc zlib -adabas -apache -apache2 birdstep bzip2 cjk curl curlwrappers db2 dbmaker debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk -filepro -firebird -flatfile -frontbase -gd-external -gdbm -gmp -hardenedphp -hash -hyperwave-api -iconv -informix -inifile -interbase -iodbc -java-external -kerberos -libedit -mcve -mhash -ming -msql -mssql -oci8 -oci8-instant-client -odbc -pdo -qdbm -recode -sapdb -sharedext -simplexml -snmp -solid -spell -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -unicode -vm-goto -vm-switch -wddx -xmlreader -xmlwriter -xpm -xsl -yaz -zip”

Now emerge it and go get a coffee as it could take a while:

emerge dev-lang/php

[edit]
Configuring lighttpd

After php compiles successfully lets edit the lighttpd.conf file, first make sure that the module fastcgi is uncommented at the server modules:

server.modules = (
“mod_fastcgi”,
“mod_access”,
“mod_accesslog”
)

And then uncomment or include the fastcgi configuration file:

include “mod_fastcgi.conf”

That is just to make the configuration file more clear to the reader, the fastcgi configuration could be included at lighttpd.conf without problems.

Now edit the mod_fastcgi.conf file, you could use the following configuration as example:

fastcgi.server = ( “.php” =>
( “localhost” =>
(
“socket” => “/tmp/php-fastcgi.socket”,
“bin-path” => “/usr/lib/php5/bin/php-cgi”,
“min-procs” => 2,
“max-procs” => 4,
“max-load-per-proc” => 8,
“idle-timeout” => 50,
# Fix PATH_INFO for PHP scripts that rely on it (like WordPress).
“broken-scriptfilename” => “enable”
)
)
)

It’s very important, and more for us that are on a limited memory environment, to control the min and max proc variable, as it will burn more or less memory depending on how many procs we set, on a small site the it could be set at 2 or even 1 without problems, making lighttpd run with very low memory, but if you’re going to use more populated applications, like a forum, feel free to edit it with your needs.

Another alternative to starting the fastcgi within lighttpd, is using fastcgi with a different init script, for that you just need to delete the line of bin-path, and make sure that you start the service /etc/init.d/spawn-fcgi everytime you start lighttpd too, everything else remains the same.

Now you are set, restart the and enjoy your fast server!

/etc/init.d/lighttpd restart