Skip to content

Instantly share code, notes, and snippets.


Rob Cameron cannikin

Block or report user

Report or block cannikin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:de18c08eab69e03da44ae8faf7388e60
"ensure_newline_at_eof_on_save": true,
View Packages\User\RubyTest-Twilight.tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
View Gemfile
source ''
# Gems needed for edge rails
gem 'rails', github: "rails/rails"
gem 'sprockets-rails', github: "rails/sprockets-rails"
gem 'sprockets', github: "rails/sprockets"
gem 'sass-rails', github: "rails/sass-rails"
gem 'arel', github: "rails/arel"
gem 'rack', github: "rack/rack"
cannikin / deploy.rb
Last active Oct 22, 2018
Notify Sentry of a new release via Capistrano
View deploy.rb
# This task will notify Sentry via their API[1] that you have deployed
# a new release. It uses the release timestamp as the `version`
# (like 20151113182847) and the git ref as the optional `ref` value.
# This task requires several environment variables be set (or just
# hardcode the values in here if you like living on the edge):
# ENV['SENTRY_ORG'] : the organization for this app
# ENV['SENTRY_PROJECT'] : the project for this app
View logstasher.json
cannikin / remote_ip.rb
Created Nov 10, 2015
Rails code for raising ActionDispatch::RemoteIp::IpSpoofAttackError
View remote_ip.rb
# Determines originating IP address. REMOTE_ADDR is the standard
# but will be wrong if the user is behind a proxy. Proxies will set
# HTTP_CLIENT_IP and/or HTTP_X_FORWARDED_FOR, so we prioritize those.
# HTTP_X_FORWARDED_FOR may be a comma-delimited list in the case of
# multiple chained proxies. The last address which is not a known proxy
# will be the originating IP.
def calculate_ip
client_ip = @env['HTTP_CLIENT_IP']
forwarded_ips = ips_from('HTTP_X_FORWARDED_FOR')
remote_addrs = ips_from('REMOTE_ADDR')
cannikin / make_install.out
Last active Oct 3, 2015
Post portaudio instructions on the Pi
View make_install.out
Libraries have been installed in:
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
View gist:dfc7d07c241773160c3c
pi@picluster1 ~/superham $ ruby demod-raw.rb iq.dat
Reading file iq.dat...
Read 5100000 data points from file.
6:1 low pass filter...
Now 850000 samples.
FM demodulator...
Deemph filter...
Reducing low pass real filter...
Now 160000 samples.
Playing 160000 data points.
View rtl_fm options
rtl_fm, a simple narrow band FM demodulator for RTL2832 based DVB-T receivers
Use: rtl_fm -f freq [-options] [filename]
-f frequency_to_tune_to [Hz]
use multiple -f for scanning (requires squelch)
ranges supported, -f 118M:137M:25k
[-M modulation (default: fm)]
fm, wbfm, raw, am, usb, lsb
wbfm == -M fm -s 170k -o 4 -A fast -r 32k -l 0 -E deemp
raw mode outputs 2x16 bit IQ pairs
View 100000 samples = 441291000 Hz
pi@picluster1 ~ $ sudo rtl_fm -f 441M -M wbfm -s 100000 -r 48000 -l 80 - | aplay -r 48k -f S16_LE
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuned to 441291000 Hz.
Oversampling input by: 11x.
Oversampling output by: 1x.
You can’t perform that action at this time.