Skip to content

Instantly share code, notes, and snippets.

View hersoncruz's full-sized avatar
🌊
Working from home

Herson hersoncruz

🌊
Working from home
View GitHub Profile
@hersoncruz
hersoncruz / auth_token_client_example.py
Last active April 7, 2021 21:39
auth_token client example
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
import crypt
import time
def index(request):
return HttpResponse("<a href='/sso/go/'>Go to LMS</a>")
def go(request):
secret_salt = 'AUTH_TOKEN_SALT'
@hersoncruz
hersoncruz / isDui.js
Created February 2, 2021 21:12 — forked from gmelendezcr/isDui.js
Verificacion DUI
/*
DUI = 00016297-5
Posiciones -> 9 8 7 6 5 4 3 2
DUI -> 0 0 0 1 6 2 9 7
DV = 5
sum: (9*0) + (8*0) + (7*0) + (6*1) + (5*6) + (4*2) + (3*9) + (2*7) = 85
residuo: (85 % 10) = 5
resta: 10 - residuo = 5
@hersoncruz
hersoncruz / README.md
Created July 24, 2020 14:51 — forked from weakish/README.md
gister -- a #shell script to access http://gist.github.com #gist
@hersoncruz
hersoncruz / .vimrc
Last active July 24, 2020 22:55
my ~/.vimrc
" Configuration file for vim
set modelines=0 " CVE-2007-2438
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=2 " more powerful backspacing
" Don't write backup file if vim is being called by "crontab -e"
@hersoncruz
hersoncruz / github_post_recieve.php
Created October 28, 2016 15:14 — forked from cowboy/github_post_recieve.php
GitHub PHP webhook to auto-pull on repo push
<?php
// Use in the "Post-Receive URLs" section of your GitHub repo.
if ( $_POST['payload'] ) {
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' );
}
?>hi
@hersoncruz
hersoncruz / ec2_instance_create_and_setup.sh
Created October 18, 2016 16:03 — forked from Pablosan/ec2_instance_create_and_setup.sh
A bash script that will set up a new EC2 instance and ssh into it.
#!/bin/bash
# Authorize TCP, SSH & ICMP for default Security Group
#ec2-authorize default -P icmp -t -1:-1 -s 0.0.0.0/0
#ec2-authorize default -P tcp -p 22 -s 0.0.0.0/0
# The Static IP Address for this instance:
IP_ADDRESS=$(cat ~/.ec2/ip_address)
# Create new t1.micro instance using ami-cef405a7 (64 bit Ubuntu Server 10.10 Maverick Meerkat)
@hersoncruz
hersoncruz / debian-install-php-phalcon.sh
Created August 15, 2016 17:09
Install PHP Phalcon on Debian(8) from the ubuntu ppa sources
#!/bin/bash
#
not_root() {
echo "ERROR: You have to be root to execute this script"
exit 1
}
# Check if user is root
[ $EUID != 0 ] && not_root