Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@davidwalter0
davidwalter0 / uploader.go
Created February 14, 2019 03:57 — forked from TheGU/uploader.go
Golang to upload file to google drive with progress bar using Google API
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
@davidwalter0
davidwalter0 / -
Last active October 29, 2016 00:22 — forked from anonymous/-
trivial-container
apiVersion: v1
kind: Pod
metadata:
name: trivial-container
spec:
containers:
- name: c
image: ubuntu:xenial
#resources:
# limits:
@davidwalter0
davidwalter0 / nginx-ssl-proxy.conf
Created July 14, 2016 16:48 — forked from khera/nginx-ssl-proxy.conf
nginx configuration file to act as SSL proxy when using with slack-hubot integration.
user httpd;
worker_processes 2;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
@davidwalter0
davidwalter0 / simple_server.py
Created June 10, 2016 16:37 — forked from trungly/simple_server.py
A simple Python HTTP server that supports a GET that echoes some request data and a POST that reads a request body, parses it as JSON and reponses with part of the data
from BaseHTTPServer import BaseHTTPRequestHandler
import urlparse, json
class GetHandler(BaseHTTPRequestHandler):
def do_GET(self):
parsed_path = urlparse.urlparse(self.path)
message = '\n'.join([
'CLIENT VALUES:',
'client_address=%s (%s)' % (self.client_address,
@davidwalter0
davidwalter0 / directory-reader.coffee
Created May 14, 2016 00:18 — forked from rodw/directory-reader.coffee
Here's a little CoffeeScript routine that will recursively read the file-system, generating an object that represents a complete directory tree. This gist should be executable. You can run it with: `coffee directory-reader.coffee [FILENAME]` to dump a JSON representation of the object to stdout.
# Here's a little CoffeeScript routine that will recursively
# read the file-system, generating an object that represents
# a directory tree.
# The returned object will contain the following attributes:
#
# * `file` - the basename of the file.
# * `dir` - the directory containing the file.
# * `types` - an array containing zero or more of
# "File", "Directory", "SymbolicLink", "BlockDevice",
@davidwalter0
davidwalter0 / Synchronize git tags
Last active March 9, 2016 19:27 — forked from okunishinishi/Remove all git tags
manage git remote tags
# Initially one user one time clean up of tags for the repo
# Delete local tags.
git tag -l | xargs git tag -d
# Fetch remote tags.
git fetch
# Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
# Delete local tags.
git tag -l | xargs git tag -d
from bottle import route, run, request, static_file
import subprocess
"""
Get DEVICE_ID by running script and connecting to the url with your mobile device
python unlock.py
Bottle v0.11.2 server starting up (using WSGIRefServer())...
Listening on http://192.168.77.102:8888/