for file in $( find /path/to/dir -maxdepth 1 -type f -name "*.mp4" | sort ); do
echo "$file"
done
find . ! -empty -type f -exec md5sum {} + | sort | uniq -w32 -dD
import os | |
import subprocess | |
import time | |
# This script is intended to transcode *.mkv files. | |
# It uses docker image from https://github.com/lisamelton/other_video_transcoding . | |
# It transcodes the videos inside the rootdir to max quality H264 mkv files. | |
# The docker container utilizes intel quick sync hardware encoder. | |
# This can be run inside a tmux session overnight. |
# This code is based on https://github.com/m4tx/pyTFTP project | |
import os | |
import errno | |
import logging | |
import socket | |
import argparse | |
from pathlib import Path, PurePosixPath | |
from threading import Thread | |
from typing import List, NewType, Tuple, Union, Dict |
#!/usr/bin/env python3 | |
# | |
# -*- coding: utf-8 -*- | |
# | |
# curl -o /dev/null http://SERVER_IP:SERVER_PORT | |
# time printf 'GET / HTTP/1.1\n\n' | netcat SERVER_IP SERVER_PORT > /dev/null | |
import os | |
import argparse |
#!/usr/bin/env python3 | |
# | |
# -*- coding: utf-8 -*- | |
# | |
import socket | |
import argparse | |
from ipaddress import ip_address | |
def run_server(ip: ip_address, port: int) -> None: |
#!/usr/bin/env python3 | |
# | |
# -*- coding: utf-8 -*- | |
import socket | |
from email.utils import formatdate | |
from ipaddress import ip_address | |
import argparse | |
import socketserver |
tolgahan@rpi:~ $ uname -a | |
Linux rpi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux | |
tolgahan@rpi:~ $ openssl version | |
OpenSSL 1.1.1w 11 Sep 2023 | |
tolgahan@rpi:~ $ openssl speed -aead -evp aes-128-gcm | |
tolgahan@rpi:~ $ openssl speed -aead -evp aes-256-gcm | |
tolgahan@rpi:~ $ openssl speed -aead -evp chacha20-poly1305 | |
type 2 bytes 31 bytes 136 bytes 1024 bytes 8192 bytes 16384 bytes | |
aes-128-gcm 1679.44k 18536.78k 29135.42k 36059.82k 36956.84k 37120.68k | |
aes-256-gcm 1365.87k 15148.50k 22993.66k 28058.28k 28740.27k 28813.99k |
#!/bin/bash | |
set -ex | |
set -o pipefail | |
# THIS MUST BE USED WITH AN SSH-AGENT THAT SUPPORTS CONFIRMATION/NOTIFICATION UPON A SIGNATURE REQUEST. | |
# Mount the sock to the docker | |
# docker run --user $(id -u):$(id -g) --rm -it -v "$HOME/.ssh/sshsock:/sshsock" -e SSH_AUTH_SOCK=/sshsock/sock ubuntu bash |
#!/usr/bin/env python3 | |
"""Extend Python's built in HTTP server to save files | |
curl or wget can be used to send files with options similar to the following | |
curl -X PUT --upload-file somefile.txt http://localhost:8000 | |
wget -O- --method=PUT --body-file=somefile.txt http://localhost:8000/somefile.txt | |
__Note__: curl automatically appends the filename onto the end of the URL so | |
the path can be omitted. | |
Windows upload & download | |
powershell -ep bypass -c "$wc=New-Object Net.WebClient;$wc.UploadFile('http://target.com/upload.bin', 'PUT', 'c:\\upload.bin');" |