Change the Envelope From Header for apache, php

On an Ubuntu installation, the php sendmail function will send out email as the apache user www-data@servername.domain. This can make the email flag as spam on some mail servers. To get around this edit your php.ini and restart apache.

Edit the php.ini

sudo vi /etc/php5/apache2/php.ini

Edit the following string:

sendmail_path = '/usr/sbin/sendmail -t -i -fno-reply@yourdomain.com -Fno-reply'

Now restart apache:

sudo service apache2 restart

Install vmware tools on Ubuntu 13.04 (Raring Ringtail)

I am doing this on server edition.
First do an apt-get update, then apt-get upgrade to bring the entire system current. Then install build tools and kernel headers with the following command:

sudo apt-get install build-essential linux-headers`uname -r`

Now click on the Install VMWare Tools option on your Guest. On your VM, run the following command:

sudo mount /dev/sr0 /mnt

Then copy the tools image to the Guest:

cp /mnt/VMwareTools-8.6.10-913593.tar.gz /tmp

You may have a different version of VMwareTools. Now ruun the following commands:

cd /tmp
tar -xzvf VMwareTools-8.6.10-913593.tar.gz
cd vmware-tools-distrib

Now start the install:

sudo ./vmware-install.pl

I chose all the default values. I did not install any options marked [EXPERIMENTAL]. When the installer is searching for valid headers, I received an error that they could not be found in “”. So, a little searching and I found that some of the headers moved so:

sudo ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/version.h

Delete .Net Temp files.

A short script to delete .Net temp files:

@ECHO OFF

iisreset /stop

Echo Deleting x86 Temporary ASP.NET Files

for /d %%i in ("%systemroot%\Microsoft.Net\Framework\v*") do for /d %%f in ("%%i\Temporary ASP.NET Files\*") do RD /q/s "%%f"

Echo Deleting x64 Temporary ASP.NET Files
for /d %%i in ("%systemroot%\Microsoft.Net\Framework64\v*") do for /d %%f in ("%%i\Temporary ASP.NET Files\*") do RD /q/s "%%f"

iisreset /start

svnsync problems

I have a little cron job that syncs two svn repos. It runs every ten minutes. For some reason it stopped working so I killed the job. Now when I try to manually run the job, I get:

Failed to get lock on destination repos, currently held by...

Great, the sync is broken!
Here is how to clear it up. Use the following command to remove the lock:

svn propdel --revprop -r0 svn:sync-lock file:///path/to/the/repository

This is the sync script:

#!/bin/sh
svnsync synchronize file:///path/to/the/repository --username svnuser --password svnpassword