Skip to content

Instantly share code, notes, and snippets.

View sefk's full-sized avatar
💭
Doing just fine, thanks.

Sef Kloninger sefk

💭
Doing just fine, thanks.
View GitHub Profile
@sefk
sefk / hack.sh
Created March 31, 2012 18:15 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@sefk
sefk / gist:3157716
Created July 22, 2012 00:32
techie.sef.kloninger.com
Hi. I blog about business-ey and management-ey things at my public
blog, [sef.kloninger.com](http://sef.kloninger.com/). But I've
been lacking a place to talk about technical things, and so I'll
use this space for it.
Also: markdown is awesome.
@sefk
sefk / .bashrc
Created August 15, 2013 08:02 — forked from swanson/.bashrc
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
# Automatically activate Git projects' virtual environments based on the
# directory name of the project. Virtual environment name can be overridden
# by placing a .venv file in the project root with a virtualenv name in it
function workon_cwd {
# Check that this is a Git repo
GIT_DIR=`git rev-parse --git-dir 2> /dev/null`
if [ $? == 0 ]; then
#!/bin/bash -e
#
# WARNING: THIS SCRIPT IS DESTRUCTIVE. IT WILL DELETE THINGS IN YOUR
# ACTUAL REPO. ONLY USE IF YOU KNOW WHAT YOU ARE DOING.
#
# This script saves away a small number of files, and then removes all
# other files in your repo, to leave it in a pristine state. This is
# useful if there are artifacts in your build tree (.js, .pyc) that are
# causing trouble.
#
## BROKEN -- SERVFAIL
sef@picard ~> dig -t ns cs101-class.org
; <<>> DiG 9.8.3-P1 <<>> -t ns cs101-class.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 51345
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
#!/bin/bash
set -u
set -e
read -r -p "This will nuke and reload your midas db, are you sure [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
set -x
@sefk
sefk / gist:800236501cfd6990f78d
Created May 18, 2015 18:30
Queries from midas /api/user/all
LOG: execute <unnamed>: SELECT sess FROM "session" WHERE sid = $1 AND expire >= NOW()
DETAIL: parameters: $1 = 'ocWG9t_R2zyuSc7NBFBSgEli'
LOG: execute <unnamed>: SELECT "user"."username", "user"."name", "user"."title", "user"."bio", "user"."photoId", "user"."photoUrl", "user"."isAdmin", "user"."disabled", "user"."passwordAttempts", "user"."id", "user"."createdAt", "user"."updatedAt" FROM "midas_user" AS "user" WHERE "user"."id" = $1 AND "user"."deletedAt" IS NULL
DETAIL: parameters: $1 = '2'
LOG: statement: SELECT "user"."username", "user"."name", "user"."title", "user"."bio", "user"."photoId", "user"."photoUrl", "user"."isAdmin", "user"."disabled", "user"."passwordAttempts", "user"."id", "user"."createdAt", "user"."updatedAt" FROM "midas_user" AS "user"
LOG: statement: (SELECT "tagentity"."type","tagentity"."name","tagentity"."data","tagentity"."id","tagentity"."createdAt","tagentity"."updatedAt","tagentity_users__user_tags"."user_tags" AS "___user_tags" FROM "tagentity" AS "tagentity" INNER JOIN "ta