Postfix smtp relay on OS X Yosemite 10.10

I’m lazy, and for email testing this is great. Who doesn’t need an email relay at some point? As there was no off the shelf solution, here it is for Yosemite.

Define the relay host:
sudo vim /etc/postfix/main.cf
Add section after the existing ‘relayhost’ example:
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_use_tls = yes
smtp_sasl_mechanism_filter = plain

Add your account for the relay to use.
sudo vim /etc/postfix/sasl_passwd
add:
[smtp.gmail.com]:587 name@somedomain.org:password

Make sure it starts at boot. If you don’t want this, skip this!
sudo vi /System/Library/LaunchDaemons/org.postfix.master.plist
after:
</dict>
add this:
<key>RunAtLoad</key>
<true/>

Finally:
sudo chmod 600 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd

Then stop postfix:
sudo launchctl stop org.postfix.master
And start it again (so it reads the config changes):
sudo launchctl start org.postfix.master
sudo postfix start

Check it’s listening:
netstat -an | grep LISTEN | grep 25
It should output something like this:
tcp6 0 0 ::1.25 *.* LISTEN
tcp4 0 0 127.0.0.1.25 *.* LISTEN

You can test it like so:
df -kH | mail -s “contents” your@yourdomain.com

Disclaimer:
1) You can screw your postfix if you don’t pay attention. Be carefull.
2) gmail was used as an example. I’m not endorsed, sponsored or whatever.

This is based on:
Using MacOSX Lion command line mail with Gmail as SMTP
Mac OS X 10.10 Yosemite Postfix SASL authentication failed

How to setup NTPd on OS X

So if you would like to have a Mac acting as a ntp server, the steps are pretty straightforward. This works on all recent client and server versions of OS X.

1) Unload the ntp plist (most definitely needed on the server OS):
launchctl unload /System/Library/LaunchDaemons/org.ntp.ntpd.plist

2) Modify the ntp-restrict.conf
The following lines in the file:
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
Should become:
restrict default kod nomodify notrap nopeer
restrict -6 default kod nomodify notrap nopeer

Basically the ‘noquery’ needs to be removed.

3) Load the ntp plist.
launchctl load /System/Library/LaunchDaemons/org.ntp.ntpd.plist

That’s it! Piece of raw brownie (better than cake, trust me).
Then modify whatever box that needs an ntp server to point to you freshly modified Mac.

Disable BitLocker on Windows (perhaps for a HW change)

In a tight spot with BitLocker on your Windows system?
For example wanting to do a hardware change(s) to your system?
Become IT dept independent!

Disable BitLocker, do your changes, and turn it back on.

Please note : You will need an admin shell – not God mode, just a ‘run as admin’ dos box.

1) In the shell type:

 manage-bde -protectors -disable C:

2) Do the changes.

3) Turn it back on:

 manage-bde -protectors -enable C:

Thats it. YMMV
This is also a decent resource:
http://technet.microsoft.com/en-us/library/dd875513(v=ws.10).aspx

Loading drivers in ESXi 5.0

So I upgraded to 5 from 4.1 – Cool. Almost. Vanilla install had no support for my Promise SuperTrak EX-8654 card which I have in my HP MircoServer. Now what?!?!?
Well, after a lot of searches, the solution was actually on the Promise site! Yay for them!

So in short an example of you to load a driver on esxi 5.0.

1) Enable ssh access on your esxi 5 host (what do you mean you’ve already done that? It’s dangerous!)

2) Get you driver. The 8654 driver I got from the Promise support site was called 'scsi-stex-4.07.0000.75-1OEM.500.0.0.472560.x86_64.vib'. Yep, what’s in a name.

3) Copy over the driver to the host using scp
ex: scp <driver name> root@<esxi_5_host_ip>:/tmp

4) Next ssh to the esxi host, go to /tmp

5) Install the driver
esxcli software vib install -v /tmp/<driver name>

6) Reload the esxi host – Oh I hand’t told you? Well you need the driver right?

7) Then ssh to the esxi host and check if the driver loaded with 'esxcli software vib list'
In my specific case it looked like this:

~ # esxcli software vib list
Name        Version                             Vendor   Acceptance Level  Install Date
----------  ----------------------------------  -------  ----------------  ------------
scsi-stex   4.07.0000.75-1OEM.500.0.0.472560    Promise  VMwareCertified   2011-12-26

8) Sit back and enjoy the fact you have access to the disks again for adding as a datastore.

(Sony) XDCAM Transfer for OS X

So as I now and then have to fix up a OS X + FCP install with XDCAM PDW-U01 import functionality, here is a short howto:
1) PDZK-P1 XDCAM Transfer, now 2.12
2) Mac i.Link FAM driver
3) XDCAM Browser, currently 1.2

The links might break, so here is the official Sony XDCAM site.

I am not affiliated with Sony, nor do they pay me for this. It’s just a braindump for myself and hopefully others will find this helpful!

The Windows multiple program installer thingie…

I keep forgetting this GREAT tool. After a nice clean Windoze install, all it takes is one visit to http://ninite.com/ and a few clicks, and your all set as far as software goes. Download the bundled installer click on it, and go for coffee… 🙂 Joy!

Before throwing rotten tomatoes, yes this is Windows only… my bad! No I don’t have shares or anything. I’m just lazy!

Joining partitions in OS X

Eager to take on new challenges, preferebly with live equipment, I decided to reclaim some disk space.

My Ubuntu install on my MacBookPro was sitting there unused for a while now. And with VM’s who needs to dual boot anyway?

So, let’s trash my Ubuntu install. Now joining my ‘windows’ disk to my active partition was a piece of cake. However the linux swap would not budge.

Ofcourse booting from another disk was a solution which is by me considered as a failure not a solution.

Simple solution in the end:

box:~ user$ diskutil list /dev/disk0

/dev/disk0
#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *320.1 GB   disk0
1:                        EFI                         209.7 MB   disk0s1
2:                  Apple_HFS Inlakesh                309.2 GB   disk0s2
3:                 Linux Swap                         4.1 GB     disk0s3

box:~ user$ diskutil eraseVolume HFS+ oldswap disk0s3

Started erase on disk0s3
Unmounting disk
Erasing
Initialized /dev/rdisk0s3 as a 4 GB HFS Plus volume
Mounting disk
Finished erase on disk0s3 oldswap

box:~ user$ diskutil list /dev/disk0

/dev/disk0
#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *320.1 GB   disk0
1:                        EFI                         209.7 MB   disk0s1
2:                  Apple_HFS Inlakesh                309.2 GB   disk0s2
3:                  Apple_HFS oldswap                 4.1 GB     disk0s3

box:~ user$ diskutil mergePartitions HFS+ Inlakesh disk0s2 disk0s3

Merging partitions into a new partition
Start partition: disk0s2 Inlakesh
Finish partition: disk0s3 oldswap
Started partitioning on disk0
Merging partitions
Waiting for disks to reappear
Growing disk
Finished partitioning on disk0
/dev/disk0
#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *320.1 GB   disk0
1:                        EFI                         209.7 MB   disk0s1
2:                  Apple_HFS Inlakesh                319.7 GB   disk0s2

That’s it. Scrapping the uneeded partition (volume in apple diskutil speak) to something diskutil understands, i.e. HFS+, worked like a charm!

Enjoy.

Serial converters on Mac OS X ( USB to RS232 )

Hello All.
Being a network equipment kind of person, there is no way around the console and then. We all know the Prolific 2303 works fine, and now I know that most FTDI converters (on sale at for example the fnac stores) also have excellent drivers for Mac OS X.

So getting a good and cheap cable is not an issue, nor is getting a driver a challenge.

The other bit I’d like to share is the wonderful command line tool called ‘screen’. Now you can do lots of funky stuff with screen, however also use it for accessing your serial port.
It’s as simple as ‘screen /dev/tty.PL2303-XXX 9600‘ or ‘screen /dev/tty.usbserial-XXX 9600‘ et voilà.
To end a screen session the propper way, releasing your serial port again, is done by ‘Ctrl+A‘, followed by ‘:‘ and typing ‘exit‘ and hitting return.
There are plenty of guides out there if you think this is too basic. I just wanted to share that serial console on a mac is easy.