Monthly Archives: September 2016

Ubuntu Server Tweaks 16.04

muppetlabslogo

Things you might want to tweak on your new Ubuntu 16.04 server – because you need a pretty prompt and a text editor.

I figured this is a good place to put some notes for next time I want to make a new server feel a bit more homely.

apt via IPv4

echo ‘Acquire::ForceIPv4 “true”;’ | sudo tee /etc/apt/apt.conf.d/99force-ipv4

update packages

apt-get update
apt-get dist-upgrade

Clone some packages from another box, maybe?

Old:
sudo apt-get install apt-clone
apt-clone clone foo

New:
sudo apt-get install apt-clone
sudo apt-clone restore foo.apt-clone.tar.gz

ssh

apt-get install openssh-server
ssh-keygen

Setup ssh keys.
Change the port your server runs on in /etc/ssh/sshd_config

mosh

apt-get install mosh

Add something like this in .zshrc (on your laptop):
alias mocms=”mosh -p 2345 –ssh=\”ssh -p 2345 \” joe@cms.my.server.co”

motd

apt-get install update-motd landscape-common update-notifier-common
ln -s /var/run/motd.dynamic /etc/motd

Auto Security Updates

apt-get install unattended-upgrades

/etc/apt/apt.conf.d/10periodic
APT::Periodic::Update-Package-Lists “1”;
APT::Periodic::Download-Upgradeable-Packages “1”;
APT::Periodic::AutocleanInterval “7”;
APT::Periodic::Unattended-Upgrade “1”;

/etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Mail “your@email.address”;

sudo apt install apticron

/etc/apticron/apticron.conf
EMAIL=”your@email.address”

zsh

apt-get install zsh

install oh-my-zsh:
sh -c “$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)”

use this .zshrc if you like.

edit your .zshrc
plugins=(autojump brew pip git django python docker screen)

jed

apt-get install jed
/etc/jed.d/99defaults.sl
No_Backups = 1;

emacs

apt-get install emacs aspell

install prelude:
wget –no-check-certificate https://github.com/bbatsov/prelude/raw/master/utils/installer.sh -O – | sh

edit .emacs.d/prelude-modules.el

You may want to run emacs as a daemon for more than one user on your server.

Add (setq server-use-tcp t) to the top of init.el config files – so emacs starts as a tcp server.

/home/joe/.zshrc:
alias emacsinit=”emacs -u joe –daemon=joe”
alias e=”emacsclient –server-file=joe -t”

/root/.zshrc:
alias emacsinit=”emacs -u root –daemon=root”
alias e=”emacsclient –server-file=root -t”

Apache HTTP2

apt-get install software-properties-common
add-apt-repository ppa:ondrej/apache2
apt-get update
apt-get dist-upgrade
a2enmod http2
service apache2 restart

Add this to your vhosts:
Protocols h2 http/1.1

Quick Update

Prodigal sons and wayward daughters…

Camps Bay
Camps Bay
  • Week of 19 to 25 September.
  • Morning hikes and braais.
  • Monday, brief frantic scramble to find Mia’s school uniform, raw cacao, avo and coconut cream smoothie, school run while talking about how the phone network works, breakfast and notes processing at The Spur (I was tired of the gym), a shower at the gym, drove to Cape Town, house viewing, first day in the new office – it’s a lot bigger and a bit quieter, catch up chat with Dan and Martin, left the office fairly late, catch up chat with Michael, a quick podcast promenade walk, Wouter’s famous temperature probe steak and broccoli and some Chilean red wine.
  • “What’s the secret, Max?” Hmm. Building things and chats with Mia. I don’t seem to ever get tired of those.
  • Tuesday, up early, blogging, walked to the office, sunset podcast promenade walk, watched a video on REST API design, macOS Sierra upgrade.
  • “The number one way to eradicate poverty is to educate girls.” — The Tim Ferriss Show: #123: Rainn Wilson

  • Wednesday, up early, shrek tea, gym, cold showers, office, extended sunset promenade walk with Cath, tweaked my new macOS install a bit – zsh config and karabiner was messed up, phone chat with Mia, phone chat with Anton, played with Oh My Zsh.
  • Octotel now has 100 buildings live.
  • Been listening to a lot of a16z podcasts.
  • Thursday, up early, Lions Head walk with Cath, office, Octotel automation project meeting, hacked my zsh config, Myog, dinner with Jonathan and Ian at Village Idiot – chats about telecoms for poor communities.
  • “Capital is abundant, opportunity is scarce.”

  • “Anomalies wanted.”

  • Friday, up before 6:00, Lions Head walk with Cath, walked to the office, Octotel automation project meeting, lunch with Michael, Paul and Philippa (sorry I missed your birthday lunch), a large Myog, made the first beta of the Octotel API live (some nginx tinkering), Braai Day after work drinks on the roof (braai 1), walked home, braai at Jacques’ house (braai 2) – Jacques brought Mia a new Kindle from London.
  • Saturday, up early, Kasteelpoort hike with Cath, Sarie and Nevo, breakfast next to the lake on top of Table Mountain, epic nap (super epic), aqp water tests – NO2 levels are finally low enough to add fish, braai at Fred’s house in Hout Bay (braai 3) – good chats, time well spent, 11h sleep.
  • “Wisdom is always desiring the same things and always refusing the same things.”

  • Lately I’ve been feeling like I actually want to grow up. Maybe 10 years overdue.
  • Sunday, stayed in bed and tinkered with some sysadmin projects till about 13:00, Paul and Hilah fetched some jumper cables, aqp water tests – I think it’s all working well now – NH3 quickly converts to NO3, tinkered with Hammerspoon, early supper and blogging at Posticino, tiramisu, watched The Secret In Their Eyes.
  • Tune of the week: Magdalena, Brandon Flowers.

Have a fun week, crazy kids.

Quick Update

Stuck in Citrusdal…

Cable Car Station
Cable Car Station
  • Week of 12 to 18 September.
  • You probably want to read the end of last week’s post before you read this post.
  • Monday, rainy morning, woke up at the Wolfkop campsite and packed up, Gerhard helped try and jump start the car, when we realised the jump starting plan was not going to work I phoned Audi Assist – who suggested I phone Outsurance, who after a while phoned me back and said I get a free roadside assist service – only, on this day they can’t help me and suggested I talk to Audi Assist who took a long time to finally find a tow truck service, waiting and more waiting, when the tow truck service arrived hours later, just before dark, the tow truck broke down… at this point I was already feeling a bit fatigued on all kinds of levels – a bit sunburn, bugs eating me alive, nothing to eat or drink really, ex girlfriend stresses from the previous evening, two long painful useless call centre phone conversations, a phone battery that’s rapidly running out and no way to charge it (although Paul did not seem too bothered by charging his phone on the dead car battery which also stressed me out) and it was getting dark – ok, back to the story – then we realised that there was a small bridge on the way to the car which the truck could maybe cross, but would not be able to cross again with the car loaded, so then the tow truck driver tried to help us jump start the car with a truck battery which we carried to the car, when this failed we phoned the event organisers who then drove out and also tried to help us jump start the car, by this time it’s pretty cold and dark, next they phoned the local mechanic who kindly also drove out to come help us, he discovered that the fuel pump was not working – all of this after a car service less than a week back, at this point we gave up and they gave us a lift to the Citrusdal Country Lodge who kindly took us in at a very late hour and give us a place to sleep.
  • “Whose Indiana Jones ringtone is that?”

  • Tuesday, had an extended breakfast with Paul at the Citrusdal Country Lodge, managed to get a lift back to my car about 20km away which was able to start again after Marius went out to fix it, settled up the bill at the garage, road trip to Stellebosch with a Nick Cave soundtrack – we managed to have a bit of a laugh about the whole ordeal – next level adventure in camping discomfort, dropped Paul off in Stellenbosch, catch up chat with JM at the Akker, drove home and had a 12h sleep.
  • Big thank you to Anja, Marius and Hannchen.
  • Lessons of the week, always ask the locals first, call centres are useless, the Citrusdal hotel is cool – great value. Wolfkop was a very cool party. I’ll go again, I think.
  • Wednesday, walked to the office, iOS 10 upgrade day, eNetworks tour of our office, catch up Myog with Michael, Octotel City Bowl community information evening in Vredehoek, which went well, some notes and photo processing.
  • I listened to the TimF Chris Sacca podcast again.
  • Thursday, walked to the office, did some reading about switches, lunch with Dan, Charlotte and Joseph, sunset promenade walk, dinner with Dan, Charlotte and Michael at Beluga – found some new inspiration for the aquaponics hobby.
  • I think my weekly blog really keeps me sane – and offers some perspective.
  • We’re turning Cape Town into a construction site it seems.
  • In other news, it seems Telkom have gone quiet after their ASA (Advertising Standards Authority) letter regarding Octotel being the largest Open Access FTTH network in Cape Town.
  • Friday, rainy day, office, office move number 5 for Octotel – we are now on the 5th floor, fetched Mia, a late lunch at W Cafe, drove to Cape Town, tried to watch a movie at the Waterfront but the lame NuMetro app UX mislead us into thinking a movie was showing which was not, gelato, we spent a healthy amount of time in Exclusive Books.
  • A very cute girl moved into office space on the 8th floor. Meh, just in time for our move to another floor.
  • Really fun filled weekend, adventures around Cape Town…
  • Saturday, took Mia to robotics class, had a beer at The Woodstock Brewery while watching the SA vs NZ rugby, fetched Mia, Hout Bay Market with Dan and Charlotte, we went to pet some dogs at DARG (animal rescue) in Hout Bay – good fun, but one of the dogs managed to bite me – not ideal, we drove to Cape Point and hiked up to the lighthouse, drove to Kalk Bay and had dinner at Live Bait – very cool how the waves crash right onto the side of the building while you eat, time well spent.
  • Sunday, up early – Mia woke me up to go hiking, Mia packed a snack box, drove to Kirstenbosch, Skeleton Gorge hike with Fred, Caley, Dan, Charlotte and six kids, perfect weather, Mia loved it – I had no idea she was such a keen hiker, we stopped at the beach while the girls caught tadpoles, walked to the cable car station, had the best beer ever after a 5 hour hike, down the cable car – good fun, we managed to fit 9 people in a 7 seater Uber back to Kirstenbosch, sing along to… the Shrek / All Star song and Guardians From The Galaxy soundtrack, William’s (13yo) best songs ever – Don’t Stop Me Now / Queen and Sympathy For The Devil / The Rolling Stones – good choices, Mia and I stopped for a pizza at Posticino, we watched The Count of Monte Cristo with a healthy dose of dark chocolate – Mia liked it, time well spent – thanks Dan, Fred.
  • “My favourite breakfast desert is pancakes.” — Mia

  • Hmm. Need to do more hiking. Maybe find a girlfriend in her twenties and get a seven seater car. I might be a bit over outdoor parties for a while.

Have a fun week, crazy kids.

Quick Update

Wolfkop Weekender…

Wolfkop
Wolfkop
  • Week of 5 to 11 September.
  • Fasting week. My 4th 5day fast. Keeping to one every three months.
  • Monday, school run while listening to the Derek Sivers episode / TimF show again while Mia was doing mathletics on a laptop while sipping BCAAs, gym, cold showers, office, sunset promenade walk, caught up on some reading.
  • This is a gem. Derek Sivers. How to code a company. Don’t be afraid to code. Share strong opinions. Life is short. Hell yes, or no.
  • “The standard pace is for chumps.”

  • We’re at peak complexity. Software needs to be at the core of a business.
  • Tuesday, green tea – fasting day 3 – the buzzy part, swim, MWEB training session, office, a very interesting chat with Ben at La Vie, a sunset promenade walk with Heleen.
  • Wednesday, fasting day 4, office, Dasan GPON training day, lunchtime visit to The Mojo Hotel – they seem keen for an aquaponics system on their roof, sunset promenade walk, hacked together three quick WordPress installs.
  • Thursday, fasting day 5, up early, car service day, swim, cold showers, office, Dasan training day, Django sysadmin, fetched my car, promenade walk, more Django reading and video watching.
  • Friday, shrek tea with ginseng Korean tea, packed, office, Dasan GPON node tour, bank visit – never thought that replacing a debit card could be this painful – app and online banking grinded to a halt – took about 30min to fix, fetched my camping gear from storage, fetched Paul from Stellenbosch, road trip to our first Wolfkop Weekender – stopped in Malmesbury for supplies, set up our camp in the quite camping area, had a nice meal at the Friday evening banquet with Wouter.
  • What industry can software eat next?
  • Foam roller week.
  • Saturday, woke up fairly late, explored the camp site and had a bloody mary, spent most of the afternoon chilling with Paul and Tash (I told them The Super Cool story – how bacteria travel in snowflakes), extended nap – woke up around 0:00 – this seems to be becoming a pattern, caught the last music act and chilled by the fire – around about this point I noticed that my car battery was not happy after its Thursday service.
  • “Different podcast.” — Paul, about tech vs alpha female conversations.

  • Sunday, chilled around the camp site with Paul after most people left, spent some time hanging out with Gerhard and ex-girlfriend – I thought I was going to be cool with seeing her, but I obviously need another year or so.
  • Tune of the week: Come and get your love.

Have a fun week, crazy kids.

Quick Update

LLAP…

Walk to Clifton
Walk to Clifton
  • Week of 29 August to 5 September.
  • Monday, walked to the office, catch up chat with Michael, I managed to figure out how to add Youtube channels to my RSS feeds, after work promenade walk with Paul – we bumped into Bienne, had moules frites while wearing bibs and drinking Belgium beer at Den Anker with Paul – we restored his iPhone backup… his phone was a bit like The Fly – a mix of two iCloud/iTunes accounts.
  • Maybe don’t keep 6k photos on your phone, kids. I keep less than 50 photos on my phone on average.
  • “Smart. Interesting. Not-cooked. – Pick two.”

  • More hikes, swims and yoga.
  • Tuesday, walked to the office, salmon and wasabi cream cheese bagel at Kleinsky’s with Paul, supplements shopping – I’ve become interested in collagen, aqp farm tinkering with Michael – turns out an RPi does not have a hwclock (pretty obvious in hindsight) – which was making it run my cronjobs at the wrong time and waking me up, processed some notes and photos.
  • Because sleep…

    root@aquapi:~# cat /etc/cron.d/pump
    # Run pump in the day, twice an hour
    # min hour day month weekday
    # Mon to Thu
    */30 7-21 * * 1-4 root /farm/pump.sh
    # Friday
    */30 7-20 * * 5 root /farm/pump.sh
    # Saturday
    */30 8-20 * * 6 root /farm/pump.sh
    # Sunday
    */30 9-20 * * 7 root /farm/pump.sh

  • Happy spring. I’ve been single for a year.
  • Smart Lazy People.
  • Wednesday, office, DASAN meeting, set up two Ubuntu servers for the Octotel automation project – had to figure out how to use Winbox (Mikrotik – yeah, people still use that), catch up chat with Joseph, catch up chat with Eugene, sunset promenade walk, some blogging and an early supper at The Duchess of Wisbeach – very cool little place – snacked on some radishes and had the wagyu burger, phone chat with Mia.
  • Note to self: I should really just get this weekly blogging thing out of the way on a Sunday evening.
  • By now you must at least have about 2k FB friends or you are obviously a loser with this social media thing.
  • We received a legal letter from Telkom, they seem to be unhappy about the Octotel website saying: “Cape Town’s largest Open Access Fibre to the Home Network”. We think it’s true. This should be interesting. Might have to have a bit of a debate about this with an ASA process.
  • Thursday, office, MWEB finally confirmed their timelines for joining our network, catch up chat with Jaap, haircut at Yogi’s, lunch at Sababba, left the office after dark – my inbox was getting unhappy, bought a foam roller, ordered an RPi3 to be delivered at Dan’s office in London (a bit cheaper than ZA price).
  • This week was busy. I don’t usually like to say I’m busy. Inbox was all over the place. Last week Octotel received 35 orders, this week 85.
  • Watch: Love And Self-Love.
  • People are interesting. In the same week I have to listen to a guy who is unhappy that 10Mbps is our entry level line speed (he wanted 4Mbps), and a guy who wants 1000Mbps upload speeds from home.
  • Friday, shrek tea with Korean ginseng (all the way from South Korean – GPON vendor meeting), gym, office, brunch with Pieter, added four more ISPs to the Octotel website, fetched Mia, fetched a bank card in Stellenbosch, we watched Star Trek Beyond / IMAX 3D – good fun – really makes for a good suspension of disbelief experience.
  • Seems I will be moving soon. I think a braai or two is in order soon.
  • Saturday, raw cacao and avo smoothies, took Mia to her robotics class, shrek flapjacks and some 3D maths puzzles, Myog with Michael, swapped the aqp farm drain pipe, transplanted some seedlings into the main growbed – ate some of the salad and micro greens, watched some Youtube videos about using a foam roller for back and neck and experimented – works pretty well, sunset walk to Clifton with Mia, cooked a healthy supper, tinkered with the RPi to make it connect to the home wifi – man, the RPi1 is slow! – good thing a have an RPi3 on its way.
  • Robotics is the new HAM radio.
  • How many pencils would you need to make a 1m cube, fully meshed grid, assuming a pencil is 10cm long? …3630
  • “In a world where all the obvious names are taken, finding a good name is a test of imagination. And the name you choose tells whether or not you passed that test.” — Paul Graham, on startup names and domain names.

  • Get in the habit of writing down, before you go to bed, the top5 things you want to get done the next day.
  • Planned obsolescence.
  • Get a foam roller and a broomstick.
  • Sunday, more RPi1 hacking – managed to get a new wifi driver working – odd bootloader setup, photo and notes processing, Mia finally woke up, raw cacao and coconut cream smoothies, we tinkered with the aqp farm, the longer range wifi works well, Mia watered all the seedlings, we ventured into the city for a burger in a bowl and some ribs at Da Vinci’s, tiramisu, a beach walk from Glen Beach to the end of Camps Bay beach, we watched Guardians of the Galaxy – Mia loved it – cool soundtrack.
  • Fasting week coming up.
  • Tunes of the week: Brandon Flowers, check out the Flamingo Album, listen to Crossfire.
  • Remember, life is a dance.

Have a fun week, crazy kids.