Install psql on macOS with Homebrew

brew install libpq brew link --force libpq psql --version libpq includes psql and other PostgreSQL client utilities. The brew link --force step symlinks the binaries into your PATH so psql is available from any terminal. If you don’t have Homebrew installed yet: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

How to avoid other pods from being scheduled on your node in Kubernetes

Taints on nodes repel pods. Tolerations on pods let them ignore specific taints. Together they give you control over scheduling. Taint effects NoSchedule — pods without a matching toleration won’t be scheduled on the node. PreferNoSchedule — the scheduler avoids the node but will use it if there’s nowhere else. NoExecute — pods without a matching toleration are evicted and won’t be rescheduled there. Applying a taint kubectl taint nodes node1 type=db:NoSchedule This prevents any pod from being scheduled on node1 unless it has a toleration for type=db. ...

Merging Unrelated Git Histories

You’ve got two repositories with completely separate histories, and you need to bring them together. Maybe it’s an old project you’re absorbing into a new one, or a submodule that started life as its own thing. You try a standard git merge and Git immediately shuts you down: fatal: refusing to merge unrelated histories This isn’t a bug – it’s Git being cautious. When two branches share no common ancestor, Git assumes you’ve made a mistake and refuses to play along. But sometimes you genuinely want this merge, and there’s a flag for that. ...

Using Ansible with Packer

Packer builds machine images. Ansible configures servers. Together, they let you bake your configuration straight into the image – no manual setup required after deployment. The Ansible provisioner in Packer runs your playbooks during the image build process. You write a normal Ansible playbook, point Packer at it, and when the image is ready, your software is already installed and configured. Note: If you specify a remote_user in your Ansible tasks, Packer will ignore it. The provisioner connects using the username from Packer’s own configuration. ...

Installing SSHPass on Ubuntu and macOS

SSHPass is a small command-line utility that lets you pass a password directly to an SSH connection, which means no interactive password prompt. Useful when you’re writing scripts that need to connect to remote machines without manual intervention. A word of warning before you go ahead: SSHPass is not secure. The password gets passed as a command-line argument, which means it can show up in process listings and shell history. It’s fine for personal automation on your own machines, but don’t use it in shared environments or anything that touches production systems. ...

Installing Docker CE on Ubuntu

What You Need Before You Begin Docker CE runs on a handful of 64-bit Ubuntu releases, so check you’re on one of these before carrying on: Ubuntu 18.04 (Bionic) - LTS Ubuntu 17.10 (Artful) Ubuntu 16.04 (Xenial) - LTS Ubuntu 14.04 (Trusty) - LTS The supported architectures are x86_64, armhf, s390x (IBM Z), and ppc64le (IBM Power). If you’re on IBM Z or Power, you’ll need at least Ubuntu 16.04 (Xenial). ...

Release Engineering 101 — Build Scripts

Every project I have worked on, from small college assignments to larger team efforts, has eventually hit the same wall: someone runs the build, something breaks, and nobody knows why. The code was fine five minutes ago. The build server is down. The classpath is wrong. The compiled output is three versions behind. It is frustrating, it is wasteful, and it is entirely preventable. The fix is a build script. ...