Skip to content

Instantly share code, notes, and snippets.

View andrew-smith's full-sized avatar

Andrew Smith andrew-smith

View GitHub Profile
@andrew-smith
andrew-smith / disable-brltty.sh
Created December 7, 2022 23:04
Disables brltty which tries to overtake the serial ports
systemctl stop brltty-udev.service
sudo systemctl mask brltty-udev.service
systemctl stop brltty.service
systemctl disable brltty.service
# unplug and plug back in your device after this
@andrew-smith
andrew-smith / reset-displaylink-ubuntu.sh
Created April 5, 2021 23:31
Displaylink Ubuntu 20 Troubleshooting
@andrew-smith
andrew-smith / sls-runtime-memory.sh
Created November 28, 2019 22:51
Commands to extract billed duration and memory used from serverless log reporting
npx sls logs -f functionname --startTime 60m | awk '/REPORT/ {print $9","$18}'

Keybase proof

I hereby claim:

  • I am andrew-smith on github.
  • I am andrew_smith (https://keybase.io/andrew_smith) on keybase.
  • I have a public key whose fingerprint is 9487 27D6 C4EB 61A7 4703 6AAA 741A 8BDD 006D E4FF

To claim this, I am signing this object:

@andrew-smith
andrew-smith / connect_to_wifi.lua
Last active February 21, 2016 00:06
nodemcu script to connect to wifi
function connect_to_wifi(ssid, password, callback)
wifi.setmode(wifi.STATION)
wifi.sta.config(ssid, password)
wifi.sta.connect()
secondsWaited = 0
secondsToWait = 15
-- WIFI CONNECT HAS ALARM ID 0
@andrew-smith
andrew-smith / DetectFire.cpp
Created October 9, 2012 01:30
Fire detection algorithm
#include "stdafx.h"
/*
// configs
//image to load (will not load if USING_VIDEO = true)
#define IMAGE_NAME "fire2.jpg"
//video to load
#define VIDEO_NAME "flamethrower.mp4"
@andrew-smith
andrew-smith / pyro.css
Created June 27, 2012 15:07
r/tf2 pyro theme css
body {
background-image:url(%%pyro%%);
background-repeat:no-repeat;
background-attachment:fixed;
background-position: right bottom;
background-color: #E5964B;
}
#header-bottom-left { background-color: #E5964B; }
@andrew-smith
andrew-smith / gist:1680557
Created January 26, 2012 02:24
Brute-forcing Euler problem 12
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.logging.Level;
import java.util.logging.Logger;