Found a good one: www.gaxee.com. Seems to support WMZ / WMR to PayPal too!
Symfony2 – how to find current environment
AppKernel and DependencyInjection container in Symfony 2 tests
It's fairly simple to use app kernel and DI container in symfony tests, just require AppKernel.php:
require_once __DIR__.'/../../../../../../app/AppKernel.php';
and then boot your app in setUp method:
private $container;
public function setUp()
{
$this->app = new \AppKernel('test', true);
$this->app->boot();
$this->container = $this->app->getContainer();
}
then, use a container where needed:
public function testFoo()
{
$this->container->get('logger')->debug('Foo');
}
bash – stripping newlines and replacing with spaces
For example, if you have an linux shell command output, newline-separated, and need to convert output to space-separated, pipe it to tr "\n" " " like so:
dpkg -l | grep php | cut -d " " -f 3 | tr "\n" " "
Hello, world!
This is a first post in a category dedicated to simple JavaScript dependency injection container.
Check repo on github:
Openvz Munin CPU monitoring
Found a wonderful plugin to monitor CPU usage on openvz containers:
http://exchange.munin-monitoring.org/plugins/openvzcpu/version/3/raw
I know you’ve got a big heart
I saw you draw it around
Bash: how to copy permissions recursively
Imagine you were copying an, eg, virtual server from /server to /newserver, and messed permissions in /etc; thre's a way to copy permissions with this simple script:
#!/bin/bash source=$1 target=$2 echo "Copy files from $source to $target" cd $source files=`find $source` for file in $files do #this is some bash voodoo - string part replacement targetFile=$target${file#$source} #stat command can accept -c parameter and return data in needed format #where %u and %g are numeric user/group ids, and %a - octal permissions permissions=`stat -c%a $file` ownership=`stat -c%u:%g $file` echo $targetFile to $ownership $permissions chmod $permissions $targetFile chown $ownership $targetFile done
invoke this like
./permissions.sh /server/etc /newserver/etc
change %u:%g to %U:%G if you prefer string id's (www-data:www-data) more than numeric (0:0)
Symfony 2 chrome firebug
If you use chrome to develop symfony 2 apps, install this extension
https://chrome.google.com/webstore/detail/cjbeipenlpoeifpkjhgakejmikdhlhcj
to view symfony generated firephp messages in console.
Oh shi…
http://habrahabr.ru/blogs/mysql/130999/
Слов нету, ага. Кажется postgres станет для меня стандартом.