Skip to content

Instantly share code, notes, and snippets.

View devries's full-sized avatar
🏠
Working from home

Christopher De Vries devries

🏠
Working from home
View GitHub Profile
@devries
devries / dhcp_option119.py
Last active April 19, 2023 17:25 — forked from grawity/dhcp_option119.py
a script for converting domain names to DHCP Option 119 (Domain Search Option)
#!/usr/bin/env python3
"""Command generator for setting DHCP Option 119
This script converts the specified domain names to DHCP Option 119
(Domain Search Option) and prints commands for various DHCP servers.
USAGE:
./dhcp_option119.py DOMAIN ...
EXAMPLE:
@devries
devries / makestableipv6.sh
Created September 10, 2021 16:49
Need a random in the sysctl conf file
#!/bin/sh
# This file goes in /etc/sysctl.d to set up a stable-privacy IPv6 Address
cat > 50-rfc7217.conf <<EOF
# Set up a secret for RFC7217 private static IPv6 address
net.ipv6.conf.default.stable_secret = $(hexdump -n 16 -e '7/2 "%04x:" 1/2 "%04x" "\n"' /dev/urandom)
EOF
@devries
devries / tmux.conf
Last active October 28, 2020 15:42
Use CTRL-a the way God intended.
unbind C-b
set -g prefix C-a
bind C-a send-prefix
bind-key a send-keys C-a
@devries
devries / terminal.go
Created April 30, 2020 16:35
Some terminal UI example
package main
import (
"bytes"
"fmt"
"os"
"os/exec"
"strings"
)
@devries
devries / main.go
Last active March 20, 2020 19:32
Go Generator with Context
package main
import (
"context"
"fmt"
"math"
"time"
)
func main() {
@devries
devries / Dockerfile
Created August 14, 2019 18:33
Alpine Nginx image
FROM alpine:3.10
RUN apk update && apk upgrade
RUN apk add openssl curl ca-certificates
RUN printf "%s%s%s\n" \
"http://nginx.org/packages/mainline/alpine/v" \
`egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release` \
"/main" \
| tee -a /etc/apk/repositories
RUN curl -o /etc/apk/keys/nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub
RUN apk add nginx
@devries
devries / singleton_main.go
Last active October 29, 2018 15:57
Singleton Example for Go
package main
import (
"fmt"
"sync"
"time"
)
func main() {
go setter()
@devries
devries / rainbow.py
Created September 29, 2018 19:25
Writing over SPI to TCL LEDs from python
#!/usr/bin/env python
import time
import math
def main():
#fout = open('spidev','w')
fout = open('/dev/spidev2.0', 'w')
ctr = 0
@devries
devries / Dockerfile
Created June 3, 2018 16:27
Alpine Python Dockerfile notes
FROM python:3.6-alpine
RUN apk add --update \
gcc \
make \
musl-dev \
libuv-dev \
linux-headers \
libxml2-dev \
libxslt-dev \
@devries
devries / ca.md
Created June 3, 2018 13:25 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.