Skip to content

Instantly share code, notes, and snippets.

Avatar

Shawn Milochik ShawnMilo

View GitHub Profile
@ShawnMilo
ShawnMilo / validate_uuid4.py
Created Dec 3, 2013
Validating a uuid4 with Python.
View validate_uuid4.py
from uuid import UUID
def validate_uuid4(uuid_string):
"""
Validate that a UUID string is in
fact a valid uuid4.
Happily, the uuid module does the actual
checking for us.
@ShawnMilo
ShawnMilo / simple_cookies.go
Created Jul 26, 2019
Simple use of cookies in Go
View simple_cookies.go
package main
import (
"crypto/rand"
"fmt"
"log"
"net/http"
"sync"
"time"
)
View sendkeys.py
#!/usr/bin/env python
import os
import sys
from time import sleep
from random import randrange
import re
fkey = re.compile(r'^F\d$')
View find_ssh.go
package main
import (
"fmt"
"net"
"sync"
"time"
)
var addresses = make(chan string)
@ShawnMilo
ShawnMilo / purge.go
Created Oct 26, 2014
purge old files
View purge.go
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"time"
@ShawnMilo
ShawnMilo / webhook.go
Created Oct 9, 2017
Listen for GitHub webhooks and keep local repos up to date.
View webhook.go
package main
/*
Listen for calls from GitHub and update local repositories.
*/
import (
"encoding/json"
"fmt"
"io/ioutil"
@ShawnMilo
ShawnMilo / klog.go
Created Jul 26, 2017
kubernetes log combiner
View klog.go
package main
import (
"log"
"os"
"os/exec"
"strings"
"sync"
"time"
)
@ShawnMilo
ShawnMilo / tellme
Created Apr 2, 2013
sample of a blog post in restructured text
View tellme
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
View auth.py
from hashlib import sha512
from uuid import uuid4
from redis import StrictRedis
__all__ = (
'hash_password', 'create_user', 'login_is_valid',
)
conn = StrictRedis()
@ShawnMilo
ShawnMilo / ff.go
Created Jan 6, 2015
file finder: Basically a handy replacement for: find . -name '*foo*'
View ff.go
package main
import (
"flag"
"fmt"
"log"
"os"
"path/filepath"
"strings"
)