Rewrite Outgoing Addresses with Postfix

July 21st, 2010

Address rewriting allows changing outgoing email ID or domain name itself. This is good for hiding internal user names. For example:
SMTP user: tom-01
EMAIL ID: tom@domain.com
Server name: server01.hosting.com

However when tom-01 send an email from shell prompt or using php it looks like it was send from tom-01@server01.hosting.com

In some cases internal hosts have no valid Internet domain name, and instead use a name such as localdomain.local or something else. This can be a problem when you want to send mail over the Internet, because many mail servers reject mail addresses with invalid domain names to avoid spam.

Postfix MTA offers smtp_generic_maps parameter. You can specify lookup tables that replace local mail addresses by valid Internet addresses when mail leaves the machine via SMTP.

Open your main.cf file
# vi /etc/postfix/main.cf

Append following parameter
smtp_generic_maps = hash:/etc/postfix/generic

Save and close the file. Open /etc/postfix/generic file:
# vi /etc/postfix/generic

Make sure tom-01@server01.hosting.com change to tom@domain.com
tom-01@server01.hosting.com tom@domain.com

Save and close the file. Create or update generic postfix table:
# postmap /etc/postfix/generic

Restart postfix:
# /etc/init.d/postfix restart

When mail is sent to a remote host via SMTP this replaces tom-01@server01.hosting.com by tom@domain.com mail address. You can use this trick to replace address with your ISP address if you are connected via local SMTP.

via NixCraft.

Tags: , ,
Posted in Tech Stuff | Comments (0)

SSH Tunnel/SOCKS Proxy

May 17th, 2010

Instructions are for Mac, YMMV.

Enter the following command into Terminal, replacing myuser@myserver.com for the username/host where you have SSH access:
ssh -D 8080 -f -C -q -N myuser@myserver.com

Thats it!  You may now configure localhost:8080 as a SOCKS proxy in your browser (see the link below for generic/Safari instructions – Firefox is configured in Preferences -> Advanced -> Network -> “Settings”).

How To: Surf Securely with an SSH Tunnel — PaulStamatiou.com.

Posted in Tech Stuff | Comments (0)

Hide Accounts from Windows Login Screen

May 4th, 2010

Login accounts can be hidden from the Windows Welcome/login screen by creating a registry key as follows:

HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\SpecialAccounts\UserList
Add DWORD for “AccountName” and set value to 0 to hide it from the UI

I use this for setting up Access Code authentication with LogMeIn after LMI has been installed.  You can create the LogMeInRemoteUser, add it to the Administrators group, then create a registry key in the above matching the username.

Posted in Tech Stuff | Comments (0)

Convert WAV file for use with Asterisk greetings/IVR

April 29th, 2010

If file1.wav is any WAV file, then executing this command: sox file1.wav -r 8000 -c 1 -s file2.wav resample -ql you will get Asterisk playable WAV file: file2.wav.

sox is a free download from http://sox.sourceforge.net/ for Windows, Mac OS X and Linux.

The “resample” option is deprecated in the most recent version of sox (v14.3.1), but still works and only throws up a warning.

I use the following script to convert a batch of files:

mkdir new
for I in $(ls -1 *.wav)
do
NAME=$I
echo “Converting $NAME”
sox $NAME -r 8000 -c 1 -s new/$NAME resample -ql
echo “Output filename: new/$NAME”
done

Posted in Tech Stuff | Comments (0)

Save non-savable PDF files

April 1st, 2010

Occasionally one has to use an annoying PDF that one can’t re-save, but can only print. My sister had this situation dealing with some obnoxious state-run Microsoft system that didn’t allow the user to save a completed form, only to print it from a browser. The individual administering the system apparently flipped the wrong bit, as last year, the form could be saved.Here’s a workaround, various versions of which can allow you to save the PDF:

1. Turn off the print queue for the printer by going to Printer Setup Utility.

2. Print the file, but don’t reactivate the printer — choose the Add to Queue option.

3. Go into the terminal and su to root. If you haven’t enabled root, use sudo -s to start a root shell.

4. Type cd /var/spool/cups, then identify the file you just printed. Do this by matching the queued file’s time stamp to the time you printed the file ls -l; the file of interest should be at the bottom.

5. Copy don’t move that file out of the spool folder: cp filename ~/Desktop. I don’t know what a move mv will do to the print system.

6. Type cd ~/Desktop to move to your user’s Desktop folder.

7. Type chown myaccount:myaccount filename to make sure the Finder in your user space will play nicely with the file.

8. Peek inside the file and determine whether it’s a postscript or PDF file — you can drop it on TextEdit to see its contents. If it’s a postscript file, rename the file to filename.ps. If it’s a PDF file, rename it to filename.pdf.

9. Confirm the above by dropping the file on Preview. If the file is a postscript file, you can then save it as a PDF file from Preview.

via Save non-savable PDF files – Mac OS X Hints.

Tags: , , , ,
Posted in Tech Stuff | Comments (0)

Disable AirPort when Ethernet cable is connected – Mac OS X Hints

March 15th, 2010

hellomrzebra415 writes: “At my office, I needed to find a way to turn of the wireless network when someone plugged in their network cable. I also did not want them to be able to turn the wireless network back on until the network cable was unplugged. I came up with the fallowing solution.

via Mac OS X Hints.

Posted in Tech Stuff | Comments (0)

LogMeIn Express Makes Screensharing Simple

December 19th, 2009

LogMeIn Express is a screensharing tool from the makers of the popular remote-desktop software, LogMeIn. With this new offering, sharing your desktop is as simple as sending your friend or associate a URL.

Only the person doing the screensharing needs to download anything. The sharer only requires a small application from LogMeIn, the viewer only needs to visit the LogMeIn Express site and plug in the number that the sharer has given them.

via Lifehacker.

Posted in Tech Stuff | Comments (0)

Mac OS X DNS Cache

December 19th, 2009

When you visit any website or host on your computer, the DNS reference/IP address gets cached for quite some time.  This can be a pain if you are migrating domains, or changing webhosts and need to test to see that your new changes are being propagated/used correctly.

In order to flush the DNS cache in Mac OS X, type the following command into a Terminal window:
dscacheutil -flushcache

This command works on Mac OS X 10.5 and above (including 10.6/Snow Leopard).

The command in Mac OS X 10.4 is:
lookupd -flushcache

Tags: , , , ,
Posted in Tech Stuff | Comments (0)

VMware Interfaces/IP Addressing

December 19th, 2009

In testing some virtual machines with multiple network cards under VMware (namely Fusion, but this information seems to apply to all variants of VMware Workstation on all platforms), I found I needed to use the NAT’d and Host-Only network interfaces.  While under other platforms, it may be easier to find, I had a hard time determining which interface was what, and what IP subnet it used (I was needing static IPs on the VM’s network cards).

As it appears, this information is stored in configuration files, as it is normally used for DHCP purposes on those interfaces.

The proper subnets can be found as follows.  I have only tested this on Mac OS X, the Linux information is merely provided for reference, as I found it mentioned elsewhere.

Linux:
/etc/vmware/vmnet1/dhcp/dhcp.conf (Host-Only)
/etc/vmware/vmnet8/dhcp/dhcp.conf (NAT)

Mac OS X:
/Library/Application Support/VMware Fusion/vmnet1/dhcpd.conf (Host-Only)
/Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf (NAT)

These files will show you the DHCP subnet and range on those interfaces in the event you need to know/use IPs in those subnets in your VMs.

Tags: , , , , , ,
Posted in Tech Stuff | Comments (0)

Recent Posts