Skip to content

Instantly share code, notes, and snippets.

root@a7c3804e9aa4:/# ldd /usr/local/lib/python2.7/site-packages/mesos/executor/_executor.so
linux-vdso.so.1 => (0x00007ffc351ba000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd3ed9cd000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd3ed7c5000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd3ed4c0000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd3ed1ba000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd3ecfa4000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd3ecd85000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd3ec9c0000)
/lib64/ld-linux-x86-64.so.2 (0x0000555664a7e000)
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <stdlib.h>
int main(int argc, char **argv) {
mkdir("/mnt/aufs", 0755);
mkdir("/tmp/br1", 0755);
mkdir("/tmp/br2", 0755);
function timeit() (
command=("$@")
exec 3>&1
exec 4>&2
time_output=$( ( TIMEFORMAT="%3R"; time "${command[@]}" 1>&3 2>&4; ) 2>&1 )
echo "time output: $time_output"
)
@EvanKrall
EvanKrall / delete_regex_blank_line.sh
Created September 29, 2011 23:07
Delete a regexp and optionally a blank line after it.
#!/bin/bash
regex="$1"
filename="$2"
sed --separate --in-place "/^${regex}\$/,+1{
/^${regex}\$/d
/^\$/d
}" "$filename"
@EvanKrall
EvanKrall / histogram.sh
Created April 22, 2011 05:33
Given a list of numbers separated by newlines, prints out a histogram.
#!/bin/bash
NUMTESTS=0
histogram=()
while read num
do
((NUMTESTS++))
((histogram[num]++))
done
@EvanKrall
EvanKrall / buttons.html
Created March 1, 2011 08:20
Closures and for loops.
<html>
<head>
<style>
span {
border: 1px solid black;
border-radius: 6px;
padding: 3px;
margin: 2px;
background: #dde;
-webkit-box-shadow: 3px 3px 6px rgba(0,0,0,0.5);
@EvanKrall
EvanKrall / counter.html
Created February 20, 2011 01:09
Shows the number of characters remaining in a textarea.
<html>
<head>
<style>
.empty {
color: green;
}
.almostfull {
color: yellow;
}
.full {