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/bash | |
create_build_file() { | |
cat > $1/build.gradle << EOF | |
repositories { | |
mavenCentral() | |
} |
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
#include <sys/time.h> | |
#include <stdio.h> | |
#include <string.h> | |
long timevaldiff(struct timeval *starttime, struct timeval *finishtime) { | |
long msec; | |
msec=(finishtime->tv_sec-starttime->tv_sec)*1000; | |
msec+=(finishtime->tv_usec-starttime->tv_usec)/1000; | |
return msec; | |
} |
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 | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf | |
# config: /etc/sysconfig/redis | |
# pidfile: /var/run/redis.pid |
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
# Redis configuration file example | |
# Note on units: when memory size is needed, it is possible to specify | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# | |
# 1k => 1000 bytes | |
# 1kb => 1024 bytes | |
# 1m => 1000000 bytes | |
# 1mb => 1024*1024 bytes | |
# 1g => 1000000000 bytes |
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
yum update kernel* | |
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
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/bash | |
files=`git status --porcelain | grep -e "^\sM" | cut -d " " -f 3` | |
for file in $files; do | |
echo "Differences in file" | |
git diff --color=always $file | |
read -p "Do you want to stage this file [y/n]" to_stage | |
if [ "$to_stage" == "y" -o "$to_stage" == "Y" ]; then | |
echo "Staging file -> $file" | |
git add $file | |
fi |
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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "twitter" | |
require "colorize" | |
require "oauth" | |
require "yaml" | |
class TwitterRotator | |
attr_writer :tweet_func |
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
DEVICE=eth0 | |
BOOTPROTO=static | |
HWADDR=XX:XX:XX:XX:XX:XX | |
IPADDR="<IP_ADDRESS>" | |
GATEWAY="<NETWORK_GATEWAY>" | |
NETMASK="<NETWORK_MASK>" | |
DNS1="<DNS_SERVER1>" | |
DNS2="<DNS_SERVER2>" | |
TYPE="Ethernet" | |
ONBOOT=yes |
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/bash | |
alias gob='go build' | |
alias goc='go clean' | |
alias gog='go get' | |
alias goi='go install' | |
alias gor='go run' | |
alias gotest='go test' | |
alias got='go tool' | |
alias govet='go vet' |
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/bash | |
alias gita='git add' | |
alias gitb='git branch' | |
# To see which local branches you have that are merged into the | |
# branch you are currently on | |
alias gitbm='git branch --merged' | |
alias gitbnm='git branch --no-merged' | |
alias gitc='git commit' |