Skip to content

Instantly share code, notes, and snippets.

‏‏‎ Eating github stars for breakfast.

Andrzej Rehmann hoto

‏‏‎ Eating github stars for breakfast.
View GitHub Profile
View postman_fetch_access_token.js
const getAccessTokenRequest = {
url: 'http://localhost:5050',
method: 'GET',
pm.sendRequest(getAccessTokenRequest, (err, res) => {
console.log(err ? err : res.json());
if (err === null) {
console.log("Saving the access token");
var responseJson = res.json();
# set screen lock after 1 min
setterm -blank 1
# enable wired connection
nmcli connection up id enp2s0
# install stuff
dnf update -y
dnf install vim mc NetworkManager-tui -y
function run_mock_server(){
local port="$1"
local usage=$(cat <<-END
Running mock server in the background always responding with 200.
More info:

Keybase proof

I hereby claim:

  • I am hoto on github.
  • I am andrzejrehmann ( on keybase.
  • I have a public key whose fingerprint is A2D1 E8EE E63B 0BA9 B711 8FA2 2018 D6C1 C652 B490

To claim this, I am signing this object:

View decrypt-jenkins-credentials.groovy
passwd = hudson.util.Secret.decrypt(hashed_pw)
#Retrieving Security Credentials from Instance Metadata

Local port forwarding through a bastion machine:

One line version:

ssh -i ~/.ssh/bastion-key.pem -N -L

Or run with -v to debug:

ssh -v -i ~/.ssh/bastion-key.pem -N -L

View Jenkinsfile-basic.groovy
pipeline {
agent any
stages {
stage('Stage 1') {
steps {
script {
echo 'Stage 1'
hoto /
Created Aug 10, 2017 — forked from hrwgc/
bash wget - check if file exists at url before downloading
# simple function to check http response code before downloading a remote file
# example usage:
# if `validate_url $url >/dev/null`; then dosomething; else echo "does not exist"; fi
function validate_url(){
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then echo "true"; fi
# Be root.
cd /dev
su - # Or “sudo -s”.
# Make sure that the device is not mounted.
umount sdb*
# source:
# Format the device for encryption.