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 bash | |
# Start SSH agent | |
SSH_ENV="$HOME/.ssh/environment" | |
function start_agent { | |
echo "Initialising new SSH agent..." | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" | |
echo succeeded | |
chmod 600 "${SSH_ENV}" |
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
kubectl run -i --rm --tty busybox --overrides=' | |
{ | |
"kind": "Pod", | |
"apiVersion": "v1", | |
"spec": { | |
"containers": [ | |
{ | |
"name": "busybox", | |
"image": "busybox", | |
"args": [ |
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 bash | |
# https://web.archive.org/web/20190329060125/https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | |
set -euo pipefail | |
# Set default values for mandatory arguments | |
CLONE_URL='' | |
BRANCH_NAME='' | |
print_help() { |
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 example has been tested against API Gateway | |
* The following HTTP Headers must be set (in HTTP Header Manager) | |
* Host: <hostname> | |
* Content-Type: application/json | |
* x-amz-date: ${amzDate} | |
* Authorization: ${amzAuth} | |
*/ | |
import java.nio.charset.StandardCharsets; | |
import java.security.MessageDigest; |
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
node { | |
// First parameter represents additional docker run options, second parameter is arguments passed to the image | |
// docker run [OPTIONS|<First parameter>] IMAGE [COMMAND] [ARG...|<Second parameter>] | |
docker.image('mesosphere/aws-cli').withRun('--entrypoint /bin/sh', '') { | |
stage('Build') { | |
sh 'aws --version' | |
} | |
} | |
} |
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 bash | |
JENKINS_VERSION=2.89.4 | |
JENKINS_HOME_VOLUME=jenkins_home | |
docker run -d --rm \ | |
--name jenkins \ | |
-p 8080:8080 \ | |
-p 50000:50000 \ | |
-v ${JENKINS_HOME_VOLUME}:/var/jenkins_home \ |
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
# .bashrc | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# User specific aliases and functions | |
# Set alias for nvim |
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
# .bash_profile | |
# Get the aliases and functions | |
if [ -f ~/.bashrc ]; then | |
. ~/.bashrc | |
fi | |
# User specific environment and startup programs | |
export PATH=$PATH:$HOME/.local/bin:$HOME/bin |
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
# Create .ssh directory and authorized_keys file | |
mkdir -m 700 ~/.ssh | |
touch ~/.ssh/authorized_keys | |
chmod 600 ~/.ssh/authorized_keys | |
# Set/restore SELinux permissions on the authorized_keys file | |
sudo /sbin/restorecon -v ~/.ssh/authorized_keys | |
# Append the public key |
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
# remap prefix to Control + a | |
set -g prefix C-a | |
# bind 'C-a C-a' to type 'C-a' | |
bind C-a send-prefix | |
unbind C-b | |
# Allow to scroll and resize panes with mouse | |
set -g mouse on |
NewerOlder