Instantly share code, notes, and snippets.
sms , ussd🖱php , python , nodejs 🖱mysql , oracle , redist , mongodb
parsibox /gist:b9ffe677a2fda458b6244de4c9a1a0c7
CreatedDecember 10, 2025 23:58
mysql view percent for alter This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| SELECT | |
| EVENT_NAME, | |
| WORK_COMPLETED, | |
| WORK_ESTIMATED, | |
| ROUND((WORK_COMPLETED / WORK_ESTIMATED) * 100, 2) AS progress_percent | |
| FROM performance_schema.events_stages_current | |
| WHERE EVENT_NAME LIKE 'stage/%'; |
parsibox /gist:2434d120a4d347ea63a23c8f99bc33b5
CreatedSeptember 2, 2025 11:32
haproxy with config in haproxy.d folder This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| sudo tee /lib/systemd/system/haproxy.service >/dev/null <<'EOF' | |
| [Unit] | |
| Description=HAProxy Load Balancer | |
| Documentation=man:haproxy(1) | |
| Documentation=file:/usr/share/doc/haproxy/configuration.txt.gz | |
| After=network-online.target rsyslog.service | |
| Wants=network-online.target | |
| [Service] |
parsibox /gist:ab56e211dfffcbd0cc24d69e18fca691
CreatedAugust 26, 2025 07:04
allow Googlebot ip range in csf This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| wget https://developers.google.com/search/apis/ipranges/googlebot.json | |
| grep -Eho '((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])(\/(3[0-2]|[12]?[0-9]))?' /root/davari/googlebot.json | sort -u | sort -u | xargs -r -n1 -I{} csf -a "{}" " Googlebot " | |
| sudo csf -a 66.249.0.0/16 "Googlebot range" | |
| sudo cp /etc/csf/csf.allow{,.bak.$(date +%F-%H%M%S)} && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| 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 /gist:986d654b58569ea14fac0d15301a2b45
CreatedAugust 4, 2025 08:05
c# samle project in windows ( dotnet ) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| dotnet new console -n SmsTest | |
| cd SmsTest | |
| notepad Program.cs # یا با ویرایشگر دلخواه (مثلاً code Program.cs) | |
| # (اینجا کد را جایگزین کن و فایل را ذخیره کن) | |
| dotnet build | |
| dotnet run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| شکن: | |
| 178.22.122.100 | |
| 185.51.200.2 | |
| الکترو: | |
| 78.157.42.100 | |
| 78.157.42.101 | |
| رادار: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| 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 /gist:10c51bcff762fe214f3e26becf101e48
CreatedApril 27, 2025 09:47
windows docker command disable auto startup container This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| docker ps -a -q | ForEach-Object { docker update --restart=no $_ } |
parsibox /gist:8e054b0498d08b6cd1f5ab72dee99a1b
CreatedApril 18, 2025 07:10
php82 install extentions from source This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| phpize8.2 | |
| ./configure --with-php-config=/usr/bin/php-config8.2 --enable-openssl --enable-fiber | |
| make -j$(nproc) | |
| sudo make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| ``` | |
| 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 |
NewerOlder