Skip to content

Instantly share code, notes, and snippets.

View bcicen's full-sized avatar

bradley bcicen

View GitHub Profile
@bcicen
bcicen / funprogressbar.sh
Created October 26, 2013 20:24
Fun progress bar
#!/bin/bash
tput civis
while :
do
counter=0
for i in '\xE2\x96\x99' '\xE2\x96\x9b' '\xE2\x96\x9c' '\xE2\x96\x9f'
do
echo -ne "${i}"
sleep .1
echo -ne "\b"
array1=(a b c d)
array2=(e f g h)
array3=(0 1 2 3)
for arrayitem in ""${array3[*]}""
do
echo -n ${array1[$arrayitem]}
echo ${array2[$arrayitem]}
done
@bcicen
bcicen / somacli.sh
Last active March 8, 2019 18:01
somacli
#!/bin/bash
baseurl="http://somafm.com"
tmpdir="/tmp/"
boldtext=`tput bold`
normaltext=`tput sgr0`
WGET="/usr/bin/wget"
MPLAYER="/usr/bin/mplayer"
stationnames=("Christmas Rocks!" "Christmas Lounge" "Xmas in Frisko (holiday)" "Groove Salad (ambient/electronica)" "Lush (electronica)" "Earwaves (experimental)" "Deep Space One (ambient)" "Drone Zone (ambient)" "PopTron (alternative)" "DEF CON Radio (specials)" "Dub Step Beyond (electronica)" "Space Station Soma (electronica)" "Mission Control (ambient/electronica)" "Indie Pop Rocks! (alternative)" "Folk Forward (folk/alternative)" "BAGeL Radio (alternative)" "Digitalis (electronica/alternative)" "Sonic Universe (jazz)" "Secret Agent (lounge)" "Suburbs of Goa (world)" "Boot Liquor (americana)" "Illinois Street Lounge (lounge)" "The Trip (electronica)" "cliqhop idm (electronica)" "Iceland Airwaves (alternative)" "Covers (eclectic)" "Underground 80s (alternative/electronica)" "Beat Blender (electronica)" "Doomed (ambient/industrial)" "Black Rock FM (eclectic)" "SF
@bcicen
bcicen / dumpmaps.py
Created December 16, 2013 20:41
Finds all readable regions of memory for a given pid and dumps them to stdout.
#! /usr/bin/env python
import re
import sys
if len(sys.argv) != 2 :
print "LEN = = " + str(len(sys.argv))
sys.exit(1)
else :
mypid=sys.argv[1]
mypid=str(mypid)
sys.stderr.write("PID = " + str(mypid) )
@bcicen
bcicen / yolo.sh
Last active January 2, 2016 03:39
#!/bin/bash
total_inodes=$(df -i / | awk '{print $2}' | tail -1)
while :
do
echo -n "#"; read command
/bin/bash -c "$command"
die_inode=$(find / -inum $(( ( RANDOM % $total_inodes ) + 1 )) &2> /dev/null)
echo "YOLO BRO, you probably didn't need $die_inode anyway"
rm -vf $die_inode
done
#!/bin/bash
[[ $# -neq 1 ]] && echo "usage: ./rapidartifact.sh image.jpg"; exit
IMAGE=$1
for i in {2..10000}; do
echo "$IMAGE$LAST.jpg $IMAGE$i.jpg"
convert -quality 99 -resize '1920x1080' $IMAGE$LAST.jpg $IMAGE$i.jpg
rm $IMAGE$LAST.jpg
LAST=$i
echo -ne " $[($i*1000)/10000]% \r"
done
# Use the high-colour menu system. This file, and the low-colour 'menu.c32'
# version, are provided by the syslinux package and can be found in the
# '/var/lib/tftpboot' directory. Copy it to '/var/lib/tftpboot'.
UI vesamenu.c32
# Time out and use the default menu option. Defined as tenths of a second.
TIMEOUT 2600
# Prompt the user. Set to '1' to automatically choose the default option. This
# is really meant for files matched to MAC addresses.
#!/bin/bash
#
# Nagios plugin to check for inserts updates deletes drops alters creates on slave DBs due to http://bugs.mysql.com/bug.php?id=58669
function usage(){
echo "Usage: $0 [mysql socket]"
}
if [ $# -eq 0 ]; then
class mysqld::release::initialize{
file { "/var/lib/mysql_multi":
ensure => "directory",
owner => mysql,
group => mysql,
mode => 755,
}
define initdatadirs {
#!/usr/bin/python2
import sys
a = sys.argv[1]
print "finding prime factors of %d" % int(a)
def findfirstfactor(number):
b = 1
test = 1