This file contains 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-keygen -R 10.10.10.10 |
This file contains 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
#!/bin/bash | |
tempfile=/tmp/ssh-agent.test | |
#Check for an existing ssh-agent | |
if [ -e $tempfile ] | |
then | |
echo "Examining old ssh-agent" | |
. $tempfile | |
fi |
This file contains 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
#!/bin/bash | |
if [ $# -ne 2 ] ; then | |
echo "Usage: ssh-add-pass keyfile passfile" | |
exit 1 | |
fi | |
eval $(ssh-agent) | |
pass=$(cat $2) |
This file contains 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
# Cluster wide setting | |
curl -XPUT "http://localhost:9200/_settings" -d' | |
{ | |
"index.search.slowlog.threshold.fetch.warn": "500ms", | |
"index.search.slowlog.threshold.fetch.info": "200ms", | |
"index.search.slowlog.threshold.fetch.debug": "50ms", | |
"index.search.slowlog.threshold.fetch.trace": "20ms", | |
"index.search.slowlog.level": "info" | |
}' |
This file contains 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
# Assuming everything in G, you need: | |
free -h | awk 'NR==2{print(int(substr($2,1,length($2)-1)/2+.5))}' | |
#Explanation: | |
#To print the second line, you need | |
free -h | awk 'NR==2{print}' | |
#To print the second field of the second line, you need |
This file contains 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
To delete orphaned volumes in Docker 1.9 and up you can also use the built-in docker volume commands instead of this docker-cleanup-volumes script. The built-in command also deletes any directory in /var/lib/docker/volumes that is not a volume so make sure you didn't put anything in there you want to save: | |
List: | |
$ docker volume ls -qf dangling=true | |
Cleanup: | |
$ docker volume rm $(docker volume ls -qf dangling=true) | |
Or, handling a no-op better but Linux specific: |
This file contains 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
Convert OpenSSH key to SSH2 key | |
Run the OpenSSH version of ssh-keygen on your OpenSSH public key to convert it into the format needed by SSH2 on the remote machine. This must be done on the system running OpenSSH. | |
#ssh-keygen -e -f ~/.ssh/id_dsa.pub > ~/.ssh/id_dsa_ssh2.pub | |
Convert SSH2 key to OpenSSH key | |
Run the OpenSSH version of ssh-keygen on your ssh2 public key to convert it into the format needed by OpenSSH. This needs to be done on the system running OpenSSH. | |
#ssh-keygen -i -f ~/.ssh/id_dsa_1024_a.pub > ~/.ssh/id_dsa_1024_a_openssh.pub |
This file contains 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
# Refresh Git file server | |
salt-run fileserver.update backend=git | |
# Clear Git file server cache | |
salt-run fileserver.clear_cache backend=git | |
# Clear gitfs locks | |
salt-run cache.clear_git_lock gitfs type=update | |
# Update specific branch and repo |
This file contains 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 is an example of how to send data to Slack webhooks in Python with the | |
requests module. | |
Detailed documentation of Slack Incoming Webhooks: | |
https://api.slack.com/incoming-webhooks | |
''' | |
import json | |
import requests |
This file contains 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Reference: | |
# http://zacklalanne.me/using-vagrant-to-virtualize-multiple-hard-drives/ | |
Vagrant.configure(2) do |config| | |
config.vm.box = "geerlingguy/ubuntu1604" | |
# Create a private network, which allows host-only access to the machine |
OlderNewer