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 / buspirate-bulkrom.py
Last active January 17, 2021 12:47
Trying out bus pirate binary mode in python and haskell
#!/usr/bin/python
import serial
import signal
import sys
import time
def BinaryModeEnter(connection):
connection.flushInput()
for x in range(0, 20): # Try at most 20 times
ps -p $$ | awk 'END{ print $NF }' | egrep -q 't?csh' \
&& lsof +p $$ | awk '$9 ~ /gethere.sh/ { system("dirname "$9) }' \
|| test -z "$BASH_SOURCE" \
&& echo "`dirname ${0}`" \
|| echo "`dirname ${BASH_SOURCE}`"
FROM centos:6
## Install the EPEL repo
RUN yum -y install wget
RUN wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm -O /tmp/epel.rpm
RUN yum -y install /tmp/epel.rpm
## Install and configure x11vnc
RUN yum -y install x11vnc
RUN mkdir ~/.vnc
@HokieGeek
HokieGeek / Dockerfile
Last active March 28, 2016 02:07
A dev platform to play with
FROM hokiegeek/arch:minimal
RUN pacman -S --noconfirm --needed go
# gcc
# RUN pacman -S --noconfirm --needed scons cmake
# apache-ant
RUN pacman -S --noconfirm --needed ctags cloc strace
# RUN pacman -S --noconfirm --needed python-pip nodejs
# jslint
# RUN pacman -S --noconfirm --needed picocom
@HokieGeek
HokieGeek / Dockerfile
Last active March 28, 2016 00:56
A minimal arch docker container
FROM base/arch:latest
RUN pacman -Sy --noconfirm --needed archlinux-keyring
RUN pacman -Sy --noconfirm --needed base-devel
RUN pacman-db-upgrade
RUN pacman -Sy --noconfirm --needed ca-certificates
RUN pacman -S --noconfirm --needed vim tmux zsh
RUN pacman -S --noconfirm --needed docker thin-provisioning-tools
@HokieGeek
HokieGeek / Dockerfile
Last active September 26, 2016 02:33
silly little script for tracking hours worked
FROM alpine:latest
RUN apk add --no-cache bash tzdata
RUN rm -f /etc/localtime && ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime
RUN echo "US/Eastern" > /etc/timezone
ADD hrs /usr/bin/hrs
ENTRYPOINT ["/usr/bin/hrs"]
# Maintainer: Andres Perez <[email protected]>
pkgname=hg-bin
_pkgname=hg-bin
epoch=1
pkgver=0
pkgrel=1
pkgdesc='My personal scripts'
url='https://gitlab.com/HokieGeek/bin'
arch=('i686' 'x86_64')
#!/bin/bash
throbber() {
stages="| / - \ | / -"
while true; do
for s in $stages; do
echo -n $s
sleep 0.0625
echo -n $'\b'
done
@HokieGeek
HokieGeek / .aliases.csh
Created June 13, 2016 13:15
Script that lets me source my primary aliases in csh
set num_processors=`grep -c processor /proc/cpuinfo | xargs expr 1 +`
set f=`mktemp`
awk '/NOCSH *$/ { next } /^ *alias/ { sub(/=/, " ", $2); print }' $HOME/.aliases > $f
source $f
unset num_processors
#include <cmath>
#include <cstdio>
#include <vector>
#include <map>
#include <iostream>
#include <algorithm>
using namespace std;
void printSentence(string s, int rows, int cols) {
/*