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 | |
LEFT=$1 | |
RIGHT=$2 | |
BASE=$2 | |
OUT=$2 | |
echo $LEFT | |
echo $RIGHT | |
echo $BASE |
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 | |
ffmpeg -i $1 -c:v libvpx-vp9 -pix_fmt yuva420p -auto-alt-ref 0 -r 30 -t 3 -filter:v scale=512:-1 -an $1.webm |
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
def sequential_subset?(a, b) | |
m = a.size | |
n = b.size | |
(0 ... n).each do |i| | |
j = 0 | |
(0 ... m).each do |_| | |
break if b[i + j] != a[j] | |
j += 1 | |
end | |
return true if j == m |
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 | |
FILE=$1 | |
OUTPUT_FOLDER=$(basename "${FILE%.*}") | |
[ -z "$FILE" ] && echo "ERROR: file path is required" && exit 1 | |
[ -z "$OUTPUT_FOLDER" ] && echo "ERROR: cannot set output folder" && exit 1 | |
[ -d "./$OUTPUT_FOLDER" ] && echo "ERROR: output folder exists" && exit 1 | |
echo "OUTPUT_FOLDER: $OUTPUT_FOLDER" | |
mkdir ./$OUTPUT_FOLDER |
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 | |
## usage: fail2ban-client-ls-ip [JAIL] | |
JAIL=$1 | |
PROGNAME=$0 | |
if [ -z $JAIL ]; then | |
[ -z $PROGNAME ] && echo "ERROR: $PROGNAME is empty" && exit 1 | |
sudo fail2ban-client status | |
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 | |
# | |
# usage: API_KEY=XXXX MONITOR_NAME=GOOGLE uptimerobot.sh | |
# | |
keep=$HOME/.uptimerobot-status | |
if [ -z "$MONITOR_NAME" ]; then | |
(>&2 echo "ERROR: MONITOR_NAME is required") | |
exit 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
[program:whoami] | |
command=/bin/bash -l -c 'echo "whoami: $(whoami)"' | |
stdout_logfile=/dev/stdout | |
startsecs = 0 | |
autorestart = false |
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
<VirtualHost *.:443> | |
ServerName whatever-domain.com | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
SSLProxyEngine on | |
ProxyPreserveHost on | |
RewriteEngine On |
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
const TreeNode = function (value) { | |
this.left = null | |
this.right = null | |
this.value = value | |
} | |
// accept muliple sorted unqiue numbers arrays | |
const buildTreeNodes = function (...arrs) { | |
let node = new TreeNode() | |
for (let i = 0; i < arrs.length; i++) { |
NewerOlder