This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// safeSplit handles quoting well for commands for use with github.com/jmervine/exec/v2 | |
// | |
// Examples: | |
// > safeSplit("/bin/bash bash -l -c 'echo \"foo bar bah bin\"'") | |
// => []string{"/bin/bash", "-l", "-c", "echo \"foo bar bah bin\""} | |
// > safeSplit("docker run --rm -it some/image bash -c \"npm test\"") | |
// => []string{"docker", "run", "--rm", "-it", "some/image", "bash", "-c", "npm test"} | |
//---- | |
// package main | |
// import "github.com/jmervine/exec/v2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Be sure to save your config files. Optional but I do: | |
sudo cp /etc/postgresql/9.3/main/postgresql.conf ~ | |
sudo cp /etc/postgresql/9.3/main/pg_hba.conf ~ | |
# Package repo (for apt-get) | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list' | |
# Also probably optional but I like to update sources and upgrade | |
sudo apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##TCP FLAGS## | |
Unskilled Attackers Pester Real Security Folks | |
============================================== | |
TCPDUMP FLAGS | |
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere) | |
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere) | |
Pester = PSH = [P] (Push Data) | |
Real = RST = [R] (Reset Connection) | |
Security = SYN = [S] (Start Connection) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import multiprocessing | |
import threading | |
from pylibmc.test import make_test_client | |
import random | |
NUM_THREADS = 4 | |
NUM_PROCS = 4 | |
NUM_SETS = 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Convert camel-case to snake-case in python. | |
e.g.: CamelCase -> snake_case | |
e.g.: snake_case -> CamelCase | |
e.g.: CamelCase -> dash-case | |
e.g.: dash-case -> CamelCase | |
By: Jay Taylor [@jtaylor] | |
Me<modifier>: Yahya Kacem <fuj.tyoli@gmail.com> | |
Original gist: https://gist.github.com/jaytaylor/3660565 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Railscast | |
http://railscasts.com/episodes/308-oh-my-zsh | |
# Install Zsh | |
sudo apt-get update && sudo apt-get install zsh | |
# Install Oh-my-zsh | |
wget –no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O – | sh | |
# Make ZSH default shell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def symbolize_keys(obj) | |
case obj | |
when Array | |
obj.inject([]){|res, val| | |
res << case val | |
when Hash, Array | |
symbolize_keys(val) | |
else | |
val | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Implementation of the benchmark tool. | |
*/ | |
#include "benchmark.h" | |
#ifndef __cplusplus | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |