- Add the environment variables to
/etc/environment
$ vi /etc/environment
LC_ALL="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LANGUAGE="en_US.UTF-8"
#!/usr/bin/env bash | |
# export CONSUL_HTTP_ADDR=http://127.0.0.1:8500 | |
# export CONSUL_HTTP_TOKEN=... | |
service=$1 | |
filter_expression=$2 | |
mode=${3:-'health'} | |
if [ -z $CONSUL_HTTP_ADDR ]; then |
#!/usr/bin/env bash | |
# Credits | |
# https://stackoverflow.com/questions/427979/how-do-you-extract-ip-addresses-from-files-using-a-regex-in-a-linux-shell | |
file=$1 | |
seperator=${2:-'\n'} | |
result=$(grep -E -o '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' $file) | |
for ip in $result; do |
#!/bin/sh | |
# Credits: | |
# https://www.jamf.com/jamf-nation/discussions/28033/uninstall-trend-micro-security-script | |
# Copyright: EVRY | |
# Filename: UninstallTrend.sh | |
# Requires: - | |
# Purpose: Removes Trend Micro Security | |
# Contact: Anders Holmdahl <[email protected]> | |
# Mod history: 2018-01-31 |
### Credits | |
# https://visibilityspots.org/nexus-oss-repository-manager.html | |
user nginx; | |
worker_processes auto; | |
events { | |
worker_connections 1024; | |
} |
[alertmanagers] | |
10.250.250.1 | |
10.250.250.2 | |
10.250.250.3 |
#!/bin/sh | |
LIMIT=$1 | |
redis-cli keys "*" | head -n $LIMIT > keys.txt | |
cat keys.txt | xargs -n 1 -L 1 redis-cli ttl > ttl.txt | |
paste -d " " keys.txt ttl.txt | grep .*-1$ | cut -d " " -f 1 | xargs redis-cli del |
#!/bin/bash | |
# https://stackoverflow.com/questions/43799932/rabbitmq-list-queues-on-all-vhosts | |
for i in $(rabbitmqctl list_vhosts); do | |
echo "vhost: $i" && rabbitmqctl list_queues -p $i; | |
done |
#!/usr/bin/env bash | |
DIRPATH=$1 | |
OUTFILE=$2 | |
if [ -z "$1" ]; then | |
DIRPATH="$HOME/.kube/clusters" | |
fi | |
if [ -z "$2" ]; then | |
OUTFILE="$HOME/.kube/config" |