Skip to content

Instantly share code, notes, and snippets.

View blakewrege's full-sized avatar

blake blakewrege

View GitHub Profile
@blakewrege
blakewrege / bubbleloop.c
Created December 11, 2014 03:14
loops the numbers
#include <msp430.h>
int p1[4] = {
BIT5+BIT6+BIT7,
BIT4+BIT6+BIT7,
BIT4+BIT5+BIT7,
BIT4+BIT5+BIT6};
int p2[10]={
BIT2+BIT1+BIT3+BIT4+BIT5+BIT6, //0
BIT1+BIT5, //1
@blakewrege
blakewrege / timer.c
Created December 11, 2014 04:01
counts on screen
#include <msp430.h>
#include <libemb/serial/serial.h>
#include <libemb/conio/conio.h>
#include <libemb/shell/shell.h>
int v=0;
int main()
{ WDTCTL = WDTPW | WDTHOLD;
BCSCTL1 = CALBC1_1MHZ; // the usual
DCOCTL = CALDCO_1MHZ; //
@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))))
@blakewrege
blakewrege / blink.c
Created December 11, 2014 04:42
msp430
@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 / 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 / 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 / .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 / 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 / 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