Skip to content

Instantly share code, notes, and snippets.

View mzmcbride's full-sized avatar

MZMcBride mzmcbride

View GitHub Profile
@atdt
atdt / takeover.py
Last active December 3, 2022 17:53
Zero-downtime restarts via interprocess descriptor transfer
#!/usr/bin/env python3
# -*- coding: utf8 -*-
"""
takeover.py
~~~~~~~~~~~
This script demonstrates a technique for zero-downtime restarts via
interprocess descriptor transfer.
The script operates a simple echo service on port 9999. When a new instance
is launched, the old instance will transfer the server socket to the new
# -*- coding: utf-8 -*-
import os
import subprocess
import irclib
class ExternalCommand(irclib.Connection):
"""Represents an external command invocation made via irclib.
@atdt
atdt / irclib_external_command_bot.py
Last active August 29, 2015 14:09
Running external commands with irclib
# -*- coding: utf-8 -*-
import subprocess
import irclib
class ExternalCommand(irclib.Connection):
"""Represents an external command invocation made via irclib.
Sample usage
@atdt
atdt / rcxml.py
Last active August 29, 2015 14:00
rcxml.py
# -*- coding: utf-8 -*-
"""
RCStream JSON -> XML transformer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dependencies:
* dicttoxml - https://github.com/quandyfactory/dicttoxml
* socketIO-client - https://pypi.python.org/pypi/socketIO-client
To install dependencies automatically, run:
@maxteufel
maxteufel / Security of cloaks.md
Last active October 21, 2021 16:50
About the security of (unaffiliated) cloaks on freenode

Copyright (c) 2014, 2016, 2017 M. Teufel

Unlimited redistribution and modification of this document is allowed provided that the above copyright notice and this permission notice remains in tact.


If you are reading this, you probably asked for a (unaffiliated) cloak on freenode because you wanted to hide your IP or hostname.

This text is here to tell you that cloaks and vHosts don't hide your IP very well. Cloaks on freenode show your (lack of) affiliation with a project or a group being hosted on freenode.

@prtksxna
prtksxna / murgi.sh
Last active August 29, 2015 13:56
Usage `./murgi.sh mediawiki/extensions/Popups dptypes.pmtpa.wmflabs 113951 2`
#!/bin/bash
REPO=$1
HOST=$2
CHANGE=$3
PS=$4
DIR=${CHANGE: -2}
ssh -t $HOST bash -c "'
cd /vagrant/$REPO
@legoktm
legoktm / BLANK_ALL_THE_MESSAGES.py
Last active December 30, 2015 05:19
This will probably work.
#!/usr/bin/python
# Public domain
import wikitools
username = 'Legoktm'
password = 'hunter2'
messages = ['Signupstart', 'Signupend']
reason = '...'
def matrix(wiki):
@armon
armon / security.md
Last active December 26, 2015 13:29
@atdt
atdt / populateCategories.php
Created March 14, 2013 07:23
Populates GettingStarted task categories in redis.
<?php
if ( PHP_SAPI !== 'cli' ) {
die( 'This script can only be run from the command line.' );
}
$IP = getenv( 'MW_INSTALL_PATH' ) ?: realpath( __DIR__ . '/../..' );
require_once( $IP . '/index.php' );
function populateCategory( $category ) {
@insin
insin / bash_prompt.sh
Created December 3, 2011 01:49 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to active virtualenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.