Postfix: Add a catch-all domain

Configure postfix to forward all email for a domain to another destination. (#Ubuntu #Trusty)

$>vim /etc/postfix/main.cf
virtual_alias_domains = domain.com example.org
virtual_alias_maps = static:<email@example.org>
#virtual_alias_maps = hash:/etc/postfix/virtual
$>service postfix reload

Any email sent to *@domain.com, *@example.org will be redirected to email@example.org, assuming of course that you setup the MX record for domain.com / example.org to be the postfix server.

One risk is that any spam will also get forwarded; this is normally ok, but gmail etc will lower the sending MTA / IP score such that future emails that are not spam will still be treated as spam.

Docker ❤️ Parallels ❤️ OS X (El-Capitan)

Tags

, , ,

Getting started with Docker + Parallels on OS X (using Homebrew)

Update: Sep 2016: This is no longer relevant; best to download Docker for Mac which uses xhyve to virtualize the Docker Engine environment and Linux kernel-specific features on OS X. This allows for much easier sharing of files between your local machine and docker containers.

Want to use Docker on OS X? At the moment, the OS X kernel does not directly support containers like Docker or OpenVZ. So you have to run a VM with docker installed. You then use the Docker CLI to interact with the Docker (daemon) running on the VM. The whole process is actually very easy to setup now that Docker Machine supports the Parallels driver.

Assumptions: You already have Parallels (11, Business or Pro Edition) and Homebrew installed.

$> brew update  # need to brew with a recent version
$> brew upgrade
$> brew install docker docker-machine docker-machine-parallels
… grab some coffee…
$> docker-machine create -d parallels dev1
$> eval `docker-machine env dev1`
$> docker run hello-world

All done!

You are now ready to use Docker, Docker Composer and even Docker Swarm.

Scoring my iPhone rumour round-up

John Gruber (Daring Fireball): iPhone 6s (or whatever it’s called) will have the biggest jump in camera tech ever (perhaps dual-lens based on technology acquired from Linx)

  • Check, camera is now 12MP, records 4K, better low-light performance. Not dual-lens though.

Mark Gurman (9to5Mac): Same exterior (perhaps 0.13mm deeper, which is too small to be noticeable). Updated interior with fewer chips. Rose Gold as an option. Difference is size could be due to inclusion of Force Touch (not sure at all, just reporting feedback and comments on the article itself). Will have faster LTE (updated Qualcomm chip).
-(http://9to5mac.com/2015/07/03/iphone-6s-photos-nfc-storage-chips/)

  • Check, iPhone 6s is a infinitesimal bit larger, has fewer chips, rose-gold option, faster LTE, substantially improved CPU

WSJ: Apple manufacturing a record number of iPhones (90mn). Same sizes.
-(http://www.wsj.com/articles/apple-preparing-record-number-of-new-iphones-1436367371)

  • Seems to be holding up, esp. when looking at Apple’s guidance for the holiday quarter.

iPhone (vNext) Rumours

John Gruber (Daring Fireball): iPhone 6s (or whatever it’s called) will have the biggest jump in camera tech ever (perhaps dual-lens based on technology acquired from Linx)
-(http://daringfireball.net/thetalkshow/2014/11/15/ep-100)

Mark Gurman (9to5Mac): Same exterior (perhaps 0.13mm deeper, which is too small to be noticeable). Updated interior with fewer chips. Rose Gold as an option. Difference is size could be due to inclusion of Force Touch (not sure at all, just reporting feedback and comments on the article itself). Will have faster LTE (updated Qualcomm chip).
-(http://9to5mac.com/2015/07/03/iphone-6s-photos-nfc-storage-chips/)

WSJ: Apple manufacturing a record number of iPhones (90mn). Same sizes.
-(http://www.wsj.com/articles/apple-preparing-record-number-of-new-iphones-1436367371)

Will have iOS9 (master of the obvious, yours truly).

Twitter’s potential

Tags

,

$TWTR has not been doing so well off late, but has immense potential.

Twitter is primarily an interest graph. I tweet about things I am interested in (and do so very publicly). I follow and am followed by people with interests similar to mine.

People reading my twitter feed are able to figure out what topics interest me. For example every time I tweet about Apple’s terrible iCloud Photo Sync, someone tells me about Dropbox Carousel and so on. I crib about how expensive the iMac is (mainly because I really really want one) and Microsoft fanboi’s see this as something to be countered.

Why are algorithms not able to do this for me? Do you need the full firehose to be able to do this? I should be able to target ads to people who are interested in a particular topic. What is a topic? What is my view on that topic? This is where I think some AI / clever algos are important.

This makes me think Twitter’s has tremendous potential. Potential that may not be fully appreciated and therefore may not be fully valued.

Funny signs

sign over a gynaecologist’s office :
“dr. jones, at ur cervix”


in a podiatrist’s office :
“time wounds all heels”


on a septic tank truck:
yesterday’s meals on wheels


on a plumber’s  truck :
“we repair wat ur husband fixed”


on another plumber’s truck :
“don’t sleep with a drip. call ur plumber.”


on a church’s billboard :
“7 days without god makes one weak”


at a tyre store:
“invite us to ur next blowout”


on an electrician’s truck :
“let us remove ur shorts.”


in a non-smoking area :
“if we see smoke, we will assume u are on fire & take appropriate action.”


on a maternity room door:
“push. push. push.”


at an optometrist’s office :
“if u don’t see wat u’re looking for, u’ve come to the right place.”


on a taxidermist’s window :
“we really know our stuff.”


on a fence :
“salesmen welcome! dog food is expensive!”


at a car dealership :
“the best way to get back on ur feet – miss a car payment.”


outside a car exhaust store :
“no appointment necessary. we hear u coming.”


in a vets waiting room:
“be back in 5 minutes. sit! stay!”


in a restaurant window :
“don’t stand there & be hungry; come on in & get fed up.”


in the front yard of a funeral home :
“drive carefully. we’ll wait.”


and don’t forget the sign at a RADIATOR SHOP :
“best place in town to take a leak.”


Sign on the back of yet another Septic Tank Truck:
“Caution – This Truck is full of Political Promises”

#iptables forward an IP address to another

Using #iptables to forward a whole IP address to another (server)

iptables -A PREROUTING -t nat -d $src -j DNAT --to $dst
iptables -A POSTROUTING -t nat -d $dst -j MASQUERADE

Connections from anywhere to $src will get forwarded to $dst (though source IP will be changed to that of eth0 or default outbound device). Useful when moving servers; keeps the old address alive for a bit. Though we lose ‘real’ source address.

For example, if forwarding IP address used by an SMTP server, all email will appear to come from $eth0. If $eth0 (could be the same as $src, but not guaranteed) is privileged, in the sense that it is allowed to relay, then anyone will be able to relay through the SMTP server. But works in a pinch, while DNS changes are propogating through the ‘net.

A somewhat more concrete example. Say you have IP address 1.2.3.4; if you do

iptables -A PREROUTING -t nat -d 1.2.3.4 -j DNAT --to 8.8.8.8
iptables -A POSTROUTING -t nat -d 8.8.8.8 -s 1.2.3.4 -j MASQUERADE

1.2.3.4 is now forwards to Google’s Public DNS Server. You can now use 1.2.3.4 as if it were 8.8.8.8.