Skip to content

Instantly share code, notes, and snippets.


R Gibim Drowze

  • Over-haul
  • Dublin, Ireland
  • Twitter @r_gibim
View GitHub Profile
Drowze / 41-setup-plex-plugins
Last active January 30, 2023 11:40
Setup plug-ins on plexinc/pms-docker docker image startup
View 41-setup-plex-plugins
#!/usr/bin/with-contenv bash
PMS_PATH="/config/Library/Application Support/Plex Media Server"
# If the first run completed successfully, we are done
if [ -e /.pluginsInstalled ]; then
exit 0
Drowze / rails-routes
Created November 22, 2022 14:53
bundle exec rails routes (with caching!)
View rails-routes
# bundle exec rails routes (with caching!) by Drowze
# Just make an executable out of this and move into your path
if [[ -f config/routes.rb ]]; then
routes_blob=$(cat config/routes.rb)
Drowze / datadog-mock.rb
Last active June 8, 2022 10:53
a datadog agent fake server to intercept ddtrace requests. NOT compatible with ddtrace v1
View datadog-mock.rb
# frozen_string_literal: true
require 'roda'
require 'pry'
require 'msgpack'
require 'json'
require 'zlib'
require 'multipart_parser/reader'
require 'google/protobuf'
Drowze / kimsufi checker
Last active February 23, 2022 18:39
Kimsufi checker
View kimsufi checker
#!/usr/bin/env bash
if ! command -v jq &>/dev/null; then
echo "missing jq!"
exit 1
Drowze /
Last active May 17, 2021 11:02
docker in docker, issues with mounting a volume

Let's try to use volumes on a docker-in-docker setup!

  • First start docker in docker
$ docker pull docker
$ docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --name docker-outer docker sh
  • Then start an inner container, create a file there and copy it to the outer container
View graylog_api.rb
require 'bundler/inline'
require 'minitest/autorun'
gemfile do
source ''
gem 'http'
require 'http'
require 'cgi'
View gist:d73fc62c4fd31d1cf6958b340900f723
RSpec.describe 'Testing' do
it 'is flagged' do
x = []
expect { x.append(1) }.to change(x, :size)
Drowze / test.rb
Last active June 20, 2019 14:08
RSpec bug on allow with block syntax #rspec #ruby #bug #bug-report
View test.rb
require 'bundler/inline'
gemfile do
source ''
gem 'rspec'
puts 'Ruby Version ' + RUBY_VERSION.to_s
puts 'RSpec version ' + RSpec::Core::Version::STRING.to_s
Drowze / compositional_fun.rb
Last active June 7, 2019 15:20
composition operator fun (using ruby 2.7 preview 1)
View compositional_fun.rb
class SubtractTwoInteraction
number - 2
class MultiplyByInteraction
def, by:)
number * by
Drowze / Suppressing undesired gem
Created September 26, 2018 15:50
Suppressing undesired gem/library load. Useful when your project has a undesired gem being loaded. This makes advantage of .pryrc (but irbrc could theorically also be used)
View Suppressing undesired gem

My project .pryrc contained awesome_print load, which I do not appreciate.

require 'awesome_print'

To patch against the .pryrc, which I could not edit at the time, I created another .pryrc at my home folder (~/.pryrc):

module Kernel
 alias :old_require :require