This file contains hidden or 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 | |
import re | |
import shutil | |
import subprocess as sp | |
from concurrent.futures import ProcessPoolExecutor, as_completed | |
class Config: | |
ffmpeg = "/replace/me/with/path/to/ffmpeg" | |
delete_completed = True |
This file contains hidden or 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 | |
# return the latest TAG version from GitHub repo (usually include "v" prefix) | |
get_github_latest_tag() { | |
local repo_path=$1 | |
curl -s -I -L "https://github.com/$repo_path/releases/latest" | \ | |
grep -i "^location" | \ | |
tail -n1 | \ | |
sed -E 's|.*/tag/([^/]+)$|\1|' | \ | |
tr -d '\r' |
This file contains hidden or 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 dataclasses import dataclass | |
import argparse | |
import os, binascii | |
@dataclass | |
class AccessPoint: | |
name: str | |
mac_addr: str |
This file contains hidden or 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 sys, subprocess, os | |
def main(): | |
input_file = sys.argv[1] | |
output_file = os.path.splitext(input_file)[0] + '.nokia150.avi' | |
subprocess.call(f"ffmpeg -i \"{input_file}\" -vf \"scale='min(320,iw)':min'(240,ih)':force_original_aspect_ratio=decrease\" -vcodec mjpeg -q:v 3 -acodec pcm_s16le -ar 8000 -ac 1 \"{output_file}\"", shell=True) | |
if __name__ == '__main__': | |
main() |
This file contains hidden or 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 | |
import sys | |
import os | |
import json | |
import shutil | |
import requests | |
import subprocess as sp | |
from datetime import datetime | |
from dataclasses import dataclass, field |
This file contains hidden or 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 | |
# Change this to the SSD you want to check | |
drive="/dev/sda" | |
# Extract the sector size and LBA written from the output | |
sector_size=$(sudo smartctl -Ai $drive | grep 'Sector Size' | awk '{print $3}') | |
lba_written=$(sudo smartctl -Ai $drive | grep 'Total_LBAs_Written' | awk '{print $10}') | |
lba_read=$(sudo smartctl -Ai $drive | grep 'Total_LBAs_Read' | awk '{print $10}') | |
# Calculate TBW and print the result | |
tb_write=$(echo "scale=2; $sector_size * $lba_written / 1024^4" | bc -l) |