Skip to content

Instantly share code, notes, and snippets.

@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 / import.rb
Created January 8, 2012 16:41 — forked from juniorz/import.rb
Import a blogger archive to jekyll (octopress version)
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'uri'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
@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 / mds_ops.sh
Created December 27, 2011 08:15
Moving a Time Machine Disk
# disable indexing on the backup disk
sudo mdutil -i off /Volume/MyBackupDisk
# delete Spotlight's indexes
sudo rm -rf /Volume/MyBackupDisk/.Spotlight-V100
# re-enable indexing
sudo mdutil -i on /Volume/MyBackupDisk
@baldowl
baldowl / gist:796353
Created January 26, 2011 07:04
Interactive fog session: how to get a bunch of signed URLs for European buckets with fog 0.4.1
require 'active_support/time'
bucket = AWS.directories.select {|d| d.key == 'my_bucket'}
files = bucket.files.select {|f| f.content_length > 0 &&
f.key =~ %r{client-name.*\.zip}}
expiration = Time.now.next_month.end_of_month
signed_urls = files.map {|f| f.url(expiration)}
fixed_signed_url = signed_urls.map do |su|
su.sub(%r{s3\.(.*)/my_bucket}, "my_bucket.s3.#{$1}")
end
@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