Skip to content

Instantly share code, notes, and snippets.

View HokieGeek's full-sized avatar
🎄

Andrés Pérez HokieGeek

🎄
View GitHub Profile
#!/bin/bash
throbber() {
stages="| / - \ | / -"
while true; do
for s in $stages; do
echo -n $s
sleep 0.0625
echo -n $'\b'
done
# 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')
@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"]
@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 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
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
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}`"
@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
#!/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"
@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