Skip to content

Instantly share code, notes, and snippets.

Avatar

Jorge Y. C. Rodriguez coquer

View GitHub Profile
View telemetry windows
0.0.0.0 a-0001.a-msedge.net
0.0.0.0 bingads.microsoft.com
0.0.0.0 choice.microsoft.com
0.0.0.0 choice.microsoft.com.nsatc.net
0.0.0.0 compatexchange.cloudapp.net
0.0.0.0 corp.sts.microsoft.com
0.0.0.0 corpext.msitadfs.glbdns2.microsoft.com
0.0.0.0 cs1.wpc.v0cdn.net
0.0.0.0 df.telemetry.microsoft.com
0.0.0.0 diagnostics.support.microsoft.com
View gist:c85b7c3361d8c1060ebbe181e27b11bc
### Keybase proof
I hereby claim:
* I am jycr753 on github.
* I am jycr753 (https://keybase.io/jycr753) on keybase.
* I have a public key ASC54-K19eHSCmiWCMSY90fbyDLbGs-JtjRCrXYuM84RYwo
To claim this, I am signing this object:
View jpgTOtxt.py
from PIL import Image
from bisect import bisect
def main():
gscale = {8:'@', 7:'#', 6:'£', 5:'=', 4: '+', 3: '|', 2: ':', 1: '.', 0: ' '}
bounds = [32,64,96,128,160,192,224]
txt = ""
jpegFilename = input('enter jpg file path: ')
View Apache Server.sh
Launch Amazon Linux T2 Micro or T2 Nano instance
- Defaults are mostly good, Except select http and admin security groups
SSH:
ssh -i key.pem ec2-user@1.2.3.4
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html
sudo yum update -y
@coquer
coquer / tor_detect.php
Created Feb 25, 2016
Simple way to detect Tor exit node using laravel 5.2 and PHP 7.0
View tor_detect.php
/**
* Detect if current User is using tor network
* @return bool
*/
public static function detectIfTorNetwork(): bool {
return ( gethostbyname(
self::reverseIPOctets( getenv( 'REMOTE_ADDR' ) ) . "." .
getenv( 'SERVER_PORT' ) . "." .
self::reverseIPOctets( getenv( 'SERVER_ADDR' ) ) .
".ip-port.exitlist.torproject.org" ) == "127.0.0.2" ? true : false
View cpr_maker.php
<?php
function validate_cpr_number( $cpr ) {
if ( empty( $cpr ) ) {
return false;
}
$cpr = str_split( $cpr );
$main_int = 0;
$x = 0;
$factors = [ 4, 3, 2, 7, 6, 5, 4, 3, 2, 1 ];
foreach ( $cpr as $cpr_single_number ) {
View cpr_maker.php
<?php
function validate_cpr_number( $cpr ) {
if ( empty( $cpr ) ) {
return false;
}
$cpr = str_split( $cpr );
$main_int = 0;
$x = 0;
$factors = [ 4, 3, 2, 7, 6, 5, 4, 3, 2, 1 ];
foreach ( $cpr as $cpr_single_number ) {
View simple_table_to_cvs.php
<?php
class EmailImporter {
private $database = "xxx";
private $server = "xx.xx.com";
private $pass = "xxxx";
private $username = "xxx";
public function __contruct(){
echo("Loading ..... \n");
@coquer
coquer / validate_cpr.php
Last active Mar 14, 2020
Validate danish CPR using PHP
View validate_cpr.php
/**
* Internally validate CPR numbers
* CPR nummer skal udfyldes i rækkefølgen dag-måned-år. Er du f.eks.
* født 2. januar 1965, skal du skrive: 020165. Derudover skal du indtaste
* de sidste 4 cifre i dit cpr. nr. Du skal være fyldt 18 år for at oprette dig som kunde.
* Kontroller venligst oplysningerne en ekstra gang før du fortsætter til næste trin.
* @param $cpr
* @return bool
*/
function validate_cpr_number( $cpr ) {
@coquer
coquer / conentModel.php
Last active Sep 17, 2015
Mixing multidimensional array into one.
View conentModel.php
public function getAllDataForACompany($company_reg_name){
$data = [];
$connection = new mysqli( self::DB_HOST, self::DB_USER, self::DB_PASSWORD, self::DB_NAME );
if ( $connection ) {
if ( $result = $connection->query( "SELECT * FROM APITester WHERE registerd_company_name = '$company_reg_name'", MYSQLI_USE_RESULT ) ) {
$data['registerd_company_name'] = $company_reg_name;
$registration_numbers = [];
$catgeories = [];
$company_classes = [];