Skip to content

Instantly share code, notes, and snippets.

View rgbkrk's full-sized avatar
🌎
Think globally, act locally

Kyle Kelley rgbkrk

🌎
Think globally, act locally
View GitHub Profile
@abkfenris
abkfenris / Dockerfile
Created July 25, 2014 23:45
ipython with matplotlib dockerfile
FROM ipython/notebook
MAINTAINER Alex Kerney <[email protected]>
RUN apt-get install -y -q python-numpy python-scipy python-matplotlib python-pandas python-sympy python-nose
@jbarratt
jbarratt / nbgrep
Last active July 31, 2025 23:11
'nbgrep', search the code of all your ipython notebooks
#!/bin/bash
# usage: nbgrep 'pattern'
SEARCHPATH=~/work/
# 'jq' technique lifted with gratitude
# from https://gist.github.com/mlgill/5c55253a3bc84a96addf
# Break on newlines instead of any whitespace
@cpuguy83
cpuguy83 / logforwarder.go
Last active August 7, 2020 06:37
libswarm logger demo
package backends
import (
"fmt"
"io"
"strings"
"sync"
"time"
"github.com/docker/libswarm"
pug:~ jesse$ time nova boot METALS --flavor onmetal-memory1 --image 1387253c-7735-4542-9612-26bc9ff77a9d --key-name=mykey --poll
+------------------------+--------------------------------------------------------------------+
| Property | Value |
+------------------------+--------------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| accessIPv4 | |
| accessIPv6 | |
@kyledrake
kyledrake / ferengi-plan.txt
Last active July 23, 2025 20:52
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@sburns
sburns / ipynb.conf
Created April 23, 2014 18:41
ipython notebook supervisor recipe
[program:ipynb]
command=/gpfs22/home/burnsss1/env6/bin/ipython notebook --profile=external #change
numprocs=1
numprocs_start=0
autostart=true
autorestart=true
startsecs=1
startretries=3
exitcodes=0,2
stopsignal=QUIT
@smashwilson
smashwilson / ocr.rb
Created April 12, 2014 14:26
Read images from a webcam. OCR any text and write it to stdout.
require 'hornetseye_v4l2'
require 'hornetseye_xorg'
require 'hornetseye_rmagick'
require 'tesseract'
include Hornetseye
camera = V4L2Input.new
image = X11Display.show { camera.read }
image.to_ubytergb.save_ubytergb 'snapshot.png'
@smashwilson
smashwilson / bench.rb
Last active August 29, 2015 13:58
excon case-insensitive header access benchmarks
#!/bin/env ruby
#
# Benchmark any performance degredation associated with moving to case-
# insensitive HTTP header access.
require 'benchmark'
require './lib/excon'
resp = Excon::Response.new
resp.headers = {}
@carsongee
carsongee / openssl-fix.yml
Last active July 5, 2017 02:23
Heartbeat / Heartbleed SSL Ansible check and correct play for Ubuntu
---
# Patches openssl problem and restarts needed services
- name: Apply common configration to all nodes
hosts: all
sudo: yes
# Uncomment to apply update one server at a time
# serial: 1
tasks:
- name: "Install packages and update cache"
@edubkendo
edubkendo / atom_opal.md
Last active April 19, 2018 05:09
Writing Atom Plugins in Opal (Ruby)

I want to write plugins for Atom's editor in Ruby. Opal makes this possible. Atom is one of several projects in recent times to combine Chromium with Node.js for a desktop app. While it utilizes chromium for it's gui, and boasts "[e]very Atom window is essentially a locally-rendered web page", writing Atom plugins is more like writing a server-side node.js app than a typical single-page client-side app (albeit with really awesome integration with Chrome Devtools). Opal development, on the other hand, has to-date been focused primarily on the browser use-case.

Because of this, I had to make a choice between using the opal-node package from npm, using Opal via Ruby w/ a compile step, or packaging up opal-parser.js, including it with the app, and writing in compilation on the fly. Each choice came with compromises. Using opal-node would have been easiest, just create a top level index.coffee that required opal-node, and then require in your ruby