Linux, Windows, Misc.
Just a quick hint if anyone else has the same problem :)
I have moved to a new place and I was experiencing strange network issues on mu linux.
It seemed like internet was working but some websites just would not load. I noticed that it was especially bad on google products and other larger sites. Many sites would never load when on SSL!
Pecl extension does not compile with the version on rabbitmq-c library shipped with ubuntu so you will have to manually install the library. Here is step by step guide how to do it.
That is just a very quick tip how to get git branch name into the prompt. Friend of mine pointed me to this neat little trick just last week and i thought its pretty neat so i am sharing it.
It was very interesting as my cacti installation began failing today. For no apparent reason. I noticed CPU usage and CPU temperature going through the roof as PHP script ran by cacti was stuck in some infinite loop or active wait state. It seemed to query database non stop without sleeping or anything and it was not doing anything either.
I looked in error log and there was nothing, looked in access log of monitored server ... nothing again. Finally i looked into cacti log and found tons of messages like this:
I guess most of people have heard of address space randomization and linux kernel patches that provide that. PAX is a project that has been running for years and it is an awesome way to reduce risk of buffer overflow attacks on your linux server. The great thing about it is that it makes it harder to execute most common buffer overflows system-wide.
It is a bit frustrating that i have to use mac and can not just use the same system that we have in production but well, that is the standard now. So to make the best of it you have to adapt and learn how to deal with operating system issues ;)
I found it a bit tricky to compile PHP extensions like PECL memcache or whatever on my mac for a few reasons. My mac comes with PHP 5.3 and i need to run my site on 5.2 that i got from MAMP. In addition i have 64 bit system that runs PHP in 32 bit mode so i have to tell compiler to use 32 bit mode only.
I am using new Ubuntu at home on my laptop for a while now and to be honest i still can not get used to it. There seems to be some friction wither i can not figure out there is the greatness or i am too old or it is just not that great. If you know answers to my questions please drop me a comment.
This is a funny problem that took forever to figure out! unreal!
Friend committed new component into the revision control system i checked it out and my maven builds would get stuck on compilation. It would take like 20 minutes to run the compilation!
Compilation with javac would take forever no matter if there was error or not. Importing any net.xxxx package would make builds stall forever.
If you do a lot of funky stuff you may need to have a few virtual machines running different images of debian. Well at least i do that. It works great but once you suspend the image it looses the current time. It is not a big deal but causes nasty errors during software updates (timestamp in the future).
The bigger problem is that if your time is not synchronized you wont be able to use Web Services Security (WS-S) extension in JAX-WS as it will complain about requests from the future as well!
Java applications that use ssl to consume web services via jax-ws or use HTTP clients may check the SSL certificate of the server in runtime. In case if your certificate is self signed or Common Name of the certificate does not match the domain name you will get connection errors.
To be able to develop applications you may need to run them on dev/qa servers and then allow your Java application consume these services. To do it you will need to import their SSL certificates into your local Java keyring (the same way you add exception rules into your browser).
Building apache and PHP with all its extensions may be fun once or twice but it is a major pain in the neck. So to avoid that (and to have it before Debian Squeeze is released) you can use e special dotdeb repository of almost everything that you may need as a web dev. It is especially convenient if you have a few development servers to update with different configurations and you don't want to waste too much time on it.
Debian is my favorite linux system since 2001 or 2002. It is awesome.
The only thing that could be better is that packages are usually very old comparing to current versions. Well but at least everything works. I have used apt-get to upgrade distributions since potato release. So far it worked every time. I think i had some small issues with upgrading samba or cups once but simply going back to previous version worked of the package worked. But after all it always worked.
Monitoring of application and server health is an important task, while trying to maintain high availability. Without monitoring you dont know what goes wrong and you do not know when exactly does it happen. Some time ago i realized that the graphs i used to use were not perfect. I searched the web, read a bit of documentation and decided to put together a set of simple scripts gathering key server performance metrics.
This bundle includes gathering scripts and graph templates for Memcached, APC, Apache2, Linux file system, Linux memeory, CPU and Network. It should cover all the most important aspects for a typical web server. Graphs are designed to match my expectations and to make analysis easier.
I still dont have postgres, sphinx nor mysql stats included but .... who knows .... maybe in version 4! :- )
Doing security reviews from time to time of web applications you can find real beauties. You see GET variables in eval, system, include and all sorts of things you would not even imagine that could run live for years without anyone noticing it :- )
Mysql is so common that its good idea to have some command line scripts or tricks. Sometimes you need to execute some SQL queries on set of tables or all of them or get stats or fix tables etc.
Its good to be able quickly get list of tables and basic stats.
You can make bash script of it or just type in the command line: