Skip to content

Instantly share code, notes, and snippets.

View pwaller's full-sized avatar
🔢
🔨

Peter Waller pwaller

🔢
🔨
  • Manchester, UK
View GitHub Profile
@pwaller
pwaller / journalctl -u systemd-timesyncd
Created October 20, 2015 09:19
CoreOS timesyncd messages
Oct 19 08:32:25 hostname systemd-timesyncd[536]: Timed out waiting for reply from 89.234.64.77:123 (0.coreos.pool.ntp.org).
Oct 19 08:32:35 hostname systemd-timesyncd[536]: Timed out waiting for reply from 54.194.18.100:123 (0.coreos.pool.ntp.org).
Oct 19 08:32:45 hostname systemd-timesyncd[536]: Timed out waiting for reply from 89.101.218.6:123 (1.coreos.pool.ntp.org).
Oct 19 08:32:55 hostname systemd-timesyncd[536]: Timed out waiting for reply from 193.1.31.66:123 (1.coreos.pool.ntp.org).
Oct 19 08:33:06 hostname systemd-timesyncd[536]: Timed out waiting for reply from 54.194.18.100:123 (2.coreos.pool.ntp.org).
Oct 19 08:33:16 hostname systemd-timesyncd[536]: Timed out waiting for reply from 149.157.192.5:123 (2.coreos.pool.ntp.org).
Oct 19 08:33:26 hostname systemd-timesyncd[536]: Timed out waiting for reply from 85.91.1.164:123 (3.coreos.pool.ntp.org).
Oct 19 08:33:36 hostname systemd-timesyncd[536]: Timed out waiting for reply from 54.229.222.210:123 (3.coreos.pool.ntp.org).
Oct 19 09:07:55 hostname syst
@pwaller
pwaller / gist:0d45a0ea6e8a5e0cf3db
Created October 13, 2015 18:51
go-gl/glfw/v3.1 (glfw 3.1.2) build failure
$ go install -x ./v3.1/glfw/
WORK=/tmp/go-build324541122
mkdir -p $WORK/github.com/go-gl/glfw/v3.1/glfw/_obj/
mkdir -p $WORK/github.com/go-gl/glfw/v3.1/
cd /home/pwaller/.local/src/github.com/go-gl/glfw/v3.1/glfw
CGO_LDFLAGS="-g" "-O2" "-lGL" "-lX11" "-lXrandr" "-lXxf86vm" "-lXi" "-lXcursor" "-lm" "-lXinerama" /usr/local/go/pkg/tool/linux_amd64/cgo -objdir $WORK/github.com/go-gl/glfw/v3.1/glfw/_obj/ -importpath github.com/go-gl/glfw/v3.1/glfw -- -I $WORK/github.com/go-gl/glfw/v3.1/glfw/_obj/ -D_GLFW_USE_OPENGL -D_GLFW_X11 -D_GLFW_GLX -D_GLFW_HAS_GLXGETPROCADDRESSARB -D_GLFW_HAS_DLOPEN build.go context.go error.go glfw.go input.go monitor.go native_linbsd.go time.go util.go window.go
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -print-libgcc-file-name
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -I $WORK/github.com/go-gl/glfw/v3.1/glfw/_obj/ -g -O2 -D_GLFW_USE_OPENGL -D_GLFW_X11 -D_GLFW_GLX -D_GLFW_HAS_GLXGETPROCADDRESSARB -D_GLFW_HAS_DLOPEN -o $WORK/github.com/go-gl/glfw/v3.1/glfw/_obj/_cgo_main.o -c $W
@pwaller
pwaller / Dockerfile
Last active August 29, 2015 14:23
poppler
FROM ubuntu:14.04
RUN apt-get update && \
apt-get install -y \
python-poppler \
python-pip \
python3-pip \
git \
jq \
curl \
@pwaller
pwaller / tree-of-failure.py
Created June 11, 2015 10:10
Tree of MOT failure
from collections import namedtuple, Counter
Item = namedtuple("Item", "id vehicle_class parent section_id name")
Rejection = namedtuple("Rejection", "id vehicle_class item_id minor short_description location man_description advisory section_id")
class Item(Item):
@property
def full(self):
parent = item_by_id_class.get((self.parent, self.vehicle_class), None)
if not parent or self.id == parent.id:
@pwaller
pwaller / Dockerfile
Last active April 18, 2019 14:19
Toolbox
# usage:
# docker build -t aws https://gist.github.com/d61df9109ed716e1d8b7.git
# alias dr='docker run -ti --rm -w $PWD -v $PWD:$PWD -v $HOME:$HOME -v /etc/passwd:/etc/passwd -v /etc/group:/etc/group -u $(id -u):$(id -g)'
# alias aws='dr aws aws'
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y python3-pip git jq curl && pip3 install awscli
RUN mkdir /data && chown nobody /data
@pwaller
pwaller / gist:f80063a253a9106cccbd
Created March 30, 2015 16:41
Determine the latest CoreOS AMI available
#!/bin/sh
COREOS_CHANNEL=stable
BASE=http://$COREOS_CHANNEL.release.core-os.net/amd64-usr
AWS_REGION=eu-west-1
COREOS_VERSION=$(curl -s $BASE/current/version.txt | sed -n 's/COREOS_VERSION=//p')
parse_ami() {
jq -r ".amis | map(select(.name == \"$AWS_REGION\")) | .[].hvm"
}
@pwaller
pwaller / Dockerfile
Created January 26, 2015 21:16
Trying to use jemalloc with cgo
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y curl build-essential git mercurial upx
RUN curl -sSL https://golang.org/dl/go1.4.src.tar.gz | tar -v -C /usr/local -xz
RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1
ENV GOPATH /go
ENV PATH /usr/local/go/bin:$PATH
ENV PATH /go/bin:$PATH
@pwaller
pwaller / crash.txt
Created January 10, 2015 13:36
novm crash
$ novm create --nofork
2015/01/10 13:32:00 Creating devices...
2015/01/10 13:32:00 Loading d25d0c01-9b5b-44aa-9261-a5f3340908e2...
2015/01/10 13:32:00 Loading 37f7a2a4-6085-4665-83f1-4568d62853ea...
2015/01/10 13:32:00 Loading 1ec1015b-82b7-4d74-819a-40a4865a9524...
2015/01/10 13:32:00 Loading 787da28e-6d86-42a4-bc53-34ac06bd8869...
2015/01/10 13:32:00 Loading 2730ad5a-8391-4481-b6f0-b3feb95e9614...
2015/01/10 13:32:00 Loading 3b79eac7-b4b6-4646-8602-53a65c484ce7...
2015/01/10 13:32:00 Loading 38e58a57-f34a-4571-9141-a67a82ef7c1d...
2015/01/10 13:32:00 Loading afd265ae-3461-4d73-b700-0ae439b0c97a...
package main
import (
"bufio"
"io"
"os"
)
func main() {
TruncateFilePrefix("tmp.txt")
@pwaller
pwaller / main.go
Last active August 29, 2015 14:11
s4cat (simple s3 cat)
// Note: doesn't work yet.
// Note: you may wish to modify the hard-coded region from eu-west-1.
package main
import (
"io"
"log"
"os"