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
@KeyboardInterrupt
KeyboardInterrupt / clone_all_project_in_gitlab_group.sh
Last active May 15, 2023 09:17
Clone all Git Projects in a Gitlab Group, including Subgroups, by ID
#!/usr/bin/env bash
if [ -z ${GITLAB_BASE_PATH+x} ]; then
read -p "GITLAB_BASE_PATH: " -r GITLAB_BASE_PATH
fi
if [ -z ${GITLAB_READONLY_PRIVATE_TOKEN+x} ]; then
read -p "GITLAB_READONLY_PRIVATE_TOKEN: " -r GITLAB_READONLY_PRIVATE_TOKEN
fi
if [ -z ${GROUP_ID+x} ]; then
read -p "GROUP_ID: " -r GROUP_ID
@KeyboardInterrupt
KeyboardInterrupt / memdump.py
Last active May 31, 2022 10:35 — forked from Dbof/memdump.py
Dump process memory in Linux. See this blog post for more: https://davidebove.com/blog/?p=1620
#! /usr/bin/env python3
import sys
import re
if __name__ == "__main__":
if len(sys.argv) != 2:
print('Usage:', sys.argv[0], '<process PID>', file=sys.stderr)
exit(1)
@KeyboardInterrupt
KeyboardInterrupt / docker-ssh-forward.bash
Created May 23, 2022 07:43 — forked from d11wtq/docker-ssh-forward.bash
How to SSH agent forward into a docker container
docker run --rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash

Hardware specs

Chinese Brand "ITworks" , Model TW891, distributed in France and Belgium by Darty

  • CPU: Intel(R) Atom(TM) CPU Z3735F @ 1.33GHz
  • Video: Intel® HD Graphics for Intel Atom® Processor Z3700 Series
  • Screen: 1280x800
  • WiFi + BT: Realtek RTL8723BS_BT
  • Disks: mmcblk1: mmc1:0001 DF4032 29.1 GiB
  • RAM: 2GB DDR3 @ 1333 MHz
# 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
@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";;
@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 / 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 / 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 / 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