Skip to content

Instantly share code, notes, and snippets.

View peteonrails's full-sized avatar

Peter Jackson peteonrails

View GitHub Profile
@peteonrails
peteonrails / database_truncator.rb
Created January 24, 2019 15:16
Database Truncation
# frozen-string-literal: true
class DatabaseTruncator
def self.truncate
skipped = 'schema_migrations'
ActiveRecord::Base.establish_connection
ActiveRecord::Base.connection.tables.each do |table|
puts "Truncating #{table}"
ActiveRecord::Base.connection.execute("TRUNCATE #{table} CASCADE") unless skipped.include?(table) # rubocop:disable Metrics/LineLength
@peteonrails
peteonrails / README.md
Created January 4, 2019 14:40 — forked from jondkinney/README.md
jondkinney's console vim setup

Console VIM and Tmux setup compatible with Mac OS X and Linux.

Installation

Install by running the following command in your terminal:

exec 3<&1;bash <&3 <(curl https://gist.githubusercontent.com/jondkinney/2040114/raw/vim.sh 2> /dev/null)
@peteonrails
peteonrails / Overview
Last active February 11, 2017 22:30
ASUS z270 Motherboard with Intel onboard controller Fix EEPROM Checksum for e1000 Linux Driver
The ASUS z270 motherboard ships with a bug in the firmware that prevents the Linux kernel driver (e1000)
from activating the hardware. The system will boot correctly, but will not activate your network interface
with this error in place.
In order to fix the issue, I followed these steps:
1. Download the latest Intel Linux drivers from https://downloadcenter.intel.com/product/19297/Intel-82573L-Gigabit-Ethernet-Controller
2. Transfer the drivers to the z270 machine with a thumbdrive
3. Patch the linux drivers to ignore the checksum error. See diff below.
4. make, make install the patched driver. Please note, this will taint your kernel We can fix that later.
@peteonrails
peteonrails / Copyright correction
Created April 8, 2016 08:43
HAMLIB IC-7300 Rig Driver (patches submitted to upstream)
@peteonrails
peteonrails / ic7300.rules
Created April 2, 2016 00:21
UDEV file for ICOM IC-7300
SUBSYSTEM!="tty",GOTO="hamlib_end"
# Bus 004 Device 026: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", TEST!="/dev/ic7300", SYMLINK+="ic7300", MODE="666"
LABEL="hamlib_end"
@peteonrails
peteonrails / lsusb | diff
Created April 2, 2016 00:14
Icom IC7300 USB device names
< Bus 004 Device 029: ID 08bb:2901 Texas Instruments PCM2901 Audio Codec
< Bus 004 Device 028: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
< Bus 004 Device 027: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
@peteonrails
peteonrails / lsusb.txt
Created February 17, 2016 14:15
Troubleshoot FT-991 USB interface
~] lsusb -v 9:14:04
Bus 004 Device 010: ID 0b05:179c ASUSTek Computer, Inc.
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 224 Wireless
bDeviceSubClass 1 Radio Frequency

Keybase proof

I hereby claim:

  • I am peteonrails on github.
  • I am peteonrails (https://keybase.io/peteonrails) on keybase.
  • I have a public key whose fingerprint is FE84 3C89 4168 5E39 32A7 AA20 09B9 F8AD 6B44 9A71

To claim this, I am signing this object:

[ ] Put signed contact in Dropbox [ ] Create Freshbooks invoice for first 2 weeks [ ] Create Freshbooks recurring invoice to start after week 3 (weekly) [ ] Create Campfire room [ ] Create Github Repo [ ] Create Trello Board (for Product Design Sprints or Rails MVPs, use Trello template) [ ] Create recurring calendar invites for weekly planning, retros, and daily standups [ ] Create project in Team [ ] Share Team project page with client [ ] Schedule thirty minute meeting with client to go over systems

# inspired by http://ariejan.net/2010/08/23/resque-how-to-requeue-failed-jobs
# retry all failed Resque jobs except the ones that have already been retried
# This is, for instance, useful if you have already retried some jobs via the web interface.
Resque::Failure.count.times do |i|
Resque::Failure.requeue(i) unless Resque::Failure.all(i, 1)['retried_at'].present?
end
# retry all :)
Resque::Failure.count.times do |i|