19 Dec, 2011
To create a large file VERY quickly (without dumping data into), for example a 20GB file, do like this: dd if=/dev/zero of=mylargefile.img seek=$(( 20 *1024*1024*1024 -1 )) bs=1 count=1 This will create your file in a second without dump zeroes using the classic ‘dd’ command: dd if=/dev/zero of=mylargefile.img bs=1M count=$((20 * 1024)) Useful to create [...]
17 Oct, 2011
Recently i developed a Perl script for a TLC company to monitor thread pools of a weblogic cluster with nagios, here i’m going to post a sample version.
10 Jun, 2011
The old versions of proftpd dont support mysql md5 algorithm for password checks, so for who like me use debian lenny with 1.3.1 the only way to make it work with MD5 is to use PAM-MySQL + libnss-mysql. With 1.3.x proftpd comes with mod_sql_passwd.c that solve this problem (here a sample conf): SQLAuthTypes MD5 SQLPasswordEngine [...]
02 Feb, 2011
Working for a Hosting provider we need to centralize virtualhosts configs on database, but there is not a native apache virtualhost module based on LDAP or SQL backends. We started using mod_vhost_ldap without success because our customer’s servers have weird paths for ServerRoot and vhosts positions changes between servers… moreover mod_vhost_ldap doesn’t support Alias parameter and [...]
11 Nov, 2010
When creating a new filter in RC Managesieve plugin with the rule “Sender is equal to” RC compile a sieve script like this one: if anyof (header :is “From” “example@example.com”) { fileinto “INBOX.Spam”; stop; } Of course this script will FAIL when sender is ‘”Simone Caruso” <example@example.com>’, because “header” matches strings NOT addresses! Ref. RFC5228 [...]
19 Sep, 2010
Environment My customer, in this case an ISP, has multiple dns servers was going to scale-out the DNS records database for multiple DNS servers. The startup configuration was a master/slave, with DRBD failover MySQL cluster; the new configuration was accomplished with a MySQL master database and three servers as slaves, two for DNS servers queries and one for [...]
14 Sep, 2010
Times ago, because we entered the web2.0/e-commerce generation all custemers want an e-shop, I was looking for some Pear/PayPal PHP script without success. Becouse i love pear for speeding up code development etc i wrote my little pear/paypal library, here an example.
05 Sep, 2010
I really like the apt system, i often use it for my personal binary packages distribution between my systems and it’s great to install test systems in few minutes. In august dovecot 2.0.1 was released, i’d have liked to test the new software on my lenny servers, but i could not find any .deb binary [...]
19 Jul, 2010
Starting a secure server like Apache, Postfix, Dovecot etc needs passphrase submission at startup… so it’s a problem start these services at book. The solution is decrypting the certificate private key with the following command: openssl rsa -in priv.key -out decrypted-priv.key
14 Jul, 2010
A small persistence class for PHP, integrable with any kind of persistence storage (file, SQL, …)