Skip to content

Instantly share code, notes, and snippets.

View KeyboardInterrupt's full-sized avatar
🐍
Living by the Zen of Python `import this`

KeyboardInterrupt

🐍
Living by the Zen of Python `import this`
View GitHub Profile
- hosts: localhost
become: no
connection: local
vars:
action: build
image: ubuntu/xenial/amd64
user: ubuntu
pubkey_file: "{{ ansible_env.HOME}}/.ssh/id_rsa.pub"
machines:
- moep-fs00
@KeyboardInterrupt
KeyboardInterrupt / Tilix Configuration
Last active July 16, 2018 08:38
To load this configuration into Tilix pipe it into: `dconf load /com/gexperts/Tilix/` i.E. curl https://gist.githubusercontent.com/KeyboardInterrupt/838f489e4e86ae153f912283018a8428/raw/cb172bc178e5764edde8d08758f0661f38f42834/Tilix%2520Configuration | dconf load /com/gexperts/Tilix/
[profiles]
list=['2b7c4080-0ddd-46c5-8f23-563fd3ba789d', '4cfe5cb4-235e-40cd-ad8a-5ed263275340', '51ef3ee5-6189-4cdf-929e-f9f41690e5f1']
[profiles/4cfe5cb4-235e-40cd-ad8a-5ed263275340]
foreground-color='#EEEEEEEEECEC'
visible-name='DANGER!'
palette=['#000000', '#CC0000', '#4D9A05', '#C3A000', '#3464A3', '#754F7B', '#05979A', '#D3D6CF', '#545652', '#EF2828', '#89E234', '#FBE84F', '#729ECF', '#AC7EA8', '#34E2E2', '#EDEDEB']
badge-color-set=true
cursor-colors-set=false
highlight-colors-set=false
@KeyboardInterrupt
KeyboardInterrupt / gist:22d5fcfee2019587f60e00ab7b7a5b56
Created October 29, 2018 07:02
git clone a github organisation
ORGANISATION="awesome-devops"
curl -s "https://$GITHUB_AT:@api.github.com/orgs/${ORGANISATION}/repos?per_page=200" | jq .[].ssh_url | xargs -n 1 git clone
@KeyboardInterrupt
KeyboardInterrupt / systemdunit.py
Created February 26, 2019 08:19 — forked from esamattis/systemdunit.py
Install Systemd units using Ansible
"""
Install Systemd units using Ansible
Handles unit restarting and systemd daemon reloading when the unit changes.
Also stops the unit correctly when uninstalled
In your playbook put this file to library/systemdunit.py and make sure the
server has python-sh package installed
@KeyboardInterrupt
KeyboardInterrupt / dim.sh
Last active May 14, 2019 11:18
Redshift and dim/undim your screens with easy to use commands.
#!/bin/bash
#
# This script can be used to set the Monitor temperatur and
# brightness to nighttime and eye friendly values
# Author: c.stein@keyboardinterrupt.com
# Usage:
# `dim.sh 1` = normal brightness
# `dim.sh .5` = half brightness
for display in $(xrandr --listmonitors | cut -d " " -f 6) ; do
xrandr --output $display --brightness ${1} --gamma 1:.8:.7
@KeyboardInterrupt
KeyboardInterrupt / crm.fact
Last active August 14, 2019 11:49
Ansible Custom Fact to gather Pacemaker Cluster Information - This script is a custom fact for ansible that turns `crm configure show` and `crm_mon` output into a fact that can be used in Ansible. i.E. to iterate over all nodes in a cluster, check for the location of a resource and so on.
#!/usr/bin/python
#
# Description:
# This script is a custom fact for ansible that turns `crm configure show` and `crm_mon`
# output into a fact that can be used in Ansible. i.E. to iterate over all
# nodes in a cluster, check for the location of a resource and so on.
#
# Dependencies:
# - xmltodict - https://pypi.org/project/xmltodict/
#
@KeyboardInterrupt
KeyboardInterrupt / list_all_user_crontabs.sh
Created October 25, 2019 08:02
list all user specific crontabs
#!/bin/bash
for user in /var/spool/cron/crontabs/*
do
echo #${user}'s crontab:
cat ${user}
done
@KeyboardInterrupt
KeyboardInterrupt / github_mirror.py
Created April 28, 2021 06:29 — forked from mgedmin/github_mirror.py
Mirror all my github repositories and gists
#!/usr/bin/env python3
# See http://stackoverflow.com/questions/3581031/backup-mirror-github-repositories/13917251#13917251
# You can find the latest version of this script at
# https://gist.github.com/4319265
import os
import sys
import json
import urllib.request
import subprocess
@KeyboardInterrupt
KeyboardInterrupt / build_ssh_config.sh
Last active July 15, 2021 06:17
I made these Snippets for Inventory to SSH configuration conversion. USE WITH CAUTION the default `StrictHostKeyChecking no` is weakening security by ignoring Host ssh key changes!
#!/bin/bash
cat ~/.ssh/config.d/*
echo "#################################################"
echo "# This will be your new ssh config, is this ok? #"
echo "#################################################"
read -p "Build Config! (y/n)?" choice
case "$choice" in
y|Y ) echo "yes" && cat ~/.ssh/config.d/* > ~/.ssh/config ;;
n|N ) echo "no";;