Skip to content

Instantly share code, notes, and snippets.

@yolleksandr
yolleksandr / gist:47ef6855d4e36043b3feaa84c0a97c80
Last active May 29, 2020 19:29
haproxy response 429 if high rate for 4xx or 4xx response codes
haproxy.cnf
acl acl_oauth_path path_beg /oauth
acl acl_4xx_status status 400 401 403
acl acl_5xx_status status 500 501 502 503 504 505 506 507 508 509 510 511 598 599
http-request track-sc0 src table oauth_4xx_table if acl_oauth_path
http-request track-sc1 src table oauth_5xx_table if acl_oauth_path
http-response sc-inc-gpc0(0) if acl_4xx_status
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -F
iptables -t mangle -F
iptables -F
iptables -X
certbot certonly -d *.domain.com -m hostmaster@domain.com --server https://acme-v02.api.letsencrypt.org/directory --manual
https://wiki.mikrotik.com/wiki/Manual:Scripting
https://wiki.mikrotik.com/wiki/Manual:Scripting-examples#Detect_new_log_entry
Prepare
1. Create bot via botfather and get token
2. Add bot to chat
3. Get chat id
On device
@yolleksandr
yolleksandr / innobackupex
Created June 27, 2019 07:07
innobackupex on debian 9
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
sudo apt-get install percona-xtrabackup-24
Enable millisecond resolution for java log4j for all .xml files with backup:
find . -name "*xml" -print0 | xargs -0 sed -i.no_milliseconds 's/:ss/:ss\.SSS/g'
elasticsearch — FORBIDDEN/12/index read-only / allow delete (api)
PUT qa-gidra-filebeat-2019.03.21/_settings
{
"index": {
"blocks": {
"read_only_allow_delete": "false"
}
}
}
@yolleksandr
yolleksandr / gist:5d6cca2c34e636725b64444bedb08fcb
Created February 15, 2019 20:38
Cassandra restore node after failure
https://docs.datastax.com/en/cassandra/3.0/cassandra/operations/opsReplaceNode.html
nodetool removenode ID
delete from snitch
restart live nodes
delete data dir on false node
enable bootstrap
start
openssl pkcs12 -info -in keyStore.p12
ALTER TABLE tablename MODIFY columnname VARCHAR(20) ;