Skip to content

Instantly share code, notes, and snippets.

View HokieGeek's full-sized avatar

Andrés Pérez HokieGeek

View GitHub Profile
@HokieGeek
HokieGeek / update_cygwin
Created April 17, 2014 11:53
Extremely simple shell script that retrieves the latest cygwin installer and runs it. No longer need this, but wanted to store it somewhere. This seemed like as good a place as any.
#!/bin/sh
cd /tmp
installer=setup-x86_64.exe
wget http://cygwin.com/${installer}
chmod +x ${installer}
exec ./${installer}
set autohidecursor
let barposition = "bottom"
let blacklists = ["https://inbox.google.com/*"]
let searchalias d = "duckduckgo"
imap <C-i> editWithVim
" map <Space> :
map <C-f> scrollFullPageDown
map <C-b> scrollFullPageUp
@HokieGeek
HokieGeek / all.snippets
Last active August 29, 2015 14:20
Quick UltiSnips user story snippet
snippet userstory
h6.+User Story+
*As a${2:n}* ${1:<STAKEHOLDER>}, *I need* ${3:<SOME GOAL>} *so that* ${4:<SOME REASON>}.
${5:
h6.+Suggested Implementation Notes+
* ${6:TODO}
}
import System.Environment
main = getArgs >>= test
test :: [String] -> IO()
test x
| x !! 0 == "foo" = putStrLn "w00t!"
| otherwise = putStrLn(x !! 0 ++ "bar")
@HokieGeek
HokieGeek / gist:0cdcea405d9856011ca0
Created May 19, 2015 19:08
Listen to multicast messages
#!/usr/bin/python
import socket
import struct
grp = 'xxx.xxx.xx.xx'
port = 7001
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
@HokieGeek
HokieGeek / gist:c23860bac515b1f8c745
Created June 2, 2015 12:40
Use this check all the time in scripts at work. Wondering if I can do it better...
ps -p $$ | awk 'END{ print $NF }' | egrep -q 't?csh'
FROM centos:5
RUN echo "exec gnome-session" > ~/.xinitrc && chmod 777 ~/.xinitrc
RUN yum --nogpgcheck -y install gnome-desktop gnome-session gnome-terminal x11vnc xorg-x11-server-Xvfb
RUN mkdir ~/.vnc && x11vnc -storepasswd 1234 ~/.vnc/passwd
CMD x11vnc -forever -usepw -create -auth /var/lib/gdm/:0.Xauth
@HokieGeek
HokieGeek / .gitignore
Last active August 6, 2018 16:18
My eagle library
*.l#*
@HokieGeek
HokieGeek / makeArduinoISP.sh
Last active November 19, 2015 17:41
I really hate the Arduino IDE
#!/bin/bash
port = "/dev/ttyACM0"
board = "uno"
sketch = "/usr/share/arduino/examples/ArduinoISP/ArduinoISP.ino"
# We need a sketch
if [ ! -f "${sketch}" ]; then
echo "ERROR: Could not find the Arduino ISP sketch (${sketch})" >&2
exit 1
#!/bin/bash
# http://archlinuxarm.org/platforms/armv6/raspberry-pi
here=$(cd $(dirname $0); pwd)
[ $UID != 0 ] && exec sudo ${here}/$0 $@
dir=`mktemp -d` && cd $dir
device="/dev/mmcblk0"
bootPart="${device}p1"