Skip to content

Instantly share code, notes, and snippets.

View forestbaker's full-sized avatar

input - process - output forestbaker

View GitHub Profile
@forestbaker
forestbaker / bandit24-solution
Created October 11, 2015 21:39 — forked from vinzdef/bandit24-solution
4 digit pin bruteforce using Bash expansions for Over The Wire bandit25
for x in {0..9}{0..9}{0..9}{0..9}; do
echo UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $x | nc localhost 30002 | egrep -v "Exiting|Wrong|I am";
echo "Try $x";
done
@forestbaker
forestbaker / upgrade_starcluster.sh
Created October 11, 2015 21:34 — forked from nickjacob/upgrade_starcluster.sh
script to safely upgrade starcluster & dependencies
#!/usr/bin/env bash
# upgrade starcluster
####
mute_run ()
{
$* >/dev/null 2>&1
}
cecho ()
{
@forestbaker
forestbaker / pre-commit.sh
Last active November 16, 2015 04:16 — forked from nickjacob/pre-commit.sh
Pre-commit hook to check for extra-large files that you probably shouldn't have in version control
#!/usr/bin/env bash
echo '================================================================================'
echo 'PRE-COMMIT: CHECKING FILE SIZES'
echo '================================================================================'
# constant that you want to check sizes against
SIZE_LIMIT=$(( 1048576 * 64 ))
# $1 - filetype
#!/bin/bash
# generate a number of files with random sizes in a range
min=1 # min size (MB)
max=10 # max size (MB)
nofiles=20 # number of files
for i in `eval echo {1..$nofiles}`
do
dd bs=1M count=$(($RANDOM%max + $min)) if=/dev/urandom of=./files/file$i
_
_._ _..._ .-', _.._(`))
'-. ` ' /-._.-' ',/
) \ '.
/ _ _ | \
| a a / |
\ .-. ;
'-('' ).-' ,' ;
'-; | .'
\ \ /
#!/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:
@forestbaker
forestbaker / cmd
Created October 11, 2015 21:10 — forked from crittelmeyer/cmd
A bash script to quickly create new bash scripts. It's scriptception.
#!/bin/bash -e
filename=$1
script_root=/usr/bin
editor=vi
createScriptIfItDoesntExist() {
if [ ! -f $1 ]; then
touch $1
chmod +x $1
@forestbaker
forestbaker / bash_commands.txt
Created October 11, 2015 21:08 — forked from corbanb/bash_commands.txt
helpful bash commands
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
@forestbaker
forestbaker / irc
Created October 11, 2015 20:44 — forked from schmunsler/irc
Bash 1-liner IRC client
#/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
@forestbaker
forestbaker / gist:eafb82d907aabe3369dd
Created October 11, 2015 20:36 — forked from chadfurman/gist:5298b4c3c63b36412083
poodle checking bash script
#!/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.";