Skip to content

Instantly share code, notes, and snippets.

Sometimes the yak shaves you!

Pete Doherty ethagnawl

Sometimes the yak shaves you!
Block or report user

Report or block ethagnawl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ethagnawl /
Created Jun 14, 2019
list/sor directories by content size
du -s * | sort -k 1,1 -V
ethagnawl / .tmux.conf
Created May 8, 2019
tmux hook examples
View .tmux.conf
set-hook after-split-window 'run "echo split > ~/tmux.log'
set-hook before-new-window 'run "date >> ~/tmux.log"'
ethagnawl / foo.yml
Created Mar 27, 2019
dynamic tmux_options
View foo.yml
# /home/peter/.config/tmuxinator/foo.yml
name: foo
root: ~/
tmux_options: -f <%= args[0] %>
- one:
- echo logs
- two:
- echo left
ethagnawl / gist:a65e5b0f43f182a34cc432624325f6dd
Created Feb 28, 2019
Django Reverse for ... with arguments not found
View gist:a65e5b0f43f182a34cc432624325f6dd
You may see the following (confusing) error message when using trying to create an entity URL for an entity which uses an `AutoField` primary key
`Reverse for 'foo_update' with arguments '('',)' not found. 1 pattern(s) tried: ['foos/(?P<pk>[0-9]+)/edit/$']`
So, in your view:
`<a href="{% url 'foo_update' %}">edit</a>`
... should be:
`<a href="{% url 'foo_update' foo.foo_id %}">edit</a>`
ethagnawl / decode.elm
Created Feb 12, 2019
non-trivial elm decode example
View decode.elm
-- adding example here for posterity's sake
-- original example can be found at:
-- source material can be found at:
module Main exposing (main)
import Html exposing (Html, text, programWithFlags)
import Json.Decode
ethagnawl / input.rc
Created Dec 21, 2018
super__mario's inputrc
View input.rc
set completion-ignore-case On
#TAB: menu-complete
Tab: complete
set editing-mode vi
# operate-and-get-next allows you to navigagte to history
# and then keep executing commands successively from
# that point onwards
ethagnawl /
Created Dec 18, 2018
pull data from airtable
#!/usr/bin/env bash
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
echo "DIR: $DIR"
echo "SRC: $SRC"
echo "DEST: $DEST"
ethagnawl / index.html
Last active Dec 18, 2018
more gatsby/elm fun
View index.html
<!DOCTYPE html>
<meta charSet="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="generator" content="Gatsby 2.0.68" />
<link as="script" rel="preload" href="/component---src-pages-index-js-ac2364b3c7ba3836ce1f.js" />
<link as="script" rel="preload" href="/app-b7a4b847d9bcda823daf.js" />
View SceneComponentElm.js
const Elm = require("react-elm-components");
const React = require("react");
const ElmApplication = require("./src/Main.elm");
const ScenesComponentElm = ({scenes}) => (
flags={{ scenes: scenes }}
IP_LOOKUP="$(ip route get | awk '{ print $NF; exit }')" # May not work for VPN / tun0
IPv6_LOOKUP="$(ip -6 route get 2001:4860:4860::8888 | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}')" # May not work for VPN / tun0
#IP="${IP:-$IP_LOOKUP}" # use $IP, if set, otherwise IP_LOOKUP
IP="" # use $IP, if set, otherwise IP_LOOKUP
IPv6="${IPv6:-$IPv6_LOOKUP}" # use $IPv6, if set, otherwise IP_LOOKUP
DOCKER_CONFIGS="$(pwd)" # Default of directory you run this from, update to where ever.
echo "### Make sure your IPs are correct, hard code ServerIP ENV VARs if necessary\nIP: ${IP}\nIPv6: ${IPv6}"
docker run -d \
--name pihole \
You can’t perform that action at this time.