Skip to content

Instantly share code, notes, and snippets.

View mv's full-sized avatar

Marcus Vinicius Ferreira mv

View GitHub Profile
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@jtriley
jtriley / ec2-fingerprint-key
Created November 1, 2013 19:28
Simple Python script that computes both public and private RSA key fingerprints as used by Amazon EC2
#!/usr/bin/env python
import hashlib
import optparse
import paramiko
from Crypto.PublicKey import RSA
def insert_char_every_n_chars(string, char='\n', every=64):
return char.join(
@mv
mv / aws.sh
Created November 30, 2012 19:04
AWS Command Line Tools: using MacOS and brew
#!/bin/bash
#
# using ec2 tools
#
# Marcus Vinicius Fereira ferreira.mv[ at ].gmail.com
# 2011-11
###
### programs
@ktheory
ktheory / check_aws_status.rb
Created January 13, 2012 05:11
Nagios plugin to check AWS Status RSS feeds
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
require 'net/http'
# check_aws_status.rb
# A nagios plugin for fetching RSS feeds from http://status.aws.amazon.com.
# Source: https://gist.github.com/1604786
# Written by Aaron Suggs: https://github.com/ktheory
@mislav
mislav / stupid-json.rb
Created December 21, 2011 12:31
Stupid simple JSON parser & generator
# encoding: utf-8
#
## Stupid small pure Ruby JSON parser & generator.
#
# Copyright © 2013 Mislav Marohnić
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the “Software”), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
@jedi4ever
jedi4ever / gist:1376525
Created November 18, 2011 14:00
Ganglia - Gmond packet listener in Ruby - Proof of Concept
require 'socket'
require 'pp'
require 'xdr'
# Inspiration
# https://github.com/fastly/ganglia/blob/master/lib/gm_protocol.x
# https://github.com/igrigorik/gmetric/blob/master/lib/gmetric.rb
# https://github.com/ganglia/monitor-core/blob/master/gmond/gmond.c#L1211
# https://github.com/ganglia/ganglia_contrib/blob/master/gmetric-python/gmetric.py#L107
@pbosetti
pbosetti / shared.rb
Created April 28, 2011 18:35
IPC shared memory access via FFI
#!/usr/bin/env ruby
# untitled.rb
# Created by Paolo Bosetti on 2011-04-22.
# Copyright (c) 2011 University of Trento. All rights reserved.
require "rubygems"
require 'ffi'
module Shared