Skip to content

Instantly share code, notes, and snippets.

@rubencabrera
rubencabrera / mezzanine.patch
Created March 26, 2017 11:35 — forked from melvyn-sopacua/mezzanine.patch
Fix Mezzanine 4.2.2 on Django 1.10+ with modeltranslation
--- ./pages/models.py.orig 2016-09-08 03:02:33.000000000 +0200
+++ ./pages/models.py 2017-01-26 23:26:16.672548649 +0100
@@ -18,6 +18,7 @@
from mezzanine.pages.fields import MenusField
from mezzanine.pages.managers import PageManager
from mezzanine.utils.urls import path_to_slug
+from mezzanine.core.models import wrapped_manager
class BasePage(Orderable, Displayable):
@rubencabrera
rubencabrera / .gitconfig
Created May 4, 2017 10:24
Git config for network on cli
[core]
editor = vim
[alias]
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
@rubencabrera
rubencabrera / gist:6f13911a7abc05355ee285c75b8670ae
Created May 24, 2017 11:42
Validate xml's inside a folder
find -type f -name "*.xml" -exec xmllint --noout {} \;
@rubencabrera
rubencabrera / paises.csv
Created July 14, 2017 08:40 — forked from brenes/README.md
CSV de paises, con nombre en castellano, ingles, codigo ISO y prefijo telefónico del país
nombre name nom iso2 iso3 phone_code
Afganistán Afghanistan Afghanistan AF AFG 93
Albania Albania Albanie AL ALB 355
Alemania Germany Allemagne DE DEU 49
Algeria Algeria Algérie DZ DZA 213
Andorra Andorra Andorra AD AND 376
Angola Angola Angola AO AGO 244
Anguila Anguilla Anguilla AI AIA 1 264
Antártida Antarctica L'Antarctique AQ ATA 672
Antigua y Barbuda Antigua and Barbuda Antigua et Barbuda AG ATG 1 268
@rubencabrera
rubencabrera / .bash_aliases
Created March 31, 2018 23:18
Print kubernetes token (to access dashboard when using proxy)
# Your other aliases go here.
alias kubetoken="kubectl config view | grep -A10 \"name: \$(kubectl config current-context)\" | awk '\$1==\"access-token:\" {print \$2}'"
@rubencabrera
rubencabrera / mis-wallpapers.xml
Last active August 10, 2018 09:58
Gnome slideshow
<?xml version="1.0" ?>
<background>
<static>
<!-- Duration in seconds -->
<duration>120.0</duration>
<file>/home/ruben/Pictures/Wallpapers/file-1.jpg</file>
</static>
<transition>
<!-- Duration of the transition in seconds, default is 2 seconds -->
<duration>0.5</duration>
@rubencabrera
rubencabrera / myip.sh
Created September 4, 2018 09:42
Get public IP from command line
dig +short myip.opendns.com @resolver1.opendns.com
@rubencabrera
rubencabrera / aws-alias.bash
Last active May 9, 2019 08:07
Alias to execute aws from mesosphere container
# AWS CLI docker container
# Needs these env variables for the AWS account:
# AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION
alias aws='docker run --rm -t -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}" -v "$(pwd):/project" mesosphere/aws-cli'
@rubencabrera
rubencabrera / bashrc
Last active July 1, 2019 10:22
Add colored git branch to prompt
function color_my_prompt {
local __user_and_host="\[\033[01;32m\]\u@\h"
local __cur_location="\[\033[01;34m\]\w"
local __git_branch_color="\[\033[31m\]"
#local __git_branch="\`ruby -e \"print (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`"
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`'
local __prompt_tail="\[\033[35m\]$"
local __last_color="\[\033[00m\]"
export PS1="$__user_and_host $__cur_location $__git_branch_color$__git_branch$__prompt_tail$__last_color "
}
@rubencabrera
rubencabrera / keybase.md
Created September 12, 2019 08:17
keybase proof

Keybase proof

I hereby claim:

  • I am rubencabrera on github.
  • I am rubencabrera (https://keybase.io/rubencabrera) on keybase.
  • I have a public key ASBFHV_jM07nR4v6uB649AO6Hj2cG0AmnUuFLfWA81PZzgo

To claim this, I am signing this object: