This file contains hidden or 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
# delete directories older than 14 days | |
find . -maxdepth 1 -type d -mtime +14 -exec rm -rf {} \; |
This file contains hidden or 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
# RedHat | |
sudo bash -c 'tail -n +1 /var/spool/cron/*' | |
# Debian | |
sudo bash -c 'tail -n +1 /var/spool/cron/crontabs/*' |
This file contains hidden or 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
# on webserver, testing metricbeat connection to elasticsearch | |
sudo metricbeat test output -e -d "*" | |
# metricbeat configuration | |
sudo vi /etc/metricbeat/metricbeat.yml |
This file contains hidden or 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
'use strict'; | |
/* eslint-disable no-console */ | |
// NOTE: update the debug scope | |
const debug = require('debug')('recordHeapdump'); | |
const heapdump = require('heapdump'); | |
var interval; | |
var nextThreshold_MB = 0; |
This file contains hidden or 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
hunt() { | |
find ./ -type f -regex "$1" -exec grep -Hn "$2" /dev/null {} + | |
} |
This file contains hidden or 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
# SSH key must already be created | |
SSH_ENV=$HOME/.ssh/environment | |
function start_agent { | |
echo "Initializing new SSH agent..." | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' >| "${SSH_ENV}" | |
echo succeeded | |
chmod 600 "${SSH_ENV}" | |
. "${SSH_ENV}" > /dev/null | |
# load all private ssh keys |
This file contains hidden or 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
# Rename multiple files | |
# http://www.24hourapps.com/2009/03/linux-tips-10-rename-multiple-files.html | |
# Renaming multiple files in Linux is surprisingly difficult given the simplistic power | |
# provided by many other system commands. Unlike DOS, which provided a rename command that | |
# allowed wild cards, Linux's rename/mv command is less versatile. Therefore to rename files | |
# one needs to write a loop. Luckily bash helps a lot here. | |
# Lets say we have in our directory a number of .txt files that we need to rename to .nfo. | |
# To do this we would need to use the command: |
This file contains hidden or 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
// This file was initially generated by Windows Terminal 1.3.2651.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", |
This file contains hidden or 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
# colorize molecule test outputs | |
export PY_COLORS=1 | |
# encrypted variables | |
export ANSIBLE_VAULT_PASSWORD_FILE=~/.ansible/.vault_password |
This file contains hidden or 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
# This was done in Ubunut-20.04 | |
# I've observed this in other Ubuntu releases when Python gets updated | |
# https://github.com/ansible/ansible/issues/14468#issuecomment-459630445 | |
cd /tmp | |
# download and unarchive python3-apt | |
apt-get download python3-apt | |
dpkg -x python3-apt_2.0.0ubuntu0.20.04.1_amd64.deb python3-apt |