Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@csexton
csexton / openssl.cnf
Created November 7, 2016 16:10
Multi-Domain CSR Config for OpenSSL with Wildcards
#
# 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 / main.go
Created June 27, 2019 19:48
Get the USB Serial Number from C in Go with IOKit
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 / app.js
Created June 21, 2021 16:29
Vue and Bootstrap Starter Template with CDN
window.addEventListener('DOMContentLoaded', (event) => {
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
});
@csexton
csexton / neopixel.c
Created April 2, 2021 18:02
NeoPixel light sequences with a serial USB interface
// Based on the NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// Released under the GPLv3 license to match the rest of the
// Adafruit NeoPixel library
// Simple interface to run light sequences based on a single character
// code over serial over usb. Makes the interface on linux look something
// like this:
//
// echo -n 'a' > /dev/cu.usbmodem123
//
@csexton
csexton / mute-meet.scpt
Created January 8, 2021 18:56
Apple Script to toggle mute on Google Meet
tell application "Finder" to activate
tell application "Google Chrome"
activate
set i to 0
repeat with w in (windows) -- loop over each window
set j to 1 -- tabs are not zeroeth
repeat with t in (tabs of w) -- loop over each tab
if title of t starts with "Meet " then
set (active tab index of w) to j -- set Meet tab to active
set index of w to 1 -- set window with Meet tab to active
@csexton
csexton / AWS4SigningKey.h
Created February 20, 2016 04:24
AWS Version 4 Signing Key in Objective C
#import <Foundation/Foundation.h>
@interface AWS4SigningKey: NSObject
+ (NSString *)getSignatureKey:(NSString *)key
dateStamp:(NSString *)dateStamp
regionName:(NSString *)regionName
serviceName:(NSString *)serviceName;
@end
@csexton
csexton / znc.conf
Created September 23, 2012 21:55
Example ZNC Config
// WARNING
//
// Do NOT edit this file while ZNC is running!
// Use webadmin or *admin instead.
//
// Buf if you feel risky, you might want to read help on /znc saveconfig and /znc rehash.
// Also check http://en.znc.in/wiki/Configuration
AnonIPLimit = 10
MaxBufferSize= 500
# frozen_string_literal: true
module Encryptable
ENCRYPTABLE_SALT = "iris.encryptable_salt"
def encrypt(string)
crypt.encrypt_and_sign(string)
end
def decrypt(encrypted_data)
@csexton
csexton / post-sqs.rb
Created July 16, 2013 18:59
Simple ruby script to post to SQS
#!/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] }
-----> 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