Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@idcrook
idcrook / tiny_i2c_lcd_rotary_encoder.ino
Last active January 25, 2024 17:43
ATtiny85 and i2c LCD backpack plus rotary encoder
/*
Demonstration sketch for Adafruit LCD backpack
using MCP23008 I2C expander
Uses the ATTiny 85 (replaces Trinket below)
Also hooked up a rotary encoder with a button.
The circuit:
* 5V to Arduino 5V pin
* GND to Arduino GND pin
* Display i2c backpack CLK to Trinket GPIO #2 (Arduino pin 2/attiny85 pin 7)
@guettli
guettli / ssh-tunnel@.service
Created December 22, 2017 11:40
Reliable persistent SSH-Tunnel via systemd (not autossh)
# Reliable persistent SSH-Tunnel via systemd (not autossh)
# https://gist.github.com/guettli/31242c61f00e365bbf5ed08d09cdc006#file-ssh-tunnel-service
[Unit]
Description=Tunnel for %i
After=network.target
[Service]
User=tunnel
ExecStart=/usr/bin/ssh -o "ExitOnForwardFailure yes" -o "ServerAliveInterval 60" -N tunnel@%i
@bigjosh
bigjosh / TimerShotTimer1A.ino
Last active April 13, 2018 22:13
Code to generate a one-shot pulse on AVR Timer1A by Nevell Greenough, N2GX. More info about this program is here... http://wp.josh.com/2015/03/05/the-perfect-pulse-some-tricks-for-generating-precise-one-shots-on-avr8/
// **************** TimerShot for Timer 1A *********************
// More info about this program is here...
// http://wp.josh.com/2015/03/05/the-perfect-pulse-some-tricks-for-generating-precise-one-shots-on-avr8/
// Demo of a technique to generate various precise one shot pulses using
// timer 1 module on an AVR. This demo code version is writen for an Arduino Uno or Mega2560 for the
// the Timer1 moudule, but this technique should would on other 16-bit AVR timers on Mega2560.
// Original code by Josh Levine, hack by N2GX 8/30/2016.
// Long-pulse working solution for TIMER 1A One-Shot, edited from Josh's Timer2 code and a partial Timer3 solution
@xvitaly
xvitaly / remove_crw.cmd
Last active March 16, 2024 16:12
Remove telemetry updates for Windows 7 and 8.1
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)
@dranger003
dranger003 / ATtiny85_PWM
Last active January 12, 2017 14:11
ATtiny85 Hardware PWM, pins 0, 1 & 4
// ATtiny85
// Hardware PWM, pins 0, 1 & 4
int main()
{
sei();
DDRB = _BV(PORTB0); // OC0A
DDRB |= _BV(PORTB1); // OC0B
DDRB |= _BV(PORTB4); // OC1B