Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Humpal phumpal

View GitHub Profile
@phumpal
phumpal / path_gitlab_upgrade.sh
Last active Sep 10, 2021
When gitlab apt repo seems borked. Then proceed on your way with upgrade shenanigans
View path_gitlab_upgrade.sh
#!/bin/sh
# https://docs.gitlab.com/ee/update/index.html#upgrade-paths
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
@phumpal
phumpal / glyphify.json
Created Jan 8, 2021
Humanized mutator output for not-so-boring sensu-core alerts
View glyphify.json
{
"mutators": {
"glyphify": {
"command": "/etc/sensu/mutators/glyphify.rb"
}
}
}
@phumpal
phumpal / Gemfile
Last active Jun 23, 2020
A simple Sinatara app to proxy Airbrake webhooks to Google Hangout Chats
View Gemfile
source 'https://rubygems.org'
gem 'hangouts-chat'
gem 'sinatra'
@phumpal
phumpal / .htaccess
Created Jan 22, 2019
Heroku force ssl
View .htaccess
##Force SSL
#Normal way (in case you need to deploy to NON-heroku)
RewriteCond %{HTTPS} !=on
#Heroku way
RewriteCond %{HTTP:X-Forwarded-Proto} !https
#If neither above conditions are met, redirect to https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@phumpal
phumpal / README.md
Last active Aug 11, 2018
Devin's WormDeath processor
View README.md

WormDeath Processor

WormDeath Processor is a simple and not so idiomatic Python script to process strain worm deaths over a given number of days.

The number of days and strains can be dynamic but the script ignores days where there were 0 worm deaths and outputs a two column CSV with the strains processed in series.

Usage

  • -i or --input input CSV
  • -o or --output output CSV
@phumpal
phumpal / Vagrantfile
Created Mar 17, 2018
jruby-1.7.4, toadhopper-2.1, openjdk-6-jdk, precise64, openSSL (1.0.1 14 Mar 2012)
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.network "public_network"
config.vm.provider "virtualbox" do |vb|
vb.memory = 2048
@phumpal
phumpal / README.md
Last active Feb 21, 2020
A simple Sinatra app to proxy Airbrake webhooks to Cisco Spark Rooms
View README.md

Setup

brew install jq # or apt-get install jq (only needed for testing)          
rvm install ruby-2.4.1
rvm gemset create spark
rvm gemset use spark
gem install cisco_spark --no-document
gem install sinatra --no-document
@phumpal
phumpal / s3_wale_policy.json
Created Jul 21, 2017
wal-e encrypted PostgreSQL backups s3 policy
View s3_wale_policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "S3PostgreSQLWALeBackups",
"Action": [
"s3:AbortMultipartUpload",
"s3:DeleteObject",
"s3:DeleteObjectVersion",
"s3:GetObject",
View keybase.md

Keybase proof

I hereby claim:

  • I am phumpal on github.
  • I am phumpal (https://keybase.io/phumpal) on keybase.
  • I have a public key whose fingerprint is F949 FD0F EB0A EAFE D01B 3349 233C 59EA 6342 D3F9

To claim this, I am signing this object:

@phumpal
phumpal / remove_ruby.sh
Created Feb 3, 2016
A shit script to remove Ruby installed from source
View remove_ruby.sh
#!/bin/bash
gem list | grep -v "test-unit|rdoc|psych|io-console|minitest|rake|bigdecimal|json" | cut -d" " -f1 | xargs gem uninstall -aIx
rm -rf /usr/local/lib/ruby
rm -rf /usr/local/share/doc/ruby
rm -rf /usr/local/share/ri
rm -rf /usr/local/include/ruby-*
rm -rf /usr/local/bin/ruby