Skip to content

Instantly share code, notes, and snippets.

@baldowl
baldowl / gist:1772132
Created February 8, 2012 18:50
Deleting EBS Snapshots with aws-sdk
require 'rubygems'
require 'active_support/time'
require 'aws-sdk'
threshold = 2.months.ago
ec2 = AWS::EC2.new
ec2.shapshots.with_owner(:self).
select {|s| s.volume_id == 'vol-12345678' && s.start_time < threshold}.
each {|s| puts "Bye-bye #{s.description}"; s.delete}
@baldowl
baldowl / gist:2900406
Created June 9, 2012 10:04
My First Standalone ATmega328p
# Clone of "Arduino UNO", without bootloader
unowithoutbl.name=Arduino Uno (w/o bootloader)
unowithoutbl.upload.maximum_size=32768
unowithoutbl.bootloader.low_fuses=0xff
unowithoutbl.bootloader.high_fuses=0xdf
unowithoutbl.bootloader.extended_fuses=0x05
unowithoutbl.bootloader.unlock_bits=0x3F
unowithoutbl.bootloader.lock_bits=0x0F
unowithoutbl.build.mcu=atmega328p
unowithoutbl.build.f_cpu=16000000L
@baldowl
baldowl / Content of an ATmega1284P
Created October 27, 2012 15:45
Bigger AVR MCU: ATmega1284P
Atmega chip detector.
Entered programming mode OK.
Signature = 1E 97 05
Processor = ATmega1284P
Flash memory size = 131072
LFuse = 62
HFuse = 99
EFuse = FF
Lock byte = FF
Clock calibration = 81
@baldowl
baldowl / gist:6542730
Last active December 22, 2015 22:49
Recompiling Optiboot
# Standard
make atmega1284p
# Who needs flashing LEDs?
make atmega1284p LED_START_FLASHES=0
# Let's use RX1/TX1
make atmega1284p UART=1
@baldowl
baldowl / octokit-basic-auth-with-otp.rb
Last active March 6, 2017 15:54
Adjusting To GitHub's 2FA
security add-generic-password \
-a my-github-login \
-s github \
-D "GitHub's OAuth2 Token" \
-T "" \
-w the-long-oauth-token
@baldowl
baldowl / RGB_LED.yaml
Created December 26, 2023 13:32
Playing with ESP32-C6 and ESPHome
light:
- platform: esp32_rmt_led_strip
name: Status LED
pin: GPIO8
rgb_order: RGB
num_leds: 1
rmt_channel: 0
chipset: ws2812
entity_category: config