Skip to content

Instantly share code, notes, and snippets.

View bcicen's full-sized avatar

bradley bcicen

View GitHub Profile
# 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.
@bcicen
bcicen / results.py
Created June 11, 2014 01:35
numpy.sum_vs_sum
>>> t = timeit.Timer("np.sum(a, axis=0)",
... "import numpy as np\na = np.random.randint(1, 1000, (30, 40))"
... )
>>> t.repeat(3,100000)
[1.3957889080047607, 1.3684840202331543, 1.3558411598205566]
>>> t = timeit.Timer("sum(a)",
... "import numpy as np\na = np.random.randint(1, 1000, (30, 40))"
... )
>>> t.repeat(3,100000)
[5.969266176223755, 5.947613954544067, 5.906123876571655]
package main
import (
"fmt"
"github.com/teacat/noire"
)
func main() {
hue := 320.0
val := 100.0
package main
import (
"testing"
)
var (
lastString string
lastNumber int
lastBool bool
@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
#!usr/bin/python
import os
import email
import imaplib
from operator import itemgetter
username = 'myemail@gmail.com'
password = 'mypass'
imap = imaplib.IMAP4_SSL("imap.gmail.com")
from colour import Color
import xml.etree.ElementTree
def import_itermcolors(filename):
ret = {}
for k,v in import_itermcolors_raw(filename).items():
r = v['Red Component']
g = v['Green Component']
b = v['Blue Component']
ret[k] = Color(rgb=(r,g,b))
#!/bin/bash
a=1 b=2 c=4; for i in a b c; do echo ${!i}; 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
@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