Skip to content

Instantly share code, notes, and snippets.

View kennethkalmer's full-sized avatar

Kenneth Kalmer kennethkalmer

View GitHub Profile
@kennethkalmer
kennethkalmer / nginx.conf
Last active August 3, 2021 19:44
Sample nginx config for serving a rails API and static frontend like Ember on the same domain...
daemon off;
worker_processes 4;
events {
use epoll;
accept_mutex on;
multi_accept on;
worker_connections 1024;
}
@kennethkalmer
kennethkalmer / _README.md
Last active August 29, 2015 14:02
Apply a PowerDNS on Rails macro to a bunch of domains on the command line

Bulk macros

Throw this script in the tmp directory of where your PowerDNS on Rails installation lives, make is executable and run like this:

$ ./tmp/apply-macro.rb 1 example.com example.org example.net

It will load the macro with ID 1, and apply it against each domain passed as CLI arguments.

@kennethkalmer
kennethkalmer / README.md
Last active August 29, 2015 14:02
School Online Bootstrap Guide/Kit

Kudos to @paulscott56 for the cool name. It all started on twitter.

School Online Bootstrap Guide/Kit

School websites suck, actually, schools suck at being online. But in reality, schools don't need much to be online. 99/100 times the minimum viable school site might just be single static page with contact information, links to FB and/or Twitter. Oh, and a "add my to the mailing list" feature, cause that would be better...

The sad thing is that currently we have three camps, maybe more:

  1. Schools getting exploited by unsavoury IT companies and paying big bucks for mediocre FOSS deployments with Corel Draw graphics.
  2. Schools teachers acting defensively against anyone who is better than them at operating Dreamweaver
@kennethkalmer
kennethkalmer / irb
Created June 5, 2014 08:24
Module magic with extend self, and extending others
irb(main):001:0> Bar.bar
=> :barred
irb(main):002:0> Bar.new.bar
=> :barred
irb(main):003:0> Foo.bar
=> :barred
@kennethkalmer
kennethkalmer / README.md
Last active April 1, 2020 19:41
Making sense of basic port forwarding with SSH tunnels

SSH tunnel example

We all know how to ssh to a remote box...

Basic SSH connection with ssh 99.88.77.66

                            99.88.77.66
 +-------+                            +--------+
 | LOCAL |----------------------------| REMOTE |
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<style type="text/css">
@kennethkalmer
kennethkalmer / gist:6602690
Last active December 23, 2015 07:39
[freenode.net #137462] AutoReply: Making amends with ChanServ
Greetings,
This message has been automatically generated in response to the
creation of a trouble ticket regarding:
"Making amends with ChanServ",
a summary of which appears below.
There is no need to reply to this message right now. Your ticket has been
assigned an ID of [freenode.net #137462].
@kennethkalmer
kennethkalmer / check-opml.rb
Created July 7, 2013 09:09
Cleaned up my feedly subs using this, no point of having feeds that clutter up the list, yet they 404 or 500
# Basic check of feeds urls in an OPML file
require 'nokogiri'
require 'faraday'
def say( text )
$stdout.write text
$stdout.flush
end
require 'prawn'
require 'benchmark'
LIPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam urna
augue, tempor a ornare tempor, blandit in sapien. Cras et purus sit amet eros
dictum euismod non sed risus. Duis sed commodo felis. Fusce scelerisque
gravida nunc, nec malesuada elit volutpat eu. Mauris rutrum posuere hendrerit.
Nulla laoreet semper tristique. Nullam aliquam dignissim auctor. Sed luctus
posuere ultricies. Proin felis lacus, feugiat eu aliquam vitae, fringilla
molestie quam."