Skip to content

Instantly share code, notes, and snippets.

View aKamrani's full-sized avatar
:electron:
Creating

Amir Hossein Kamrani aKamrani

:electron:
Creating
View GitHub Profile
@aKamrani
aKamrani / Binance-Socket-Monitoring
Last active October 31, 2024 08:32
Binance Socket Monitoring | /etc/systemd/system/binance-monitor.service | /opt/binance-monitor/binance-monitor.py
sudo apt install python3-websocket
sudo systemctl daemon-reload
sudo systemctl start binance-monitor.service
sudo systemctl enable binance-monitor.service
sudo systemctl status binance-monitor.service
@aKamrani
aKamrani / mssql-backup-storage-powershell-minio-s3.ps1
Created October 31, 2024 07:02
Automatic Backup MSSQL Database to S3 Storage / Minio - Powershell Windows
$server = "127.0.0.1"
$database = "MMSQL_EXAMPLE_DATABSE"
$currentDate = Get-Date -Format "yyyy-MM-dd"
$backupFilePath = "F:\Backups\EXAMPLE-Backup-$currentDate.bak"
$logFilePath = "F:\Backup-Logs\EXAMPLE-Backup-Logs.txt"
$daysToKeep = 10
$mcPath = "F:\mc.exe"
$minioUrl = "https://storage.example.com"
$accessKey = "ACCESS_KEY"
@aKamrani
aKamrani / change-hostname.sh
Created October 24, 2024 13:19
change hostname bash script
```
#!/bin/bash
# Check if a VM name was provided as an argument
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <new-vm-name>"
exit 1
fi
NEW_VM_NAME="$1"
@aKamrani
aKamrani / Boundary
Last active September 17, 2024 15:32
Hashicorp Boundary - Docker & Configures - Master/Worker Arch - other descriptions on telegram devops channel
This include Boundary Configs
Hashicorp Boundary - Docker & Configures - Master/Worker Arch - other descriptions on telegram devops channel
@aKamrani
aKamrani / mysql-config
Created September 10, 2024 17:30
Configure MySQL database
[mysqld]
# ------------------------------------------
# GENERAL SETTINGS
# ------------------------------------------
innodb_buffer_pool_size = 8G # بهتره 60-70 درصد از RAM رو بهش بدی، واسه سیستم‌های پرترافیک خیلی خوبه
innodb_buffer_pool_instances = 8 # به ازای هر 1GB یه instance درست کن، اگه buffer pool از 1GB بیشتره، این عددو ببر بالا
innodb_log_file_size = 2G # این لاگ تراکنش‌ها رو نگه می‌داره، واسه حجم کارای سنگین 2G خوبه
innodb_log_buffer_size = 256M # بافر لاگ تراکنش‌ها، با این مقدار تراکنش‌های نوشتنی رو راحت‌تر می‌کنه
innodb_flush_log_at_trx_commit = 1 # این مقدار رو بذار 1 تا تضمین کنه همه تراکنش‌ها امن هستن، اما اگه کارایی بیشتر می‌خوای و نگران از دست رفتن داده‌ها نیستی می‌تونی بذاری 2
@aKamrani
aKamrani / NTP-Configure.md
Last active August 11, 2024 07:29
Configure NTP server & client

https://vitux.com/how-to-install-ntp-server-and-client-on-ubuntu/

  • ntpq -p
  • ntpdate
@aKamrani
aKamrani / Dummies
Last active August 16, 2025 09:00
My Dummies :)
my dummies goes here on comments!
1- change password
2- docker-compose up -d
3- after docker-compose up -d comment all part of init-db out to prevent initing db in next times
In boundary clients need to connect to API (9200) and worker (9201) to be able to proxy to targets
@aKamrani
aKamrani / Reset Harbor Password
Last active June 10, 2024 09:15
Reset Harbor Password
https://knowledge.broadcom.com/external/article/329106/how-to-reset-and-retrieve-forgotten-harb.html
To retrieve the admin password configured initially during the deployment of Harbor tile vm:
Log in to Harbor instance by running:
bosh -d harbor-container-registry-xxxxxxxxxxxxxxxxxxxx ssh
Provide root privileges by running sudo -i.
Set the docker environment alias by running the below command:
@aKamrani
aKamrani / DNS Timeout etc-resolv.conf
Created May 26, 2024 13:30
DNS Timeout /etc/resolv.conf
options timeout:100 attempts:10 rotate