Skip to content

Instantly share code, notes, and snippets.

from dataclasses import dataclass
import argparse
import os, binascii
@dataclass
class AccessPoint:
name: str
mac_addr: str
$ErrorActionPreference = "Stop"
# The array containing the files to compress
$files = @()
# The folders where to look for files
$wsl_folders = @(
# WSL OSes from the Windows Store
"$env:LOCALAPPDATA\Packages",
# The Docker WSL files
"$env:LOCALAPPDATA\Docker"
@Delnegend
Delnegend / nokia150.py
Created November 20, 2023 06:33
Transcode any video into Nokia 150 compatible file so it can playback
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()
@Delnegend
Delnegend / backup-to-discord.py
Last active November 11, 2023 09:48
Backup any file/folder from your Linux server to a Discord channel using webhook. Requires `pip install requests`.
#!/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
@Delnegend
Delnegend / calculate-tbw.sh
Last active July 15, 2024 09:33
Calculate the TBR and TBW of an SSD, requires `smartmontools` to be installed.
#!/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)
@-moz-document domain("facebook.com"){div#mount_0_0 div[class="kr520xx4 j9ispegn poy2od1o n7fi1qx3 tkr6xdv7"],div[class="cwj9ozl2 ue3kfks5 pw54ja7n uo3d90p7 l82x9zwi nwpbqux9 rq0escxv jgsskzai ni8dbmo4 stjgntxs"] div[class="ll8tlv6m j83agx80 taijpn5t hzruof5a"] div[class="bjjx79mm jbae33se"],div[class="ll8tlv6m j83agx80 taijpn5t hzruof5a"] div[class="j83agx80 cbu4d94t lzcic4wl ni8dbmo4 stjgntxs oqq733wu l9j0dhe7 du4w35lb cwj9ozl2 ue3kfks5 pw54ja7n uo3d90p7 l82x9zwi nwpbqux9 gc7gaz0o k4urcfbm"],div[class="j34wkznp qp9yad78 pmk7jnqg kr520xx4"] div[class="cwj9ozl2 ue3kfks5 pw54ja7n uo3d90p7 l82x9zwi nwpbqux9 rq0escxv jgsskzai ni8dbmo4 stjgntxs"],div[class="rq0escxv lpgh02oy tkr6xdv7 rek2kq2y"],div[class="kr520xx4 j9ispegn poy2od1o n7fi1qx3 tkr6xdv7"],div[class="datstx6m j83agx80 cbu4d94t ni8dbmo4 stjgntxs"],div.j83agx80.bp9cbjyn.ni8dbmo4.stjgntxs.rq0escxv.cxgpxx05.sj5x9vvc.scb9dxdr.dflh9lhu.abiwlrkh.k4urcfbm.m7zwrmfr.nred35xi.rlauoc8d.tn0ko95a.cmqm4kv0.b7h9ocf4,div[class="nred35xi ue3kfks5 pw54ja7n leyxi2ww pi1r