Skip to content

Instantly share code, notes, and snippets.

View rorymckinley's full-sized avatar

Rory McKinley rorymckinley

  • Cape Town, South Africa
View GitHub Profile
@rorymckinley
rorymckinley / sanitised.eml
Created May 27, 2021 15:35
Spam email with noisy headers
Delivered-To: xxxxxxxxxx@gmail.com
Received: by 2002:a4a:5e42:0:0:0:0:0 with SMTP id h63csp3374554oob;
Mon, 24 May 2021 17:16:48 -0700 (PDT)
X-Google-Smtp-Source: ABdhPJyKp6gW2dKktMurjH/o2ChRn/YlqMUonSvALTtmzHxltPJTOB/GP7mIUy35kyHEdW8mTAzB
X-Received: by 2002:a17:902:f291:b029:f0:ba5b:5c47 with SMTP id k17-20020a170902f291b02900f0ba5b5c47mr28313770plc.41.1621901808578;
Mon, 24 May 2021 17:16:48 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1621901808; cv=none;
d=google.com; s=arc-20160816;
b=veQUdmJt0/ISfl4k+veXFATeIk1AJUqPVB1k7aKy2kdA4tQtIVOAiG8bZCF0aAyycV
gYBPGZoE3wGqidTKO/bgGj/wPun/W1hUzozHa2e3MWmKLSlcob/IQZFK3JxTTmgSjfyJ
@rorymckinley
rorymckinley / sync.rb
Created December 5, 2020 11:46
Odd Behaviour of STDOUT .sync
#!/usr/bin/env ruby
STDOUT.sync = true if ARGV[0] == 'sync'
i = 0
while i < 5 do
i = i + 1
STDERR.puts "I ERR: #{i}"
STDOUT.puts "I OUT: #{i}"
end
@rorymckinley
rorymckinley / config.yml
Created November 18, 2019 17:37
Parsing yaml file and using an array as input to args() for command
---
marking:
command:
arguments:
- 8
@rorymckinley
rorymckinley / Cargo.lock
Created October 30, 2019 10:46
I broke it already (Rust)
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "fuchsia-cprng"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "guessing_game"
version = "0.1.0"
@rorymckinley
rorymckinley / backtrace.txt
Created June 19, 2018 13:42
backtrace when running script/docker_dev_setup.sh
<pre>working in 1 processes
--&gt; Starting: &apos;i18n:generate_js&apos;
ENOENT: no such file or directory, stat &apos;symlink_to_node_modules/.bin/nopt&apos;
Error extracting JS translations; confirm that `./gems/canvas_i18nliner/bin/i18nliner generate_js` works
rake aborted!
Parallel::DeadWorker: Parallel::DeadWorker
/home/docker/.gem/ruby/2.4.0/gems/parallel-1.12.1/lib/parallel.rb:74:in `rescue in work&apos;
/home/docker/.gem/ruby/2.4.0/gems/parallel-1.12.1/lib/parallel.rb:71:in `work&apos;
/home/docker/.gem/ruby/2.4.0/gems/parallel-1.12.1/lib/parallel.rb:382:in `block (4 levels) in work_in_processes&apos;
/home/docker/.gem/ruby/2.4.0/gems/parallel-1.12.1/lib/parallel.rb:495:in `with_instrumentation&apos;
@rorymckinley
rorymckinley / deadlock_stacktrace.txt
Created February 22, 2018 09:27
Deadlock Stacktrace
fatal: No live threads left. Deadlock?
/usr/local/bundle/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:509:in `checkin'
/usr/local/bundle/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:463:in `block (3 levels) in clear_reloadable_connections'
/usr/local/bundle/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:460:in `each'
/usr/local/bundle/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:460:in `block (2 levels) in clear_reloadable_connections'
/usr/local/bundle/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:459:in `block in clear_reloadable_connections'
/usr/local/bundle/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `block in with_exclusively_acquired_all_connections'
/usr/local/bundle/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abs
@rorymckinley
rorymckinley / le.txt
Created August 22, 2017 15:38
Trying to get certs installed in a nominated directory
# I would like to have the certs created in /etc/letsencrypt/live/xxx,
# but instead they are created in /etc/letsencrypt/live/www.test.domain
sudo letsencrypt certonly --manual --expand --preferred-challenges dns --cert-path /etc/letsencrypt/live/xxx --key-path /etc/letsencrypt/live/xxx --fullchain-path /etc/letsencrypt/live/xxx --chain-path /etc/letsencrypt/live/xxx -d www.test.domain -d test.domain
@rorymckinley
rorymckinley / asset_path_funny
Last active February 20, 2017 11:33
Assets for gem not appearing in 3.22.X asset path
gem: https://rubygems.org/gems/anjlab-bootstrap-rails/versions/3.0.0.3
GEMFILE BEFORE:
****************************************************************************************************************
source 'https://rubygems.org'
source "http://xxxxxxxxxxxxxxx" do
gem "htaccess", "~> 0.0.2"
gem "htpasswd", "~> 0.0.1"
end
@rorymckinley
rorymckinley / casperjs_test.js
Created January 25, 2016 12:56
The mocha-casperjs equivalent to Hello World
var expect = require("chai").expect
describe('Duck Duck Go', function() {
before(function() {
casper.start('http://www.duckduckgo.com/');
})
it('checks for the correct title', function() {
casper.then(function() {
expect(this.getTitle()).to.equal("DuckDuckGo");
expect(this.exists("#search_form_input_homepage")).to.equal(true);
@rorymckinley
rorymckinley / registrator.ex
Created November 4, 2015 20:15
Registrator module with some debugging
defmodule PhoenixTokenAuth.Registrator do
alias Ecto.Changeset
alias PhoenixTokenAuth.Util
alias PhoenixTokenAuth.UserHelper
@doc """
Returns a changeset setting email and hashed_password on a new user.
Validates that email and password are present and that email is unique.
"""
def changeset(params = %{"username" => username}) when username != "" and username != nil do