Skip to content

Instantly share code, notes, and snippets.

Node 1 Redis Master
```
10.4.1.31:6380> info replication
# Replication
role:master
connected_slaves:2
slave0:ip=10.4.1.33,port=6380,state=online,offset=364,lag=0
slave1:ip=10.4.1.32,port=6380,state=online,offset=364,lag=0
master_failover_state:no-failover
@linuxmail
linuxmail / puppet-firewall-docker.pp
Created December 19, 2022 11:49 — forked from pmoranga/puppet-firewall-docker.pp
Make puppetlabs-firewall works with docker smoothly
class my_fw::pre {
# Disable due to selective purges of firewallchain
# resources { "firewall":
# purge => true
# }
# Avoid removing Docker rules:
firewallchain { 'FORWARD:filter:IPv4':
purge => true,
@linuxmail
linuxmail / move-storage.sh
Created August 24, 2021 12:53 — forked from mrl22/move-storage.sh
Bash script to move storage of all Proxmox Virtual Machines to different storage
#!/bin/sh
movefrom='micronssd'
moveto='wdredpro'
for vm in $(qm list | awk '{print $1}' | grep -Eo '[0-9]{1,3}');
do
for storage in $(qm config $vm | grep $movefrom: | awk '{print $1}' | grep -Eo '[a-z0-9]+');
do
echo Moving VM$vm Storage $storage
@linuxmail
linuxmail / check_graylog_json.sh
Last active January 24, 2020 11:27
Check graylog stream for firewall blocks
#!/bin/sh
# STREAM_ID needs to be replaced with Graylog STREAMID.
DC1_FGT_DENY="$(curl -s --netrc-file /etc/icinga2/secrets/graylog_auth_file -k -H 'Accept: application/json' -X GET "https://dc1-graylog.example.com:443/api/search/universal/relative?query=deny&range=60&filter=streams%3ASTREAM_ID&fields=action%2Cmessage" | jq '.total_results')"
DC2_FGT_DENY="$(curl -s --netrc-file /etc/icinga2/secrets/graylog_auth_file -k -H 'Accept: application/json' -X GET "https://dc2-graylog.example.com:443/api/search/universal/relative?query=deny&range=60&filter=streams%3ASTREAMD_ID&fields=action%2Cmessage" | jq '.total_results')"
echo "Blocked packages: DC1 $DC1_FGT_DENY, DC2 $DC2_FGT_DENY|dc1=$DC1_FGT_DENY dc2=$DC2_FGT_DENY"
# config file for TMUX 2.1
# http://www.cs.ru.nl/~gdal/dotfiles/.tmux.conf
# good practice: don't use different aliases for the same command
# set --> set-option
# setw --> set-window-option
# run --> run-shell
# bind --> bind-key
# -r flag: enable keep hitting bind key without prefix
# -n flag: enable bind key without prefix
@linuxmail
linuxmail / agent.pp
Last active May 24, 2019 11:44
Puppet Icinga2 profile
# Included for normal nodes, via base.pp and boolean in Hiera
class profile::icinga2::agent(
Hash $parent_endpoints,
String $parent_zone,
String $zone_name = 'ZoneName',
$apiuser_name = false,
$apiuser_password = false,
Boolean $manage_repo = $profile::icinga2::params::manage_repo,
Array $features = ['mainlog'],
Stdlib::Compat::Ip_address $agent_ip = $::default_ipaddress,
### Keybase proof
I hereby claim:
* I am linuxmail on github.
* I am linuxmail (https://keybase.io/linuxmail) on keybase.
* I have a public key whose fingerprint is 9281 E9D2 068D 2F98 4A7E 63B8 2A5C E192 AB7D 3FE0
To claim this, I am signing this object: