Skip to content

Instantly share code, notes, and snippets.

View emir-munoz's full-sized avatar

Emir Muñoz emir-munoz

  • Galway, Ireland
View GitHub Profile
@emir-munoz
emir-munoz / ec2_info_retriever.py
Created September 16, 2020 18:36 — forked from dastergon/ec2_info_retriever.py
A basic boto3 based tool for retrieving information from running EC2 instances.
from collections import defaultdict
import boto3
"""
A tool for retrieving basic information from the running EC2 instances.
"""
# Connect to EC2
ec2 = boto3.resource('ec2')
@emir-munoz
emir-munoz / pandas_s3_streaming.py
Created February 28, 2019 17:55 — forked from uhho/pandas_s3_streaming.py
Streaming pandas DataFrame to/from S3 with on-the-fly processing and GZIP compression
def s3_to_pandas(client, bucket, key, header=None):
# get key using boto3 client
obj = client.get_object(Bucket=bucket, Key=key)
gz = gzip.GzipFile(fileobj=obj['Body'])
# load stream directly to DF
return pd.read_csv(gz, header=header, dtype=str)
def s3_to_pandas_with_processing(client, bucket, key, header=None):
@emir-munoz
emir-munoz / scrape_Wikipedia_tables.py
Created April 23, 2018 20:26 — forked from wassname/scrape_Wikipedia_tables.py
Scrape a table from wikipedia using python. Allows for cells spanning multiple rows and/or columns. Outputs csv files for each table
# -*- coding: utf-8 -*-
"""
Scrape a table from wikipedia using python. Allows for cells spanning multiple rows and/or columns. Outputs csv files for
each table
"""
from bs4 import BeautifulSoup
import urllib2
import os
import codecs
@emir-munoz
emir-munoz / Makefile
Created February 6, 2017 18:13 — forked from svenwltr/Makefile
LaTeX draft corner
MASTER=document.tex
DESCRIBE=$(shell git describe --tags --dirty)
SOURCE="\def\MyGitRevision{$(DESCRIBE)}\input{$(MASTER)}"
full:
make pdf
make pdf
pdf:
pdflatex "\def\MyGitRevision{$(DESCRIBE)}\input{$(MASTER)}"
@emir-munoz
emir-munoz / Vagrantfile
Created January 26, 2016 17:48 — forked from tknerr/Vagrantfile
Sample Vagrantfile that works with all providers (virtualbox, aws, managed) and in combination with the vagrant-omnibus plugin
#
# Vagrantfile for testing
#
Vagrant::configure("2") do |config|
# the Chef version to use
config.omnibus.chef_version = "11.4.4"
def configure_vbox_provider(config, name, ip, memory = 384)
config.vm.provider :virtualbox do |vbox, override|
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},