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 / config_miniconda_fish.sh
Created March 15, 2018 15:42
Configure fish with Miniconda and oh-my-fish themes
curl -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x Miniconda3-latest-Linux-x86_64.sh
./Miniconda3-latest-Linux-x86_64.sh
echo 'set -U fish_user_paths $HOME/miniconda3/bin $fish_user_paths' >> ~/.config/fish/config.fish
echo 'source (conda info --root)/etc/fish/conf.d/conda.fish' >> ~/.config/fish/config.fish
echo 'set -gx CONDA_LEFT_PROMPT 1' >> ~/.config/fish/config.fish
curl -L https://get.oh-my.fish | fish
@emir-munoz
emir-munoz / add_GPG_support.md
Last active February 28, 2018 22:44
How to add a GPG key to verify your commits in GitHub
@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|
Compression
------------
http://linux.dsplabs.com.au/tar-how-to-create-and-extract-tar-gz-and-bz2-compressed-archives-under-linux-p39/
**Creating archives tar
tar cf dir.tar dir/
tar czf dir.tar.gz dir/
tar cjf dir.tar.bz2 dir/
**Extracting archives
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\usepackage{times}
\usepackage{color}
\definecolor{gray97}{gray}{.97}
\definecolor{gray75}{gray}{.75}
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},