Install the required packages
brew install ncmpcpp mpd mpc
Make the.mpd
directory in your home directory
mkdir ~/.mpd
let | |
nixpkgs-src = builtins.fetchTarball { | |
# master of 2021-01-05. | |
url = "https://github.com/NixOS/nixpkgs/archive/1a57d96edd156958b12782e8c8b6a374142a7248.tar.gz"; | |
sha256 = "1qdh457apmw2yxbpi1biwl5x5ygaw158ppff4al8rx7gncgl10rd"; | |
}; | |
pkgs = import nixpkgs-src { | |
config = { | |
# allowUnfree may be necessary for some packages, but in general you should not need it. |
Install the required packages
brew install ncmpcpp mpd mpc
Make the.mpd
directory in your home directory
mkdir ~/.mpd
Accessing a subnet that is behind a WireGuard client using a site-to-site setup
We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.
(ns pms.core | |
(:require [clojure.spec.alpha :as s] | |
[clojure.spec.gen.alpha :as gen] | |
[clojure.spec.test.alpha :as stest])) | |
(comment "This is a small experiment inspired by Oskar Wickströms | |
excellent work at | |
https://haskell-at-work.com/episodes/2018-01-19-domain-modelling-with-haskell-data-structures.html. I | |
wanted to see what would be involved in building the equivalent | |
functionality in reasonably ideomatic Clojure. It is also my first |
Last week I spent a lot of time trying to deploy an F# ASP.NET Core app (a Giraffe app, specifically) to Azure because the information to complete all the steps was scattered in several places. So I'm writing this hopefully it will save the pain to others :)
The following steps are mostly taken from this guide and it's only necessary to do them once:
This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere… I hope to present the information you need without assuming anything.
Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!
One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.
#!/bin/bash -xe | |
# requires jq and 3 brokers to start | |
which jq || echo 'no jq found, bye!' && exit 1 | |
ZK_HOST=zkhost1:2181/kafka | |
# record all topics | |
/usr/local/kafka/bin/kafka-topics.sh --zookeeper $ZK_HOST --list > all_topics | |
# generate json for listing which topics to reassign |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
#!/usr/bin/env pxi | |
(ns cli | |
"pxi cli.pxi --verbose --bar 42 --hello 'world!' | |
{:verbose true, :bar 42, :hello world!}" | |
(:require [pixie.string :as string])) | |
(defn- arg? | |
"Returns true if the string is an argument to an option" | |
[s] |