Skip to content

Instantly share code, notes, and snippets.

@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 / gist:6eed856ca914803a8445e776263cfce9
Created May 14, 2016 20:14 — forked from g3d/gist:2709563
Clean Install – OS X 10.11 El Capitan
#!/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 / frontendDevlopmentBookmarks.md
Created August 18, 2016 01:20 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@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?

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.

# so that Ctrl-V works
alias xclip='xclip -selection c'
# this is from transfer.sh website, with small adjustment near the end
transfer() {
if [ $# -eq 0 ]; then
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md";
return 1;
fi
@mrmichalis
mrmichalis / xml-rpc-supervisord.py
Created May 12, 2017 13:55
Connect to Cloudera Manager Agent supervisord via xmlrpclib
#!/usr/lib64/cmf/agent/build/env/bin/python
# grep -A2 username /var/run/cloudera-scm-agent/supervisor/supervisord.conf | head -2
# ...
# username=6898309654436388381
# password=7733585661005351423
# ...
import xmlrpclib
server = xmlrpclib.Server('http://6898309654436388381:7733585661005351423@localhost:19001/RPC2')
server.system.listMethods()
@mrmichalis
mrmichalis / LICENSE.txt
Created August 18, 2017 10:12 — forked from kevinoid/LICENSE.txt
An example program using AsyncHttpClient with SSL certificate verification
CC0 1.0 Universal
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for the
@mrmichalis
mrmichalis / s3update.py
Created November 24, 2017 09:24 — forked from nateware/s3update.py
Check local files vs what's on S3, and upload any that have changed.
#!/usr/bin/env python
# Compare a file on S3 to see if we have the latest version
# If not, upload it and invalidate CloudFront
import fnmatch
import os
import boto
import pprint
import re