git log --all --pretty=oneline --follow -- path/to/file.cc
# -I: ignore binary
# -F: fixed string
# -G: basic regex
| #!/bin/bash | |
| wget -O /tmp/filegator_latest.zip https://raw.githubusercontent.com/filegator/static/master/builds/filegator_latest.zip | |
| mkdir /tmp/filegator | |
| unzip /tmp/filegator_latest.zip -d /tmp/filegator | |
| cd /var/www/html/filegator | |
| sudo find . ! -name . -prune ! -path ./private \ | |
| ! -path ./repository \ | |
| ! -path ./configuration.php \ |
| #!/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');" |
| #!/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 |
| 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 |
| #!/usr/bin/env python3 | |
| # | |
| # -*- coding: utf-8 -*- | |
| import socket | |
| from email.utils import formatdate | |
| from ipaddress import ip_address | |
| import argparse | |
| import socketserver |
| #!/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 -*- | |
| # | |
| # 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 |
| # 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 |