This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Save this as awakealways.ps1 | |
add-type -AssemblyName microsoft.VisualBasic | |
add-type -AssemblyName System.Windows.Forms | |
Add-Type -AssemblyName System.Windows.Forms | |
Add-Type -AssemblyName System.Drawing | |
Write-Warning "This will Prevent screen from sleep" | |
$form = New-Object System.Windows.Forms.Form | |
$form.Text = 'AwakeScreen' | |
$form.Size = New-Object System.Drawing.Size(200,100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set $upstream_app diyhue; | |
set $upstream_port 80; | |
set $upstream_proto http; | |
include /config/nginx/proxy.conf; | |
include /config/nginx/resolver.conf; | |
# allow controlling lights | |
location ~ ^/api/(.*)/lights/(.*)/state[/]*$ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/NetworkManager/conf.d/30-mac-randomization.conf | |
[device-mac-randomization] | |
# "yes" is already the default for scanning | |
wifi.scan-rand-mac-address=yes | |
[connection-mac-randomization] | |
ethernet.cloned-mac-address=stable | |
wifi.cloned-mac-address=stable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=macchanger on %I | |
Wants=network-pre.target | |
Before=network-pre.target | |
BindsTo=sys-subsystem-net-devices-%i.device | |
After=sys-subsystem-net-devices-%i.device | |
[Service] | |
ExecStart=/usr/bin/macchanger -r %I | |
Type=oneshot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
target_host=$1 | |
if [ ! -z "$2" ];then | |
target_port=$2 | |
else | |
target_port="22" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isValidCNPJ(cnpj = '') { | |
cnpj = `${cnpj}`.replace(/^\D+/gmi, '') | |
if (cnpj.length != 14 || new Set(cnpj).size === 1) return false | |
size = cnpj.length - 2 | |
numbers = cnpj.substring(0, size) | |
digits = cnpj.substring(size) | |
soma = 0 | |
pos = size - 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Author: Gerardo Junior <[email protected] | |
// 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) => { |
NewerOlder