Skip to content

Instantly share code, notes, and snippets.

Adventures in Python Core Dumping

After watching Bryan Cantrill's presentation on [Running Aground: Debugging Docker in Production][aground] I got all excited (and strangely nostalgic) about the possibility of core-dumping server-side Python apps whenever they go awry. This would theoretically allow me to fully inspect the state of the program at the point it exploded, rather than relying solely on the information of a stack trace.

@mrmichalis
mrmichalis / angelize.py
Last active October 30, 2016 04:42
Angelize - proof of concept tool to 'undaemonize' a process that backgrounds itself
#!/usr/bin/env python2
# ref:
# http://pastebin.com/15KaENGf
# https://www.reddit.com/r/linux/comments/5a3ek9/angelize_proof_of_concept_tool_to_undaemonize_a/
# exec angelize gpg-agent --daemon
# so what's the deal and what is this?
# it turns out that Linux has an interesting feature in prctl that allows any process to register itself as the child set_child_subreaper
# you know when a parent's process dies before the process and how it gets reparented to pid 1 then?
@mrmichalis
mrmichalis / frontendDevlopmentBookmarks.md
Created August 18, 2016 01:20 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
#!/bin/bash
# You must accept the Oracle Binary Code License
# http://www.oracle.com/technetwork/java/javase/terms/license/index.html
# usage: get_jdk.sh <rpm|tar> <jdk_version>
# jdk_version: default 8
# rpm
EXT="rpm"
JDK_VERSION="8"
@mrmichalis
mrmichalis / gist:6eed856ca914803a8445e776263cfce9
Created May 14, 2016 20:14 — forked from g3d/gist:2709563
Clean Install – OS X 10.11 El Capitan
@mrmichalis
mrmichalis / SSLPoke.java
Created April 8, 2016 21:14 — forked from 4ndrej/SSLPoke.java
Test of java SSL / keystore / cert setup. Check the commet #1 for howto.
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {
@mrmichalis
mrmichalis / centos_python_env_setup
Created October 20, 2015 16:10 — forked from floer32/centos_python_env_setup
CentOS 6: Install Python 2.7.4, pip, virtualenv, and virtualenvwrapper on CentOS (plus some bonus items at the end if you want). You should probably run with `sudo`.
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs
@mrmichalis
mrmichalis / SSLPoke.java
Created October 9, 2015 21:05
Establish a SSL connection to a host and port, writes a byte and prints the response.
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
* https://confluence.atlassian.com/download/attachments/117455/SSLPoke.java
*/
public class SSLPoke {
# source this code in a Bash shell ($ . django-csrftoken-login-demo.bash),
# and run with a DB name as parameter (e.g. $ django-csrftoken-login-demo demo)
django-csrftoken-login-demo() {
# -- CHANGE THESE VALUES TO MATCH YOUR ACCOUNT --
local HOSTING_USERID=9988
local HOSTING_PANEL_USER='customer@email.address'
local HOSTING_PANEL_PASS='my secret login password'
local HOSTING_DB_PREFIX='username_'
local DB_NAME=$HOSTING_DB_PREFIX$1
@mrmichalis
mrmichalis / main.py
Last active November 21, 2017 20:53 — forked from gear11/main.py
"""
A simple proxy server. Usage:
http://hostname:port/p/(URL to be proxied, minus protocol)
For example:
http://localhost:8080/p/www.google.com
"""