Skip to content

Instantly share code, notes, and snippets.

Andrew Scheller lurch

Block or report user

Report or block lurch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lurch
lurch / bmap_write.py
Created Mar 23, 2018
Super simple standalone script to parse a bmap file (works on Python2 or Python3)
View bmap_write.py
#!/usr/bin/python
# A super-simple standalone script (which makes various assumptions, and does no
# verification) to show how easily .bmap files can be parsed.
# It only supports uncompressed images, and if the image is named mydata.img it
# assumes the bmap is named mydata.bmap
# MIT License
#
# Copyright (c) 2018 Andrew Scheller
@lurch
lurch / Github Flavored Markdown.md
Last active Nov 16, 2019 — forked from paulprogrammer/Github Flavored Markdown.md
Github Flavored Markdown cheatsheet
View Github Flavored Markdown.md

Github Flavored Markdown (GFMD) is based on Markdown Syntax Guide with some overwriting as described at Github Flavored Markdown

Text Writing

It is easy to write in GFMD. Just write simply like text and use the below simple "tagging" to mark the text and you are good to go!

To specify a paragraph, leave 2 spaces at the end of the line

Headings

@lurch
lurch / architecture-detect.sh
Last active Dec 7, 2017
Handy scripts to automate part of the Etcher release process
View architecture-detect.sh
#!/bin/bash
###
# Copyright 2017 resin.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
View rpiboot.diff
diff --git a/main.c b/main.c
index e8e9b59..28475f0 100755
--- a/main.c
+++ b/main.c
@@ -5,6 +5,22 @@
#include <unistd.h>
+#include <sys/time.h>
+
@lurch
lurch / ensure-angular-dependencies-compatibility.sh
Created Mar 10, 2017
Bash script to check matching package versions
View ensure-angular-dependencies-compatibility.sh
#!/bin/bash
###
# Copyright 2017 resin.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@lurch
lurch / download_all_releases.py
Created Dec 8, 2016
Attempt to download all the Etcher releases, to verify that the S3 links are correct
View download_all_releases.py
#!/usr/bin/env python
from __future__ import print_function
import requests
import re
import os
github_project = 'resin-io/etcher'
releases_url = 'https://github.com/' + github_project + '/releases'
aws_url = 'https://resin-production-downloads.s3.amazonaws.com/etcher'
View monitor_gpio_args.py
#!/usr/bin/env python
import RPi.GPIO as GPIO
import sys
from signal import pause
def button_pressed(channel):
print("Button %d was pressed" % channel)
if len(sys.argv) < 2:
print("No port numbers were supplied!")
@lurch
lurch / pizero_usb_internet.sh
Last active May 29, 2019
Script to automatically provide internet access to a PiZero connected to a Linux host over a USB-network (only tested on Ubuntu 14.04)
View pizero_usb_internet.sh
#!/bin/bash
# Automatically setup routing and DNS for a PiZero connected over a USB-network
# NOTE: Before running this script for the first time, you need to run the
# following two commands on your Linux PC
# sudo sysctl -w net.ipv4.ip_forward=1
# sudo iptables -t nat -A POSTROUTING -s 169.254.0.0/16 -o eth0 -j MASQUERADE
# (replace eth0 in the second command with your internet-facing network device,
# e.g. wlan0 on a laptop)
# The Avahi-discovered hostname
@lurch
lurch / wam.py
Created Mar 7, 2016
Very simple whack-a-mole type game for the Pimoroni DrumHAT
View wam.py
#!/usr/bin/env python
import cap1xxx
import random
import time
"""
4 3 2
5 7 1
@lurch
lurch / display_decimals.py
Last active Feb 20, 2018
Sample code to display decimal numbers on a 4-digit 7-segment display
View display_decimals.py
# code modified, tweaked and tailored from code at
# http://raspi.tv/2015/how-to-drive-a-7-segment-display-directly-on-raspberry-pi-in-python
import RPi.GPIO as GPIO
import random
import time
NUMBER_OF_DIGITS = 4
def format_num(num):
digits_left = NUMBER_OF_DIGITS
You can’t perform that action at this time.