Skip to content

Instantly share code, notes, and snippets.

View juffaz's full-sized avatar

Juffaz juffaz

  • Baku
View GitHub Profile
@juffaz
juffaz / zabbix-agent2-for-debian11.sh
Last active July 30, 2025 10:24
zabbix agent2 for debian11
##### zabbix agent2 for debian11
apt update && apt install -y wget
wget https://repo.zabbix.com/zabbix/7.2/release/debian/pool/main/z/zabbix-release/zabbix-release_latest_7.2+debian11_all.deb
dpkg -i zabbix-release_latest_7.2+debian11_all.deb
apt update && apt install -y zabbix-agent2
sed -i 's/^Server=127.0.0.1/Server=10.10.1.51/' /etc/zabbix/zabbix_agent2.conf
sed -i 's/^ServerActive=127.0.0.1/ServerActive=10.10.1.51/' /etc/zabbix/zabbix_agent2.conf
grep -q '^Hostname=' /etc/zabbix/zabbix_agent2.conf \
@juffaz
juffaz / autoexec.cfg
Created May 31, 2025 06:07
autoexec.cfg steam cs2
[juff@omen2025 ~]$ cat ~/.local/share/Steam/steamapps/common/Counter-Strike\ Global\ Offensive/game/csgo/cfg/autoexec.cfg
cl_showfps 1
fps_max 300
rate 786432
sensitivity 2.0
bind "F1" "buy ak47; buy vesthelm"
host_writeconfig
[juff@omen2025 ~]$
@juffaz
juffaz / pacman-hook-kernel-efi
Last active May 3, 2025 15:43
pacman-hook-kernel-efi
[root@omen2025 ~]# cat /etc/pacman.d/hooks/copy-kernel.sh
#!/bin/bash
if ! mountpoint -q /boot; then
echo "/boot is not mounted, skipping kernel copy" >&2
exit 0
fi
cp -v /boot/vmlinuz-linux /boot/EFI/refind/vmlinuz-linux
cp -v /boot/initramfs-linux.img /boot/EFI/refind/initramfs-linux.img
cp -v /boot/initramfs-linux-fallback.img /boot/EFI/refind/initramfs-linux-fallback.img
@juffaz
juffaz / calico-cloudflare.sh
Created January 4, 2025 09:09
calico-cloudflare.sh
root@gnizdo ~/cloudflare # cat calico-cloudflare.sh
#!/bin/bash
# Получить актуальные IPv4-адреса Cloudflare
CF_IPS_V4=$(curl -s https://www.cloudflare.com/ips-v4)
# Создать YAML для GlobalNetworkPolicy
cat <<EOF > cloudflare-ipv4-policy.yaml
apiVersion: projectcalico.org/v3
kind: GlobalNetworkPolicy
@juffaz
juffaz / k3s with calico -reinstall
Created January 4, 2025 09:08
k3s with calico -reinstall
sudo /usr/local/bin/k3s-uninstall.sh
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" INSTALL_K3S_EXEC="--flannel-backend=none --cluster-cidr=192.168.0.0/16 --disable-network-policy --disable=traefik" sh -
kubectl get nodes
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.29.1/manifests/tigera-operator.yaml
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.29.1/manifests/custom-resources.yaml
kubectl get nodes
watch kubectl get pods --all-namespaces
kubectl get nodes
kubectl get nodes -o wide
@juffaz
juffaz / cf2netpol.sh
Created December 20, 2024 10:02
cf2netpol.sh - update network policy yaml with new cloudflare subnet
root@host ~ # cat cf2netpol.sh
#!/bin/bash
# URL to fetch the latest Cloudflare IP ranges
cloudflare_url="https://api.cloudflare.com/client/v4/ips"
# Path to the YAML file to be updated
yaml_file="traefik-networkpolicy.yaml"
# Fetch Cloudflare IP ranges
echo "Fetching Cloudflare IP ranges..."
@juffaz
juffaz / k3s traefik - disable 80 http port .txt
Created December 19, 2024 13:25
k3s traefik - disable 80 http port
curl -sfL https://get.k3s.io | sh -s - --disable=traefik
helm repo add traefik https://traefik.github.io/charts
helm install traefik traefik/traefik --namespace kube-system
kubectl edit svc traefik -n kube-system
### comment or remove web/80 port config
@juffaz
juffaz / check_and_send_logs.sh
Created August 28, 2024 10:40
bash-script-check-msg-send-me-logs
root@k3s01:~/scripts# cat /root/scripts/check_and_send_logs.sh
#!/bin/bash
##### and add this script to CRON "* * * * * /root/scripts/check_and_send_logs.sh"
# Variables from environment
ELAN_BOTURL="https://api.telegram.org/bot6022113232328:AAEfdsfdsdsadsadsadmh0niW_XDw9fsdfdsfdsfdsSMFU"
ELAN_CHATID="-8101111111"
BOT_URL=$ELAN_BOTURL
@juffaz
juffaz / custom-metrics.toml
Created July 29, 2024 13:19
custom-metrics.toml oracle exporter
[[metric]]
context = "scheduler_jobs"
labels = [ "job_name", "state" ]
metricsdesc = { job_name = "Name of the scheduler job.", state = "Current state of the scheduler job.", value = "scheduler jobs metric with values." }
request = '''
SELECT
JOB_NAME AS job_name,
STATE AS state,
COUNT(*) AS value
FROM
@juffaz
juffaz / keyclock-nomad-dev.job
Created July 23, 2024 13:59
keyclock-nomad-dev.job
job "keycloak" {
datacenters = ["test-dc1"]
type = "service"
group "keycloak" {
count = 1
task "keycloak" {
driver = "docker"