Recently I changed something in an open source project and wanted to make the patch public. It had been a long time since I made a patch, so I forgot how(even though it’s fairly easy). So here’s a quick how-to. Make sure you have both the original and modified versions. In the example I’ll make a patch for a directory [...]

Optimizing your web server: Part 4b – XDebug Profiler

Here we are, part 4b. By using XDebug, a pecl extension, our php code can be analyzed pinpointing the slower functions. Installing XDebug is easy: pecl install xdebug Now, you’ll have to enable it in the php.ini file: extension=xdebug.so xdebug.profiler_enable=1 xdebug.profiler_output_name=profiler-%s-%t.cache xdebug.profiler_output_dir=/tmp/xdebug Don’t forget to create the directory and give apache enough permissions to write in it. So after restarting [...]

After looking on the internet after a good kickstart guide, there was not one that helped me set up everything from start to end. I’m not one that likes to read allot. So after 10minutes together with Google the road to ‘the perfect kickstart’ started. This is what the target was: – Mount a small iso, about 10mb big – [...]

When using php scripts on the command line or in the cron, there are often times that you do not want to allow the same script to run more then once at a the same time. So a single instance application in php. Personally I use php scripts like this allot. My cron is filled with all kind of tasks [...]

Recently I needed to query a postgres database and put some of the info in a sqlite database. At first I wondered how am I going to do that?, but it’s much much easier then you’d think it is. A small example of a bash script doing just that: #!/bin/bash export PGPASSWORD=mypassword psql="psql -h localhost -U myuser -d mydatabase"   [...]

© 2011 Crazy's Blog Suffusion theme by Sayontan Sinha