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
shuf -n 1 oblique.txt | |
# or | |
rl -c 1 oblique.txt | |
# or | |
sed -n $((RANDOM%$(wc -l < leader.txt)+1))p oblique.txt |
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
import random | |
print(random.choice([line for line in open('oblique.txt')])) |
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 python | |
import os | |
import random | |
import sys | |
def randline(fname): | |
result = '' | |
if os.path.exists(fname): | |
result = random.choice([line for line in open(fname)]) | |
return result |
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
CREATE SEQUENCE cid_seq | |
START WITH 100 | |
INCREMENT BY 1; | |
CREATE OR REPLACE FUNCTION get_next_cseq | |
RETURN NUMBER AS l_return NUMBER; | |
BEGIN | |
SELECT cid_seq.NEXTVAL INTO l_return FROM DUAL; | |
RETURN l_return; | |
END; |
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
cmake_minimum_required(VERSION 2.8) | |
project(mylib C CXX) | |
# TODO: in cmake 3.2, we can set the version without making new variables | |
# project(asimux VERSION "1.0.0" C CXX) | |
set(VERSION_MAJOR "1") | |
set(VERSION_MINOR "0") | |
set(VERSION_PATCH "0") | |
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") |
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
cd $WORKSPACE/dcable-rpms/ | |
svn up ./* | |
find . -iname '**.spec' | xargs grep -i '^Version' | sed -e 's_./.*/SPECS/__' -e 's/\.spec//' -e 's/Version://' |
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 | |
# List missing files from a web server. Missing means we get a non-200 response. | |
BASE="http://www.example.com" | |
FILES="index.html | |
about.html" | |
for ITEM in ${FILES}; do | |
URL="${BASE}/${ITEM}" |
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 | |
# mac setup automation script based on | |
# http://lapwinglabs.com/blog/hacker-guide-to-setting-up-your-mac | |
# Check for Homebrew, | |
# Install if we don't have it | |
if test ! $(which brew); then | |
echo "Installing homebrew..." | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
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 | |
# Toggle proxy settings. | |
# It will be necessary to reload ${HOME}/.profile after running this. | |
USAGE="usage: ${0} on|off|status" | |
if [[ "d${PROXY_FILE}d" == "dd" ]]; then | |
echo "PROXY_FILE undefined" >&2 | |
exit 1 | |
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
#!/bin/sh | |
# assuming you just installed Oracle JDK7 in '/Library/Java/JavaVirtualMachines/jdk1.7.0_72.jdk' | |
cd /System/Library/Frameworks/JavaVM.framework/Versions | |
sudo mv CurrentJDK JDK6 | |
# the version number must match the installed version | |
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_72.jdk /Library/Java/JavaVirtualMachines/jdk1.7.0 | |
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0/Contents JDK7 | |
sudo ln -s JDK7 CurrentJDK | |
sudo cp -r JDK6/Commands JDK7/ |
OlderNewer