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
cat *.zip > combined.zip;zip -FF combined.zip --out combined-fixed.zip;rm combined.zip;yes A|unzip -qq combined-fixed.zip;rm combined-fixed.zip |
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
# Commands to retrieve the top 5 personal news items from GitHub. Can easily be used with GeekTools: | |
# top 5 news items | |
GITHUB_USER="...";GITHUB_TOKEN="...";curl --silent "https://github.com/$GITHUB_USER.private.atom?token=$GITHUB_TOKEN"|grep -E '(title type="html">|published>)'|sed -e 's/<title type="html">//' -e 's/<\/title>//' -e 's/<published>//' -e 's/<\/published>/ DATE /' -e 's/ //' -e 's/\([0-9]*\)-\([0-9]*\)-\([0-9]*\)/\3-\2/' -e 's/T\([0-9]*\):\([0-9]*\):\([0-9]*\)Z/ \1:\2/'|awk 'gsub(/DATE $/,""){printf $0;next;}1'|head -n 5 | |
# same as above but now separated into three commands for formatting purposes: | |
# 1. top 5 news date times: | |
GITHUB_USER="...";GITHUB_TOKEN="...";curl --silent "https://github.com/$GITHUB_USER.private.atom?token=$GITHUB_TOKEN"|grep -E '(published>)'|sed -e 's/<published>//' -e 's/<\/published>//' -e 's/\([0-9]*\)-\([0-9]*\)-\([0-9]*\)/\3-\2/' -e 's/T\([0-9]*\):\([0-9]*\):\([0-9]*\)Z/ \1:\2/'|head -n 5 | |
# 2. top 5 new users: | |
GITHUB_USER="...";GITHUB_TOKEN="...";curl --silent " |
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
# alias for bash to install older ports in macports | |
# (several port versions can live next to each other) | |
# add this code to your ~/.profile to have the | |
# oldports command / alias available in terminal. | |
# | |
# Usage: oldport portname | |
# oldport portname version | |
# | |
# author Jeroen Wesbeek <work@osx.eu> | |
oldport() { |
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
<VirtualHost *:80> | |
ServerName studies.dbnp.org | |
ServerAlias gscf.dbnp.org | |
ErrorLog /var/log/apache2/dbnp.org_gscf-studies-error.log | |
CustomLog /var/log/apache2/dbnp.org_gscf-studies-access.log combined | |
# disable gzip encoding for monitoring page | |
<Location /monitoring> | |
RequestHeader unset Accept-Encoding |
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
# hash methods | |
rmd160() { | |
openssl dgst -rmd160 $1 | |
} | |
portsums() { | |
echo 'MD5 : '`md5 $1` | |
echo 'SHA : '`shasum $1` | |
echo 'RMD160 : '`rmd160 $1` | |
} |
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
# alias for creating a graph video of a git project | |
g() { | |
DEFAULT_USER_IMAGE=~/Pictures/avatars/default.png | |
USER_IMAGE_DIR=~/Pictures/avatars | |
BRANCH=master | |
# determine first commit for this branch | |
FIRST_COMMIT=`git log $BRANCH --reverse --format=%H|head -n 1` | |
# get the third last commit to have a pretty accurate timestamp | |
LAST_COMMIT=`git log $BRANCH --format=%H|head -n 3|tail -n 1` |
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
# mongo db | |
# see http://noteit.jiaeil.com/install-mongodb-via-macports-on-mac | |
alias mongostart="sudo nice mongod --rest -f /opt/local/etc/mongodb/mongod.conf; clear; tail -f /opt/local/var/log/mongodb/mongodb.log" | |
mongostop_func () { | |
# local mongopid=`ps -o pid,command -ax | grep mongod | awk '!/awk/ && !/grep/{print $1}'`; | |
# just find a simpler way | |
local mongopid=`less /opt/local/var/db/mongodb_data/mongod.lock`; | |
if [[ $mongopid =~ [[:digit:]] ]]; then | |
sudo kill -15 $mongopid; | |
echo mongod process $mongopid terminated; |
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
# show connected users / ip's | |
alias connected="netstat -f inet -n | awk '/\.548 / { print $5 }' | sed 's/\.[^.]*$//'" |
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
# change prompt | |
LOGIN_NAME=$(whoami) | |
if [[ ${EUID} == 0 ]] ; then | |
if [ ${#LOGIN_NAME} -gt 20 ]; then | |
PS1='\[\033[01;35m\]${SCREENTITLE}\[\033[01;34m\]\w \$\[\033[00m\] ' | |
else | |
PS1='\[\033[01;36m\]${SCREENTITLE}\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] ' | |
fi | |
else | |
if [ ${#LOGIN_NAME} -gt 20 ]; then |
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
######################### | |
# .gitignore file for Xcode4 / OS X Source projects | |
# | |
# NB: if you are storing "built" products, this WILL NOT WORK, | |
# and you should use a different .gitignore (or none at all) | |
# This file is for SOURCE projects, where there are many extra | |
# files that we want to exclude | |
# | |
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
######################### |
OlderNewer