Skip to content

Instantly share code, notes, and snippets.

View elipapa's full-sized avatar

Eliseo Papa elipapa

View GitHub Profile
@elipapa
elipapa / com.elipapa.keychains-backup.plist
Last active August 4, 2019 19:10
launchd job that i use to back up mac os x keychains to an encrypted disk image.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.elipapa.keychain-backup</string>
<key>OnDemand</key>
<true/>
<key>ProgramArguments</key>
<array>
@elipapa
elipapa / _Setup_new_laptop.md
Last active February 26, 2024 04:27
Steps to set up a new osx laptop for data science and computational biology work

Set up a new os x laptop

Steps to setup a new OS X laptop with a data science & computational biology development environment.

Last updated: 7 Jan 2017 macOS: Yosemite => Sierra

Sure you could try to do this from dotfiles, but historically something has broken and required manual input anyway. So, inspired by the pragmatism of paul irish bash setup script and a few other gists written in markdown like this, I rolled my own.

Some design considerations:

@elipapa
elipapa / minimal-terminal-setup.md
Created October 22, 2015 10:07
Least amount of steps to get a decent command line in OSX/linux environments

The minimal set of steps to get a decent command line on a server

using homebrew, apt-get or whatever you have access to:

  • install git
  • install zsh

Directly from prezto install instructions

@elipapa
elipapa / journey2dayone.py
Created November 24, 2015 17:42
converting journey android app entries to dayone entries using the the dayone-cli limited input options
#!/usr/bin/env python3
## converting journey android app entries to dayone entries using the the dayone-cli limited input options
# first download all single posts zip files and place them in the folder of the script. Then run
# unzip '*.zip'
# where quotes are important!
#
# Then run this script in the folder
@elipapa
elipapa / decomp.sh
Last active May 22, 2016 22:49
simple bash task queue to download, decompress and upload files to a S3 bucket
#!/bin/bash
while true; do
until [[ $usedspace -ge 60 ]]; do
for file_ready in queue/*.downloaded; do
filepath=${file_ready%.downloaded}
file=${filepath##*/}
srsid=${file/.*/}
if [ ! -e "queue/$srsid.decompressed" ]
then
echo "Decompressing $srsid ..."
@elipapa
elipapa / git-deploy-setup.sh
Last active May 22, 2016 22:49
Edit files locally and deploy the changes on a remote server using git - often better than playing with sshfs, rsync, scp, tramp, remote-edit, rmate
#!/usr/bin/env bash
# Installation with this script in your $PATH:
# $ git config --global alias.deploy '!git-deploy'
# When in the repo just go:
# $ git deploy ssh://user@server/a/path/to/repo
# which creates a bare repository bare.git in that remote directory
# and copies the working tree in the directory
@elipapa
elipapa / gene2ensembl.sh
Created April 16, 2016 02:55
Map human gene symbols to ensembl gene ids, using the ensembl REST api, curl and jq
#!/usr/bin/env bash
# USAGE:
# 0. install jq from https://stedolan.github.io/jq/ if not already present
# 1. make this script executable
# chmod u+x gene2ensembl.sh
# 2. then run it on a gene list with one gene ID per line
./gene2ensembl.sh genesymbollist.txt > ensembl_list.txt
# NOTE: this command does not run in parallel on purpose
@elipapa
elipapa / preemtible_kubernetes.md
Created October 14, 2016 21:34 — forked from tsuri/preemtible_kubernetes.md
kubernetes cluster w/ pre-emptible instances

Kubernetes clusters using preemtible instances

Motivation

People experimenting with kubernetes clusters on the GKE not necessarily have money to keep a full cluster on at all time. GKE clusters can be easily resized, but this still incurs in the full instance cost when the cluster is up.

Google has added preemptible instances that are ideal for many

@elipapa
elipapa / .tmux.conf
Last active May 15, 2017 21:26 — forked from subfuzion/.tmux.conf
My .tmux.conf for tmux 2.1 (with fixes for mouse breakage)
# Inspirations:
# http://mutelight.org/practical-tmux
# http://zanshin.net/2013/09/05/my-tmux-configuration/
# http://files.floriancrouzat.net/dotfiles/.tmux.conf
# http://stackoverflow.com/questions/9628435/tmux-status-bar-configuration
# https://github.com/Lokaltog/powerline
# https://github.com/remiprev/teamocil
# http://superuser.com/questions/74492/whats-the-best-prefix-escape-sequence-for-screen-or-tmux
# http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
#
@elipapa
elipapa / register_http_repo.sh
Created September 11, 2017 11:02
restore open targets elasticsearch public snapshots
#!/usr/bin/env bash
# assuming your ES is at http://localhost:9200
# set all existing indices to 0 replicas
curl -XPUT "http://localhost:9200/_settings" --data '{"index":{"number_of_replicas": 0}}'
# set marvel index to default 0 replicas
curl -XPUT "http://localhost:9200/_template/custom_marvel" --data '{
"template": ".marvel*",