Skip to content

Instantly share code, notes, and snippets.

View juffaz's full-sized avatar

Juffaz juffaz

  • Baku
View GitHub Profile
@juffaz
juffaz / python-gitlab-webhook-telegram-alarm-changes-count.py
Last active April 25, 2024 06:37
python-gitlab-webhook-telegram-alarm-changes-count.py
[root@docker01test gitlab-webhook]# ls
app.py Dockerfile req.txt
[root@docker01test gitlab-webhook]# cat app.py
import os
from flask import Flask, request, jsonify
import json
import requests
app = Flask(__name__)
@juffaz
juffaz / arch-sound-fix.sh
Created April 15, 2024 21:06
arch-sound-fix.sh
pacman -Rdd wireplumber && pacman -S pipewire-media-session
https://bbs.archlinux.org/viewtopic.php?id=277743
What are your issues? Wireplumber is the officially recommended option to handle pipewire session logic including bluetooth, which works just fine here.
Trying to remove it for a quick short term fix might lead to issues later down the line.
So your real issue is with bluetooth. Instead of asking for help with that, you decided to take a wrong path in trying to fix it, which also didn't work, then that's what you asked for help with. This is the definition of an xy-problem.
@juffaz
juffaz / vault-policy-search-secret.sh
Created March 27, 2024 14:20
vault-policy-search-secret.sh
#!/bin/bash
DATABASES=("db/postdb" "db/camunda" "secret/mydb")
read_policy() {
local policy_name=$1
local policy_content=$(vault policy read $policy_name)
echo "$policy_content" | while read -r line; do
for database in "${DATABASES[@]}"; do
@juffaz
juffaz / gitlab-ci.yaml-k3s
Created March 25, 2024 15:54
gitlab-ci.yaml-k3s
stages:
- deploy-test
- deploy-prod
deploy-prod:
image:
name: bitnami/kubectl:1.27.3
entrypoint: [""]
stage: deploy-prod
only:
@juffaz
juffaz / ips-auth-sessionid-restart-telegram.sh
Created February 27, 2024 14:25
/root/ips-auth-sessionid-restart-telegram.sh
[root@nomad01test ~]# cat /root/ips-auth-sessionid-restart-telegram.sh
#!/bin/bash
TELEGRAM_BOT_TOKEN="571111150:AAG111cO7itQ7vfdsfdsfdsjFDFDpGl9FDFDSdDOz4"
TELEGRAM_CHAT_ID="-100111111971111"
job_name="ips-auth"
error_pattern="Connection state is null, that means there is not any active connection"
last_restart_file="/tmp/last_restart_timestamp.txt"
@juffaz
juffaz / python-pandas-parse-group-logs.py
Created February 23, 2024 14:17
python-pandas-parse-group-logs.py
import pandas as pd
import re
# Добавление новых данных в DataFrame
data = {
'key': [
"/loans-clone/11111111-124221101/accounts",
"/loans-clone/11111111-124221101/schedule",
"/loans-clone/22222222-1162201111/accounts",
"/loans-clone/123456-102228111/accounts",
@juffaz
juffaz / kubernetes-front.yml
Created February 22, 2024 11:45
kubernetes-front.yml
---
apiVersion: v1
kind: Namespace
metadata:
name: k3s-test
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: front-deploy
@juffaz
juffaz / elasticsearch-groupby-regex-microservice-endpoint
Last active January 24, 2024 20:53
elasticsearch-groupby-regex-microservice-endpoint
GET /api-log-2024.01.24/_search
{
"_source": ["client-request.uri"],
"query": {
"regexp": {
"client-request.uri.keyword": "/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^?]+)"
}
}
}
@juffaz
juffaz / prometheus.yml
Created December 27, 2023 08:30
prometheus.yml
[root@ .grafana]# cat prometheus/prometheus.yml
---
# my global config
global:
scrape_interval: 15s #Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s #Evaluate rules every 15 seconds.Thedefaultisevery1 minute.
external_labels:
monitor: 'prometheus-project'
rule_files:
@juffaz
juffaz / docker-compose.yml
Created December 27, 2023 08:24
docker-compose.yml-grafana-victoria-prometheus
[root@ .grafana]# cat docker-compose.yml
version: '3.7'
volumes:
prometheus_data: {}
grafana_data: {}
networks:
front-tier:
back-tier: