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
curl "https://www.duckdns.org/update?domains=###&token=***&ipv6=`curl -s6 ifconfig.co`&verbose=true" |
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
# Video from text for x duration | |
ffmpeg -f lavfi -i \ | |
color=size=1920x1080:duration=10:rate=60:color=black \ | |
-vf "drawtext=fontfile=/path/to/font.ttf:fontsize=14:fontcolor=gray:x=(w-text_w)/2:y=(h-text_h)/2:text='Stack Overflowing'" \ | |
output.mp4 | |
# Add text to existing video | |
ffmpeg -i output.mp4 \ | |
-vf "drawtext=text='Centered Text':x=(w-text_w)/2:y=(h-text_h)/2:fontsize=24:fontcolor=gray" -c:a copy output2.mp4 |
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
# WA photos/videos do not have exif data embedded, so first fill them | |
exiftool '-alldates<${filename;$_=substr($_,0,12)} 00:00:00' SOURCE | |
# Now organize them into YY/YY-mm structure | |
exiftool -r -d %Y/%Y-%m '-directory<createdate' "-directory<datetimeoriginal" SOURCE |
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
for commit in $(git rev-list origin/master..HEAD) | |
do | |
err=`git --no-pager show $commit | clang-format-diff-10 -p1` | |
if [ -n "$err" ] | |
then | |
# echo "$err" | |
echo >&2 "\"`git log --oneline -1 $commit`\" failed clang-format check!" | |
exit 1 | |
fi | |
done |
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
{ | |
"alt-speed-down": 50, | |
"alt-speed-enabled": false, | |
"alt-speed-time-begin": 540, | |
"alt-speed-time-day": 127, | |
"alt-speed-time-enabled": false, | |
"alt-speed-time-end": 1020, | |
"alt-speed-up": 50, | |
"bind-address-ipv4": "0.0.0.0", | |
"bind-address-ipv6": "::", |
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 | |
set -e | |
prefix=/mnt/usb/ | |
# delete dir with size < 5 MB | |
#DIRRM=`find /mnt/usb -mindepth 1 -maxdepth 1 -type d -exec du -ks {} + | awk '$1 <= 50000' | cut -f 2-` | |
#IFS=' | |
#' | |
#for i in $DIRRM; do | |
# rm -rf $i |
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 json | |
import glob | |
import os | |
import re | |
def clean_json(string): | |
string = re.sub(",[ \t\r\n]+}", "}", string) | |
string = re.sub(",[ \t\r\n]+\]", "]", string) | |
string = re.sub(",$", "", string) |
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
cmake_minimum_required(VERSION 3.16) | |
project(testcmake) | |
# Build only when gen.g gets modified | |
add_custom_command( | |
OUTPUT ${PROJECT_SOURCE_DIR}/gen | |
COMMAND ${CMAKE_COMMAND} -E touch ${PROJECT_SOURCE_DIR}/gen | |
DEPENDS "${PROJECT_SOURCE_DIR}/gen.g" | |
) |
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/python3 | |
# Example: | |
# http://192.168.1.100:8080/?cmd=ls%20-l&cmd=date | |
# | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
from urllib.parse import parse_qs | |
import subprocess | |
class Handler(BaseHTTPRequestHandler): | |
def do_HEAD(self): |
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
#include <iostream> | |
#include <list> | |
#include <map> | |
class cache { | |
public: | |
cache(int s) : size(s) {}; | |
void put(int k) { |