Skip to content

Instantly share code, notes, and snippets.

@electrickite
electrickite / http.ps1
Last active December 19, 2023 20:18
PowerShell Simple HTTP Server
# Simple HTTP Server
# Serves files in current working directory
#
# Use: http.ps1 [-port PORT] [-index INDEX]
#
# Requires PowerShell 6.0+ and .NET 4.5+
# Note: May need to set execution policy:
# Set-ExecutionPolicy -Scope CurrentUser unrestricted
param (
@electrickite
electrickite / glib.supp
Created November 19, 2018 02:54
Supression files for libnotify
{
GLib:Leak1
Memcheck:Leak
match-leak-kinds: possible
fun:calloc
fun:g_malloc0
obj:/usr/lib/libgobject-2.0.so.0.5800.1
fun:g_type_register_fundamental
obj:/usr/lib/libgobject-2.0.so.0.5800.1
fun:call_init.part.0
@electrickite
electrickite / release-check.sh
Last active November 13, 2022 02:00
Shell script to check for new Github releases
#!/bin/bash
# Send email notification of new Github project releases
usage () {
cat <<EOF
Usage: release-check.sh [OPTION]... PROJECT...
Check for new releases on Github PROJECTs
Options:
-h Print this help text
@electrickite
electrickite / CAN_BUS.ino
Last active July 30, 2017 03:52
Arduino sketch to log CAN-BUS messages
// Arduino sketch to log CAN-BUS messages
// Writes messages via serial in a CSV-like format for later analysis
//
// Requires a SeeedStudio CAN-BUS Shield and library
// https://www.seeedstudio.com/CAN-BUS-Shield-V1.2-p-2256.html
// https://github.com/Seeed-Studio/CAN_BUS_Shield
#include <SPI.h>
#include <mcp_can.h>
@electrickite
electrickite / serialwriter.py
Created July 30, 2017 03:29
Write lines from a serial device to stdout
#!/usr/bin/env python
# Writes lines from a serial device to stdout. Use Ctrl+C to exit.
# Requires pySerial
#
# Usage:
# python serialwriter.py DEVICE [BAUD_RATE]
#
# Example:
# $ python serialwriter.py /dev/serial.device 115200
#!/bin/bash
# Roll a few dice!
# Installation: Make this script executable and place in your PATH, ex:
# $ chmod a+x roll && mv roll ~/bin
function usage() {
cat <<EOF
Usage: roll [<number>]d<sides>[+|-][<modifier>]
Ex: roll d20
roll 2d8+3
sudo apt-get -y purge avahi-daemon bluez-firmware cifs-utils debconf-utils gdbserver ncdu samba-common v4l-utils zlib1g-dev
sudo apt-get -y install aptitude-doc-en bc dnsutils ftp gettext-base gnupg-agent gnupg2 lsof mlocate telnet texinfo time w3m wamerican whois
sudo apt-get -y autoremove
sudo apt-get autoclean
#!/bin/bash
: ${USERNAME:=$USER}
for hostname in ${@:-$(</dev/stdin)}
do
ssh-copy-id $USERNAME@$hostname
done
@electrickite
electrickite / deploy.rb
Created January 25, 2016 21:58
AWS Opsworks deploy recipes for PHP Composer-based projects
node[:deploy].each do |application, deploy|
script "install_composer" do
interpreter "bash"
user deploy[:user]
group deploy[:group]
cwd "#{deploy[:deploy_to]}/current"
code <<-EOH
composer install
EOH
end
@electrickite
electrickite / keybase.md
Created January 2, 2015 06:32
keybase.md

Keybase proof

I hereby claim:

  • I am electrickite on github.
  • I am electrickite (https://keybase.io/electrickite) on keybase.
  • I have a public key whose fingerprint is DB2C 22C4 B407 E6A9 69B1 8D3F C59A 4A21 EBC2 B02F

To claim this, I am signing this object: