Skip to content

Instantly share code, notes, and snippets.

View amcolash's full-sized avatar

Andrew McOlash amcolash

View GitHub Profile
@amcolash
amcolash / gist:faaacae603241a520d7cbfc6c3c1bad8
Last active May 7, 2016 16:22
Wifi install script for Raspberry Pi
wget https://dl.dropboxusercontent.com/u/80256631/install-wifi.tar.gz
gunzip install-wifi.tar.gz
tar xvf install-wifi.tar install-wifi
@amcolash
amcolash / wakeup
Last active September 7, 2018 07:28
Wakeup script in python and upstart script for my magic mirror. This allows for the mirror to turn on from a motion sensor.
#!/bin/bash
# /etc/init.d/wakeup
### BEGIN INIT INFO
# Provides: Wakeup for Display
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Wakeup at boot
@amcolash
amcolash / wakeup
Last active December 26, 2016 23:09
Simple script to toggle display based off of PIR hooked up to sbc
#!/bin/bash
# /etc/init.d/wakeup
### BEGIN INIT INFO
# Provides: Wakeup for Display
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Wakeup at boot
@amcolash
amcolash / README.md
Last active March 21, 2017 14:47
Translate a directory of files w/ node

This is a simple node application that will convert a path of files into english names. It does not translate directory names.

You will need to add in your own google translation api key by defining translateKey. Additionally, you will need to run npm install google-translate to the place that you copied translate.js so that you have the translation api dependency.

I made this function synchronous (for better or for worse) using promises to make sure it is all done before continuing on.

Free to use or modify however you want!

@amcolash
amcolash / scrape.js
Last active December 8, 2023 19:27
A tapermonkey script to scrape linkedin job listings
// ==UserScript==
// @name LinkedIn Scraper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Andrew McOlash
// @match https://www.linkedin.com/jobs/search/*
// @grant none
// ==/UserScript==
@amcolash
amcolash / ATTiny + Micronucleus
Last active April 23, 2024 21:28
ATTiny85 + micronucleus using an AVR programmer
This gist is a list of instructions that I used to program my ATTiny85s with Micronucleus. They worked for me, but your mileage may vary! I would highly recommend starting by looking at the SparkFun article linked at the bottom for schematics and more in-depth info. This gist is mostly just a copy/paste list.
## Required:
- ATTiny85
- AVR programmer
- 1 uF capacitor
- Micronucleus FW: https://github.com/micronucleus/micronucleus/releases
- avrdude: http://www.nongnu.org/avrdude/
## Setup:
@amcolash
amcolash / flowkey.js
Last active August 7, 2023 14:50
UPDATE, see here: https://github.com/amcolash/flowkey-scraper - Noteflight auto transcribe
// Find the sheet music images on the page
const elements = document.getElementsByClassName('split-image');
// Check that there are actually images on the page
if (elements.length === 0) {
console.error('No images found');
} else {
// If images were found, extract the base url from the 1st one
const imageUrl = elements[0].src;
const imageIdMatch = /\/sheets\/([\w\d]+)\//;
@amcolash
amcolash / Tuxedo InfinityBook.md
Last active March 21, 2023 13:20
Notes on how I set up my Tuxedo Infinity Book S 14 v5

Setting Up Tuxedo InfinityBook S 14 v5

Add Tuxedo Repo + Install Tuxedo Drivers/Utils

All of the Tuxedo stuff seems to be optional and this laptop has fantasic support out of the box w/ Xubuntu.

To add the repos, make a source list for the tuxedo repos sudo vim /etc/apt/sources.list.d/tuxedo-computers.list

Add the following (for now, until updated)

@amcolash
amcolash / extend_tiles.sh
Last active June 11, 2020 07:20
Tile extension script (add padding to a tileset/spritesheet)
#!/bin/bash
# Add padding to a tileset. This script assumes that the input file is a png
# Usage: extend_tiles.sh [image_file.png] [width] [height] [new_width] [new_height] [columns]
# 1 2 3 4 5 6
if [ "$#" -ne 6 ]; then
echo Usage: extend_tiles.sh [image_file.png] [width] [height] [new_width] [new_height] [columns]
exit 1
fi
@amcolash
amcolash / index.js
Last active July 25, 2020 19:16
Merge IP blocklists
/* Simple node script to merge 2 IP blocklists into a single one for use with Synology */
const fs = require('fs');
const path = require('path');
function makeSet(file) {
const split = file.split(/\r?\n/);
const set = new Set();
split.forEach(ip => set.add(ip));