Skip to content

Instantly share code, notes, and snippets.

View raphapr's full-sized avatar

Raphael Ribeiro raphapr

View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDG01jYZ94FrELRA8wyysbF2Y7CPjPQfS7HbgLNyZ5kP02uEmQ0EKMAWKFwWpmydOP8dXJUegGRfO+gq6WjwJcWK4RQgx3muJOhCcqgIa8AW0GwwAseJw0XqZRobRvZ8wQ+D25BaHYV0rnDR3zVRD+kNee+Xt0wYwGJk8TLODKHrigO1pELzAiE3DaivgJRTCYaNapQBLTtXm+SYXVfMLpqpiIC93vZGlesH7ZAieHfr92/6Yb+vpQ9cQk9NUdrkX/wJFnxVhgvt3DsSoRIARFS09lI95VSwGO6QH+pHLUveUSj8glPvWX56VyPlTcnbwQ66O2YiWqsqIHGlCQsL+J7 raphael@darkstar
@raphapr
raphapr / ldap_send_metrics.sh
Last active July 29, 2017 01:57
Sends LDAP (389 DS) metrics to Librato
#!/bin/bash
# It sends LDAP (389 DS) metrics to Librato
# Install shellbrato:
# git clone https://github.com/djosephsen/shellbrato.git
# sudo cp -a shellbrato /opt
source /opt/shellbrato/shellbrato.sh
#!/bin/bash
apt-get update
apt-get upgrade -y
apt-get install -y tmux
wget bit.ly/rprtmux
mv rprtmux ~/.tmux.conf
@raphapr
raphapr / .cvimrc
Last active February 18, 2017 17:09
set noautofocus
let barposition = "bottom"
let blacklists = ["https://mail.google.com/*", "https://docs.google.com/*", "https//feedly.com/*"]
let mapleader = ","
map d :quit<CR>
@raphapr
raphapr / horizontal_scaling.md
Created February 18, 2017 02:12 — forked from lucasuyezu/horizontal_scaling.md
Escalabilidade Horizontal

Escalabilidade Horizontal

##O que é O jargão do momento é o Cloud. A nuvem. Pessoas diferentes, empresas diferentes, produtos diferentes possuem definições diferentes do que é o cloud, de onde começa, onde termina. Diferente do "Cloud", uma definição que todos parecem entender logo de cara é o conceito de escalabilidade. É um conceito bem simples de entender, e difícil de aplicar. Quanto mais escalabilidade, mais chances você tem de crescer e agüentar a carga que vem junto. Sem escalabilidade, você pode ser pego de calças curtas e não dar conta de todo mundo que quer acessar o seu conteúdo, ou consumir o seu produto ou serviço.

##Por quê? Todos nós fazemos software querendo que ele faça sucesso. Mas esse sucesso implica em uma multidão de pessoas acessando o seu site. E essa multidão de acessos pode ser pré-determinada (você aparece em algum programa de TV ou na home de um portal) ou de repente (você viraliza). Independente da forma, ter um site escalável é a diferença entre se estabelecer de vez ou quebr

#! /bin/bash
########################################
# Check if script already running
lf=/tmp/battery_warning.pidlock
# create empty lock file if none exists
touch $lf
read lastPID < $lf
# if lastPID is not null and a process with that pid exists , exit
using PyPlot
font_size = 13
data = readcsv("output.csv")
data = map(Float64,data[1:size(data,1) .!= 1,: ])
boxplot(data)
ylabel("Execution time (seconds)", fontsize = font_size*1.25)
xlabel("Tasks", fontsize = font_size*1.25)
grid("on")
Section "InputClass"
Identifier "Dell Touchpad"
Driver "synaptics"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Option "TapButton1" "1"
Option "TapButton2" "2"
Option "TapButton3" "3"
Option "VertEdgeScroll" "0"
Option "VertTwoFingerScroll" "1"
@raphapr
raphapr / PG::Error: ERROR: new encoding (UTF8) is incompatible
Created December 20, 2016 05:16 — forked from amolkhanorkar/PG::Error: ERROR: new encoding (UTF8) is incompatible
Postgres PG::Error: ERROR: new encoding (UTF8) is incompatible
======= Prolbem =================================================================================================================
I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute:
rake db:create , command I get:
PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.
: CREATE DATABASE "my_db_name" ENCODING = 'unicode'.......
bin/rake:16:in `load'
[Unit]
Description=Starts i3lock at suspend time
Before=sleep.target
[Service]
User=raphael
Type=forking
Environment=DISPLAY=:0
ExecStartPre=
ExecStart=/usr/bin/xflock4