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
""" | |
Ubuntu update manager for Fabric | |
Checks for updates, installs them across multiple servers | |
Create a "hosts" file alongside this fabfile and put your hosts in there one per line | |
Updating package list:: | |
fab update |
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 | |
#--------------------------- | |
#-- dynamic_motd -- | |
#-- by lgaggini -- | |
#-- CC BY-SA 3.0 -- | |
#--------------------------- | |
echo -e " | |
db d888b .d8b. d888b d888b d888888b d8b db d888888b | |
88 88' Y8b d8' 8b 88' Y8b 88' Y8b 88' 888o 88 88' |
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 |
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/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 - [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
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 | |
# 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
#! /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 |
OlderNewer