•March 22, 2010 •
Leave a Comment
I’m a big fan of Continuous Integration (CI), however I find the complexity of solutions such as phpUnderControl/CruiseControl off putting and disruptive. Setting up projects requires shell access to the server and therefore knowledge of the file system layout and every config change requires CruiseControl to be restarted for the changes to take affect. This just provides non-believers with more excuses to avoid unit testing.
I was introduced to Hudson during a Sheffield Java User Group meetup in late 2009. Inspired by the claims of easy web based configuration and a wide variety of plugins I had to give it a try. Over a couple of blog posts, I’ll cover the integration of PHP with Hudson using the following tools:
Continue reading ‘Continuous Integration with PHP and Hudson part 1′
Posted in Development, php
Tags: hudson, php, phpunit
•September 16, 2009 •
Leave a Comment
Munin is a simple to use, client-server based system monitoring tool. Data is presented using nice RRDtool driven graphs via a webpage. Installation on Debian is just a matter of installing munin munin-node munin-plugins-extra packages. Additional plugins are enabled by creating symlinks in /etc/munin/plugins/ from /usr/share/munin/plugins/* and then restarting munin. By default, graphs are created under /var/www/munin/ so are accessable in your browser assuming a web server, such as Apache, is installed.
If you can’t find a plugin you need, try MuninExchange or if you have some scripting experience (any language will do) you can write your own plugin.
Posted in Linux
Tags: munin, system admin
•June 6, 2009 •
Leave a Comment
For some reason Adobe Air apps do not like KDEs’ desktop effects. When these effects are enabled with the default settings, Air apps such as Tweetdeck and Twhirl have a fit when they try to restore from the system tray and cause the system to become unresponsive.
After a bit of googling, I found a workaround in KDE’s bug tracker. It seems the problem is related to KDE’s feature that keeps thumbnails of running applications. Anyway, the workaround is to completely disable this feature by setting System Settings -> Desktop -> Advanced -> Keep window thumbnails to “never”.
Posted in Linux
Tags: Adobe Air, Linux
•April 13, 2009 •
Leave a Comment
I joined the notebook community at Christmas last year when I unwrapped my Asus 901 (Linux variant). It runs a custom build of Xandros which is itself a fork of Debian. Asus provide software updates using their own repository which Eee’s are pre-configured to use exclusively. This means upstream software updates including security patches from Debian and Xandros have to be merged into their repository by Asus in order for Eee customers to benefit and run secure systems. That’s how it should work…
Continue reading ‘Poor security on Asus Eee’
Posted in Linux, Security
Tags: asus, Debian, easy peasy, eee, Security, ubuntu eee
•April 12, 2009 •
Leave a Comment
Most people know Facebook for their contribution to the social networking phenomena along with the likes of MySpace, etc. Their rapid and massive increase in popularity has brought interesting technical challenges and today Facebook are one of the biggest PHP users in the world. This in detailed presentation Aditya Agarwal, Director of Engineering at Facebook talks about their software stack and how they use PHP and 25TBs worth of Memcached storage to serve their 200 million users.
If this stuff interests you, also check out their engineering blog.
Posted in Development, Linux
Tags: enterprise, lamp, php facebook memcache
•January 26, 2009 •
Leave a Comment
Despite being introduced in PHP 5.1.0 that was released in late 2005, there are a pair of less well known php.ini directives that can have a noticeable affect on performance, especially for developers who work with spagetti code. These options control how PHP files are cached internally by PHP when using, for example, the include/require constructs (not functions!). These options are,
realpath_cache_size
Determines the size of the realpath cache to be used by PHP. This value should be increased on systems where PHP opens many files, to reflect the quantity of the file operations performed.
realpath_cache_ttl
Duration of time (in seconds) for which to cache realpath information for a given file or directory. For systems with rarely changing files, consider increasing the value.
So why should people care about these options? Well, everytime that a file is loaded using a relative path PHP first has to lookup where that file exists on the filesystem. Once cached futher includes will be far cheaper, however with small cache size by default entries will quickly churn when you consider that PHP frameworks such as Zend Framework contain well over a thousand files.
So what should it be set to? Well that largely depends on your personal situation, those with extreme symptoms of spaghetti-code-itous which vast numbers of library files should use higher values. Personally, on my modest Zend Framework installation I find a cache size of 128KB works well. As for the time to live (ttl) value this defaults to 2 minutes and should be tweaked on a per-case basis depending on how frequently the application is updated.
References,
- http://uk.php.net/ini.core
Posted in Development
Tags: performance, php, php.ini, realpath_cache_size, realpath_cache_ttl, tuning
•December 15, 2008 •
Leave a Comment
The iptables recent module can be used to,
track seen IP addresses and be able to match against them using some criteria.
This enables admins to identify and block traffic brute force attacks. In the following config will only allow 4 connections to port 22 within a 60 second time frame from a given IP address. Subsequent connections will be logged and dropped. The disadvantage of this approach is that iptables can not distinguish between successful and unsuccessful connections. This means that you potentially lock yourself out of your server! To help overcome this problem a whitelist of admin IP addresses is added.
Continue reading ‘Block brute force attacks with iptables’
Posted in Linux, Security
Tags: brute force, iptables, Security, ssh
•November 10, 2008 •
Leave a Comment
Xubuntu Intrepid Ibex has done away with the traditional hacking ofm the X11 config file for monitor, mouse, keyboard and other I/O device setup. This latest release uses HAL to automatically configure itself with ‘reasonable defaults’. For me however, these defaults don’t play nicely with my IBM Thinkpad and Apple keyboard combination.
To emulate the standard wheel functionality I made the following changes,
$ cat /etc/hal/fdi/policy/mouse-wheel.fdi
<match key="info.product" string="TPPS/2 IBM TrackPoint">
<merge key="input.x11_options.EmulateWheel" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
<merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
<merge key="input.x11_options.ZAxsisMapping" type="string">4 5</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
</match>
And turn off the brightness, volume, eject, etc keys by default on Mac keyboards add line this to /etc/modprobe.d/options
options hid pb_fnmode=2
Posted in Linux
Tags: ubuntu key mapping apple keyboard hal fdi
•May 24, 2008 •
Leave a Comment
My hosting companies recent upgrade from Virtuozzo Power Panel to HyperVM resulted in a change to how RAM usage is calculated (and therefore restricted). Despite top telling I was only using ~80% of my RAM, after the upgrade I started receiving frequent emails from cron informing me that processes were running out of memory and I even had problems opening SSH connections to the server.
Continue reading ‘Free memory upgrade’
Posted in Random
Tags: vps