Skip to content

Instantly share code, notes, and snippets.

View Lesmiscore's full-sized avatar
💭
🤔

Lesmiscore Lesmiscore

💭
🤔
  • なぞのばしょ
  • Mystery Zone, Pokémon
View GitHub Profile
@Lesmiscore
Lesmiscore / ffmpeg-arm64.sh
Last active December 6, 2021 11:45
run ffmpeg for x86_64 on arm64
#!/bin/bash
LD_LIBRARY_PATH=/usr/x86_64-linux-gnu/lib/ exec qemu-x86_64 /usr/x86_64-linux-gnu/lib64/ld-linux-x86-64.so.2 \
/home/lesmi/.local/ffmpeg-n4.4.1-3-g4f470b2e93-linux64-gpl-4.4/bin/ffmpeg "$@"
@Lesmiscore
Lesmiscore / encrypted-dvd.md
Created October 31, 2021 14:19 — forked from ansemjo/encrypted-dvd.md
create an encrypted dvd with squashfs and luks

1. Create compressed squashfs image

Use mksquashfs to create a compressed image from a directory. Depending on how compressible the files are you could put on much more than 4.7 GB on a single disc.

mksquashfs /path/to/my/directory image.sqfs

You can use a different compression algorithm with e.g. -comp zstd or append multiple times to one archive to fill it up to almost the allowable size.

2. Reencrypt the image to wrap it in a LUKS container

#!/bin/bash
TIME="$1"
shift
( exec "$@" ) &
timeout "$TIME" tail -f /dev/null --pid "$!"
import itertools
from os import scandir
MAX_SCORE = 160 * 1024**3 # 160GiB
with scandir('.') as sd:
dirs = sorted((x for x in sd if x.is_dir()), key=lambda x: x.path)
def recursive(path):
with scandir(path) as adr:
[debug] Command-line config: ['-N', '16', '--downloader-args', 'ffmpeg:-loglevel warning -stats', '--downloader-args', 'aria2c:-q', '--external-downloader', 'aria2c', '--trim-filename', '150', '--force-ipv4', '--sleep-interval', '2', '--sleep-requests', '2', '--max-sleep-interval', '5', '--ignore-errors', '--no-continue', '--no-overwrites', '--download-archive', 'archive.log', '--add-metadata', '--write-description', '--write-info-json', '--write-annotations', '--write-thumbnail', '--embed-thumbnail', '--all-subs', '--embed-subs', '--output', '%(playlist)s - (%(uploader)s)/%(title)s [%(id)s].%(ext)s', '--merge-output-format', 'mkv', '_8GUNJZwAQ0', '-v']
[debug] Loading archive file 'archive.log'
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] yt-dlp version 2021.07.17.1626506853 (zip)
[debug] from commit d05ae24
[debug] Python version 3.8.10 (CPython 64bit) - Linux-5.8.0-1031-oracle-aarch64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4
[debug] Proxy map: {}
import re
from sympy import simplify, expand, sqrt, Sum
from sympy.matrices import Matrix
from sympy.physics.vector.frame import ReferenceFrame
from sympy.vector import CoordSys3D
from sympy.physics.mechanics import cross
from sympy.core.symbol import symbols
from sympy.vector.vector import Cross, Vector
#!/usr/bin/env python3
# Licensed under Public Domain
from math import atan, atan2, inf
import numpy as np
class Matrix3D():
def __init__(self) -> None:
self.matrix = np.array([
[1, 0, 0, 0],
[debug] Command-line config: ['-sv', 'https://youtube.com/shorts/HwnoPSKNb2I']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] yt-dlp version 2021.06.03.1622688875 (zip)
[debug] Python version 3.9.5 (CPython 64bit) - Linux-5.11.0-051100-generic-x86_64-with-glibc2.31
[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4, rtmpdump 2.4
[debug] Proxy map: {}
[debug] [youtube:tab] Extracting URL: https://youtube.com/shorts/HwnoPSKNb2I
WARNING: [youtube:tab] A channel/user page was given. All the channel's videos will be downloaded. To download only the videos in the home page, add a "/featured" to the URL
[youtube:tab] shorts: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 404: Not Found (caused by <HTTPError 404: 'Not Found'>); please report this issue on https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see https://github.com/yt-dlp/yt-dlp on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.
@Lesmiscore
Lesmiscore / keybase.md
Created April 15, 2021 13:00
Keybase proving now

Keybase proof

I hereby claim:

  • I am nao20010128nao on github.
  • I am nao20010128nao (https://keybase.io/nao20010128nao) on keybase.
  • I have a public key ASBL4WxtEay7nw6bKGvqfNwCh_2Ai5Qp4PgAdR40aJpeuwo

To claim this, I am signing this object:

#!/bin/bash
if ! [ -z "$VSCODE_GIT_ASKPASS_NODE" ] ; then
code --wait "$@"
else
nano "$@"
fi