Skip to content

Instantly share code, notes, and snippets.

View graphaelli's full-sized avatar

Gil Raphaelli graphaelli

View GitHub Profile
graphaelli /
Created February 21, 2012 17:32
Ganglia For MySQL Metrics
The MIT License
Copyright (c) 2008 Gilad Raphaelli <>
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 permit persons to whom the Software is
graphaelli /
Created February 6, 2013 18:00
markdown previewer
#!/usr/bin/env python
""" .vimrc: autocmd BufEnter *.md exe 'noremap <F5> :! %<CR>' """
import subprocess, sys, tempfile
with tempfile.NamedTemporaryFile(suffix=".html", delete=False) as mdhtml:
subprocess.check_call(["pandoc", "--to=html", "--from=markdown", "-o",, sys.argv[1]])
# webbrowser.open_new_tab ... chrome howto?
subprocess.check_call(["open", "-a", "Google Chrome",])
package main
import (
func main() {
graphaelli /
Created March 2, 2015 14:49
pre-commit hook
#!/usr/bin/env python
import json
import subprocess
import sys
def against():
subprocess.check_call("git rev-parse --verify HEAD".split())
#!/usr/bin/env python
from import Action, Condition, Policy, Principal, Statement
from import Deny, Everybody, StringNotEquals
from awacs.s3 import ARN as S3_ARN
import troposphere
import troposphere.s3
def resource_namify(resource_name):
import troposphere
import troposphere.ec2
import troposphere.iam
from import Allow, Statement, Policy
from awacs.s3 import ARN as S3_ARN
import awacs.s3 as s3
def read_only_bucket_access(bucket_name):
graphaelli / Dockerfile
Last active October 5, 2020 20:46
Caffe with Python3 on Centos 7
FROM centos:7
MAINTAINER graphaelli ""
RUN yum -y update && yum clean all
# python3 deps
RUN yum -y groupinstall 'Development Tools'
RUN yum -y install bzip2-devel db4-devel gdbm-devel libpcap-devel ncurses-devel openssl-devel readline-devel sqlite-devel xz-devel zlib-devel
# jupyter deps
RUN yum -y install epel-release
RUN yum -y install blas-devel freetype-devel gcc gcc-c++ gcc-fortran git hdf5-devel lapack-devel libjpeg-turbo-devel libpng-devel make opencv-devel patch readline-devel zeromq-devel
#!/usr/bin/env python
import fileinput
import urllib.parse
dsn = next(fileinput.input()).strip()
url = urllib.parse.urlparse(dsn)
graphaelli / gist:dd75bc730a7eafd25fe99c2d6a17ed5f
Created April 11, 2016 01:10 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
graphaelli / scp.terminal
Last active November 25, 2017 15:19
Mac OSX Terminal Settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">