Skip to content

Instantly share code, notes, and snippets.

View mz0's full-sized avatar
🥎
Թակել յոթ դուռ, մինչեվ մեկը կբացվի

Mark Zhitomirski mz0

🥎
Թակել յոթ դուռ, մինչեվ մեկը կբացվի
View GitHub Profile
@mz0
mz0 / github-is-messing-linear-history.md
Created February 23, 2026 10:42
how to convince GitHub to NOT mess up git history

Q: my PR can merge into main --ff-only , and only "Rebase and merge" option is available in PR. When applied, the PR is merged with commit SHA different from the one in the PR HEAD. But why!? Gitlab never surprised me in that case.

A: Google AI Overview:

Even if your Pull Request (PR) branch is up-to-date with main (making it eligible for a fast-forward merge), selecting "Rebase and merge" on GitHub will always produce new commit SHA hashes, changing them from your original HEAD.

GitHub’s "Rebase and Merge" deviates slightly from a standard local git rebase:

@mz0
mz0 / gpg.md
Created October 23, 2025 13:18
mysql-build@oss.oracle.com OpenPGP public key get/check

Get a PGP key and check validity

MySQL PGP pubkey bug of 2025-10-22

export KEY16=B7B3B788A8D3785C
gpg --no-default-keyring --keyring /tmp/keyring.gpg --keyserver keyserver.ubuntu.com --recv-key $KEY16 \
  && gpg --export --no-default-keyring --keyring /tmp/keyring.gpg --output /tmp/$KEY16.gpg 

### Or ###
export GNUPGHOME=$(mktemp -d)
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $KEY16
@mz0
mz0 / GPU.md
Last active May 15, 2025 11:52
GPGPU milestones
@mz0
mz0 / learning-notes.md
Last active May 17, 2025 11:41
On learning
@mz0
mz0 / JavaScript-notes.md
Last active May 5, 2025 16:25
JavaScript history bits

JavaScript

was built in only 10 days in 1995 by a single person, Brendan Eich, who was tasked with building a simple scripting language to be used in version 2 of the Netscape browser. It was initially called LiveScript, but since the Java language was so popular at the time, the name was changed to JavaScript - although Java and JavaScript are in no way related.

For the first few years, after it was built, JavaScript was a simple scripting language to add mouseover effects and other interactivity. Those effects were being added to webpages using the <script> HTML element.

@mz0
mz0 / integrity.sh
Created April 28, 2025 21:19
Compute integrity_no="sha384-SgOJ...79m7" string for HTML resources
#!/bin/sh
if [ ! -n "$1" ]; then
echo "No file path argument found"
elif [ -f $1 ]; then
b64=$(sha384sum $1 | grep -o -E '^[a-f0-9]{96}' | xxd -r -p | base64)
echo "integrity=\"sha384-${b64}\""
else
echo "\"$1\" not found, or is not readable"
fi
@mz0
mz0 / blockchain-dict.txt
Last active March 17, 2025 11:29
Blockchain Lexikon
CIA-triad - Confidentiality, Integrity, Availability
DAO - Decentralized Automous Org
DeFi - Decentralized Finance
DON - Decentralized Oracle Network
OCR - Off-Chain Reporting
Rollup - Off-Chain Txn Bundler
TEF - Transaction Execution Framework
VRF - Verifiable Random Function
@mz0
mz0 / fscrypt-enable.sh
Last active November 5, 2025 06:33
Ubuntu *fscrypt* (Ext4 / F2FS only. See `gocryptfs` for XFS/Btrfs) https://github.com/google/fscrypt
sudo apt install fscrypt libpam-fscrypt
# encrypt only filesytem with /home (it may be in '/' filesystem)
FileSystem=$(grep -E ' (/home|/) ' /proc/mounts | grep -o '^[^ ]*')
getconf PAGE_SIZE # 4096
# TODO check Ext2/Ext3 (FSFS, UBIFS ??)
sudo tune2fs -l $FileSystem | grep 'Block size'
sudo tune2fs -O encrypt $FileSystem
sudo fscrypt setup
sudo pam-auth-update