This file contains 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
/* | |
* Simple header for tracing time. | |
* Include and define TRACE to enable. | |
*/ | |
#ifndef _TRACE_H | |
#define _TRACE_H | |
#ifdef TRACE | |
#include <sys/time.h> |
This file contains 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
MACHINES=$(shell ls *.rl | xargs basename -s .rl) | |
CFLAGS= -O0 -g | |
RFLAGS= -V | |
# pattern rules | |
# see https://www.gnu.org/software/make/manual/html_node/Pattern-Rules.html#Pattern-Rules | |
%.o : %.c | |
gcc $(CFLAGS) -o $@ $< |
This file contains 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
#!/bin/sh | |
brew_cflags() { | |
local flags | |
for lib in $@; do | |
P=`brew --prefix $lib` | |
name=`echo $lib | sed 's/^lib//'` | |
flags="$flags -L$P/lib -I$P/include -l$name" | |
done | |
echo $flags |
This file contains 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
#!/bin/sh | |
# Usage: $0 [user@]hostname | |
public_key_path="$HOME/.ssh/id_dsa.pub" | |
public_key=$(<${public_key_path}) | |
ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $1 <<-END | |
echo "Authorize public key ${public_key_path} on \`hostname\`" | |
[ -d \$HOME/.ssh ] || mkdir \$HOME/.ssh | |
echo $public_key >> \$HOME/.ssh/authorized_keys |
This file contains 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
dnsmasq=homebrew.mxcl.dnsmasq | |
postgres=homebrew.mxcl.postgresql |
This file contains 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
DATE_FORMAT_ASN1="%y%m%d%H%M%SZ" | |
# @stdout: ASN1 formatted date string | |
# $1: offset expression (seconds) eg. 24 hours: '+(60*60*24)' | |
date_asn1() { | |
local offset=$1 | |
date -j -f %s `echo $(date +%s)${offset}|bc` +${DATE_FORMAT_ASN1} | |
} |
This file contains 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
#!/bin/sh | |
# Combine find and grep to search (source) files. | |
# Just for lazy typers ;) | |
# | |
# E.g limit grep to *.h and *.c: | |
# sgrep X509_verify_cert .c .h | |
find_args="" | |
for arg in $(echo $@ | cut -d' ' -f 2-); do |
This file contains 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
tree ~/.network/ | |
~/.network/ | |
├── down.d | |
│ └── mynet_down.sh | |
└── up.d | |
└── mynet_up.sh |
This file contains 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
<html> | |
<body> | |
<p><%= @options[:title] %></p> | |
<%= import("chapter.html.erb") %> | |
</body> | |
</html> |
This file contains 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
require 'reek/rake/task' | |
require 'syspect/rspec/reek_checkstyle_formatter' | |
Reek::Rake::Task.new do |t| | |
t.fail_on_error = false | |
t.reek_opts = '-y -n' | |
end | |
namespace :reek do | |
desc 'Generate checkstyle report for code smells analyzed by reek.' |