Skip to content

Instantly share code, notes, and snippets.

@juanique
juanique / ubuntu-config.sh
Last active September 29, 2015 17:58
Script to run just after installing ubuntu.
#!/bin/bash
sudo apt-get install -y git-core curl screen vim-nox zsh fonts-inconsolata tree mercurial git-core python-pip python-virtualenv
# Ruby
\curl -sSL https://get.rvm.io | bash -s stable --ruby
gem install json jsonpretty ncurses-term meld rake
#github key
rm -rf ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
from django import template
import unicodedata
register = template.Library()
def stripaccents(value, arg=""):
if type(value) == str:
return value
return ''.join((c for c in unicodedata.normalize('NFD', value) if unicodedata.category(c) != 'Mn'))
@juanique
juanique / git-add-key.sh
Last active November 2, 2024 05:49
Bash script to add a new SSH key to your GitHub account
rm -rf ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
read -p "Enter github email : " email
echo "Using email $email"
ssh-keygen -t rsa -b 4096 -C "$email"
ssh-add ~/.ssh/id_rsa
pub=`cat ~/.ssh/id_rsa.pub`
read -p "Enter github username: " githubuser
echo "Using username $githubuser"
read -s -p "Enter github password for user $githubuser: " githubpass
curl -u "$githubuser:$githubpass" -X POST -d "{\"title\":\"`hostname`\",\"key\":\"$pub\"}" https://api.github.com/user/keys
@juanique
juanique / colors.sh
Created September 12, 2013 06:04
Terminal color test
#!/bin/bash
RESTORE='\033[0m'
RED='\033[00;31m'
GREEN='\033[00;32m'
YELLOW='\033[00;33m'
BLUE='\033[00;34m'
PURPLE='\033[00;35m'
CYAN='\033[00;36m'
LIGHTGRAY='\033[00;37m'
@juanique
juanique / hotslogs_recent.js
Last active April 25, 2018 17:26
Most played heroes in recent games
var heroesCount = {};
var rows = document.querySelector('.rgMasterTable ').children[2].children;
for (let i = 0; i < rows.length; i++) {
row = rows[i];
let heroName = row.children[4].innerText;
heroesCount[heroName] = heroesCount[heroName] || 0;
heroesCount[heroName] += 1;
}
# make CTRL+a the 'prefix' ala screen.
bind C-a send-prefix
set -g prefix C-a
# get rid of the tmux standard of CTRL+b
unbind C-b
set -s escape-time 1
set -g base-index 1
setw -g pane-base-index 1
# make it easy to reload the config (CTRL+r)
# make CTRL+a the 'prefix' ala screen.
bind C-a send-prefix
set -g prefix C-a
# get rid of the tmux standard of CTRL+b
unbind C-b
set -s escape-time 1
set -g base-index 1
setw -g pane-base-index 1
# make it easy to reload the config (CTRL+r)