Skip to content

Instantly share code, notes, and snippets.

View zodiacfireworks's full-sized avatar
:octocat:
Working from home

Martín Josemaría zodiacfireworks

:octocat:
Working from home
View GitHub Profile

How to install ROOT with Python 3

Los siguientes pasos le permitiran instalar ROOT

  1. Ejecutar en orden los siguientes comandos
mkdir ~/root-builder
cd ~/root-builder
git clone http://github.com/root-project/root.git
@zodiacfireworks
zodiacfireworks / vincenty.js
Last active June 7, 2019 03:06
Vicenty's Formulae JS
// Determines the distance between two points on the earth surface
// using Vicenty's Formulae
//
// * https://en.wikipedia.org/wiki/Vincenty%27s_formulae
//
const vincenty = (p1, p2) => {
if (p1.lat === p2.lat && p1.lng === p2.lng) {
return 0.0
}
const MAX_ITERATIONS = 200
@zodiacfireworks
zodiacfireworks / image-tag-exists.sh
Last active February 21, 2019 21:38 — forked from outofcoffee/find-ecr-image.sh
Check if Docker image exists with tag in AWS ECR
#!/usr/bin/env bash
# Example:
# ./find-ecr-image.sh foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
fi
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"
@zodiacfireworks
zodiacfireworks / lambda.js
Created December 23, 2018 11:29
Headers for S3 and Cloudfront
// Code sourced from https://iangilham.com/2017/08/22/add-headers-with-lambda-edge.html
'use strict';
exports.handler = (event, context, callback) => {
function add (h, k, v) {
h[k.toLowerCase()] = [
{
key: k,
value: v
}
];
@zodiacfireworks
zodiacfireworks / plot_settings.py
Last active November 22, 2018 19:23
Ajustes gráficos para mis gráficas con Matplotlib
# Ajustes generales para los gráficos
from distutils.spawn import find_executable
from matplotlib.font_manager import FontProperties
import matplotlib.pyplot as plt
import seaborn
import gc
plt.ioff()
plt.rc('lines', linewidth=1)
@zodiacfireworks
zodiacfireworks / common.cors.inc
Created October 31, 2018 15:01
Enable cors on Nginx
#
# Wide-open CORS config for nginx
#
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
@zodiacfireworks
zodiacfireworks / geant4_installer.sh
Last active April 25, 2024 09:31
Full installation of Geant4 (10.04.p02) with QT and all it's data sets
#! /usr/bin/env bash
sudo apt-get -y install \
autotools-dev \
axel \
binutils \
build-essential \
cmake \
console-setup \
dpkg-dev \
expat \
@zodiacfireworks
zodiacfireworks / include_in.zshrc
Last active June 4, 2018 18:51
Auto load SSH Keys and make it persistent
# Include this file in your .zshrc right after
# source $ZSH/oh-my-zsh.sh
# User configuration
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
eval `ssh-agent` > /dev/null
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
fi
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
@zodiacfireworks
zodiacfireworks / ssh_auto_load.sh
Created January 17, 2018 02:19
Auto load SSH keys
# User configuration
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
eval `ssh-agent` > /dev/null
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
fi
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
if [[ $(ssh-add -l) == "The agent has no identities." ]]; then
for key in `ls -1 ~/.ssh/*.pub`; do

How to generate SSH key

mkdir ~/.ssh/
ssh-keygen -t rsa -b 4096 -f ~/.ssh/$SSH_KEY_NAME -C "$COMMENT <$EMAIL>" -N ''

Config Template

In ~/.ssh/config: