Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import re
import sys
import json
import requests
USER = 'replace_with_your_username'
PASS = 'replace_with_your_password'
LINE = '7075551212' # your line's phone number
@lisamelton
lisamelton / transcode-video.sh
Last active September 8, 2023 23:51
Transcode video file (works best with Blu-ray or DVD rip) into MP4 (or optionally Matroska) format, with configuration and at bitrate similar to popular online downloads.
#!/bin/bash
#
# transcode-video.sh
#
# Copyright (c) 2013-2015 Don Melton
#
about() {
cat <<EOF
$program 5.13 of April 8, 2015
typeset -U path
typeset -U manpath
function addpath {
[[ -d "$1" ]] && path=("$1" $path)
[[ -d "${1:h}/sbin" ]] && path=("${1:h}/sbin" $path)
for d in "${1:h}"/{man,share/man}; do
[[ -d "$d" ]] && manpath=("$d" $manpath)
done
}
@slumos
slumos / l.sh
Created March 18, 2013 17:04
Magical DWIM show the thing
function l {
if [[ ! -t 0 ]]; then
# stdin is not connected to a tty
pager -
elif [[ $# -eq 1 && -f "$1" ]]; then
# single argument names a file
pager "$1"
else
ls -CFL $*
fi
@plathrop
plathrop / rename.sh
Last active December 14, 2015 13:48
#!/usr/bin/env bash
set -e
indir=${1}
outdir=${2}
case "$(arch)" in
i686) bits="32";;
x86_64) bits="64";;
@slumos
slumos / ru.sh
Created September 23, 2012 05:22
#! /usr/bin/env zsh
user="$1"
env="$2"
function usage {
cat <<EOF 2>&1
usage: ru rails_user rails_env command args...
Run command as rails_user with RAILS_ENV=rails_env.
@jboner
jboner / latency.txt
Last active May 7, 2024 19:39
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@silas
silas / README.md
Created March 21, 2012 03:52
Vagrant and devstack
  1. Download and install VirtualBox

  2. Download and install Vagrant

  3. Clone devstack repository

     git clone git://github.com/openstack-dev/devstack.git
    
  4. Switch to devstack directory

cd devstack

Adrian -

I appreciate that you spent time in writing this post. I know I've been up until 2am writing similarly long ones as well. I will take responsibility for having what is likely an irrational response (I blame Twitter for that) to the term "NoOps", but I invite you to investigate why that might be. I'm certainly not the only one who feels this way, apparently, and thus far have decided this issue is easily the largest distraction in my field I've encountered in recent years. I have had the option to simply ignore my opposition to the term, and just let the chips fall where they may with how popular the term "NoOps" may or may not get. I have obviously not taken that option in the past, but I plan to in the future.

You're not an analyst saying "NoOps". Analysts are easy (for me) to ignore, because they're not practitioners. We have expectations of engineering maturity from practitioners in this field of web engineering, especially those we consider leaders. I don't have any expectations from analysts,

@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!