Skip to content

Instantly share code, notes, and snippets.

View bodsch's full-sized avatar

Bodo Schulz bodsch

View GitHub Profile
@MarcoMatarazzo
MarcoMatarazzo / check_redis.py
Last active September 5, 2022 17:50 — forked from luanntvn/check_redis.py
Redis check for Nagios and Icinga, with perfdata
#!/usr/bin/python
#
# LICENSE: MIT
#
# Copyright (C) 2017 Marco Matarazzo
#
# Based on check_redis.py from Samuel Stauffer
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@geerlingguy
geerlingguy / ansible-role-test.sh
Last active January 18, 2024 17:37
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
@jonatanblue
jonatanblue / docker_py_to_docker.md
Last active July 18, 2019 12:15
Resolve docker-py older version naming conflict

Problem

When running docker-compose I get this error:

docker-compose --version
> ERROR: Dependency conflict: an older version of the 'docker-py' package is polluting the namespace. Run the following command to remedy the issue:
> pip uninstall docker docker-py; pip install docker
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@luanntvn
luanntvn / check_redis.py
Last active September 5, 2022 17:50 — forked from samuel/check_redis.py
Redis health and memory check for Nagios
#!/usr/bin/python
#
# LICENSE: MIT
#
# Copyright (C) 2014 Samuel Stauffer
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@CMCDragonkai
CMCDragonkai / bash_sockets.sh
Last active July 6, 2022 18:11
Bash: Socket Programming (Alternative to using Netcat)
#!/usr/bin/env bash
# consider if the server is passing a file like
while true; do nc -l 10000 <<<"hi"; done
# on our client side, we can consume this using nc
nc 10.0.0.1 10000
@AdamOssenford
AdamOssenford / ansible-summary.md
Created January 18, 2016 00:50
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@mayank-io
mayank-io / pg_truncate_tables.sql
Created January 9, 2016 07:59
Postgres: Truncate all tables in PUBLIC schema for a given USER
-- Running this snippet creates a function. This function can then be executed
-- in this manner:
-- SELECT truncate_tables('postgres');
CREATE OR REPLACE FUNCTION truncate_tables(_username text)
RETURNS void AS
$func$
BEGIN
RAISE NOTICE '%',
-- EXECUTE -- dangerous, test before you execute!
@jhrcz
jhrcz / tmux-ansible.sh
Last active September 22, 2020 08:08
combining tmux, tmux-cssh and ansible - cluster ssh alternative with ansible inventory, uses https://github.com/dennishafemann/tmux-cssh
#!/bin/bash
login=root
grp="$1"
shift
tmux-cssh -u $login -sc `ansible ${grp:-all} -i ${CSSH_ANSIBLE_INVENTORY:-hosts.ini} --list-hosts` "$@"