Skip to content

Instantly share code, notes, and snippets.

@vsajip
vsajip / no-text-socket.diff
Last active June 25, 2018 01:53
Supervisor on Python3: no-text-socket approach - diff (including fixture data), and results of manual testing. When applied to fa7e3f5, all tests pass on 2.x and 3.x
diff --git a/.gitignore b/.gitignore
index d656399..4fff496 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@
*.pyc
*.pyo
*.swp
+*.pss
.DS_Store
# Inspired by the following sentence that I ran across this morning:
#
# "f_lineno is the current line number of the frame - writing to
# this from within a trace function jumps to the given line
# (only for the bottom-most frame). A debugger can implement a
# Jump command (aka Set Next Statement) by writing to f_lineno."
#
# https://docs.python.org/2/reference/datamodel.html
#
# There is an older implementation of a similar idea:
---
- name: Group by Distribution
hosts: all
tasks:
- group_by: key={{ansible_distribution}}
- name: Set Time Zone
hosts: Ubuntu
gather_facts: False
vars:
@jehiah
jehiah / check_swap_paging_rate.sh
Created January 19, 2014 21:37
Nagios Monitor for the rate pages are swapped in/out
#!/bin/bash
# Show the rate of swapping (in number of pages) between executions
OK=0
WARNING=1
CRITICAL=2
UNKNOWN=-1
EXITFLAG=$OK
WARN_THRESHOLD=1
@tmm1
tmm1 / rails3_mailer.rb
Created March 27, 2013 23:25
rails3 mailer backport
if Rails.version < '3.0'
require 'mail'
require 'active_support/core_ext/module/attr_internal'
class ActionMailer3
class Collector
attr_reader :responses
def initialize(context, &block)
@context = context
@cypriss
cypriss / action_mailer_no_tmail.rb
Created August 14, 2012 17:32
Use TMail -> Mail gem in Rails 2.3
require 'action_mailer'
require 'mail'
module ActionMailer
class Base
def clean_address(str)
EmailAddress.parse(str, :no_default_name => true).quoted rescue str
end
@pfreixes
pfreixes / gist:3187511
Created July 27, 2012 11:36
Supervisorctl bash autocomplete
# pfreixes, 2012-07-27
# Add to /etc/bash_completion.d/supervisorctl
_supervisor()
{
local cur prev opts base
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@cypriss
cypriss / README.md
Last active June 18, 2018 11:57
Rails 2.3.14 Ruby 1.9.3 - Monkey Patches

How we upgraded UserVoice, a Rails 2.3.14 app, to Ruby 1.9.3.

Blog post here

@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.