Skip to content

Instantly share code, notes, and snippets.

View parsibox's full-sized avatar

Mohsen Davari parsibox

View GitHub Profile
apt install nfs-kernel-server
sudo systemctl enable nfs-kernel-server
systemctl status nfs-kernel-server
sudo firewall-cmd --permanent --add-service=nfs
//centos
sudo yum install nfs-utils
sudo systemctl start nfs-server
sudo systemctl enable nfs-server
@parsibox
parsibox / gist:986d654b58569ea14fac0d15301a2b45
Created August 4, 2025 08:05
c# samle project in windows ( dotnet )
dotnet new console -n SmsTest
cd SmsTest
notepad Program.cs # یا با ویرایشگر دلخواه (مثلاً code Program.cs)
# (اینجا کد را جایگزین کن و فایل را ذخیره کن)
dotnet build
dotnet run
شکن:
178.22.122.100
185.51.200.2
الکترو:
78.157.42.100
78.157.42.101
رادار:
@parsibox
parsibox / per min
Created April 27, 2025 14:58
calculate rate of new lines in log
stdbuf -oL tail -f /var/www/golang/logs/2025-04-27/esb_worker_db_queue_peertopeer_0_404012_2_access.log | \
> stdbuf -oL grep -oP '"time":"\K[^"]+' | \
> stdbuf -oL awk -F'[:T.]' '{print $2":"$3}' | \
> stdbuf -oL uniq -c | \
> while read count minute; do
> echo "Rate for $minute: $count logs";
> done
@parsibox
parsibox / gist:10c51bcff762fe214f3e26becf101e48
Created April 27, 2025 09:47
windows docker command disable auto startup container
docker ps -a -q | ForEach-Object { docker update --restart=no $_ }
@parsibox
parsibox / gist:8e054b0498d08b6cd1f5ab72dee99a1b
Created April 18, 2025 07:10
php82 install extentions from source
phpize8.2
./configure --with-php-config=/usr/bin/php-config8.2 --enable-openssl --enable-fiber
make -j$(nproc)
sudo make install
```
for host in /sys/class/scsi_host/*; do echo "- - -" | sudo tee $host/scan; ls /dev/sd* ; done
or
echo "- - -" | tee /sys/class/scsi_host/host*/scan
lsblk
@parsibox
parsibox / csf_release_no_packet_ip.sh
Created January 28, 2025 16:51
unblocked no droped packet blocked ip from iptables with csf
#!/bin/bash
# Temporary file to store IPs dropped by iptables in DENYIN chain
TEMP_DROPPED_IPS="/tmp/dropped_ips.txt"
# Function to extract IP blocks/ranges being dropped in the DENYIN chain
get_dropped_ips() {
# Extract IP blocks/ranges that are actively being dropped in the DENYIN chain
iptables -vL DENYIN -n | grep 'DROP' | awk '{if ($1 > 0) print $8}' | sort | uniq > "$TEMP_DROPPED_IPS"
}
@parsibox
parsibox / notepad++.reg
Created December 12, 2024 07:25
notepad++.reg for windows 11
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Notepad++]
@="Edit With Notepad++"
"Icon"="C:\\Program Files\\Notepad++\\notepad++.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Notepad++\command]
@="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\""
@parsibox
parsibox / gist:263d0b2a813702064f6ce949b2314351
Created November 1, 2024 17:26
nginx error log get clientip
grep -oP '(?<=client: )[\d.]+(?=,)' /var/log/nginx/error.log | sort | uniq -c | sort -nr | head -n 20