Archive for the survivalgames Category

The standard PHP4 installation that comes with Litespeed may be missing important libraries that you require for your PHP applications. Also, the bundled APC accelerator is not always enabled. Chances are that you will want to compile PHP5 and eAccelerator yourself for maximum compatibility and performance. Luckily, Litespeed has a built-in PHP compiler that simplifies this process.

First, make sure that your Dreamhost PS is temporarily set to at least 600MHz/600MB. Compiling is a CPU intensive task, and without sufficient CPU power, it will take far too long.

Next, connect to your shell account via SSH.

Download, extract, and compile autoconf and automake:
wget ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/distfiles/autoconf-2.61.tar.gz
wget ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/distfiles/automake-1.10.1.tar.bz2
tar xzf autoconf-2.61.tar.gz
tar xjf automake-1.10.1.tar.bz2
cd autoconf-2.61
./configure --prefix=$HOME
make
make install
export PATH=$PATH:$HOME/bin
cd $HOME/automake-1.10.1
./configure --prefix=$HOME
make
make install

Compile PHP5 from the Litespeed web administration interface. Note that the compile options and file paths in the below image differ from the defaults. Replace username with your user name. gettext is important for international language support, mysql is important for Wordpress, jpeg is important for image manipulation, and PEAR is not used very often. Each PHP web application has different PHP requirements, and not everything was included here, so please make sure to include the compile options that you need. If you are unsure, take a look at Dreamhost’s default compile options to see many other possibilities. In the interest of keeping a small PHP memory footprint, include only necessary compile options.
Litespeed PHP5 compile wizard
Next, we must compile eAccelerator manually. If you are compiling PHP 5.2.5, you can skip this and download the binary here.
wget http://bart.eaccelerator.net/source/0.9.5.2/eaccelerator-0.9.5.2.tar.bz2
tar -xjf eaccelerator-0.9.5.2.tar.bz2
cd eaccelerator-0.9.5.2
export PHP_PREFIX=$HOME/lsws/lsphp5/bin
export PATH=$PATH:$HOME/bin
$PHP_PREFIX/phpize
./configure --prefix=$HOME --enable-eaccelerator-shared --with-php-config=$PHP_PREFIX/php-config
make
cp modules/eaccelerator.so $HOME

After the compile is complete and eaccelerator.so is in your /home/username/ folder, change the Command setting in Server/External App/phpLsapi from $SERVER_ROOT/fcgi-bin/lsphp to $SERVER_ROOT/fcgi-bin/lsphp5
Make a file called php.ini in your $HOME/lsws/fcgi-bin/ directory. Add these lines to enable eAccelerator.
extension_dir = "/home/username"
extension="eaccelerator.so"
eaccelerator.allowed_admin_path="/home/username"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/home/username/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="0"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="1"
eaccelerator.compress="0"
eaccelerator.compress_level="1"
eaccelerator.keys = "shm_only"
eaccelerator.sessions = "shm_only"
eaccelerator.content = "shm_only"
output_buffering = On
memory_limit = 32M

Make a directory /home/username/tmp/eaccelerator and chmod those directories 777. Keep the shm_size as large as your memory will allow. Dreamhost’s NFS file mounts are slow, and we want to avoid putting cache files there. Using /tmp as the cache_dir is faster and allows a smaller shm_size to be used, but it has a capacity of only 128MB, and the server will crash if that directory runs out of space.

Now perform a graceful restart of Litespeed. That’s it! To check if everything is running as it should, create and browse to a file called phpinfo.php with these lines of code:
< ?php
phpinfo();
?>

If all is well, you should see a page titled PHP 5.2.5 that contains this line: “with eAccelerator v0.9.5.2, Copyright (c) 2004-2006 eAccelerator, by eAccelerator.”

With the installation of PHP5 and eAccelerator, most of our speed optimizations for Litespeed are complete. Next time: final tuning of Litespeed and Dreamhost settings for lowest cost and highest stability.

Dreamhost PS

Dreamhost PS can act as a very cost effective VPS setup if you are able to configure it correctly. For $15.00 a month on top of the generous Dreamhost shared hosting plan, you can move off of the horrendously loaded shared webservers and onto a virtual private server with 150 MB RAM, 150 MB swap memory, and 150 MHz of dedicated CPU. Dreamhost’s MySQL database servers are still shared with others, but they are decent enough for most sites, and the fact that they are off-server means that they don’t use precious VPS memory.

Dreamhost Panel memory usage

Dreamhost PS’s default configuration was inherited directly from their shared hosting setup. It was slightly fiddled with but never fully optimized for low memory situations, which is what we have with Dreamhost PS. In particular, the Apache prefork threads that manage web connections to clients are compiled with libraries that you probably don’t need for your personal site. Because of this, more than 2MB of RAM are wasted per thread, and a moderately popular website usually has 30 or more threads. Also, the FastCGI settings are crude, leading to out-of-memory errors and debilitating “blocking” load from common FCGI daemons such as PHP, Perl, and Ruby.

There is much instability when running Dreamhost PS at the lowest memory settings. The easiest solution to this problem is to scale up the CPU/Memory of the Dreamhost PS server until it reaches acceptable levels, and pay extra month after month. A more cost-effective solution is to install an alternative web server behind Dreamhost’s Apache mod_proxy setup. The Litespeed web server is fast, stable, and .htaccess rewrite compatible so it’ll work straight out of the box with your Wordpress or Gallery or phpBB. (more…)

harajuku school girls

harajuku schoolgirls!

1. Rush to class

Forget about composure! Rush to class to get much-needed exercise. Being late to class is both physically and mentally stressful, so take it as a chance to practice stress management techniques. Stress causes a release of adrenaline, which helps to encode strong memories of class material.

2. Procrastination is key

Inspiration is vital for increased concentration and efficiency. It’s the key to getting things done fast. The threat of a looming deadline is the most consistent source of inspiration that I know of. Harness its power with procrastination.

Even for an inspired person, work is work. Work will still take up time and energy. Plan ahead or the quality of procrastinated works will suffer. There is no guilt associated with careful procrastination. Accurately judging the time needed for a certain piece of work is a skill gained with practice.

“A deadline is negative inspiration. Still, it’s better than no inspiration at all.” -Rita Mae Brown

2.5 Life in overdrive

Those who intentionally overload themselves with work will discover that life is not much worse than it was before. Take four or more AP classes. Take more than 22 credits. Negative inspiration runs rampant in busy people.
This is really interesting. By taking 30-40 credits per semester, Steve Pavlina was able to graduate college in three semesters.

3. Cram for exams

This only works for classes in which you regurgitate knowledge without thought. Introductory biology, psychology, and history come to mind. These classes require zero study except at exam time. Take advantage of powerful short-term memory and cram weeks of information into the one night before an exam. Start early and study quickly.

Try not to pull an all-nighter. Without sleep, the knowledge crammed won’t stick around for the long term, and you’ll find yourself in a pinch when the cumulative final exam rolls around.

4. Use piracetam

Piracetam is a nootropic drug that enhances cognition and slows down brain aging. Since it has no side effects, it is unregulated and inexpensive in the US. Buy it online and use it like a nutritional supplement to gain a subtle boost in intelligence.

5. Don’t pay attention during class

Paying full attention in class is inefficient because knowledge often arrives slower than the ability to absorb it. When learning, learn with intensity. Always have some other material to study. When you hear but do not learn, divert your attention away from the lecturer and study something else. Try not to do homework in class though, because homework requires a lot of concentration and is difficult to multitask.

6. Apply NaNoWriMo to your essay writing

NaNoWriMo, or National Novel Writing Month, is a creative writing project in which participants attempt to write a 50,000 word novel in only one month. The pace is too quick for editing, so the project emphasizes “quantity over quality.”

Use the same principle for essays. Bust out the pages like a wild rabbit first, and edit later. Type before you think, because you can fix it later. No paragraphs? No problem! Writing in this carefree manner is much faster than typing in perfect paragraphs from the start.

7. Buy the solutions manual for textbooks

Getting stuck while doing math/physics/engineering problems is a giant waste of time. It’s the chaff of the critical thinking process and doesn’t contribute to learning. Buy the solutions manual and skim it before attempting the problem so that you don’t get stuck.

Samsung E870 Champagne

Once upon a time, three little piggys went out and decided to go mobile. Because they were a family, they purchased a family plan: three phones and 400 minutes for $69.99 $77.64 a month. The big bad wolf was laughing all the way to the bank.

Recently, those three piggys switched to prepaid: 1000 minutes per phone for one year. Each line costs only $100 per year, or $8 per month. They will save $53 a month.

What is the moral of this fable?

1. You can have mobile service with minimal cost.

2. If you use your mobile phone infrequently, drop the monthly plan and switch to prepaid. Even families should eschew the family plan in favor of individual prepaid plans. If you or your family use more than 10 hours of talk time each month though, don’t go prepaid.

3. Individuals with a landline: port the number to a prepaid mobile.

This service is called T-Mobile to Go. It is a painless switch for T-Mobile and Cingular customers.

For customers of other carriers like Verizon, your existing mobile may or may not be compatible with T-Mobile’s GSM network. If it is not, you can get a new phone. Alternatively, with your existing phone, you can use a prepaid service on the Verizon CDMA network called Page Plus Cellular.

There are other prepaid providers, but these two are first and second for value. Don’t make the same mistake as those piggys.

Check your phone number transfer eligibility. Check your coverage. Buy refills on eBay, they’re cheaper.

4. Families with a landline that also have broadband internet: switch from the local phone company to Sunrocket internet phone service. It’s $10 a month. Check for Sunrocket deals on slickdeals.net.