This file contains hidden or 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 | |
# Let it Rain! | |
# Copyright (C) 2011, 2013 by Yu-Jie Lin | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains hidden or 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 -e | |
filename=$1 | |
script_root=/usr/bin | |
editor=vi | |
createScriptIfItDoesntExist() { | |
if [ ! -f $1 ]; then | |
touch $1 | |
chmod +x $1 |
This file contains hidden or 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
I have marked with a * those which I think are absolutely essential | |
Items for each section are sorted by oldest to newest. Come back soon for more! | |
BASH | |
* In bash, 'ctrl-r' searches your command history as you type | |
- Input from the commandline as if it were a file by replacing | |
'command < file.in' with 'command <<< "some input text"' | |
- '^' is a sed-like operator to replace chars from last command | |
'ls docs; ^docs^web^' is equal to 'ls web'. The second argument can be empty. | |
* '!!:n' selects the nth argument of the last command, and '!$' the last arg |
This file contains hidden or 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 | |
# Fully functional IRC client. Takes server as arg, raw IRC commands on stdin, outputs full transaction labelled for downstream filters | |
{ { tee >(sed 's/^/< /' >&4) <&3 | sed -un 's/^PING/PONG/p' & cat ;} | tee >(sed 's/^/> /' >&4) >&3 ;} 3<>/dev/tcp/$1/6667 4>&1 |
This file contains hidden or 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 | |
ciphers=`nmap --script ssl-enum-ciphers -p 443 $1` | |
echo "$ciphers" | grep -q "SSLv3: No supported ciphers found" | |
if [ $? -eq 0 ];then | |
echo "Cipher not supported. No poodles."; | |
exit 1 # cipher not found | |
fi | |
echo "Cipher supported. Poodles."; |
This file contains hidden or 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 Bash Hash Generator | |
# | |
# Author: Chris Hager <[email protected]> | |
# | |
# Put the `hashgen` method in your `.functions` file and source it from your `.bash_profile` | |
# | |
# Usage: hashgen [type] [#chars] | |
# | |
# Optional argument `type`: | |
# |
This file contains hidden or 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
start on runlevel [2345] | |
stop on runlevel [016] | |
respawn | |
respawn limit 10 10 | |
kill signal INT | |
kill timeout 20 | |
normal exit 0 TERM INT |
This file contains hidden or 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
declare -rx IFC='/sbin/ifconfig' | |
showips() { | |
NAMES=( $($IFC | egrep 'lo|eth|wlan|en' -A 1 | awk -F' ' '{print $1 }' | egrep -v 'inet|-|UP|RX|collisions' | sort -u) ) | |
for i in "${NAMES[@]}"; do | |
echo "$i has ip address: $($IFC | grep $i -A 1 | grep 'addr' | awk -F' ' '{print $2}' | awk -F':' '{print $2}')" | |
done |
NewerOlder