Skip to content

Instantly share code, notes, and snippets.

View dankozlowski's full-sized avatar
🌲
Steady in the storm!

Dan Kozlowski dankozlowski

🌲
Steady in the storm!
  • Portland, OR
View GitHub Profile
-- Script that writes secrets to k/v engine in Vault
-- Indicate number of secrets to write to secret/read-test path with "-- <N>"
local counter = 1
local threads = {}
function setup(thread)
thread:set("id", counter)
table.insert(threads, thread)
counter = counter + 1

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
class WantToChatAnswerGetter
attr_accessor :answer
def initialize(answer)
@answer = get_answer(answer)
end
def get_answer(answer)
r = get_string_answer
process_string_answer(r)
"[{\"id\":1,\"user_id\":null,\"twilio_sid\":\"PNb05fa743d9263b5e3fd531302badc1df\",\"number\":\"+12069294753\",\"country_code\":\"US\",\"region\":\"WA\",\"sms_enabled\":true,\"mms_enabled\":true,\"verified\":null,\"voice_enabled\":true,\"created_at\":\"2017-06-30T14:31:02.000Z\",\"updated_at\":\"2018-09-25T19:56:21.000Z\",\"last_used_at\":\"2018-09-25T19:56:21.000Z\",\"ghost_call_leased_at\":null,\"ghost_call_phone_for_call_id\":null},{\"id\":2,\"user_id\":null,\"twilio_sid\":\"PN8d754c96675614d0ae09133957faffe0\",\"number\":\"+5117097786\",\"country_code\":\"PE\",\"region\":null,\"sms_enabled\":false,\"mms_enabled\":false,\"verified\":null,\"voice_enabled\":true,\"created_at\":\"2017-06-30T16:23:46.000Z\",\"updated_at\":\"2018-08-01T21:06:55.000Z\",\"last_used_at\":\"2018-08-01T21:06:55.000Z\",\"ghost_call_leased_at\":null,\"ghost_call_phone_for_call_id\":null},{\"id\":3,\"user_id\":null,\"twilio_sid\":\"PN119eb5ecfa48e530ba5d0ce90f52727a\",\"number\":\"+5713571102\",\"country_code\":\"CO\",\"region\":\"Bogo
@dankozlowski
dankozlowski / ssl_puma.sh
Created July 3, 2017 23:26 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key

Keybase proof

I hereby claim:

  • I am dankozlowski on github.
  • I am dankozlowski (https://keybase.io/dankozlowski) on keybase.
  • I have a public key whose fingerprint is 0578 A140 77AA 5128 8BCC C6A8 8288 2058 9FD2 4C2D

To claim this, I am signing this object:

@dankozlowski
dankozlowski / install_ruby_rpi.sh
Created October 24, 2015 01:00 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby 2.2 on the Raspberry Pi (Raspbian).
#!/bin/bash
# -----------------------------------------------------------------------
# Installs Ruby 2.2 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s raw_script_url_here)
# -----------------------------------------------------------------------
# Set up variables
# Defines a new sequence
FactoryGirl.define do
sequence :email do |n|
"person#{n}@example.com"
end
end
generate :email
# => "[email protected]"
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
// Javascript that submits data:
function pushResults() {
$.ajax({
type : "POST",
url : "/mindfulness_tutor",
beforeSend: function(jqXHR, settings) {
jqXHR.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'));
},
dataType: "text/plain",
data : "stats=" + serialize(resultsArray) + "&total=" + totalMeditationTime,