Mirroring All the Nim Packages
The Problem At $DAY_JOB we like to keep our development environment isolated from the internet1. This means we have to mirror stuff like the Ubuntu and CentOS package repositories, so they are available in our dev environment.
Recently my company has decided to try and develop some tools in Nim, meaning we now had to mirror any an all nim packages so that Developers could install them with nimble2.
Getting the Packages Unlike a lot of languages nim doesn’t have a centralised package repository we can just rsync and serve.
Solving Exercism’s Bash Grep Challenge
Reimplementing grep One of exercism.io’s challenges is to reimplement grep in bash. Here’s a walk through of how I solved it.
Solution 1 #/bin/env bash grep "${@}" exit 0 This solution probably isn’t in the spirit of the challenge, but it does satisfy all the tests.
Time to go home.
Solution 2 For the same reasons why you shouldn’t use a word in its own definition, reimplementations shouldn’t use the original tool.
Custom Prompt on Remote Servers
The Insanity In my job I have to ssh into a lot of servers to do preventive and routine maintenance. These servers tend to have a patch work of settings and configurations. During a shift I can touch Redhat, AIX, and HP-UX servers. These servers do not have a consistent prompt. Some show user@hostname $, others just display bash-#.#.#, and several are just a lonely $ devoid of any context to keep you from bricking the server or deleting HIPPA records.