wtorek, 25 października 2011

piątek, 23 września 2011

czwartek, 8 września 2011

PHP Ubuntu simple server monitoring script

Simple PHP monitoring script.

Change hosts variable (array) and path to icon file (-i /usr/share/icons/Faenza/status/scalable/error.svg).

You can use it in your crontab: Edit your cron settings:
 
crontab -e

and insert:
 
* * * * * php /home/exu/scripts/monitoring

(change /home/exu/scripts/monitoring to path to your file) Enjoy!


piątek, 29 lipca 2011

Symfony 2 już dostępne


Symfony 2 nareszcie dostępne, juz mam kilka projektów na DEV, wygląda naprawdę super, developerzy wykonali naprawdę kawał dobrej roboty.

czwartek, 7 lipca 2011

rsync with --itemize-changes flag

My yesterday rsync battle notes:
rsync --checksum --verbose  --recursive --delete --itemize-changes --times SOURCE_HOST DESTINATION_HOST 

+- incoming / outgoing / change 
|
|+- type : f for a file, a d for a
||         directory, an L for a symlink, 
||         a D for a device, and a S  for  a
||         special file (e.g. named sockets and fifos
||
<f.st......
  |||||||||
  ||||||||+- x - extended attributes
  |||||||+- a - ACL info changed
  ||||||+- u - reserved for future
  |||||+- g - group
  ||||+- o - owner
  |||+- p - permissions
  ||+- t - modification time 
  |+- s - size
  +- c - checksum


Additional information:
. - no change
* - e.g. *deleting
c - local change/creation e.g. creating dir symlink
< - file transfer to remote
> - file transfer to local host (received)

środa, 8 czerwca 2011

Faster PHP? Kick off getters and setters.

In PHP getters and setters sucks on performance.



Output on my Ubuntu VM (PHP 5.3.5):
test_getters_setters: 0.64945447444916
test_public_properties: 0.27986690998077
test_magic_methods: 1.0444820642471
test_array_access: 0.9640593290329


WTF? How many getters/setters You use in your project per request?

Source: Let's make the web faster by Google