Skip to content

Instantly share code, notes, and snippets.

Christian S. KeyboardInterrupt

Block or report user

Report or block KeyboardInterrupt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@KeyboardInterrupt
KeyboardInterrupt / list_all_user_crontabs.sh
Created Oct 25, 2019
list all user specific crontabs
View list_all_user_crontabs.sh
#!/bin/bash
for user in /var/spool/cron/crontabs/*
do
echo #${user}'s crontab:
cat ${user}
done
@KeyboardInterrupt
KeyboardInterrupt / crm.fact
Last active Aug 14, 2019
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.
View crm.fact
#!/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 / build_ssh_config.sh
Created Aug 2, 2019
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!
View build_ssh_config.sh
#!/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";;
@KeyboardInterrupt
KeyboardInterrupt / dim.sh
Last active May 14, 2019
Redshift and dim/undim your screens with easy to use commands.
View dim.sh
#!/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 / systemdunit.py
Created Feb 26, 2019 — forked from esamattis/systemdunit.py
Install Systemd units using Ansible
View systemdunit.py
"""
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
View gist:22d5fcfee2019587f60e00ab7b7a5b56
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
View apt-get-dist-upgrade.yml
# TODO:
- name: TODO At this point we should create a VM Snapshot
debug:
msg: "create a Snapshot via VMWare or whatever your Virtualisation Solution is"
# do an "apt-get update", to ensure latest package lists
- name: apt-get update
apt:
update-cache: yes
changed_when: 0
View lxd_deploy.yml
- 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 Jul 16, 2018
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/
View Tilix Configuration
[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
You can’t perform that action at this time.