View sshsrv-proxy-command.sh
#!/bin/bash | |
target_host=$1 | |
if [ ! -z "$2" ];then | |
target_port=$2 | |
else | |
target_port="22" | |
fi |
View ngrok-daemon.sh
#!/bin/bash | |
# /etc/init.d/ngrok | |
# Thanks Marcos Lin for generic deamon | |
ngrok_bin="/opt/ngrok/ngrok" | |
ngrok_config_file="$ngrok_bin.yml" | |
ngrok_region="sa" | |
process_name="$ngrok_bin" |
View termux-send-sms
#!/data/data/com.termux/files/usr/bin/sh | |
set -e -u | |
# Frist install https://f-droid.org/en/packages/com.android.shellms/ and give sms permission manually | |
SCRIPTNAME=termux-sms-send | |
show_usage () { | |
echo "Usage: $SCRIPTNAME -n number[,number2,number3,...] [text]" | |
echo "Send a SMS message to the specified recipient number(s). The text to send is either supplied as arguments or read from stdin if no arguments are given." | |
echo " -n number(s) recipient number(s) - separate multiple numbers by commas" |
View search-on-imap.js
var Imap = require('imap'), | |
inspect = require('util').inspect; | |
var imap = new Imap({ | |
user: 'USERNAME', | |
password: 'PASSWORD', | |
host: 'IMAP_HOST', | |
port: 993, // Default port is 993 | |
tls: true, | |
tlsOptions: {rejectUnauthorized: false} |
View isValidCPF.js
function isValidCPF (cpf) { | |
let sum = 0, | |
remainder | |
cpf = cpf.toString().replace(/^\D+/g, '') | |
if (cpf.length != 11 || new Set(cpf).size === 1) return false | |
for (let i = 1; i <= 9; i++) sum = sum + parseInt(cpf.substring(i - 1, i)) * (11 - i) | |
remainder = (sum * 10) % 11 |
View csvParser.js
// Author: Gerardo Junior <me@gerardo-junior.com | |
// Date: 10/14/2019, 8:53:55 PM | |
// URL: https://gist.github.com/gerardo-junior/2dfda6b7557e1334d1ef2ba495c4ad7c/ | |
function csvParser(filename) { | |
const fs = require('fs') | |
, path = require('path') | |
, filePath = path.join(__dirname, filename); | |
return new Promise((resolve, reject) => { |
View DateFomater.js
// Author: Gerardo Junior <me@gerardo-junior.com | |
// Date: 10/14/2019, 8:53:55 PM | |
// URL: https://gist.github.com/gerardo-junior/ba6ab5a121248328005c5e53d00e7bd7 | |
class DateFomater { | |
constructor(datetime) { | |
if (typeof datetime !== 'string') | |
throw new Error('The class parameter must be a String') |
View Keybase proof
### Keybase proof | |
I hereby claim: | |
* I am gerardo-junior on github. | |
* I am gerardojunior (https://keybase.io/gerardojunior) on keybase. | |
* I have a public key ASAo0sOcd-OqTxkLOCVtbJchBEewLr11xpSzRWbmXKkFMgo | |
To claim this, I am signing this object: |
View Dockerfile
FROM library/alpine:3.7 | |
ARG DEBUG=false | |
ARG XDEBUG_VERSION=2.6.0 | |
ARG XDEBUG_VERSION_SHA256=b5264cc03bf68fcbb04b97229f96dca505d7b87ec2fb3bd4249896783d29cbdc | |
ARG XDEBUG_SOURCE_URL=https://xdebug.org/files | |
# ( ... ) Install the php | |
# Compile, install and configure XDebug php extension |
View .zshrc
# Configure antigen | |
source /usr/share/zsh/share/antigen.zsh | |
antigen use oh-my-zsh | |
antigen bundle git | |
antigen bundle zsh-users/zsh-syntax-highlighting | |
antigen bundle zsh-users/zsh-completions | |
antigen bundle zsh-users/zsh-autosuggestions | |
antigen theme robbyrussell |
NewerOlder