Configure mailgun on Ubuntu (bsd-mailx / postfix)

1) Install bsd-mailx

aptitude install bsd-mailx

Select Internet Site in the Postfix Configuration screen.

If you missed it or want do reconfigure do:

dpkg-reconfigure postfix

2) Add mailgun configuration

Edit /etc/postfix/main.cf

relayhost = smtp.mailgun.org
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:[email protected]:password
smtp_sasl_security_options = noanonymous

3) Restart the postifx service

service postfix restart

Source: https://www.jamroom.net/brian/documentation/guides/1312/set-up-postfix-with-mailgun-for-reliable-e-mail-delivery

VirtualBox useful commands (VBoxManage/VBoxHeadless)

[bash gutter=”false”]
# change VirtualBox disk and machine default location
VBoxManage setproperty hdfolder /volumes/data/vbox
VBoxManage setproperty machinefolder /volumes/data/vbox

# create a VM
VBoxManage createvm –name "U10.4-base" –ostype Ubuntu –register
# add some ram, network card, DVD-ROM
VBoxManage modifyvm "U10.4-base" –memory 128 –acpi on –boot1 dvd –nic1 bridged
# create a HDD
VBoxManage createhd –filename U10.4-base.vdi –size 10000 –register

# attach storage controllers to it
VBoxManage storagectl "U10.4-base" –name "IDE Controller" –add ide
VBoxManage storageattach "U10.4-base" –storagectl "IDE Controller" –port 1 –device 0 –type dvddrive –medium none

# remove .iso
VBoxManage closemedium dvd /volumes/data/exchange/mini-ubuntu-10.04-server-i386.iso

# start VM
VBoxHeadless –startvm "U10.4-base"

# stop VM (requires package acpid)
VBoxManage controlvm "U10.4-base" acpipowerbutton

# view VM information
VBoxManage showvminfo "U10.4-base"
[/bash]

FreeNAS CIFS/Samba changing Guest Account ‘FTP’ not working

Using FreeNAS 0.7 Khasadar (revision 4919) with CIFS/SMB Authentication Anonymous, I changed the Guest account for but it is not actually applying it to the configuration, it is a trivial bug and here’s a small dirty workaround.

1 – Create an excutable file containing this:

[bash]
#!/bin/sh

# find and replace ‘ftp’ by ‘transmission’
sed -i. ‘s/ftp/transmission/g’ /etc/rc.d/samba

# restart samba to use the new config
/etc/rc.d/samba restart
[/bash]

2 – Go in System|Advanced|Command scripts and add an entry for your script in “PostInit”

For those who are interested, I am doing this because my network is not accessible from the outside and I didn’t want to bother with user privileges. I am using my FreeNAS box to share media files downloaded using Transmission and I wanted everybody to be able to access/modify/delete them, so I change the guest account to be “transmission” 🙂

Tip: use rsync to convert filenames from/to UTF-8 latin-1/ISO-8859-1

This will copy files with UTF-8 encoded characters filenames to new files with a ISO-8859-1 encoded filenames and, when everything is completed, will delete the old (UTF-8) files.

BE CAREFUL THIS IS NOT FOOL PROOF 🙂 YOU MUST KNOW WHAT YOU ARE DOING TO NOT DOUBLE ENCODE THE CHARACTERS FILENAMES.

rsync SOURCE SAMEFORDESTINATION --recursive --human-readable --stats --times --progress --iconv=utf8,iso88591 --delete-after

To do the opposite change the iconv switch to: --iconv=iso88591,utf8

Note: If you run rsync as root, you can use --owner --group to keep the same user.group for the copied files.