Skip to content

Instantly share code, notes, and snippets.

View henriquemenezes's full-sized avatar

Henrique Menezes henriquemenezes

  • Recife, Brazil
View GitHub Profile
function http-ping {
SLEEP=${2:-5}
while true; do echo "$(date +'%Y-%m-%d %H:%M:%S') - GET $1 - $(curl -sL -w "%{http_code}" -o /dev/null $1)"; sleep $SLEEP; done
}
@henriquemenezes
henriquemenezes / facebook.md
Last active March 20, 2018 17:09
OAuth Sign-In with Google and Facebook
@henriquemenezes
henriquemenezes / app-api-versioning.md
Created November 11, 2017 18:43
APP and API Versioning, breaking changes updates, etc.

API Request Headers:

GET http://api.example.com/posts
X-App-Ver: 1.2.0

URL Based:

GET /api/v1/xxxx

GET /api/v2/xxxx

@henriquemenezes
henriquemenezes / get_ip.sh
Created September 22, 2016 01:32
Get current IP addresses
#!/bin/sh
IP=""
OS=`uname`
case "${OS}" in
Linux)
IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
;;
FreeBSD|OpenBSD)
@henriquemenezes
henriquemenezes / android-generate-keystores.md
Last active May 2, 2024 21:33
Android: Generate Release/Debug Keystores

Android: Generate Release/Debug Keystores

Generate Keystores

Debug Keystore

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"
@henriquemenezes
henriquemenezes / android-publish.md
Last active May 31, 2016 01:03
Android Publish

Android - Publish Your App

Preparing Your Application for Release

Configuring your application for release

  • At a minimum you need to remove Log calls and remove the android:debuggable attribute from your manifest file.
  • You should also provide values for the android:versionCode and android:versionName attributes, which are located in the <manifest> element.
  • Building and signing a release version of your application.
  • Testing the release version of your application.
@henriquemenezes
henriquemenezes / postgresql-dump-without-scheme.sh
Created May 22, 2016 20:55
PostgreSQL dump without specific Scheme
# Dump all postgres database without specific scheme (-N topology)
pg_dump -N topology -U $DATABASE_USERNAME -h $DATABASE_HOST -f /path/to/output.sql $DATABASE_NAME
@henriquemenezes
henriquemenezes / fixing-problems.md
Last active March 24, 2017 15:44
Fixing problems

Fixing problems

  1. Offending ECDSA key in /Users/Username/.ssh/known_hosts:38
sed -i .bak '38d' ~/.ssh/known_hosts
@henriquemenezes
henriquemenezes / syncing-a-fork.md
Last active April 29, 2016 00:43
Syncing a fork

Syncing a fork

Sync a fork of a repository to keep it up-to-date with the upstream repository.

1. Configuring a remote for a fork

List the current configured remote repository for your fork.

git remote -v
@henriquemenezes
henriquemenezes / ip-default-gw.rb
Created April 1, 2016 14:32
Get default gateway IP in Ruby
gw = `ip route show`[/default.*/][/\d+\.\d+\.\d+\.\d+/]