Skip to content

Instantly share code, notes, and snippets.

View lsdr's full-sized avatar

Luiz Rocha lsdr

  • São Paulo, Brazil
  • 15:51 (UTC -03:00)
View GitHub Profile
@lsdr
lsdr / saints-louis-and-paulo.txt
Created August 29, 2012 11:15
Stupid comparison between St. Louis/MO and São Paulo/SP
St. Louis São Paulo
========================================================================
where? Missouri, EUA São Paulo, Brasil
http://goo.gl/maps/g15x7 http://goo.gl/maps/Hf6Jj
population (2011) 318.069 11.316.149
area (km2) 171.3 1.522.986
founded 1764 1544
elevation (m) 142 760
time zone UTC-6 UTC-3
@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 / 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
"""
@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
@lsdr
lsdr / my_python_env.sh
Last active September 28, 2021 21:40
requirements.txt and a quick sh script to bootstrap my core virtualenv
#!/bin/sh
# assumptions:
# * virtualenv is avaliable and working
# * virtualenvs go to ~/.pvm
export PIP_REQUIRE_VIRTUALENV=true
export PIP_RESPECT_VIRTUALENV=true
export VIRTUALENV_DISTRIBUTE=true
cd ~; mkdir -p ~/.pvm/core
virtualenv --python=/usr/bin/python --clear --no-site-packages --distribute ~/.pvm/core
@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 / 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)
brew install openblas;
brew info qrupdate --with-openblas;
brew install suite-sparse --with-openblas;
brew install fltk;
brew install octave --with-openblas --with-fltk
@lsdr
lsdr / windows-vm-box
Created May 12, 2014 17:34
sometimes a windows vm box is quite useful
# IE10 - Win8
curl -O "https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/OSX/IE10_Win8/IE10.Win8.For.MacVirtualBox.part{1.sfx,2.rar,3.rar}"
@lsdr
lsdr / tunemac.sh
Last active August 29, 2015 14:11
mac osx tunning script (yosemite version)
# Shamelessly stolen from fnando:
# https://github.com/fnando/dotfiles/blob/master/files/.bash/macosx.sh
#
# Disable menu bar transparency
#defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
# Show remaining battery time; hide percentage
#defaults write com.apple.menuextra.battery ShowPercent -string "NO"
#defaults write com.apple.menuextra.battery ShowTime -string "YES"