-
SSH into proxmox node and become root user. Run the following commands to download extra software dependencies we'll need.
apt update apt install -y libsasl2-modules mailutils
-
Enable 2FA for the gmail account that will be used by going to security settings
Discover gists
This file contains 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
<?php | |
// PHP Máscara CNPJ, CPF, Data e qualquer outra coisa | |
// http://blog.clares.com.br/php-mascara-cnpj-cpf-data-e-qualquer-outra-coisa/ | |
// ver em funcionamento ~~> https://ideone.com/wP7zN2 | |
function mask($val, $mask) | |
{ | |
$maskared = ''; | |
$k = 0; |
This file contains 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 | |
iatest=$(expr index "$-" i) | |
####################################################### | |
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me | |
####################################################### | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc |
This file contains 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
# to do: error checking/resumption code (can use pagination cursor of post to determine when script paused?) | |
# clean up repetition | |
# timing issue: if fetching by latest, someone can make a comment | |
# that puts a post out of the date limits before the looping | |
# has a chance to fetch the post | |
# do a second sweep after hitting the date limit? | |
# would have to store the script's start time and figure out | |
# when it halts due to hitting the lower date limit and | |
# reprocess comments according to that... |
This file contains 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
apt-get update && apt-get upgrade -y && \ | |
apt-get install -y \ | |
linux-tools-common | |
linux-tools-generic | |
linux-cloud-tools-generic | |
linux-tools-`uname -r` | |
linux-cloud-tools-`uname -r` |
This file contains 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
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
This file contains 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
#!/usr/bin/env python | |
# | |
# AccessDump.py | |
# A simple script to dump the contents of a Microsoft Access Database. | |
# It depends upon the mdbtools suite: | |
# http://sourceforge.net/projects/mdbtools/ | |
import sys, subprocess, os | |
DATABASE = sys.argv[1] |
This file contains 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
<?php | |
/** | |
* Search through an array for a matching key. | |
* | |
* Examples: | |
* <code> | |
* $array = array( | |
* "database.name" => "my_db_name", | |
* "database.host" => "myhost.com", |
This file contains 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
import sys | |
import json | |
from urllib.parse import urlparse, parse_qs | |
def parse_multimap(ordered_pairs): | |
"""JSON loads object_pairs_hook, which creates a list of values when | |
duplicate keys are found in the JSON file being parsed |
NewerOlder