Welcome to my blog!

Here I try to keep useful information about IT, mostly related to Web development and Linux stuff. Any comments or feedback that you might have will be much appreciated!

Thanks,
Tomi

Quick DB dumps with automatic file name generation based on date/time

Filed Under (Databases, Linux) by admin on 27-12-2009

Simple DB backup
mysqldump -h [server name] -u [user name] [db name] -p > site-db-`date +%y%m%d-%H%M`.sql

Complete MySQL dump with compression
mysqldump –all-databases -u admin -p`cat /etc/psa/.psa.shadow` > `hostname -s`-mysql-`date +%y%m%d`.sql
tar zcf `hostname -s`-mysql-`date +%y%m%d`.tgz `hostname -s`-mysql-`date +%y%m%d`.sql
rm `hostname -s`-mysql-`date +%y%m%d`.sql

Complete HTTP sites data with compression
cd /var/www/vhosts/
tar zcf `hostname -s`-sites-`date +%y%m%d`.tgz * –exclude=*/statistics/* -v –exclude=ilatina.com/httpdocs/downloads/
mv `hostname -s`-sites-`date +%y%m%d`.tgz /root/.data/`hostname -s`

Query string based redirection with mod_rewrite

Filed Under (Linux, mod_rewrite) by admin on 31-07-2009

Today I was playing (more) with mod_rewrite, and came to an interesting requirement: how to redirect a page that receives a specific parameter value to another URL (as in article.php?id=57 to article.php?id=686)?

Read the rest of this entry »

Create bind records which match any query

Filed Under (DNS, Linux) by admin on 19-03-2009

Tagged Under : , , , ,

Today I was configuring a DNS server and noticed that not much reference on how to create records that match any host exists.

What I needed was to setup up a proxy server using a domain that was has its website and email externally hosted, while giving the LAN users the option to enter proxy.example.com as the proxy name server.  Basically, I needed the DNS server to return a local IP address for the proxy and the real Internet addresses for the other hosts.  I came with two possible solutions: Read the rest of this entry »

Blocking connections to ssh without iptables

Filed Under (Linux) by admin on 23-08-2006

On our Internet connected servers, besides using iptables to limit incoming connections, we are using TCP wrappers (hosts.allow and hosts.deny) to reject connections originating on untrusted networks.

Probably you’re already using iptables to block incoming traffic on port 22 (ssh), which is fine but what we want to do is increase security by using a more persistent method for blocking traffic. Don’t get me wrong, iptables’ rules can (and should) be made persistent but sometimes while trying new rules some key ports can be left open. Read the rest of this entry »

Horde 3.0.5 / Plesk 7.5.4 Exploit

Filed Under (Linux, PHP, Plesk) by admin on 13-08-2006

Running a check on Apache’s default logs (/var/log/httpd/access_log), I found attempts to exploit the server thru a “backdoor” in Horde.

I haven’t fully checked what could be done with this exploit but certainly leaving the affected script unprotected is an open invitation for trouble. Read the rest of this entry »

psycheclone? Just a poorly written spider?

Filed Under (Linux, Technical Internet) by admin on 26-06-2006

Recently I noticed that a new spider was going thru all of our sites, but there was something special about this one: Read the rest of this entry »

Using an alternate sendmail configuration file on PHP

Filed Under (Linux, PHP) by admin on 17-06-2006

While I was designing a system that needed to send mass-customized emails from PHP, I faced two problems: a) change the envelope address (Return-path: header) and b) (most important) avoid overloading the server when sending the messages because of virus check.

Basically, I wanted to use a different sendmail configuration file from PHP to skip the relay-mail virus check from Amavis.

Read the rest of this entry »