Skip to content

Instantly share code, notes, and snippets.

View arsalanses's full-sized avatar
🧠
lets play chess

Arsalan Sefidgar arsalanses

🧠
lets play chess
View GitHub Profile
@arsalanses
arsalanses / compose.yml
Last active December 14, 2024 17:55
caddy + v2ray
services:
# caddy:
# image: docker.arvancloud.ir/caddy:2.8-alpine
# restart: unless-stopped
# command: caddy reverse-proxy --access-log --from https://domain:443 --to http://jumper:6157
# ports:
# - "80:80"
# - "443:443"
# - "443:443/udp"
# volumes:
@arsalanses
arsalanses / CronJob.yml
Last active October 17, 2024 12:10
arvancaas minio api svc ingress
apiVersion: batch/v1
kind: CronJob
metadata:
name: minio-cleanup
namespace: devops-storage
spec:
schedule: "0 * * * *"
jobTemplate:
spec:
template:
@arsalanses
arsalanses / compose.yml
Last active October 12, 2025 09:55
cadvisor
services:
cadvisor:
container_name: cadvisor
hostname: cadvisor
image: gcr.io/cadvisor/cadvisor:${CADVISOR_VERSION}
restart: unless-stopped
privileged: true
networks:
backend: null # backend communications
caddy_caddynet: null # frontend communications (web UI)
@arsalanses
arsalanses / README.txt
Last active November 16, 2025 08:14
minio policy example
# This script sets up a MinIO server with a bucket and user, and configures policies for read/write access and public read access.
openssl rand -hex 10
openssl rand -hex 20
mc alias set local http://127.0.0.1:9000 f2fc721724d133e6ebeb 62f2c9d238737b3893721fdbfb3147c5571ddb94
# Create a bucket named 'bucketname' and set a quota of 25GB
mc mb local/bucketname
mc quota set local/bucketname --size 25G
# Create a user named 'bucketuser' with a specific access key and secret key
@arsalanses
arsalanses / compose.yml
Created October 5, 2024 11:55
caddy + healthchecks
services:
caddy:
image: caddy:2.6.4
restart: unless-stopped
command: caddy reverse-proxy --from https://hc.monkeyseemonkeydo.lv:443 --to http://web:8000
ports:
- 80:80
- 443:443
volumes:
- caddy:/data

swarm init

docker swarm init --data-path-port=7789 --advertise-addr <ip-addr>
docker network create -d overlay --attachable proxy
@arsalanses
arsalanses / Dockerfile
Last active December 14, 2024 17:56
queue exporter
FROM python:3.8-slim-buster
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY exporter.py .
CMD ["python", "exporter.py"]
@arsalanses
arsalanses / cloud-init.yaml
Created September 24, 2024 11:17 — forked from syntaqx/cloud-init.yaml
cloud init / cloud config to install Docker on Ubuntu
#cloud-config
# Option 1 - Full installation using cURL
package_update: true
package_upgrade: true
groups:
- docker
system_info:

Master

CREATE USER 'replica'@'%' IDENTIFIED BY 'password';
GRANT REPLICATION SLAVE ON *.* TO 'replica'@'%';
FLUSH PRIVILEGES;
nice mysqldump -h 127.0.0.1 --port 123 -u root -p'' --single-transaction --opt --skip-lock-tables --all-databases --source-data=2 > snapshot.sql
#!/bin/bash
set -xue
# Synchronize the system clock with an NTP server
sudo ntpdate pool.ntp.org
# Get the current UTC time
current_utc=$(date -u +"%Y-%m-%d %H:%M:%S")
# Convert the current UTC time to a timestamp