This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Lorenzo Gaggini | |
# | |
# Calculates the password expiration date based on pwdChangeTime | |
# validity in days | |
usage() { | |
cat <<USAGE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Author: Lorenzo Gaggini - [email protected] | |
# Check if a the target path has the expected permissions | |
# | |
# Usage: ./check_file_perms.sh -t target_path -p expected_permissions | |
function usage() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python2 | |
# Author: Lorenzo Gaggini | |
# Version: 0.1 | |
# | |
# Retrieve accounts info from pass (passwordstore.org) | |
# to be used in dotfiles instead of clear passwords: | |
# pass is on the first line, username on the second one. | |
from subprocess import check_output | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Author: Lorenzo Gaggini | |
# Version: 0.1 | |
# | |
# Get cluster info by ansible and ansible-cmdb | |
#check input | |
if [ "$#" -ne 1 ]; then | |
echo "usage: cluster_info.sh group | host" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOST={{ some_master_hostname/ip address }} | |
PORT=9200 | |
TO_NODE="{{ destination_node }}" | |
curl "http://$HOST:$PORT/_cat/shards" | grep UNAS | awk '{print $1" "$2}' | while read var_index var_shard; do | |
curl -XPOST "http://$HOST:$PORT/_cluster/reroute?pretty" -H 'Content-Type: application/json' -d " | |
{ | |
\"commands\" : [ | |
{ | |
\"allocate_stale_primary\": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Author: Lorenzo Gaggini - [email protected] | |
# Check if a file matching file pattern in a path matching path | |
# pattern was modified in the last N minutes and it raise a CRITICAL | |
# if it's the case, it's OK otherwise. | |
# | |
# Usage: ./check_mod_file_glob.sh -p path_pattern -f file_pattern -c minutes | |
function usage() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://cyprio.net/wtf/2012-08-13-using-newsbeuter-with-tmux-and-w3m-to-read-news.html | |
W3M='/usr/bin/w3m' | |
# If the window has only one pane, create one by splitting. | |
pane_count=`tmux list-panes -F '#{line}' | wc -l` | |
if [ $pane_count -lt 2 ]; then | |
tmux split-window -h | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Author: Lorenzo Gaggini | |
# Version: 0.2 | |
# | |
# Create a naughty awesome wm notification by title | |
# and message on secondary (big) screen | |
# init env for cron/at execution | |
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus | |
export DISPLAY=:0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Erik Kristensen, Lorenzo Gaggini | |
# Email: [email protected], [email protected] | |
# License: MIT | |
# Nagios Usage: check_nrpe!check_docker_container!_container_id_ | |
# Usage: ./check_docker_container.sh _container_id_ | |
# | |
# The script checks if a container is running and grab performance data | |
# OK - running |
NewerOlder