Skip to content

Instantly share code, notes, and snippets.

@miguelmota
miguelmota / instructions.sh
Last active January 16, 2025 03:59
Arch linux kernel modules not loading or not found fix notes
# 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
@miguelmota
miguelmota / gist:4921b9cc38a5b66609edf740135f131f
Created December 4, 2024 01:52
Linux screen display tools processes programs
i3-gaps
neofetch
gotop
cava
tty-clock
nvtop
@miguelmota
miguelmota / ssh_agent.sh
Last active December 14, 2024 13:58
SSH agent enable service
systemctl --user enable ssh-agent
systemctl --user start ssh-agent
eval "$(ssh-agent -s)"
ssh-add -l
# ssh config: https://gist.github.com/miguelmota/8151c9213c5d1de80423e26297db8636
@miguelmota
miguelmota / instructions.sh
Created November 27, 2024 11:34
Arch linux install mate desktop environment
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
@miguelmota
miguelmota / instructions.txt
Created November 27, 2024 11:31
Arch linux partition using fdisk
# 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):
@miguelmota
miguelmota / browser_install.sh
Last active November 28, 2024 20:21
Arch linux browser install
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
@miguelmota
miguelmota / jsonDeterministicStringify.ts
Created August 23, 2024 02:04
JavaScript deterministic JSON stringify
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
@miguelmota
miguelmota / npm_downloads.js
Created June 25, 2024 18:22
Node.js get npm package downloads ranked for username
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)
}
@miguelmota
miguelmota / proxy_mitm_example.js
Last active May 3, 2024 03:56
Node.js proxy mitm log example
// 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
@miguelmota
miguelmota / README.md
Last active February 15, 2024 00:04
Fork Me on GitHub Button PNG

forkmebutton

PNG

https://gist.github.com/assets/168240/25dd56cb-861f-4442-a6fb-b79e8c4afae4