Skip to content

Instantly share code, notes, and snippets.

:octocat:
‏‏‎ Eating github stars for breakfast.

Andrzej Rehmann hoto

:octocat:
‏‏‎ Eating github stars for breakfast.
Block or report user

Report or block hoto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am hoto on github.
  • I am andrzejrehmann (https://keybase.io/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
// https://myjenkins.com/script
hashed_pw='{AQAAABAAAAAQB68ttY8Fp7wpTtF/d8VPl8ZU5PZEIJbofSrTgZXxbdY=}'
passwd = hudson.util.Secret.decrypt(hashed_pw)
println(passwd)
View aws-retrievie-credentials-from-metadata.sh
#Retrieving Security Credentials from Instance Metadata
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<role_name>
View local-port-forwarding.md

Local port forwarding through a bastion machine:

One line version:

ssh -i ~/.ssh/bastion-key.pem -N -L 9000:db.mycompany.com:1521 myuser@bastion.mycompany.com

Or run with -v to debug:

ssh -v -i ~/.ssh/bastion-key.pem -N -L 9000:db.mycompany.com:1521 myuser@bastion.mycompany.com

View Jenkinsfile-basic.groovy
pipeline {
agent any
stages {
stage('Stage 1') {
steps {
script {
echo 'Stage 1'
}
}
}
@hoto
hoto / validate.sh
Created Aug 10, 2017 — forked from hrwgc/validate.sh
bash wget - check if file exists at url before downloading
View validate.sh
#!/bin/bash
# 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
}
View encrypt-pendrive.sh
# Be root.
cd /dev
su - # Or “sudo -s”.
# Make sure that the device is not mounted.
umount sdb*
# source: http://www.linuxquestions.org/questions/slackware-14/harddisk-shredding-uncredibly-slow-any-speed-up-possible-635202/
# Format the device for encryption.
View aws-cli-query.sh
aws iam list-roles --profile sandbox --query "Roles[?RoleName == 'ABC']"
View two-laptops-lan.sh
# Setup IPs for two laptops
PC1 (master0
IP - 192.168.1.2
mask 255.255.255.0
gw - 192.168.1.2
PC2 (slave - live cd)
IP - 192.168.1.3
mask 255.255.255.0
gw - 192.168.1.3
View fedora26-install.sh
# cgdisk is graphical
sudo cgdisk /dev/sda
sgdisk -o /dev/sda
sgdisk -n 1::+256MiB -u 1:fbf5660e-0474-4361-8b8f-22d8049e6920 -t 1:EF00 /dev/sda
sgdisk -n 2::+1024MiB -u 2:05ee6a32-f7ca-4379-9ac9-80cf6c63933b -t 2:8300 /dev/sda
sgdisk -n 3::+20480MiB -u 3:c522f8fe-01ee-433d-8642-e0c897e817aa -t 3:8304 /dev/sda
sgdisk -n 4::-9MiB -u 4:a086c08d-49f8-48ba-918d-e38d912d734b -t 3:BF01 /dev/sda
sgdisk -n 9::+8MiB -u 9:c3935f60-0315-427c-ac5b-db1808a72112 -t 3:BF07 /dev/sda
dd if=/dev/urandom of=/dev/sda3 bs=1MiB count=10
You can’t perform that action at this time.