Skip to content

Instantly share code, notes, and snippets.

View webervin's full-sized avatar

Ervin Weber webervin

  • pactum.com
  • Estonia, Tallinn
View GitHub Profile
@kquinsland
kquinsland / dummy0.netdev
Created December 3, 2019 02:54
How to get consul-agent and systemd.resolvd to co-exist peicefully and still be able to resolve *.consul hostsnames from within docker
# Creates a "dummy" network interface
# we'll configure this interface with a link-local address
# See: https://www.freedesktop.org/software/systemd/man/systemd.netdev.html
##
[NetDev]
Name=dummy0
Kind=dummy
@a7madgamal
a7madgamal / dark.md
Last active July 14, 2023 04:00
Dark mode for Slack on MacOS
@searls
searls / octohooks.rb
Last active May 13, 2017 14:57
Use Octokit to add a particular webhook to all of your repos (handy for things like chat integration)
# This is just a scratchpad after I hacked what I needed in an irb session
require 'octokit'
Octokit.configure do |c|
c.login = 'searls'
c.password = 'c0d3b4ssssss!'
end
client = Octokit::Client.new
repos = client.repos #Note, for an org's repos, see `client.orgs.first.rels[:repos].get.data`
@rduplain
rduplain / gist:4946399
Last active December 13, 2015 17:18
Prevent stop/restart of postgresql on Debian/Ubuntu. Do so carefully while watching updates, and restart manually.
#!/bin/sh
# /usr/sbin/policy-rc.d
# Do not stop/restart postgresql. --rduplain 2013-02-13
# http://askubuntu.com/a/254307/113086
if [ "$1" = "postgresql" ]; then
# Forbid stop/restart, or any init action for that matter.
# 101 - action forbidden by policy
exit 101
fi
@dirtyhenry
dirtyhenry / poc-openssl-aes.rb
Last active June 5, 2018 11:48
Encryption interoperability demo between Ruby and OpenSSL
require 'openssl'
require 'base64'
# Read the dummy file
data = File.read("test.txt")
# Create an encrypter
cipher = OpenSSL::Cipher::AES.new(256, :CBC)
cipher.encrypt
key = cipher.random_key
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@stympy
stympy / deploy.rb
Created December 12, 2011 21:27
Skip asset pre-compilation when deploying if the assets didn't change
namespace :deploy do
namespace :assets do
task :precompile, :roles => :web, :except => { :no_release => true } do
from = source.next_revision(current_revision)
if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
else
logger.info "Skipping asset pre-compilation because there were no asset changes"
end
end
@cwsaylor
cwsaylor / gist:90971
Created April 6, 2009 22:07
Capistrano deployment campfire notifier
# Requires config file config/campfire.yml with the following settings:
# account: "foo"
# email: "bar@baz.com"
# password: "changeme"
# ssl: false
# room: "foobar"
require 'tinder'