create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
import codecs | |
class Parser(object): | |
def __init__(self): | |
self.nodes = {} | |
def node_with_name(self, name): | |
node = self.nodes.get(name) |
################################################################## | |
# /etc/elasticsearch/elasticsearch.yml | |
# | |
# Base configuration for a write heavy cluster | |
# | |
# Cluster / Node Basics | |
cluster.name: logng | |
# Node can have abritrary attributes we can use for routing |
while true; do sleep 1; curl http://www.google.com; echo -e '\n\n\n\n'$(date);done |
SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.
apt-get install sshpass
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |
# Add the following 'help' target to your Makefile | |
# And add help text after each target name starting with '\#\#' | |
help: ## Show this help. | |
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
# Everything below is an example | |
target00: ## This message will show up when typing 'make help' | |
@echo does nothing |
#!/bin/bash | |
# Usage: ./s3cmdclearfiles "bucketname" "30d" | |
s3cmd ls s3://$1 | grep " DIR " -v | while read -r line; | |
do | |
createDate=`echo $line|awk {'print $1" "$2'}` | |
createDate=`date -j -f "%Y-%m-%d %H:%M" "$createDate" +%s` | |
olderThan=`date -j -v-$2 +%s` | |
if [[ $createDate -lt $olderThan ]] |
[Unit] | |
Description=Demonstrate Bash | |
[Service] | |
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment MYVAR=$(( 2 + 2 ))" | |
ExecStart=/usr/bin/echo "2 + 2 = ${MYVAR}" |
# tcpdump -A -nn -s 0 'tcp dst port 9200 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i lo | |
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode | |
listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes | |
14:32:33.525122 IP 127.0.0.1.49777 > 127.0.0.1.9200: Flags [P.], seq 313752908:313753888, ack 2465010394, win 257, options [nop,nop,TS val 2684167067 ecr 2684167066], length 980 | |
E...^.@.@............q#...}L............... | |
..#...#.GET /index/_search HTTP/1.1 | |
Host: 127.0.0.1:9200 | |
Accept: */* | |
Content-Length: 845 | |
Content-Type: application/x-www-form-urlencoded |