Skip to content

Instantly share code, notes, and snippets.

@rossdylan
rossdylan / vm.sh
Last active August 29, 2015 14:27
# Welcome to Episkopos!
# Now, I know you are all wondering what madness has crawled out of my twisted
# mind and into your computer. This is a register based virtual machine...
# written completely in bash.
# Don't look at me like that, its a great idea.
# Think of a world where bash is compiled to bash and run on bash. Its an endless
# recursive cycle. The name comes from discordianism, which I often turn to
# when I'm writing something particularlly nutty.
declare -A general_reg=(["r0"]=0 ["r1"]=0 ["r2"]=0 ["r3"]=0 ["r4"]=0 ["r5"]=0 ["ze"]=0 ["tr"]=1)
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@samuraisam
samuraisam / wordlist.py
Created June 11, 2012 22:53
A wordlist for python. 67k words, with "bad words" filtered out. Use responsibly :)
This file has been truncated, but you can view the full file.
import random
def random_words(num, separator='-'):
"""
Return `num`-random concatinated to each other.
They will be joined by `separator`
"""
words = []
@jboner
jboner / latency.txt
Last active May 10, 2024 14:27
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
@lmacken
lmacken / sshtail.py
Last active October 3, 2015 07:08
A script to tail a file across many systems at once
# sshtail.py
# A script to tail a file across many systems at once
# Author: Luke Macken <lmacken@redhat.com>
# License: GPLv3+
import getpass
import subprocess
servers = ['app1', 'app2', 'app3', 'app4', 'app5', 'app6', 'app7']
logfile = '/var/log/httpd/access_log'
@ralphbean
ralphbean / linkify.py
Created February 21, 2012 19:12 — forked from lmacken/linkify.py
A script to linkify URLs in text
#!/usr/bin/env python
# A simple script that can be used to turn URLs into links
#
# Using within a pipeline:
#
# $ echo 'http://lewk.org' | linkify
# <a href="http://lewk.org">http://lewk.org</a>
#
# Using on a file:
#
@eatnumber1
eatnumber1 / .gitignore
Created May 30, 2011 16:40
Koluring: Coloring text for your terminal.
.*.swp
@jeresig
jeresig / .vimrc
Created May 4, 2011 16:46
VIM Config
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
set nocompatible
set autoindent
set tabstop=2
set showmatch
set vb t_vb=
set ruler
set nohls
set incsearch
syntax on
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@cdwilson
cdwilson / gitosis_setup_fedora.sh
Created July 27, 2010 17:29
Gitosis setup instructions for Fedora
# Gitosis setup instructions for Fedora
# copied from http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way
# and modified to work on Fedora
# Comment out the next two lines after you've changed this script to match your config
echo "This is not meant to be run as a script!"
exit 0
# do you have setuptools or distribute? if not, run these commands
cd ~/src