Skip to content

Instantly share code, notes, and snippets.

View lsdr's full-sized avatar

Luiz Rocha lsdr

  • São Paulo, Brazil
  • 17:36 (UTC -03:00)
View GitHub Profile
@lsdr
lsdr / net-sec-cheatsheet.sh
Last active July 29, 2018 19:05
unix sec-related cheatsheet
# references
# https://www.thegeekstuff.com/2012/08/lsof-command-examples/
# list open network files
sudo lsof -PiTCP -sTCP:LISTEN
# list files opened by a process
lsof -c ssh
@lsdr
lsdr / ibge.sh
Last active June 1, 2018 13:05
Carregando dados do IBGE no PostGIS
# download dos shapefiles do IBGE
curl -s 'ftp://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_municipais/municipio_2016/Brasil/BR/BR.zip' -o BR.zip
# abrir o pacote
unzip -j BR.zip
# instala o postgresql e o postgis
brew install postgis
# inicia o postgresql
@lsdr
lsdr / neovim-setup.md
Created February 2, 2016 11:58 — forked from adamzaninovich/neovim-setup.md
How to get an awesome neovim setup that runs tests asynchronously in a neoterm split

How to get an awesome neovim setup that runs tests asynchronously in a neoterm split

Example

Installing neovim

brew install neovim/neovim/neovim
@lsdr
lsdr / palindromic_primes.rb
Created March 3, 2018 20:53
Random code challenge scripts and stuff like that
# Enter your code here. Read input from STDIN. Print output to STDOUT
require 'prime'
def ppn(n)
Prime.each(Float::INFINITY).lazy.select do |p|
p if p.to_s == p.to_s.reverse
end.first(n.to_i)
end
@lsdr
lsdr / login.py
Created November 12, 2012 04:34
tweaked out version of simplegeo/oauth2 3-way auth adapted to Y! Sports API
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
simplegeo/python-oauth2 basic 3-legged example adapted to Y! Sports OAuth API
references:
https://github.com/simplegeo/python-oauth2#twitter-three-legged-oauth-example
https://github.com/simplegeo/python-oauth2/issues/10
http://stackoverflow.com/questions/4026759/problems-with-python-oauth2-and-yahoos-fantasy-sports-api
"""

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.


Effective Engineer - Notes

What's an Effective Engineer?

@lsdr
lsdr / config.js
Created April 12, 2017 19:00
Gaveteiro CKEditor Config
// CKEditor configuration - Gaveteiro
// referencia: http://docs.ckeditor.com/#!/api/CKEDITOR.config
// https://github.com/galetahub/ckeditor#customize-ckeditor
CKEDITOR.editorConfig = function( config )
{
config.language = 'pt-br';
config.height = 250;
config.allowedContent = true;
@lsdr
lsdr / Vagrantfile
Last active February 8, 2016 19:24
# My helpers
#
def fwd_ports(config, ports=[])
Array[*ports].each do |port|
config.vm.network :forwarded_port, guest: port, host: port
end
end
def share_folder(config, source, destiny)
if File.directory? File.expand_path(source)
@lsdr
lsdr / rbenv-install-cmdline.sh
Last active December 22, 2015 15:09
Scripts and stuff that helped me migrate from rvm to rbenv
#!/bin/sh
# CFLAGS="-arch x86_64 -g -O2" CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install 2.0.0-p247
__install_ruby () {
local CFLAGS='-arch x86_64 -g -O2'
local READLINE=`brew --prefix readline`
local OPENSSL=`brew --prefix openssl`
if [ -d "$READLINE" ]; then
@lsdr
lsdr / es.sh
Last active December 14, 2015 16:48 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk -y
curl -XGET -L https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.5.tar.gz -o elasticsearch-0.20.5.tar.gz
tar -xf elasticsearch-0.20.5.tar.gz
mv elasticsearch-0.20.5 elasticsearch
sudo mv elasticsearch /usr/local/share