Архиви на блога

bash rename file

This is simple script which rename files based on some pattern For example rename all files AABBBCCC and replace BBB with DDD ./ren „AAABBBCCC“ „BBB“ „DDD“ #!/bin/bash # renames.sh # basic file renamer criteria=$1 re_match=$2 replace=$3 for i in $(

Публикувано в linux, Без категория

catch spam from apache

Sometimes is very hard to debug from which virtual host spam is This can be check very easy with this trick create a new file  vim /usr/local/bin/phpsendmail place inside it #!/usr/bin/php <?php $sendmail = ‘/usr/sbin/sendmail’; $logfile = ‘/var/log/mail.form’; /* Get

С етикет: , , , ,
Публикувано в linux, php

mysql Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead.

If you get some errors like this you need to open your home directory vim ~/.my.cnf and change on the row pass= to password=

С етикет: , , , , , ,
Публикувано в linux

dkim on debian with postfix

This is a guide to installing OpenDKIM for multiple domains on a Postfix-installtion on Debian. I tried some other guides but kept running into problems, so this is how I did it. Among others, Google Gmail and Yahoo mail check

С етикет: , ,
Публикувано в linux

sort output from linux du command

du -h | perl -e ‘sub h{%h=(K=>10,M=>20,G=>30);($n,$u)=shift=~/([0-9.]+)(\D)/;return $n*2**$h{$u}}print sort{h($b)h($a)};’ > dusort.txt

Публикувано в linux