Skip to content

Instantly share code, notes, and snippets.

View blakewrege's full-sized avatar

blake blakewrege

View GitHub Profile
@blakewrege
blakewrege / appifiy.scpt
Created July 29, 2015 23:31
A script to turn any bash script into an app for mac
tell application "Finder"
set myFolder to POSIX path of (parent of (path to me) as string)
end tell
display dialog "NOTE: This deletes previous versions of .app in the folder
Enter name of script to appify: " default answer ""
set appname to text returned of the result
set appPWD to myFolder & appname
@blakewrege
blakewrege / numbers.py
Created July 23, 2015 18:24
strip letters python
import string
with open("numbers.txt") as f:
lines = [line.rstrip('\n') for line in open("numbers.txt")]
print 'Number of lines: ', len(lines)
for index in range(len(lines)):
x=lines[index]
all=string.maketrans('','')
nodigs=all.translate(all, string.digits)
print x.translate(all, nodigs)
@blakewrege
blakewrege / VMscripts
Created July 20, 2015 15:13
Some vmscripts I used on cflock
virt-install --connect qemu:///system --arch=x86_64 -n win2012 --ram 4096 --cpu host --vcpus=2 --hvm --disk size=100,sparse=false,format=raw,bus=virtio --cdrom /home/cclub/images/en_windows_server_2012_x64_dvd_915478.iso --os-type=windows --os-variant=win2k8 --network bridge=br0,model=virtio --noautoconsole
qemu-system-x86_64 --enable-kvm -m 2048 -boot d -drive file=WIN2K8R2.qcow2,if=virtio -cdrom /home/cclub/images/en_windows_server_2012_x64_dvd_915478.iso -drive file=virtio-win-drivers-20120712-1.iso,media=cdrom -net nic,model=virtio -net user
qemu-img create -f qcow2 ws2012.qcow2 80g
@blakewrege
blakewrege / labeler.ps1
Last active August 29, 2015 14:23
Labels each picture using ImageMagick
#Labels Each Picture using ImageMagick
#http://www.imagemagick.org/script/binary-releases.php#windows
#Select which routine you would like to run: 1, 2, or 3
$option=1
#Gravity is the position of the label: North, South, Center
$gravity="South"
#Use "convert -list color" to see color options ex: Green, Red, Orange, Blue, Black, White
#Use "convert -list font" to see font options ex: Arial, Calibri, Times-New-Roman
$backgroundcolor="White"
@blakewrege
blakewrege / .bashrc
Last active October 1, 2015 01:23
bash aliases
alias ,edit-alias='nano .bashrc'
alias ,processes='ps -u gigglesbw4'
alias ,webcam2="scp cclub@141.218.117.219:~/misc/image.jpg /home/members/gigglesbw4/www"
alias ,webcam="scp cclub@141.218.117.219:/tmp/cclub/webcam.jpg /home/members/gigglesbw4/www"
alias shrek='ssh shrek.dhcp.io -l cclub'
alias millenniumfalcon='ssh shrek.dhcp.io -p 9000 -l cclub'
alias uglyduck='ssh shrek.dhcp.io -p 9010 -l administrator'
alias ralph='ssh shrek.dhcp.io -p 9030 -l cclub'
@blakewrege
blakewrege / Printer.ps1
Created February 16, 2015 19:43
Scripts for Konica Printer
$PortName = "IP_141.218.90.17"
$PortIP = "141.218.90.17"
$DriverName = "KONICA MINOLTA C754SeriesPCL SP"
$DriverLocation = "\c754_c754e_c654_c654e_pcl6_win64_v312ssd03_en_add\KOFYSJ1_.inf"
##Leave This code commented out unless you are removing old drivers with the same name
#net stop spooler
#net start spooler
#rundll32 printui.dll PrintUIEntry /dl /q /n $DriverName
#rundll32 printui.dll,PrintUIEntry /dd /m $DriverName
@blakewrege
blakewrege / lazygit
Created February 6, 2015 20:15
3 git commands in one
##Copy and paste into your .bashrc
##usage: lazygit "your message here"
function lazygit() {
git add .
git commit -a -m "$1"
git push
}
@blakewrege
blakewrege / addbits.S
Created December 14, 2014 06:53
possible 2230 assignments?
.text
RESET_ISR:
MOV #WDTPW+WDTHOLD, &WDTCTL
MOV #__stack, R1
CLR.B &DCOCTL
MOV.B &CALBC1_1MHZ, &BCSCTL1
MOV.B &CALDCO_1MHZ, &DCOCTL
@blakewrege
blakewrege / blink.c
Created December 11, 2014 04:42
msp430
@blakewrege
blakewrege / Makefile
Created December 11, 2014 04:34
for msp430
SOURCE = blink.c
ADDITIONAL =
NAME = $(basename $(SOURCE))
CPU = msp430g2553
OPTIMIZATION = -O0
CFLAGS = -mmcu=$(CPU) $(OPTIMIZATION) -Wall -g
LIBEMB = -lshell -lconio -lserial
$(NAME).elf: $(SOURCE) $(ADDITIONAL)
ifeq (,$(findstring libemb,$(shell cat $(SOURCE))))