start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/bash | |
# pre-commit git hook to check the validity of a puppet manifest | |
# | |
# Prerequisites: | |
# gem install puppet-lint puppet | |
# | |
# Install: | |
# /path/to/repo/.git/hooks/pre-comit | |
# Source RVM if needed |
#!/usr/bin/env python | |
import json | |
import requests | |
def main(): | |
update_record('example.com', 'home', 'ID') | |
def update_record(zone, name, id): | |
newip = requests.get('https://icanhazip.com').text.rstrip() |
#!/usr/bin/env python | |
import json | |
import requests | |
def main(): | |
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'} | |
url = 'https://api.digitalocean.com/v2/domains/example.com/records' | |
r = requests.get(url, headers=headers) |
#include <parted/parted.h> | |
#include <parted/device.h> | |
#include <parted/debug.h> | |
#include <ctype.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <limits.h> |
#!/bin/bash | |
# pre-commit git hook to check the validity of a puppet manifest | |
# | |
# Prerequisites: | |
# gem install puppet-lint puppet | |
# | |
# Install: | |
# /path/to/repo/.git/hooks/pre-comit | |
# Source RVM if needed |
#!/bin/sh | |
# | |
# This script will create the Iozone graphs using | |
# gnuplot. | |
# | |
# | |
# | |
# ------------------------------------------------ | |
# YOU MUST PROVIDE A FILE NAME FOR IT TO PROCESS. | |
# This filename is the name of the file where you |
#!/usr/bin/ruby | |
n = 5 | |
z = 1 | |
while n > 0 | |
z += 4*(n-1) | |
n -= 1 | |
end | |
#!/usr/bin/ruby | |
def partition(ar, start, stop) | |
pivot = ar[stop] | |
pindex = start | |
for i in (start..stop-1) do | |
if ar[i] <= pivot | |
ar[i], ar[pindex] = ar[pindex], ar[i] | |
pindex += 1 | |
end |
#!/usr/bin/ruby | |
def quicksort(ar) | |
return ar if ar.length < 2 | |
left = [] | |
equal = [] | |
right = [] | |
p = ar[0] | |
ar.each do |i| |