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 / django-apache.conf
Created July 12, 2019 12:41
Apache conf for Django
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
@julianobarbosa
julianobarbosa / import-gz.sh
Created July 7, 2019 14:38
Import sql.gz file to MySQL
zcat myfile.sql.gz | mysql -u root -ppassword mydb
@julianobarbosa
julianobarbosa / import-tar-gz.sh
Created July 7, 2019 14:35
Import a tar.gz file to MySQL
tar xzOf dump.sql.tar.gz | mysql -u $user -p $database

7zip 19.0 7zip.commandline 16.02.0.20170209 7zip.install 19.0 7zip.portable 19.0 ag 2.1.0.1 audacity 2.3.2 autohotkey 1.1.30.03 autohotkey.install 1.1.30.03 autohotkey.portable 1.1.30.03 autohotkey_l 1.1.14.20140119

@julianobarbosa
julianobarbosa / env_gen.py
Created June 26, 2019 13:46
contrib env_gen.py - Create environment variables to use with settings of Django
#!/usr/bin/env python
"""
Django SECRET_KEY generator.
"""
from django.utils.crypto import get_random_string
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
@julianobarbosa
julianobarbosa / profiles.json
Last active September 22, 2019 13:04
Microsoft Open Terminal
{
"globals" :
{
"alwaysShowTabs" : true,
"copyOnSelect" : false,
"defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
./configure --with-features=huge \
--enable-multibyte \
--enable-python3interp=yes \
--with-python3-config-dir=/usr/bin/python3-config \
--enable-gui=gtk2 \
--enable-cscope \
--enable-fail-if-missing \
--prefix=/usr/local
@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