Install the OpenSSL on Debian based systems
sudo apt-get install openssl
#!/usr/bin/env bash | |
# | |
# Go Version Switcher/Downloader | |
# THIS SCRIPT SHOULD BE SOURCED UNLESS YOU WANT TO KEEP A STATIC GOROOT OF: /opt/goroot/go | |
# example usage: source ./go_version_switcher.sh 1.11.5 | |
# | |
# Some defaults | |
GO_ROOT_PATH=/opt/goroot |
#!/bin/bash | |
# Simple tool to automate fetching videos on MacOSX from YouTube | |
# Installing dependencies: | |
# pip install youtube-dl | |
# brew install libav | |
echo "Resetting clipboard ..." | |
echo "-" | pbcopy |
Some Jenkinsfile examples |
# Install chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads | |
import os | |
from optparse import OptionParser | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
CHROME_PATH = '/usr/bin/google-chrome' |
#!/bin/bash | |
#Run buildDJ3.sh script first in the same folder from: https://gist.github.com/aldaris/fe234d76f3940c42ae9bb5aa69b8e98e | |
function build() { | |
mvn clean install | |
if [ $? -ne 0 ] ; then | |
exit 1; | |
fi | |
} |
// Related to https://issues.jenkins-ci.org/browse/JENKINS-26481 | |
abcs = ['a', 'b', 'c'] | |
node('master') { | |
stage('Test 1: loop of echo statements') { | |
echo_all(abcs) | |
} | |
stage('Test 2: loop of sh commands') { |
#!/bin/bash | |
# file: ttfb.sh | |
# curl command to check the time to first byte | |
# ** usage ** | |
# 1. ./ttfb.sh "https://google.com" | |
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com" | |
curl -o /dev/null \ | |
-H 'Cache-Control: no-cache' \ | |
-s \ |
Question: | |
. How to run Ansible without specifying the inventory but the host directly? | |
. Run a playbook or command with arbitrary host not in the inventory hosts list? | |
. run ansible with arbitrary host/ip without inventory? | |
Answer: | |
Surprisingly, the trick is to append a , | |
The host parameter preceding the , can be either a hostname or an IPv4/v6 address. | |
ansible all -i example.com, |
#!/bin/bash | |
TARGET="mysite.example.net"; | |
RECIPIENT="[email protected]"; | |
DAYS=7; | |
echo "checking if $TARGET expires in less than $DAYS days"; | |
expirationdate=$(date -d "$(: | openssl s_client -connect $TARGET:443 -servername $TARGET 2>/dev/null \ | |
| openssl x509 -text \ | |
| grep 'Not After' \ | |
|awk '{print $4,$5,$7}')" '+%s'); | |
in7days=$(($(date +%s) + (86400*$DAYS))); |