Skip to content

Instantly share code, notes, and snippets.

@sigmonsays
sigmonsays / doom.txt
Created March 18, 2021 17:05 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@sigmonsays
sigmonsays / dhcp-event
Created October 15, 2019 22:28 — forked from tomoconnor/dhcp-event
Thingy for updating powerdns backend when stuff changes
#!/usr/bin/env python
import MySQLdb
import os, sys
import pprint
pp = pprint.PrettyPrinter()
mysql_host = "localhost"
mysql_user = "dbusername"
mysql_pass = "dbpassword"
@sigmonsays
sigmonsays / custom
Created December 3, 2018 01:08 — forked from zoqaeski/custom
xkbcomp keyboard layout dump
// $XDG_CONFIG_HOME/xkb/symbols/custom
// Makes ALT + CAPS_LOCK act as 3rd level switch
// Works sporadically
partial modifier_keys
xkb_symbols "alt_caps_mode_switch" {
key <CAPS> {
type[Group1]="PC_ALT_LEVEL2",
[ Caps_Lock, ISO_Level3_Shift ]
};
@sigmonsays
sigmonsays / streaming-tar.py
Created June 22, 2018 22:52 — forked from chipx86/streaming-tar.py
Sample code to build a tar chunk-by-chunk and stream it out all at once.
#!/usr/bin/env python
#
# Building a tar file chunk-by-chunk.
#
# This is a quick bit of sample code for streaming data to a tar file,
# building it piece-by-piece. The tarfile is built on-the-fly and streamed
# back out. This is useful for web applications that need to dynamically
# build a tar file without swamping the server.
import os
import sys
@sigmonsays
sigmonsays / README.md
Created June 5, 2018 16:39 — forked from jhollinger/README.md
rbackup - time-stamped, hard-linked backups powered by rsync

rbackup

rbackup is a lightweight, rsync-powered backup utility that creates time-stamped backups.

Features

It can save backups to your local filesystem (probably an attached USB device) or to a remote host.

Backups are saved in time-stamped directories. Backups are cheap on storage, because hard-links are used for files that haven't changed between backups.

@sigmonsays
sigmonsays / gist:c911b618a970d9748ac877b736180a6a
Created April 16, 2018 14:52
why does mac os have to be case insensitive?
sig@sig-macbook:~$ head usage-by-user.log
curl: (6) Could not resolve host: usage-by-user.log
sig@sig-macbook:~$ type head
head is hashed (/Users/sig/bin/head)
sig@sig-macbook:~$ ls -l bin/HEAD
-rwxr-xr-x 1 sig staff 31 Feb 8 2016 bin/HEAD
@sigmonsays
sigmonsays / main.go
Created January 7, 2018 16:19 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@sigmonsays
sigmonsays / sshd.go
Created December 19, 2017 17:00 — forked from jpillora/sshd.go
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@sigmonsays
sigmonsays / gist:63244f224c78a968f7ea40d628de6a7b
Created October 1, 2017 23:54
how I built mycroft-core release/v0.8.22-25-gdfaed4f on ubuntu trusty #mycroft
sudo apt-get install libgdk-pixbuf2.0-dev libgtk2.0-dev
export CFLAGS="-I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gtk-unix-print-2.0 -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0"
when dev_setup.sh fails i can this manually
./scripts/install-pygtk.sh 1
@sigmonsays
sigmonsays / share_send_app_endpoints.md
Created July 24, 2017 01:05 — forked from StephenBlackWasAlreadyTaken/share_send_app_endpoints.md
DexcomShare Endpoints for the Uploader App
  • these are the calls used by the dexcom uploader app
  • these are in no particular order!
  • User-Agent: Dexcom%20Share/3.0.2.11 CFNetwork/672.0.2 Darwin/14.0.0

General

Read Dexcoms System time clock

GET