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 | |
cpid=$1 | |
while true; do | |
ppid=$(ps -o ppid= -p $cpid) | |
pname=$(ps -o comm= -p $ppid) | |
if [ "$pname" == "docker" ]; then | |
echo "$cpid parent $ppid ($pname)" | |
break | |
else |
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 -e | |
# https://stackoverflow.com/questions/24406743/coreos-get-docker-container-name-by-pid | |
# Prints the name of the container inside which the process with a PID on the host is. | |
function getName { | |
local pid="$1" | |
if [[ -z "$pid" ]]; then | |
echo "Missing host PID argument." | |
exit 1 |
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
fulload() { dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null & }; fulload; read; killall dd | |
Repeat the command in the curly brackets as many times as the number of threads you want to produce (here 4 threads). Simple enter hit will stop it (just make sure no other dd is running on this user or you kill it too). | |
https://stackoverflow.com/questions/2925606/how-to-create-a-cpu-spike-with-a-bash-command |
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
#!/usr/bin/env python | |
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
# Written by Nathan Hamiel (2010) | |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
from optparse import OptionParser | |
class RequestHandler(BaseHTTPRequestHandler): | |
def do_GET(self): |
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 | |
HOST=$1 | |
PORT=$2 | |
timeout 1 bash -c "cat < /dev/null > /dev/tcp/${HOST}/${PORT}" | |
RESULT=$? | |
if [ "${RESULT}" -ne 0 ]; then | |
echo "Failed: ${RESULT}" | |
else | |
echo "Connected: ${RESULT}" |
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
while true; do | |
ssh -o ConnectTimeout=1 -o ConnectionAttempts=1 $@; | |
RESULT=$? | |
if [ "${RESULT}" -eq 0 ]; then | |
break | |
fi | |
done |
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
D=$(date) | |
timeout 1 bash -c 'cat < /dev/null > /dev/tcp/smtp.mydomain.net/25' | |
port_25=$? | |
timeout 1 bash -c 'cat < /dev/null > /dev/tcp/smtp.mydomain.net/587' | |
port_587=$? | |
echo "$D Port Check result: port_25:$port_25 git:$port_587" | |
MAILSERVER=smtp.mydomain.net | |
PORT=25 |
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
# - name: Generate DH Params (may take several minutes!) | |
# command: openssl dhparam \ | |
# -out "/data/jenkins_home/ssl/dhparam.pem" 2048 | |
# args: | |
# creates: "/data/jenkins_home/ssl/dhparam.pem" | |
# | |
# - name: Generate ECC Key | |
# command: openssl ecparam \ | |
# -genkey \ | |
# -name prime256v1 \ |
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
### Keybase proof | |
I hereby claim: | |
* I am jsidhu on github. | |
* I am jsidhu (https://keybase.io/jsidhu) on keybase. | |
* I have a public key ASBlpUiQzU2mRnLU-XHgUp48K8Dh0ClDczVnZ7ATKJYQogo | |
To claim this, I am signing this object: |
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
curl -i -X POST -H 'Content-type:application/json' -d '{"jsonrpc":"2.0","method":"user.login","params":{ "user":"myUserName","password":"myPassword"},"auth":null,"id":0}' https://zabbix-web.symcpe.net/api_jsonrpc.php |
NewerOlder