Skip to content

Instantly share code, notes, and snippets.

@spthm
spthm / led_ctl
Last active June 22, 2018 20:46
Turn on/off Raspberry Pi 2 Model B POWER LED
#!/bin/bash
if [[ $# -eq 0 || "$1" == "-h" || "$1" == "--help" ]]; then
echo "Usage: led_ctl [on|off|auto]"
echo "on -- turn POWER LED on"
echo "off -- turn POWER LED off"
echo "auto -- turn POWER LED on if between 08:00 and 20:00, else turn off"
echo "Run as root."
exit 0
fi
@spthm
spthm / Makefile
Last active March 19, 2018 23:27 — forked from mr-sudaca/Makefile
monaco for powerline
PATCHED_FILENAME = "Monaco for Powerline.ttf"
$(PATCHED_FILENAME): Monaco.ttf fontpatcher.py fontpatcher-symbols.sfd
fontforge -script fontpatcher.py Monaco.ttf
@echo "(´・_・`) You can install the $(PATCHED_FILENAME) now."
Monaco.ttf: Monaco.dfont
fondu Monaco.dfont
rm *.bdf
@spthm
spthm / find-color-pages
Last active January 24, 2018 21:10 — forked from agarciadom/find-color-pages
Small Python 2.7+ script that lists the color pages in a PDF along with their CMYK ink mixes, as computed by the 'inkcov' device in Ghostcript 9.05+. "find-color-pages file.pdf" lists the color pages and their CMYK ink mixes, "find-color-pages -c file.pdf" prints the number of color pages in the PDF and "find-color-pages -C 0.39 -B 0.04 file.pdf…
#!/usr/bin/env python
# Simple script for finding and counting the color pages in a PDF
# Copyright (C) 2013 Antonio Garcia-Dominguez
# Licensed under the GPLv3
#
# This script is based on the following thread (thanks for the tip!):
#
# http://tex.stackexchange.com/questions/53493