Skip to content

Instantly share code, notes, and snippets.

View miladrahimi's full-sized avatar
🏠
Working from home

Milad Rahimi miladrahimi

🏠
Working from home
View GitHub Profile
@miladrahimi
miladrahimi / delete-all-x-likes.md
Last active November 19, 2024 17:19
Delete all likes from X (Twitter)

To delete all your likes on X (formerly Twitter):

  1. Open your X (Twitter) profile in your browser.
  2. Navigate to the "Likes" tab.
  3. Open your browser's console:
    • Chrome (macOS): ⌥ (Option) + ⌘ (Command) + J
    • Firefox (macOS): Shift + ⌘ (Command) + J
    • Chrome/Firefox (Windows): Shift + CTRL + J
  4. Copy and paste the following code into the console, then press Enter to run it.
@miladrahimi
miladrahimi / @ Set Up Debian Server As A Router with NAT .sh
Last active November 24, 2024 22:23
Set Up Debian Server As A Router with NAT
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o ens192 -j MASQUERADE
iptables -A INPUT -i ens224 -j ACCEPT
iptables -A INPUT -i ens192 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -j ACCEPT
@miladrahimi
miladrahimi / @ Revert changed file permissions in Git (before commit).bash
Last active March 10, 2023 09:12
Revert changed file permissions in Git (before commit)
git diff -p \
| grep -E '^(diff|old mode|new mode)' \
| sed -e 's/^old/NEW/;s/^new/old/;s/^NEW/new/' \
| git apply
@miladrahimi
miladrahimi / @ Config LVM to use all available space
Last active March 10, 2023 09:12
Extend LVM to use all the remained space on Ubuntu
It is a few commands that you can run to configure LVM to use all the available space left on the device (server).
$ lvm
lvm> lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
lvm> exit
$ resize2fs /dev/ubuntu-vg/ubuntu-lv
$ df -h