Skip to content

Instantly share code, notes, and snippets.

Christopher Sexton csexton

Block or report user

Report or block csexton

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
@csexton
csexton / openssl.cnf
Created Nov 7, 2016
Multi-Domain CSR Config for OpenSSL with Wildcards
View openssl.cnf
#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
# This definition stops the following lines choking if HOME isn't
# defined.
HOME = .
RANDFILE = $ENV::HOME/.rnd
@csexton
csexton / post-sqs.rb
Created Jul 16, 2013
Simple ruby script to post to SQS
View post-sqs.rb
#!/usr/bin/env ruby
# This require the 'aws-sdk' gem to be installed
require 'aws/sqs'
require 'json'
ENV['AWS_ACCESS_KEY_ID']="XXX"
ENV['AWS_SECRET_ACCESS_KEY']="XXX"
ENV['AWS_SQS_QUEUE']="https://sqs.us-east-1.amazonaws.com/XXX/queue-name"
body = { "string" => "data", "array" => [1,2,3] }
View heroku.log
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.5.3
-----> Installing dependencies using bundler 2.0.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Using rake 12.3.3
Using concurrent-ruby 1.1.5
Using i18n 1.6.0
Using minitest 5.11.3
Using thread_safe 0.3.6
@csexton
csexton / mov2gif.rb
Created Jul 3, 2019
Simple script to convert a mov file to an animated gif. Requires ffmpeg.
View mov2gif.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'optparse'
options = {
rate: 30,
log: 0,
}
@csexton
csexton / ip_address.rb
Created Apr 18, 2012
Store the IP Addresses as integers in MongoDB
View ip_address.rb
module MongoidTypes
#
# Store the IP Addresses as integers in MongoDB.
#
# The documents would look something like this in mongo
#
# { "_id" : ObjectId("4f8e2ea261455b704d000001"), "ip_address" : NumberLong("3232235777") }
#
# To have your model use this class simply set the type for the feild in mongoid
#
@csexton
csexton / neopixel.cc
Created Jun 27, 2019
Simple Neopixel with serial command control
View neopixel.cc
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// Released under the GPLv3 license to match the rest of the
// Adafruit NeoPixel library
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pin on the Arduino is connected to the NeoPixels?
@csexton
csexton / main.go
Created Jun 27, 2019
Get the USB Serial Number from C in Go with IOKit
View main.go
package main
// #cgo LDFLAGS: -framework CoreFoundation -framework IOKit
// #include <CoreFoundation/CoreFoundation.h>
// #include <IOKit/IOKitLib.h>
// #include <IOKit/serial/IOSerialKeys.h>
// #include <IOKit/usb/IOUSBLib.h>
//
// const char *
// getSerialNumber()
@csexton
csexton / local-rails.diff
Created Jun 2, 2019
Terrastories local dev mode
View local-rails.diff
diff --git a/rails/Gemfile b/rails/Gemfile
index 0262b60..61d5bd8 100644
--- a/rails/Gemfile
+++ b/rails/Gemfile
@@ -6,6 +6,7 @@ ruby '2.5.1'
gem 'rails', '~> 5.2.0'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4', '< 0.6.0'
+gem 'sqlite3'
# Use Puma as the app server
@csexton
csexton / gist:3772971
Created Sep 23, 2012
/etc/init.d/znc startup script
View gist:3772971
#! /bin/sh
### BEGIN INIT INFO
# Provides: znc
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: znc initscript
# Description: This is the init-Script for znc.
### END INIT INFO
# Author: Henner M. Kruse
@csexton
csexton / ice.md
Created Apr 29, 2019
Icebreaker Questions
View ice.md

Icebreaker Questions

  • Is it okay for your job to be really boring if it pays well?
  • Describe yourself in one word (then say “does t follow directions)
  • Are you a different person by the end of each day?
  • If a waiter leaves an item off the bill and you say nothing, is that stealing?
  • Could you ever learn too much?
  • Would you be happy if you had all you wanted?
  • If you have to talk to someone for 2 hours, what topic would you pick?
  • Can you fall asleep fast?
You can’t perform that action at this time.