Skip to content

Instantly share code, notes, and snippets.

View jasonehines's full-sized avatar

Jason Hines jasonehines

View GitHub Profile
@gustavolaureano
gustavolaureano / main.py
Created August 4, 2023 20:15
MicroPython code for the raspberry pico to count how many WS2812 are connected, the data signal of the LEDs must be connected to GP2 and the ADC (GP26) must be connected to the strip ground after a jump wire (I used a cheap 20cm jumper cable), using the jumper as a shunt
import machine, neopixel, time
from machine import Pin, ADC
np = neopixel.NeoPixel(Pin(2), 200)
adcpin = machine.ADC(26)
while True:
num_of_leds = None
for i in range(len(np)):
onvalue = 0
@exemplum100
exemplum100 / outl.py
Last active April 5, 2024 16:53
Py+Outlook
import os
import win32com.client as win32
olApp = win32.Dispatch('Outlook.Application')
olNS = olApp.GetNameSpace('MAPI') # NameSpaces need for attchm
mailItem = olApp.CreateItem(0)
mailItem.Subject = 'Dummy Email2'
mailItem.BodyFormat = 1
mailItem.Body = "Hello World"
@hexagon5un
hexagon5un / randomImage
Created November 18, 2022 17:00
Random number from webcam and hash
#! /bin/env bash
number_contestants=$1
# convert to hexadecimal
number_contestants=$(echo "ibase=10 ; obase=16 ; $number_contestants" | bc)
# take image
ffmpeg -f v4l2 -i /dev/video0 -frames:v 1 -y foo.png
# md5sum it and extract the value
@ReturnRei
ReturnRei / Arch on Mac M1.txt
Last active July 29, 2023 20:58
Install Arch / EndeavourOS Mac M1 Parallels
This gist is provided as an addition to my youtube video
https://www.youtube.com/watch?v=dKvetujHjYQ&t=737s
## Useful links
https://wiki.archlinux.org/title/Install_Arch_Linux_from_existing_Linux#Using_a_chroot_environment
https://archlinuxarm.org/platforms/armv8/generic
https://www.reddit.com/r/archlinux/comments/6kwt61/systemd_doesnt_create_machineid_during/
https://arm.endeavouros.com/endeavouros-arm-install/
## Get into chroot
@247arjun
247arjun / privacy-policy.md
Last active June 2, 2022 17:34
Gist from Drafts

Privacy Policy

This app does not send the author/developer any data from your usage.

The app does not collect any information about your usage beyond what is provided by Apple.

@josephmancuso
josephmancuso / README.md
Last active April 21, 2020 06:28
Deploy a Masonite application through a GitHub action

Instructions

This is a gist containing several files needed to get Masonite automatically deploying to your servers via GitHub pushes (or releases)

NOTE: This script will have a downtime of a few seconds between deployments. If your application requires no downtime you can see this GIST here for a bit more complex GIST for getting to zero downtime deployments through the use of uWSGI, unix sockets and managed config files

Requirements

  • NGINX installed (may or may not be fully configured)
  • Python 3 installed and everything needed to run a Masonite application (see Masonite documentation for requirements)
@pamolloy
pamolloy / README.md
Last active April 6, 2024 05:49
Mesh network using VXLAN over Wireguard
@pamolloy
pamolloy / README.md
Last active January 23, 2024 07:28
Ubiquiti USG configuration for Wireguard

Download the latest ugw3 package from https://github.com/Lochnair/vyatta-wireguard/releases and install it on your USG using dpkg -i wireguard-ugw3-<version>.deb.

cd /config/auth
umask 077
mkdir wireguard
cd wireguard
wg genkey > wg_private.key
wg pubkey < wg_private.key > wg_public.key
@OttoWinter
OttoWinter / 0migrator.md
Last active May 19, 2019 04:21
Lovelace Migration Script

Home Assistant Lovelace Migrator

Do you want to try out this experimental (!) new lovelace UI stuff in Home Assistant but don't want to migrate your entire configuration? This script is here to help! It reads in your Home Assistant configuration (specifically the group: section) and creates a matching ui-lovelace.yaml file in your Home Assistant configuration folder (of course backing up any previous file at that path).

To use this script, you first need to have python and home assistant installed where you plan to run this script. Do so using virtual environments and the pip3 install -U homeassistant command. Then copy below file to lovelace_migrate.py (any location should work) and run:

python3 lovelace_migrate.py -c <PATH_TO_HASS_CONFIG_DIR>
@Jachimo
Jachimo / README.md
Created June 2, 2018 02:29
Using ZeroTier to route between two UniFi USG LANs

Routing between two UniFi USG based LANs with ZeroTier

Intro

This is a quick explanation of how to configure both ZeroTier and two Ubiquiti UniFi USGs to allow routing between two IPv4 networks. Both networks are in private (RFC1918) address space and each one has its own DHCP service. There is no need for NAT between them, only IP routing.

The two networks are 192.168.1.0/24 (call this the "left" network) and 192.168.10.0/24 (the "right" network) but they can be anything. Also, you can have multiple CIDR blocks on one side or the other of the ZeroTier route; if you do, you just have to create more routing table entries.