Skip to content

Instantly share code, notes, and snippets.

View julianobarbosa's full-sized avatar
💭
I may be slow to respond.

Juliano Barbosa julianobarbosa

💭
I may be slow to respond.
View GitHub Profile
@julianobarbosa
julianobarbosa / 256 colors.md
Created July 21, 2019 16:50 — forked from limingjie/256 colors.md
256 colors in putty, tmux/screen and vim

#256 colors in putty, tmux/screen and vim There is a detailed answer on stackoverflow. If you are looking for a short one, here it is.

  • putty

    Set Connection -> Data -> Terminal-type string to xterm-256color

  • tmux

Add this line to ~/.tmux.conf

@julianobarbosa
julianobarbosa / grafana-dashboard-exporter
Created January 22, 2019 18:26 — forked from crisidev/grafana-dashboard-exporter
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@julianobarbosa
julianobarbosa / how_to_install_tmux_on_centos
Created April 7, 2017 14:59 — forked from ekiara/how_to_install_tmux_on_centos
HOW TO: Install tmux on Centos release 6.5
# Install tmux on Centos release 6.5
# http://superuser.com/questions/738829/attempting-to-install-tmux-on-centos-6-4-or-centos-6-5-fails-with-error-evbuff
#
# READ THIS FIRST!!!
# MAKE SURE YOU HAVE BUILD TOOLS/COMPILERS TO BUILD STUFF FROM SOURCES
# yum groupinstall "Development Tools"
# CD TO TEMPORARY DIRECTORY
@julianobarbosa
julianobarbosa / update-dnsdynamic.sh
Created December 16, 2016 15:26 — forked from Mic92/update-dnsdynamic.sh
Update Public Ip on dnsdynamic.com
#!/bin/sh
# EDIT this
[email protected]
PASSWORD=yoursecret
DOMAIN=example.dnsd.me
IP=`curl --silent http://myip.dnsdynamic.com/`
curl --silent --user "$EMAIL:$PASSWORD" -k "https://www.dnsdynamic.org/api/?hostname=$DOMAIN&myip=$IP"
@julianobarbosa
julianobarbosa / opkg-upgrade-all
Created December 15, 2016 16:37 — forked from WebReflection/opkg-upgrade-all
A simple way to upgrade all packages in an Open WRT distribution
#!/usr/bin/env sh
for p in $(opkg list-upgradable); do
if [ "$p" != "-" ]; then
if [ "$(echo ${p:0:1} | sed -e 's/[0-9]//')" != "" ]; then
echo "upgrading $p"
opkg upgrade $p
fi
fi
done
@julianobarbosa
julianobarbosa / zabbix-alert-smtp.sh
Created November 20, 2016 18:20 — forked from superdaigo/zabbix-alert-smtp.sh
Zabbix SMTP Alert script for gmail
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Zabbix SMTP Alert script for gmail.
"""
import sys
import smtplib
from email.MIMEText import MIMEText
from email.Header import Header
@julianobarbosa
julianobarbosa / ubuntu_agnoster_install.md
Created September 22, 2016 02:58 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 14.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH