Skip to content

Instantly share code, notes, and snippets.

@selivan
selivan / gist:ec62999ba3116323929bee74aae6d0a2
Last active March 12, 2024 09:37
xray-domains-nekoray
geoip:ru
geoip:by
------
geosite:category-gov-ru
domain:ru
domain:su
domain:xn--p1ai
domain:by
domain:xn--90ais
domain:yandex.net
#!/bin/sh
# Accept all traffic first to avoid ssh lockdown via iptables firewall rules #
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
# Flush All Iptables Chains/Firewall rules #
iptables -F
# Delete all Iptables Chains #
geoip:ru,
geoip:by,
geosite:category-gov-ru,
domain:ru,
domain:su,
domain:xn--p1ai,
domain:by,
domain:xn--90ais,
domain:vk.com,
domain:userapi.com,
@echo off
:: https://privacy.sexy — v0.12.4 — Tue, 03 Oct 2023 15:55:39 GMT
:: Ensure admin privileges
fltmc >nul 2>&1 || (
echo Administrator privileges are required.
PowerShell Start -Verb RunAs '%0' 2> nul || (
echo Right-click on the script and select "Run as administrator".
pause & exit 1
)
exit 0
@selivan
selivan / gist:04d61e0bea490ce17043a7a7e7661020
Created February 6, 2023 11:51
View - Key history and script info
2D 152 i d 0.00 Insert
2D 152 i u 0.00 Insert
2C 137 u 0.26 PrintScreen
74 03F d 0.55 F5
74 03F u 0.08 F5
5B 15B d 6.64 LWin
2C 137 d 0.27 PrintScreen
2C 137 u 0.14 PrintScreen
5B 15B u 0.20 LWin
74 03F d 1.50 F5
@selivan
selivan / render-jinja-template.py
Created March 5, 2021 22:04
Python3 script to render jinja2 template. Requirements: pip install jinja2
#!/usr/bin/env python3
from jinja2 import Template
import sys
if len(sys.argv) < 3:
print(f'Usage: sys.argv[0] template_file output_file')
template_file = sys.argv[1]
out_file = sys.argv[2]
@selivan
selivan / docker-compose.yml
Created February 5, 2021 00:51
docker-compose for test one-node elastic and kibana
version: '3'
services:
elastic-node1:
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2
container_name: elastic-node1
environment:
- node.name=elastic-node1
- discovery.type=single-node
- bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
@selivan
selivan / generate-bundle-certs.sh
Last active December 1, 2020 22:08
Letsencrypt hook to generate combined fullchain+privkey certificates for software like Haproxy
#!/bin/bash
# SAVE TO /etc/letsencrypt/renewal-hooks/post/generate-bundle-certs.sh
# chmod a+x /etc/letsencrypt/renewal-hooks/post/generate-bundle-certs.sh
find /etc/letsencrypt/live -mindepth 1 -maxdepth 1 -type d -print0 | while IFS='' read -d $'\0' dir; do
# Update only if necessary
test -e "$dir/fullchain.pem" -a \
-e "$dir/privkey.pem" -a \
-e "$dir/fullchain_and_privkey.pem" && \
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFgZ3rMBEAC++XgX78AfLYt0i/1HyW3GxuVRb/yvWA5EmXOLhM0yVPczkRDe
qM96iTtWDx0UzX1/AL9D6jFcZ+N4DL8oWVgK2V/ZYC/zrIXGEBWOHA5BnRisn5Xr
dZVv1Lb1iZaoAkk6CgHTh53zYUqqAs6h2AgBfXQL7aUp6FIw2Oe0tUWORL18/iRG
LZgcd0ChuMI0C83NRtAu7ksSZJdf/9f7aQuv1mevvaUswdxW4122WEJ4ZHD7qOhh
5at+oQ52+Je0ugLp2jLRkCGWzxZBd1koJadprS+iBR0czegb9jYv+c5HvjztsEAp
1k5aKjcNAD44yXksRINQw07bMrBto402qLx97bxo/oNzLnDNjckQaf74H2gCt4xJ
naTnufRGqy+NZeJ49Vi4ks3J1SG2kIQwH2D0uOye1NcWJcMWSFbn/PJQQUQa9sib
XC07Q9we3QbxbYFmo0HmyY2BJi3D3Z6Kn8zY4CqZkVNTO75lBUDH3+DPNZToS5Fn
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/elastalert/util.py", line 26, in get_module
module_path, module_class = module_name.rsplit('.', 1)
ValueError: not enough values to unpack (expected 2, got 1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/elastalert/loaders.py", line 461, in load_alerts
alert_field = [create_alert(a, b) for a, b in alert_field]