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/zsh | |
cat /etc/passwd | grep username | cut -d : -f 6 |
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/zsh | |
# Constants { | |
postgres_container_name="" | |
main_user="" | |
# } | |
# Make a copy of the DB files within the container | |
postgres_home_dir=$(docker exec --user postgres $postgres_container_name bash -c "echo \$HOME") |
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
// Source: https://codewithmark.com/easily-edit-html-table-rows-or-cells-with-jquery | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function($) |
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
function ARRAYMIN(xx, yy) { | |
return xx.map((x, idx) => { | |
const y = yy[idx] | |
return Math.min(x, y) | |
} | |
} | |
function ARRAYMAX(xx, yy) { | |
return xx.map((x, idx) => { | |
const y = yy[idx] |
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
from time import sleep | |
def try_until_success(task, | |
delay=0, | |
number_of_tries=3, | |
exception_to_catch=Exception): | |
success = False | |
tries = 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/python3 | |
''' | |
Split a secret using Shamir Secret Sharing Scheme and then put each | |
share in its own file with a specified note. | |
Uses: ssss v0.5 | |
''' | |
import subprocess |
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/python3 | |
''' | |
Encrypt several files individually with GPG. | |
NOTE: The script moves all original files to ./trash | |
Dependencies: | |
- gpg (GnuPG) 2.2.19 | |
- libgcrypt 1.8.5 |
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 os | |
from flask import Flask, flash, request, redirect, url_for, render_template | |
from werkzeug.utils import secure_filename | |
UPLOAD_FOLDER = 'path/to/upload/folder' | |
ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'} | |
app = Flask(__name__) | |
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER |