Skip to content

Instantly share code, notes, and snippets.

View purp's full-sized avatar
🖤
https://xrl.us/mlkbirmletterpdf

Jim Meyer purp

🖤
https://xrl.us/mlkbirmletterpdf
View GitHub Profile
@purp
purp / light_and_cat5_times.md
Last active November 27, 2017 17:48
Some data about ping time from Sunnyvale through various VPN endpoints to commonly used servers/services.

Minimum latency for fiber and Cat 5 copper

This is a calculation of the minimum possible latency you could possibly expect between two points, if the theoretical connection between them was completely straight and of perfect quality. This is not attainable in a modern switched network, but it's useful both to understand the amount of delay injected by network implementation and complexity, and to compare relative latencies between routes.

Distances and optimum latency between cities

Nuremberg/Prague

  • 156.098 mi
  • 0.8379643083349 light-milliseconds
  • 1.309319231773281 cat5-milliseconds
@purp
purp / README.md
Created August 26, 2017 17:44
Install and Run Rocket.Chat on OpenSUSE Leap 42.2

Install and Run Rocket.Chat on OpenSUSE Leap 42.2

Last updated 2017-08-26

These are barebones instructions for how to set up a Rocket.Chat server on OpenSUSE Leap 42.2 using nginx as a reverse proxy. These will help you set up a system you can experiment with. THEY ARE NOT INTENDED FOR SETUP OF A PRODUCTION SYSTEM! They are oriented on using a VM from AWS, but should work for any Leap 42.2 system.

Overview

You will install and configure:

@purp
purp / README.md
Last active October 21, 2024 15:21
Debug Travis CI config locally using Docker

Debugging Travis CI locally using Docker

This assumes you've got docker-machine installed, running, and can do docker run

1. Get a debug instance running

    docker run --name travis-debug -dit quay.io/travisci/travis-ruby /sbin/init
    docker exec -it travis-debug bash -l
@purp
purp / README.md
Last active January 5, 2017 04:40
Setting up Rails 5, Puma, and nginx on OpenSUSE Leap 42.1

Huge thanks to @bounga for his post that didn't assume you've got a working /etc/nginx.conf. Everyone else's posts just assume that you've got the same /etc/nginx.conf as they do, and when you don't, you're screwed.

I like the sites-available/sites-enabled paradigm so I did this:

mkdir /etc/nginx/sites-available /etc/nginx/sites-enabled
ln -s /etc/nginx/sites-enabled /etc/nginx/vhosts.d

I highly recommend using capistrano-puma. Super basic steps condensed from the capistrano-puma readme:

  1. Add this to your Gemfile in the development group:
@purp
purp / README.md
Last active January 4, 2017 17:05
Installing Nokogiri gem manually on OpenSUSE Leap 42.1

Installing nokogiri manually on OpenSUSE Leap 42.1:

gem install nokogiri -- --use-system-libraries \
    --with-xml2-dir=/usr \
    --with-xslt-dir=/usr \
    --with-exslt-dir=/usr

I can't say I understand why I had to specify those dirs as that's the system default, but it works and I'm in a hurry. I'll update this as I learn more someday.

Meanwhile, you may be interested in the Nokogiri issue that this stems from

@purp
purp / Capfile
Last active October 20, 2021 22:44
Using Capistrano 3, capistrano-rbenv, and capistrano-rbenv-build together with Rails 5
# Load DSL and set up stages
require "capistrano/setup"
# Include default deployment tasks
require "capistrano/deploy"
# Load the SCM plugin appropriate to your project:
#
# require "capistrano/scm/hg"
# install_plugin Capistrano::SCM::Hg
@purp
purp / README.md
Last active August 11, 2017 21:06
Measuring how well Homebrew's awscli formula tracks releases, now with measured time deltas. Hacked in a hurry. #notproud #dontjudge

How To Run This Piece Of Junk

  1. clone aws/aws-cli and homebrew-core into ~/work
  2. Run check_awscli_tracking.sh
  3. Run awscli_release_stats.rb
@purp
purp / delegate_matcher.rb
Last active July 31, 2020 10:46 — forked from bparanj/delegate_matcher.rb
RSpec matcher for delegations
# RSpec matcher to spec delegations.
#
# Usage:
#
# describe Post do
# it { should delegate(:name).to(:author).with_prefix } # post.author_name
# it { should delegate(:day).to(:created_at) }
# it { should delegate(:month, :year).to(:created_at) }
# end
#
@purp
purp / rbenv-copy-gems.rb
Created July 7, 2016 16:01
rbenv: install all gems from one version to another
#!/bin/bash
# copy is a misnomer; it's actually LIST + INSTALL
# --from 2.2.1 [--to other-version-else-whatever-is-currently-set]
#
# TODO: install only most-recent version that's installed in FROM
# TODO: use gem names only from FROM, install latest available version (might be more recent than in FROM)
# TODO: pass arguments to gem command (e.g. --no-document)
CURRENT_VERSION=`rbenv version | cut -d' ' -f1`
GEM_LIST_ARGS="--local"
@purp
purp / mapped_open_struct.rb
Created February 21, 2016 05:52
MappedOpenStruct: useful for hashes from JSON with crappy keys
require 'ostruct'
class MappedOpenStruct < OpenStruct
MAP = {}
def initialize(hash=nil)
super
add_mapped_methods
end