Skip to content

Instantly share code, notes, and snippets.

View thblckjkr's full-sized avatar
🎯
Focusing

Teo Gonzalez thblckjkr

🎯
Focusing
View GitHub Profile
@thblckjkr
thblckjkr / affine.js
Created February 1, 2019 01:55
JavaScript algorithm to cipher/decipher text with the affine method
/**
* Affine Cipher Class.
*
* Class to cipher text using the affine method.
*
* @version 0.0.1
* @file This files defines the AffineCipher class.
* @author Teo Gonzalez Calzada [thblckjkr].
*/
@thblckjkr
thblckjkr / directoryparse.js
Last active February 24, 2019 21:51
Creates an object from a html string obtained from an index of apache directory. Translates an APACHE default directory listing, to javascript object.
/**
* Requires JQuery >= 1.8
* @param {info} str string-based data of the
* Author: @thblckjkr | Theo G
* Ported to JQuery from https://github.com/juliangruber/parse-apache-directory-index
* Usage:
* $.get("/a/directory/path", function(data, status){
* var files = directoryparse(data);
* console.log(files);
* })
@thblckjkr
thblckjkr / simple_backup.sh
Created September 10, 2018 06:00
A really simple backup of webserver, including mysql, mongodb and code
#! /bin/bash
# You need to execute this bash file on tmux, to have an easy way to see the output
# then, just execute the script and have a daily report of the status
#
# Default ouput on $path/log.md can be readed by markdown and by a human
#
# Maybe you'll need to do some modifications
# Autor: Teo Gonzalez Calzada @thblckjkr
# Global variables
@thblckjkr
thblckjkr / tmux-cheatsheet.markdown
Created February 13, 2018 05:56 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@thblckjkr
thblckjkr / index.js
Created January 24, 2018 05:13
Simply get on NodeJS
var options = {
host: this.blackbox.ip,
port: this.blackbox.port,
path: '/alive',
method: 'GET',
headers: {
'Accept': 'application/json',
'Accept-Encoding': 'gzip,deflate,sdch',
'Accept-Language': 'en-US,en;q=0.8'
}
/*
* Reloader for any page
*
* Dependences:
* JQuery (?)
*
* Author: [thblckjkr]
*/
var Reloader = function (options) {
this.timeToReload = 45; // Time to reload the page (in seconds)
@thblckjkr
thblckjkr / gist:15497cd6f000652163511b3b03850d47
Last active January 19, 2018 23:29
Prevent proxy on apt-get
Prevent proxy on APT-get
sudo apt-get -o Acquire::http::proxy=false
Prevent Proxy on NPM
npm config rm proxy
npm config rm https-proxy
npm update --noproxy