Skip to content

Instantly share code, notes, and snippets.

@miguelmota
miguelmota / instructions.sh
Last active March 2, 2025 03:09
Arch linux monitor folder file access
pacman -S audit
sudo systemctl enable --now auditd
# track folder
sudo auditctl -w /tmp/custom_folder_to_watch -p r -k custom_test_watch_key
# view access logs
sudo ausearch -k custom_test_watch_key
# list watchers
@miguelmota
miguelmota / instructions.sh
Created February 26, 2025 03:56
Arch linux brother scanner packages
pacman -S brlaser
pacman -S brscan5
pacman -S sane
@miguelmota
miguelmota / install.sh
Created January 30, 2025 06:43
Arch linux annotation tool write on-screen on touchscreen overlay paint
yay -S gromit-mpx
@miguelmota
miguelmota / hacker_news_sort.js
Last active January 12, 2025 01:30
Hacker News sort by points
function extractAndSortPosts() {
// Get all posts
const rows = document.querySelectorAll(".athing.submission");
const posts = [];
rows.forEach(row => {
// Extract title
const titleElement = row.querySelector(".titleline a");
const title = titleElement ? titleElement.innerText : "No title";
@miguelmota
miguelmota / instructions.sh
Last active December 30, 2024 00:56
Arch linux install gnome desktop environment
sudo pacman -Syu
sudo pacman -S gdm
sudo systemctl enable gdm.service
# disable lightdm if installed
sudo systemctl disable lightdm.service
# (optional) remove lightdm
sudo pacman -Rns lightdm lightdm-gtk-greeter
@miguelmota
miguelmota / disable_dropbox_autostart.sh
Created December 30, 2024 00:13
Arch linux gnome disable dropbox autostart disable start on boot
# edit autostart file
vim ~/.config/autostart/dropbox.desktop
# Add or modify
X-GNOME-Autostart-enabled=false
# completely remove autostart
# rm ~/.config/autostart/dropbox.desktop
# disable service
@miguelmota
miguelmota / ethereum_generate_keys.sh
Created December 18, 2024 20:57
Ethereum generate private key, public key, public address using openssl secp256k1 keccak-256sum bash
ethereum_generate_keys() {
# Generate the private key and public key
local key=$(openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout 2>/dev/null)
# Extract and clean the public key
local pub=$(echo "$key" | grep pub -A 5 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^04//')
# Extract and clean the private key
local priv=$(echo "$key" | grep priv -A 3 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^00//' | sed 's/^priv//')
@miguelmota
miguelmota / ethereum_generate_address_from_private_key.sh
Created December 18, 2024 20:52
Ethereum openssl generate public address from hex private key
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"
@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