Skip to content

Instantly share code, notes, and snippets.

View h3nr1ke's full-sized avatar
🤔
Should I?

H3NR1KE h3nr1ke

🤔
Should I?
View GitHub Profile
@h3nr1ke
h3nr1ke / android_home.sh
Created May 29, 2018 17:09
Add android_home variable
#add this code to your .bash_profile
#------
export ANDROID_SDK_ROOT='/Users/<YOURUSER>/Library/Android/sdk'
export PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/tools/lib/x86_644
#------
@h3nr1ke
h3nr1ke / PPK2PEM.sh
Created May 23, 2018 02:57
Convert ppk to pem
# mac
brew install putty
#linux
apt-get install putty-tools
puttygen keybase.ppk -O private-openssh -o output.pem
#connect
ssh -i output.pem user@your.server.com
@h3nr1ke
h3nr1ke / nginx_tips.txt
Created May 2, 2018 00:48
Useful tips for nginx configuration
# -- UBUNTU + PHP7 + NGINX
# -- must add it to you pgp location
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; #replace if already there...
# -- must to check the listen path to php fpm sock is this file
nano /etc/php/7.0/fpm/pool.d/www.conf
# -- search for "listen = ", this path must be
/var/run/php/php7.0-fpm.sock
@h3nr1ke
h3nr1ke / certbot.sh
Last active March 26, 2018 22:17
certbot error...
#---- renew ssl when you get the error
#---- Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.
certbot --authenticator standalone --installer apache -d <domain> --pre-hook "systemctl stop apache2" --post-hook "systemctl start apache2"
@h3nr1ke
h3nr1ke / fix_android_err_spawn.sh
Created February 21, 2018 10:13
Fix Error: spawn EACCES when running cordova build android
# run it from your project folder
# based on this link
# https://github.com/ionic-team/ionic-cli/issues/2835
# erroroccurs when run...
cordova build android
# ANDROID_HOME=/usr/local/Caskroom/android-platform-tools/27.0.1
# JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
# Error: spawn EACCES
@h3nr1ke
h3nr1ke / compress_command_line.sh
Created February 15, 2018 17:32
Install and use compress tool ubuntu
#install
sudo apt-get install yui-compressor
#to use, js and css files only
yui-compressor /path/to/file -o /path/to/new/file
@h3nr1ke
h3nr1ke / resultado-falha.sh
Created February 15, 2018 12:40
resultado do teste automático com falha
$ mocha
Teste API magicthegathering.io
1) Deve receber 100 cartas
√ Deve receber a carta 'A Indiferente' (414ms)
1 passing (2s)
1 failing
@h3nr1ke
h3nr1ke / resultado.sh
Created February 15, 2018 12:39
resultado do teste autoático da URL
$ mocha
Teste API magicthegathering.io
√ Deve receber 100 cartas (1468ms)
√ Deve receber a carta 'A Indiferente' (351ms)
2 passing (2s)
@h3nr1ke
h3nr1ke / cards.spec.js
Last active April 15, 2019 18:29
Arquivo exemplo de teste automático, projeto no github https://github.com/h3nr1ke/teste_api
/**
* Arquivo exemplo para teste de api
* A API utilizada neste projeto eh
* @see https://magicthegathering.io/
*
* Este exemplo faz parte de um post no medium
* @see https://medium.com/@hdeodato/teste-autom%C3%A1tico-de-api-rest-usando-com-node-js-mocha-chai-6aec4613d100
*
* @author Henrique Deodato
* @see twitter.com/hdeodato
@h3nr1ke
h3nr1ke / package.json
Last active February 15, 2018 10:55
Package.json
{
"name": "teste_api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"