Skip to content

Instantly share code, notes, and snippets.

View chesterbr's full-sized avatar
👾

Carlos Duarte Do Nascimento (Chester) chesterbr

👾
View GitHub Profile
@chesterbr
chesterbr / 6507_clock_and_monitor.c
Last active September 9, 2017 16:16
10Hz clock pulse generator / 13-bit monitor (for 6507 CPU)
// Turns an Arduino into a 10Hz clock generator and a monitor for a 13-bit address bus
//
// Based on David Barton's clock generator/monitor in http://www.plingboot.com/2015/10/homebrew-6502-part-2/
// (MIT License; full license information on footer)
// Pulse pin 13
#define CLOCK 13
// Read pins 0-12 as a 13 bit value from 6507's address bus
#define ADDRA 0
#define ADDRB 1
@chesterbr
chesterbr / tomato-WNDR3700v3.txt
Last active March 19, 2017 01:14
Boot messages from Tomato firmware on my (bricked?) Netgear WNDR3700v3 router
Decompressing..........done
Decompressing..........done
CFE for WNDR3700v3 version: v1.0.6
Build Date: Wed May 18 17:25:10 CST 2011
Init Arena
Init Devs.
Boot partition size = 262144(0x40000)
Found an ST compatible serial flash with 128 64KB blocks; total size 8MB
@chesterbr
chesterbr / original-WNDR3700v3.txt
Created March 19, 2017 01:14
Boot messages from the original firmware on my Netgear WNDR3700v3 router
Decompressing..........done
Decompressing..........done
CFE for WNDR3700v3 version: v1.0.6
Build Date: Wed May 18 17:25:10 CST 2011
Init Arena
Init Devs.
Boot partition size = 262144(0x40000)
Found an ST compatible serial flash with 128 64KB blocks; total size 8MB
@chesterbr
chesterbr / ezbasic.rb
Created September 12, 2016 12:37
[WIP] running ezbasic with Ruby2600's 6507 CPU emulator
#!/usr/bin/env ruby
require 'ruby2600'
rom_file = "/Users/chester/Downloads/ehbasic.bin"
rom_addr = 0xC000
# Initialize a CPU with 64K of memory
cpu = Ruby2600::CPU.new
memory = Array.new(64*1024) { 0 }
cpu.memory = memory
@chesterbr
chesterbr / some_class_spec.rb
Created October 3, 2013 15:59
Get the described instance method name(as long as it follows the `describe '#method_name'` convention) in RSpec from within a shared spec, so it can call the method regardless of what it is. Useful when different methods share the same behavior (as an alternative to a block or paramter with the method name)
describe SomeClass do
shared_examples_for 'a nice method' do
let(:method) { example.metadata[:example_group][:example_group][:description].gsub /\#/,'' }
it 'should do nice things' do
...
# This will call subject.foo_method or subject.bar_method, according to context
subject.send(method)
...
end
@chesterbr
chesterbr / lolcommitify.rb
Created February 28, 2013 20:29
Quick, hack-y script to add lolcommits hooks to all repos in a dir.
#!/usr/bin/env ruby
#
# lolcommitify.rb - adds the post-commit hook of https://github.com/mroth/lolcommits
# to every single git repository on a directory, recursively
#
# Copyright 2013 Chester (cd@pobox.com), BSD-style copyright and disclaimer apply
# (http://opensource.org/licenses/bsd-license.php)
require 'fileutils'
@chesterbr
chesterbr / vacuum_firefox_mac.sh
Created May 8, 2012 15:55
Script that cleans up Firefox data files on Mac OS X, useful for "old" installs that get slower with time. I used Automator.app to make it run when I login, so whenever I reboot the computer I get a fresh, snappier Firefox!
#!/bin/bash
# Closes any running Firefox (you'd better close it manually,
# but this is a safeguard)
killall firefox
# Defragments all databases. A few will result in "Error: file
# is encrypted or is not a database". It's fine, they will be
# skipped and no harm will be done.
for f in ~/Library/Application\ Support/Firefox/Profiles/*/*.sqlite; do sqlite3 "$f" 'VACUUM;'; done
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAmB0lJnHS43/9rBCdT3gBNtq7h7cw9ie26b7CNK9C7qiyo9z2gwGPnYRD+/cPZ72eHX9e8fWxDJ6CS0QxXIga0WUwJLDlDYGEZDXU6pc0KPEilZ8SIXUhD2FVwZilB62fw9eEOY3vGLtP/NckKcqIuWXauX48aVyf8Dkyriwl18wYAUYqf1dFfILplLx+GJXCsc5DRsNkSLj7jNMBD2Z64TtHw3uqV84XV58+vNc5UPTzHlateMOmcZTNg4AmM/DyBMTcj3PhoVebjBcEtGtWYgId4Q1vy6sq3QOwoOMKq95TAszRUqckqQ99R2dGEfWy2rXjW6zYCNZa8aoKk+IPow== cd@pobox.com
@chesterbr
chesterbr / gist:10067766
Created April 7, 2014 22:17
keybase.md
### Keybase proof
I hereby claim:
* I am chesterbr on github.
* I am chesterbr (https://keybase.io/chesterbr) on keybase.
* I have a public key whose fingerprint is B26F 1A11 370A CB21 35B5 6469 1B8A C8B8 3B04 9C92
To claim this, I am signing this object: