Archive for December, 2009

Stop BackupExec failing on corrupt files

I expect there will be a flag for this in future versions, but for now regedit is needed: HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\Backup Exec\Engine\Backup [For versions 9x and 10x] HKEY_LOCAL_MACHINE\SOFTWARE\SYMANTEC\Backup Exec for Windows\Backup Exec\Engine\Backup [For versions  11x and 12x] On the menu bar, select Edit | Add Value In the Value name field, type in “Fail Jobs On Corrupt […]

IIS File Upload Limit

By default IIS sets the upload filesize limit to a measly 200KB.  To edit this you need to enable direct metabase editing in IIS, then edit c:\windows\system32\inetsrv\Metabase.xml .  You need to modify the MaxRequestEntityAllowed which is in bytes.  Restart IIS.

SMTP Reply codes

Code     Meaning 200     (nonstandard success response, see rfc876) 211     System status, or system help reply 214     Help message 220     <domain> Service ready 221     <domain> Service closing transmission channel 250     Requested mail action okay, completed 251     User not local; will forward to <forward-path> 354     Start mail input; […]

BASH create random password

apg -MSNCL  -m8 -x11 -n10 -E\%\\\/\|\`\<\>\+\{\}\”\’ or < /dev/urandom tr -dc A-Za-z0-9_$*?! | head -c10 Another useful implementation thanks to, a sample random password generator (put in your ~/.bashrc): genpasswd() { local l=$1 [ “$l” == “” ] && l=20 tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs } Run it: […]

BASH email test script

#!/bin/bash # script to send simple email # Email To ? echo “Enter Mail To” read EMAIL # Email text/message EMAILMESSAGE=”/tmp/emailmessage.txt” echo “This is an email message test”>>$EMAILMESSAGE echo | date >> $EMAILMESSAGE echo “Test”>>$EMAILMESSAGE echo “Test”>>$EMAILMESSAGE nail -v -r “” -s “Test Email” -S smtp=mysmtpserver $EMAIL < $EMAILMESSAGE #Clean up rm /tmp/emailmessage.txt

Base64 Decode using shell

perl -MMIME::Base64 -ne ‘print decode_base64($_)’ < | less

Purge MySQL Binary Logs

If you have binary logging enabled in MySQL, for example if you are using replication, there is a good chance that these binary logs will grown pretty big and fill the disk.  It’s a good idea to set some limits in my.cnf expire-logs-days    = 20 max_binlog_size         = 104857600 If you find the need to purge […]

Crazy Zend Errors!

Like so: Zend� 2002062301�1�29734�169503�xù Ÿ2 ì½MlgÇu/x›¤ßÉ0 Y|RlÙn·r«n}>=%ÔJ^Ú‹‘”<Ä“1Ãnþ[Í›ìlK­Á´`A›Ù%›L?H XhÀ… kñyÐBh-ò.öh1„EÀ+ƒ0§îg}ž**’¢¸õÿœ[¿:çÔ©SU§ŒSøüﯽ0Û¼9 xÇ´D‘ ÑJUíÜ¿uûæÍ;mnmí÷SxeÜ3ó?Z½ô@÷åŽ,Ëjkvm{w¶ÕOJ÷²)sãOž¼ü7þðÙN½H§ÀzÞ×¾¤¾„¹Žë;þ,úæâ‡Nm „‰êâöþìêáÚ“W¯ÎÀmØ[3C¿¶³wuóp{o×Ì~»{‡k›;;{/϶[û_§ ùúáá­ÿüÛ¿mìÊ•;{‡³«×aùí›WwníÜ>xøw.=ùôåuø¯µõý½µ§ÁöìíÎv×®íí¯]ÚÛ»¹³ùŸÖÈcõc¤Y{¾ðvnÿß7M¾ Ioncube and Zend Optimizer don’t get on.  Ioncube needs to be loaded by PHP first to avoid problems.  Rather than loading them in php.ini, it’s wiser to add their own ini files in /etc/php.d which is then read alphabetically.

Disable Data Execution Prevention (DEP) in Windows 2003

In Windows, right click on My Computer -> Properties -> Advanced -> Startup and recovery -> Setting -> Edit and change /NoExecute=…  to  /NoExecute=AlwaysOff You will need to reboot for changes to take effect.

xpdf and antiword test scripts

xpdf and antiword test scripts.  xpdf is now part of the poppler and poppler-utils packages <HTML> <BODY> <PRE> <?php $return_code = 0; $result = array(); $error = exec(‘/usr/bin/pdftotext /var/www/vhosts/’, $result, $return_code);