Skip to content

Instantly share code, notes, and snippets.

View llarsson's full-sized avatar

Lars Larsson llarsson

View GitHub Profile
@llarsson
llarsson / pihole-systemd.md
Last active January 3, 2018 19:14
Running the Docker version of Pi-hole as a systemd service

Running the Docker version of Pi-hole as a systemd service

I use this on Ubuntu 16.04, but as long as your systemd is recent enough, I don't see why this should not work for you.

  1. Set your IP address to a static one, using e.g. NetworkManager or by editing /etc/network/interfaces. Set 127.0.0.1 as your DNS server.
  2. Write the /etc/systemd/system/pihole.service file below.
  3. Start and enable ("install") the systemd unit file by typing sudo systemctl start pihole.service and sudo systemctl enable pihole.service.
  4. Configure your other devices to use your computer's now static IP address as their DNS server.

Here's what you should put in /etc/systemd/system/pihole.service:

@llarsson
llarsson / list-api-paths.sh
Created April 5, 2017 08:36
List all API paths in a Swagger JSON file using jq
cat swagger.json | jq '.paths | keys'

CoreOS: recover etcd2 if a service has started etcd

sudo systemctl stop fleet.service fleet.socket etcd
sudo systemctl start etcd2
sudo systemctl reset-failed
etcdctl rm --recursive /_coreos.com/fleet/job/my_failed_unit.service
sudo systemctl start fleet fleet.socket

Credit to @jessegonzalez in etcd-io/etcd#3211