Recent Posts
Brand New Approach to Java Validation Using Function Composition
I’ve got to say, I thought the how to write Java validation was done to death until I had to write one myself. The task was simple but no one provided a testable, scalable and ultimately readable approach.
Without sounding brash they were all based around the died to death and broken mechanism of: * Create an interface called ValidationRule with a single method called validate. * Iterate over a collection of ValidationRule and pass your entity in * Collect the results to a list
read more
Binding Ghost to a Unix Domain Socket
So while I was setting up igu, like many people I needed to setup which port Ghost would listen on. While digging through the documentation I found that Ghost could bind to a Unix Domain Socket, so lets give that a go instead
Solution config.production.json “server”: { “socket”: { “path”: “/tmp/igu-io.sock”, “permissions”: “0666” } }
/etc/nginx/sites-available/igu.io server { listen 80; server_name igu.io; location / { proxy_pass http://igu; } }
read more
Hardening SSH in One Line
Many moons ago I used to manage several hundred servers for a company I worked for. Whilst it was fun it also proved very tiresome as menial tasks, such as changing the port SSH listens on, becomes very tiresome moving server to server.
A more efficient way was needed and ideally a one liner. Tho in saying that SSH is managed from a file under /etc/ssh/sshd_config which having to vim into was not an option.
read more