Skip to content

Instantly share code, notes, and snippets.

View ShawnMilo's full-sized avatar

Shawn Milochik ShawnMilo

View GitHub Profile
@ShawnMilo
ShawnMilo / foe.go
Created January 6, 2015 20:08
foe. A file search that opens the files found in vim.
package main
import (
"bufio"
"flag"
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
from hashlib import sha512
from uuid import uuid4
from redis import StrictRedis
__all__ = (
'hash_password', 'create_user', 'login_is_valid',
)
conn = StrictRedis()
@ShawnMilo
ShawnMilo / tellme
Created April 2, 2013 18:37
sample of a blog post in restructured text
tellme
======
:date: 2013-04-02
:tags: computing, Ubuntu
:category: computing
:slug: tellme
:author: Shawn Milochik
:email: shawn@milochik.com
:summary: "tellme" when you're done
@ShawnMilo
ShawnMilo / klog.go
Created July 26, 2017 23:22
kubernetes log combiner
package main
import (
"log"
"os"
"os/exec"
"strings"
"sync"
"time"
)
@ShawnMilo
ShawnMilo / webhook.go
Created October 9, 2017 15:35
Listen for GitHub webhooks and keep local repos up to date.
package main
/*
Listen for calls from GitHub and update local repositories.
*/
import (
"encoding/json"
"fmt"
"io/ioutil"
@ShawnMilo
ShawnMilo / purge.go
Created October 26, 2014 03:14
purge old files
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"time"
package main
import (
"fmt"
"net"
"sync"
"time"
)
var addresses = make(chan string)
@ShawnMilo
ShawnMilo / simple_cookies.go
Created July 26, 2019 19:25
Simple use of cookies in Go
package main
import (
"crypto/rand"
"fmt"
"log"
"net/http"
"sync"
"time"
)
@ShawnMilo
ShawnMilo / audit.py
Created October 5, 2021 13:27
audit.py
#!/usr/bin/env python3
"""
Find files to audit so that all files are looked
at regularly.
"""
from os.path import abspath, dirname, join
from os import walk
import re
@ShawnMilo
ShawnMilo / adoc.py
Created July 21, 2022 03:36
Convert .adoc file to PDF using AsciiDoctor
#!/usr/bin/env python3
"""
Convert .adoc files to .pdf.
Periodically check for updated tags:
https://hub.docker.com/r/asciidoctor/docker-asciidoctor/tags
"""
import sys
import os
from subprocess import check_output