Skip to content

Instantly share code, notes, and snippets.

View igoralves1's full-sized avatar

Igor Alves igoralves1

View GitHub Profile
@igoralves1
igoralves1 / Buffer Overflow Tutorial in Kali.md
Created August 7, 2017 15:11 — forked from stephen1065/Buffer Overflow Tutorial in Kali.md
Buffer overflow demonstration in Kali Linux, based on the Computerphile video
@igoralves1
igoralves1 / gist:82f15cf6cef170441569f5da51eb3f8d
Last active September 7, 2017 17:32
Get Docker CE for Ubuntu
#https://github.com/tianon/docker-brew-ubuntu-core/blob/a2573609340194bf33712c1fa2dc4de8f9b70ca2/trusty/Dockerfile
Docs @ Docker
https://store.docker.com/images/docker-docs
DevOps Tools
https://store.docker.com/search?category=tools&source=verified&type=image
https://www.lynda.com/Docker-tutorials/Docker-Basics/485649-2.html?utm_source=google&utm_medium=cpc&utm_campaign=l1-US-Search-Dev-Docker-MBM&cid=mbm-docker_basics&utm_content=188694096608&utm_term=%2Bdocker%20%2Bbasics&src=go-pa&veh=skwd-179185467675_pcrid_188694096608_pkw_%2Bdocker%20%2Bbasics_pmt_b_pdv_c_ext__plc__trg__agid_37975019741_cmid_791016461_adp_1t1_net_g&lpk35=9137
Apache and PHP on Docker
https://writing.pupius.co.uk/apache-and-php-on-docker-44faef716150
@igoralves1
igoralves1 / gist:fa314a61c668a00f5d3b1f1fa1e90bc6
Created July 20, 2017 19:39
Validation regex Javascript
function validateRefund(el) {
reg = /^[1-9][0-9]*(\.[0-9]{1,2})?$/;
if (!reg.test(el.value))
return false;
if (parseFloat(el.value) > parseFloat($(el).data('max')) || parseFloat(el.value) <= 0) {
return false;
} else {
return true;
}
//Editor
https://code.visualstudio.com/download
https://code.visualstudio.com/docs?start=true
//Tuto
https://www.youtube.com/watch?v=SbJun7RFLCw
https://firebase.google.com/docs/database/security/quickstart
http://www.tutorialspoint.com/firebase/
@igoralves1
igoralves1 / main.js
Last active June 9, 2017 20:45
NodeJs
//http://thisdavej.com/beginners-guide-to-installing-node-js-on-a-raspberry-pi/
//http://weworkweplay.com/play/raspberry-pi-nodejs/
//https://learn.adafruit.com/node-embedded-development/installing-node-dot-js
//Reading from a Stream
/*
var fs = require("fs");
@igoralves1
igoralves1 / gist:3321a796ba619614cb4e251f4a2fee76
Last active August 3, 2017 15:30
Fazer NginX ler um arquivo que se econtra numa pasta fora da maquina virtual
Temos uma pasta test.com dentro do windows, em uma pasta aa_share
Temos uma maquina virtual ubuntu com NginX com servidor.
O NginX aponta para ~/vhosts.
Dentro de vhosts temos um link simbolico que aponta para ~/media/aa_share/test.com.
Quando tentamos abrir o site test.com recebemos um erro de permission deneid.
Parece que n'ao [e permitido ao nginx accessar o arquivo test.com dentro do arquivo
compratilhado aa_share que se encontra fisicamente dentro do windows.
a solucao que encontrei foi:
@igoralves1
igoralves1 / gist:fd38a6a8dafbb57a79e726b199d072c6
Last active September 18, 2017 17:58
Installing PHP 5.6 on Xenial (16.04) [duplicate]
How do I install different (upgrade or downgrade) PHP version in still supported Ubuntu release?
https://askubuntu.com/questions/109404/how-do-i-install-different-upgrade-or-downgrade-php-version-in-still-supported
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
#check if php5.6 is avaliable
apt list
#Install desired version
@igoralves1
igoralves1 / gist:85c747a1635985d70b0a645265deef42
Created May 24, 2017 14:08
xdebug sem o browser - POSTMAN GET ou POST
https://stackoverflow.com/questions/1531391/launch-xdebug-in-netbeans-on-an-external-request
Go to project properties > run configuration > advanced > debug url and check "Do Not Open web browser" (*).
Do not set the host under debugger proxy. Save these settings. In the project window, on your project:
right mouse click > debug (this starts listening for debug connections).
NO BROWSER IS STARTED.
1-Put the xdebug_break(); inside the code to be debbuged.
2-IF want to test GET, go to a browser or POSTMAN and put the path in the URL:
http://www.mywebsite.com/anysubFolder/myFile.php?XDEBUG_SESSION_START=netbeans-xdebug&id=490062&invoiceID=RG_2d4&hash=I13Dp$variables=youWantToTest.
3-Press enter. IF is postman press SEND btn
@igoralves1
igoralves1 / gist:de93643c078c71c574f2f45fd45a1bf0
Last active August 7, 2017 14:09
SQL => DEFAULT CURRENT_TIMESTAMP => Insert timestamp by default in a Table
/*
Just use the CURRENT_TIMESTAMP as DEFAULT
when creating the table.
In the query we will not need to insert
any date.
That will be automatically inserted by
mysql engine
@igoralves1
igoralves1 / xdebugAndNetBeans_POST
Last active December 14, 2018 21:58
How to debug php-xdebug x NetBeans8.2 x POSTman in an external income request by POST?
#http://stackoverflow.com/questions/1531391/launch-xdebug-in-netbeans-on-an-external-request
#https://xdebug.org/docs/all_settings
#HTTP Debug Sessions -> https://xdebug.org/docs/remote#browser_session
Attach the debugger to any request that comes in, rather just those I launch from within Netbeans?
xdebug.remote_autostart
Type: boolean, Default value: 0
Normally you need to use a specific HTTP GET/POST variable to start remote debugging (see Remote Debugging).
When this setting is set to 1, Xdebug will always attempt to start a remote debugging session and try to