Skip to content

Instantly share code, notes, and snippets.

View ricardocabral's full-sized avatar

Ricardo Niederberger Cabral ricardocabral

View GitHub Profile
@ricardocabral
ricardocabral / google_ips.sh
Created April 17, 2020 21:47
Prints all current Google Cloud public egress IPs
#!/bin/bash
# https://cloud.google.com/compute/docs/faq#find_ip_range
# nslookup -q=TXT _cloud-netblocks.googleusercontent.com 8.8.8.8
myarray=()
for LINE in `dig txt _cloud-netblocks.googleusercontent.com +short | tr " " "\n" | grep include | cut -f 2 -d :`
do
myarray+=($LINE)
for LINE2 in `dig txt $LINE +short | tr " " "\n" | grep include | cut -f 2 -d :`
@ricardocabral
ricardocabral / GIF-Screencast-OSX.md
Last active September 4, 2018 13:00 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Installation

The conversion process requires the following command-line tools:

  • ffmpeg to process the video file
  • gifsicle to create and optimize the an animated gif
@ricardocabral
ricardocabral / trigger-travis.sh
Last active August 17, 2020 08:24
trigger a downstream travis build
#!/bin/bash
## brief: trigger a downstream travis build
## see: travis API documentation
## forked from https://raw.githubusercontent.com/stephanmg/travis-dependent-builds/master/trigger-travis.sh
# variables
USER=$1
REPO=$2
TRAVIS_ACCESS_TOKEN=$3
BRANCH=$4
@ricardocabral
ricardocabral / sync_lftp_local_to_remote.sh
Last active May 22, 2023 07:48
sync_lftp_local_to_remote
#!/bin/bash
# Credentials
## inspired by: https://github.com/guttertec/lftp-sync/blob/master/sync.sh
## inspired by: http://www.torrent-invites.com/showthread.php?t=132965&s=a5f6146c4e37fbcce4529ecd93c1989e
## inspired by: http://sourceserver.info/wiki/tutorial/root/abgleich_ftp
## lftp manpage: http://lftp.yar.ru/lftp-man.html
# Check if sync.cfg can be found and no parameters are missing
if [ ! sync.cfg ]; then echo "sync.cfg could not be found."; exit; fi
@ricardocabral
ricardocabral / Package Control.sublime-settings
Last active April 30, 2018 16:05
Package Control. To update go to Preferences -> Package Settings -> Package Control -> Settings-User
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"1337 Color Scheme",
"Advanced CSV",
"AlignTab",
@ricardocabral
ricardocabral / remote_install_zsh.sh
Created October 2, 2016 21:48
Install Zsh and theme on remote servers
sudo su
apt-get install zsh -y && curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
wget https://gist.github.com/ricardocabral/0d431a9b78363b9457363df72f047eef/raw/219b0dabb56662a56ff749ae1c3e7020c0051001/mitsuhiko.zsh-theme -P ~/.oh-my-zsh/themes
sed -ri 's/robbyrussell/mitsuhiko/' ~/.zshrc
@ricardocabral
ricardocabral / mitsuhiko.zsh-theme
Created October 2, 2016 21:01
mitsuhiko theme with current timestamp
setopt prompt_subst
export LSCOLORS=ExGxFxDxCxHxHxCbCeEbEb
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[blue]%}git%{$reset_color%}:"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}+"
ZSH_THEME_GIT_PROMPT_BRANCH=""
ZSH_THEME_GIT_PROMPT_SEPARATOR=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
@ricardocabral
ricardocabral / trello_json_to_xls.py
Created September 2, 2016 14:38
Convert the JSON file exported by Trello into Excel
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson, pandas
data = simplejson.loads(open('f877UwgO.json').read())
data2=[]
to_del = ['attachments',
'badges',
'checkItemStates',
### Keybase proof
I hereby claim:
* I am ricardocabral on github.
* I am rnc (https://keybase.io/rnc) on keybase.
* I have a public key whose fingerprint is 5303 9C33 32DD 4511 9CA0 5BFA E716 5CA3 7560 D35C
To claim this, I am signing this object: