Skip to content

Instantly share code, notes, and snippets.

View theanurin's full-sized avatar

Max Anurin theanurin

View GitHub Profile
@theanurin
theanurin / bypass-directory-files-via-base64.md
Last active July 25, 2023 11:10
Files -> Base64 -> Files

Files -> Base64 -> Files

Files -> Base64 (Tar+Gz+Base64)

tar -czvp * | base64

Base64 -> Files

Obtain list of desired streams

ffprobe -hide_banner -i input-file.mkv
...
  Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
    Metadata:
 title : Criminal (WEB-DL 1080p)
@theanurin
theanurin / static-member-hell.md
Last active October 6, 2023 19:47
Static member difference across languages

Static member difference across languages

Visibility via inherit class

// C++
#include <iostream>

class A {
public:
@theanurin
theanurin / install-dart-linux-x64-sdks.sh
Last active September 7, 2023 16:31
Install Dart Linux x64 SDKs script
#
# To start this script from remote:
#
# curl https://gist.githubusercontent.com/theanurin/833b22f6c0fa9776dae5cf9bcc2fb295/raw/install-dart-linux-x64-sdks.sh | /bin/bash
#
mkdir --parents ~/opt/dart
cd ~/opt/dart/
for DART_VERSION in 2.18.3 2.17.7 2.16.2 2.15.1 2.10.5; do
echo
@theanurin
theanurin / install-flutter-linux-x64-sdks.sh
Last active September 7, 2023 16:31
Install Flutter Linux x64 SDKs script
#
# To start this script from remote:
#
# curl https://gist.githubusercontent.com/theanurin/9d0d348657e5fd4d307520e836611724/raw/install-flutter-linux-x64-sdks.sh | /bin/bash
#
mkdir --parents ~/opt/flutter
cd ~/opt/flutter/
for FLUTTER_VERSION in 3.3.10 3.0.5 2.10.5 2.8.0; do
echo
@theanurin
theanurin / make-an-offline-mirror-copy-of-a-website.md
Created July 22, 2022 15:18
Make an offline mirror copy of a website

Make an offline mirror copy of a website

wget --mirror --convert-links --adjust-extension --page-requisites --no-parent https://site-to-copy.local
  • --mirror – Makes (among other things) the download recursive.
  • --convert-links – Convert all the links (also to stuff like CSS stylesheets) to relative, so it will be suitable for offline viewing.
  • --adjust-extension – Adds suitable extensions to filenames (html or css) depending on their content-type.
  • --page-requisites – Download things like CSS style-sheets and images required to properly display the page offline.
@theanurin
theanurin / git-switch-orphan.md
Last active June 17, 2022 07:47
Create orphan branch

git 2.23+

git switch --orphan <branch_name>
git commit --allow-empty -m "<commit_msg>"
git push origin <branch_name>
@theanurin
theanurin / extlinux-how-to.md
Last active September 26, 2023 05:49
Universal USB boot by SYSLINUX
USB_DEVICE=/dev/sdb

sfdisk --wipe always --label gpt "${USB_DEVICE}" <<EOF
,1G,C12A7328-F81F-11D2-BA4B-00A0C93EC93B
,1G,0FC63DAF-8483-4772-8E79-3D69D8477DE4
EOF
sfdisk --part-attrs "${USB_DEVICE}" 2 LegacyBIOSBootable

dd if=/usr/share/syslinux/gptmbr.bin bs=440 count=1 conv=notrunc of="${USB_DEVICE}"
@theanurin
theanurin / easylinux-pacmd-hints.md
Last active August 4, 2022 06:46
Easy Linux - Pulse Audio Sound Management Hints

Pulse Audio Sound Management Hints

See more examples

Quick Start

Unmute default input/output

pacmd set-source-mute @DEFAULT_SOURCE@ false
@theanurin
theanurin / gpg-encrypt-decrypt-file-by-passphrase.md
Last active January 26, 2024 16:49
Encrypt/Decrypt by passphrase using GPG

Encrypt

gpg --output sensetive-data.tar.gz.gpg --symmetric sensetive-data.tar.gz 
  • --symmetric - use the default symmetric cipher, which means that the same passphrase is used for both encryption and decryption (as opposed to asymmetric, which involves public keys and private keys.).

Test

gpg --no-symkey-cache sensetive-data.tar.gz.gpg