Peter Mac

Consulting Technology Architect

Background Check Network Status

Because I live in the land down under where we’re serviced by a broadband network system that’s been screwed over by a number of successive Governments, we can never be guaranteed a consistent service. I wrote the following script to run in the background on my Apple Mac to notify me of any changes to the network status. It requires nc to run…but you can change this to any command that does an external connection test such as a simple ping. It does a little sleep at the end for 10 seconds. Obviously adjust to suit your circumstances.


The Notes Dilemma

I’m predominantly an Apple system user (iPad, Mac Mini Desktop, MacBook Pro, iPhone), but in the hunt for the perfect note taking app, I’ve gone down several rabbit-holes.

Background

I’ve been using Evernote for general note taking and document archiving since about 2012. Overall it’s been pretty good with a few integration features that really expanded its’ use case. Examples are IFTT and Gmail integration, the scannable app and the Skitch screen-grab app. The web clipper is also incredibly useful for storing your own copy of web content that may or may not be around for longer (e.g. news snippets, stock reviews).


102 Linux Tips

Over 100 tips for beginner to intermediate Linux command line users. I’ll add to the list as and when I think of it. The tips start simple but get a bit more complex as things go along.


Calculating ip address ranges

A handy way of calculating how many IP addresses are available in a subnet is as follows:

Eg. 1 Given an IP subnet with the CIDR of 192.168.0.0/16, how many available IP addresses have you got?


Securing PostgreSQL

Here’s some post install tasks tht should be considered to ensure your PostgreSQL setup is nice and secure.

Install PostgreSQL

sudo apt-get update sudo apt-get install postgresql postgresql-contrib


Renewing letsencrypt certs for Apache

> sudo service apache2 stop sudo certbot certonly --standalone

Results in the following output:

Saving debug log to /home/peter/appdir/~/.certbot/logs/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Please enter in your domain name(s) (comma and/or space separated) (Enter 'c'
to cancel): staging.spxtrader.com.au
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for staging.spxtrader.com.au
Waiting for verification...
Cleaning up challenges
Non-standard path(s), might not work with crontab installed by your operating system package manager

    
    


TMUX Operations

Tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x) Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:


Home Automation with Nue hub

Experience with combination of the 3ASmartHome ‘Nue’ and Philips Hue components so far.

The Goal

To automate light operations around the house with integration between Alexa, IFTTT and general schedules.


The Ruby Memoirs

Ruby The Cat

Ruby passed away on 15th February 2017 at about 1:10PM. He was about 10 years old.

He arrived on our front door about 6 months after we moved in (2008) and stayed. We found his original owners but he wasn’t impressed when they called to collect him and he decided he wanted to stay. Ruby usually got his way.


Joomla out of memory error with exception.php

I’ve just suffered a strange out of memory exception with one of my Joomla sites. All the posts I read indicated that I needed to allocate more memory in my php configuration – crazy I thought – I already had 64MB allocated. There must be something more fundamentally wrong for this nasty gremlin to be happening. The actual error is–