Skip to content

Instantly share code, notes, and snippets.

View pourmand1376's full-sized avatar
😉
Learning

Amir Pourmand pourmand1376

😉
Learning
View GitHub Profile
@pourmand1376
pourmand1376 / tutorial.md
Created November 9, 2022 15:18 — forked from Makeshift/tutorial.md
Tutorial for automatically syncing an Obsidian vault with Git on an Android device

How to sync Obsidian with Git on Android

Limitations

  • If Termux is closed in the background by Android, the cron service will stop updating your repository and you must open Termux again. Refer to instructions for your device model to disable the killing of certain background applications.
  • This may negatively affect your devices battery life. I'm not entirely sure yet.

Setup

@pourmand1376
pourmand1376 / shecan.sh
Created October 6, 2022 21:47
Add Shecan DNS Server
# https://devilbox.readthedocs.io/en/latest/howto/dns/add-custom-dns-server-on-linux.html
echo "nameserver 178.22.122.100" > /etc/resolv.conf
echo "nameserver 185.51.200.2" > /etc/resolv.conf
@pourmand1376
pourmand1376 / forward.sh
Created September 27, 2022 13:39
Forward Every packet from a server to another!
سلام روز بخیر
روی سرور ایرانتون این کامند رو ران کنید:
sudo apt install iptables-persistent
و بعدش فایل زیر رو باز کنید با nano:
/etc/iptables/rules.v4
این محتویات رو وارد فایل کنید:
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
@pourmand1376
pourmand1376 / git-lfs-install.md
Last active November 9, 2025 08:27
Single User Installation of Git-LFS without sudo

I wanted to install GIT-Lfs on my user account without access to server root account. I write this to my future self.

  1. Download tar.gz file from git-lfs website.
wget https://github.com/git-lfs/git-lfs/releases/download/v3.2.0/git-lfs-linux-amd64-v3.2.0.tar.gz

2.Untar it

tar xvf git-lfs-linux-amd64-v3.2.0.tar.gz
@pourmand1376
pourmand1376 / sharif_login.sh
Last active March 29, 2025 08:03
Sharif Login
function sharif_login
{
curl -d "username=$1&password=$2" -X POST "https://net2.sharif.edu/login" > /dev/null
curl -s https://net2.sharif.edu/status | grep -o '<td>.*</td>'
sleep 1s # To See login status
}
function sharif_ip
{
# from ping net2.sharif.edu
# this is written since sometimes DNS server doesn't work!
@pourmand1376
pourmand1376 / gist:aaa519389734215cd8518c94d6b39ba3
Created April 20, 2022 11:43
Remove git file from all_history
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch path/to/file" \
--prune-empty --tag-name-filter cat -- --all
@pourmand1376
pourmand1376 / nvidia-smi2
Created April 16, 2022 05:44
Show User Info and CPU information per user in NVIDIA-SMI
nvidia-smi | tee /dev/stderr | awk '/ C / {print $3}' | xargs -r ps -up
@pourmand1376
pourmand1376 / nvv.sh
Created April 15, 2022 18:05 — forked from WeiTang114/nvv.sh
Show username after each process in nvidia-smi.
#!/bin/bash
# Show username after each process in nvidia-smi
# like:
# ...
# +------------------------------------------------------+
# | Processes: GPU Memory |
# | GPU PID Type Process name Usage |
# |======================================================|
# | 0 150752 C python 830MiB | User: user1
# | 1 2185 C /usr/bin/python 1090MiB | User: user2
@pourmand1376
pourmand1376 / ubuntu_font.sh
Last active March 27, 2022 11:13
Install `ubuntu font` in Fedora 35
cd /tmp
wget https://assets.ubuntu.com/v1/fad7939b-ubuntu-font-family-0.83.zip
# you can check for newer versions
unzip fad7939b-ubuntu-font-family-0.83.zip
# then copy it to the font directory (applied to all users)
sudo cp -r ubuntu-font-family-0.83 /usr/share/fonts
fc-cache -v
@pourmand1376
pourmand1376 / After Manjaro installation.sh
Last active April 16, 2022 05:54
Things I do After installation of manjaro distribution
manjaro
sudo pacman -Syu
#install lts kernel
#kde settings
# night mode
#ignore linux kernel updates