Skip to content

Instantly share code, notes, and snippets.

View ju-arroyom's full-sized avatar

Juan Arroyo-Miranda ju-arroyom

View GitHub Profile
@nicor88
nicor88 / bootstrap_jupyter.sh
Created April 20, 2017 10:23
Bootstrap action to install Conda and Jupyter on EMR
#!/usr/bin/env bash
set -x -e
JUPYTER_PASSWORD=${1:-"myJupyterPassword"}
NOTEBOOK_DIR=${2:-"s3://myS3Bucket/notebooks/"}
# home backup
if [ ! -d /mnt/home_backup ]; then
sudo mkdir /mnt/home_backup
sudo cp -a /home/* /mnt/home_backup
@atcuno
atcuno / gist:3425484ac5cce5298932
Last active March 25, 2024 13:55
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@nancyru
nancyru / configure_python.py
Created June 27, 2015 05:28
AWS EMR bootstrap action for configuring python
#!/bin/bash
#When Spark is installed by a bootstrap action on an AWS EMR cluster,
#this script can be used as an additional bootstrap action to
#install ipython on all the nodes of the cluster.
#Make Python 2.7 the default python
echo `sudo rm /usr/bin/python`
echo `sudo ln -s /usr/bin/python2.7 /usr/bin/python`
#Install iPython and dependencies for Python 2.7
@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)

@nvanderw
nvanderw / example.py
Created October 18, 2012 01:19
Hacks that make Python more functional
from functional import fun
from itertools import imap, ifilter, takewhile, count
@fun(2)
def add(x,y): return x + y
# Here I define a function which takes a string and shows what it evaluates to.
@fun(1)
def evalPrint(s):
print "%s -> %s" % (s, eval(s))
@bortzmeyer
bortzmeyer / gist:1284249
Created October 13, 2011 13:42
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys