Skip to content

Instantly share code, notes, and snippets.

View gustavohenrique's full-sized avatar

Gustavo Henrique gustavohenrique

View GitHub Profile
@gustavohenrique
gustavohenrique / telnet-imap
Created June 6, 2013 14:00
playing with gmail via telnet
openssl s_client -crlf -connect imap.gmail.com:993
tag login [email protected] passwordhere
tag list "" "*"
tag select "inbox"
tag fetch 1:3 body[header]
tag fetch 3 body[header]
tag fetch 3 body[text]
tag fetch 2 all
tag fetch 2 fast
tag fetch 2 full
@gustavohenrique
gustavohenrique / soap-curl-shell
Created June 11, 2013 19:24
SOAP request using curl
# request.xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wst="http://sensedia.com/repository/wstoolkit">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1">
<wsse:Username>system</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">manager</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">DWk64SMfJ6RxHAKgPRGtPA==</wsse:Nonce>
<wsu:Created>2013-04-17T18:36:54.013Z</wsu:Created>
</wsse:UsernameToken>
@gustavohenrique
gustavohenrique / send-email-to-facebook-users
Created July 9, 2013 23:21
This script will allow you to send Messages to people who have a username on facebook from an email id you specify in the script.Although message will not be sent to their inbox,if you're not a friend but it will be sent to other category.
#usr/bin/env/python
"""
This script can get the user data from facebook.com.
This is written for better understanding of python
Modules required:BeautifulSoup
Author:Ajay Kumar Medepalli aka Cybercam
Blog:http://pythonnotesbyajay.blogspot.in/
"""
import smtplib
git config --global alias.lg=log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
@gustavohenrique
gustavohenrique / tsuru_completion
Last active December 22, 2015 20:09
Bash completion for tsuru command
_command() {
local current=${COMP_WORDS[COMP_CWORD]}
local tasks=`tsuru | egrep "^[ ]" | awk -F ' ' '{print $1}'`
COMPREPLY=( $(compgen -W "$tasks" $current) )
}
complete -F _command tsuru
brew install bzr
download go package http://code.google.com/p/go/downloads/list?q=OpSys-OSX+Type-Installer
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
go get github.com/globocom/tsuru/cmd/tsuru
go get github.com/globocom/tsuru/cmd/tsuru-admin
go get github.com/globocom/tsuru/cmd/crane
@gustavohenrique
gustavohenrique / mount-iso-osx
Created October 12, 2013 03:12
Mount an ISO image on Mac OS X Mountain Lion
sudo hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount "example.iso"
sudo diskutil mount /dev/diskDevice
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1
network={
# Set scan_ssid=1 if the access point is hidden.
scan_ssid=0
proto=WPA RSN
key_mgmt=WPA-PSK
@gustavohenrique
gustavohenrique / elementaryos-postinstall
Created October 31, 2013 14:54
Post installation of Elementary OS
First update:
sudo apt-get update && sudo apt-get upgrade
Kernel updates:
sudo apt-get install linux-generic-lts-raring
Essential:
sudo apt-get install build-essential ubuntu-restrict-extras devede winff k3b libavformat-extra-53 libavcodec-extra-53 tomboy vlc audience etube foto gazette faac faad ffmpeg ffmpeg2theora flac icedax id3v2 lame libflac++6 libjpeg-progs libmpeg3-1 mencoder mjpegtools mp3gain mpeg2dec mpeg3-utils mpegdemux mpg123 mpg321 regionset sox uudeview vorbis-tools x264 dconf-editor dconf-tools wingpanel-slim soundconverter gstreamer0.8-plugins gstreamer0.8-mad gstreamer0.8-lame gwenview pinta indicator-synapse vim-gtk tree aria2 links2 gimp unzip msttcorefonts openjdk-6-jdk
Developer:
@gustavohenrique
gustavohenrique / custom-jenkins-gui
Created November 14, 2013 11:11
Steps to customize the Jenkins graphical user interface
# Login
core/src/main/resources/jenkins/model/Jenkins/login.jelly
# Main page
core/src/main/resources/lib/layout/layout.jelly
core/src/main/resources/hudson/views/BuildButtonColumn/column.jelly
core/src/main/resources/lib/hudson/iconSize.jelly
core/src/main/resources/lib/hudson/rssBar.jelly
# Build