Skip to content

Instantly share code, notes, and snippets.

View AndrianBdn's full-sized avatar

Andrian Budantsov AndrianBdn

View GitHub Profile
@AndrianBdn
AndrianBdn / ansible-host-playbook.sh
Last active October 24, 2018 08:44
bash script that creates inventory file and calls ansible (works with bastion hosts)
#!/bin/bash
export ANSIBLE_SSH_PIPELINING=1
ANSIBLE_PYTHON3_CONFIG="ansible_python_interpreter=/usr/bin/python3"
if [ $# -ne 2 ]
then
echo "Usage: $0 [user@]host[#bastion_user@bastion_host] playbook.yml"
exit 1
fi
@AndrianBdn
AndrianBdn / waittype.py
Last active July 28, 2023 17:16
Typing command-line args inside VM or Remote Desktops on Mac
#!/usr/bin/python
from __future__ import print_function
from time import sleep
import sys
import tempfile
import subprocess
import getpass
if len(sys.argv) < 2:
print("Using interactive mode for passwords...")
// copy-paste me
function UUIDv4Base64Url() {
return global.crypto.randomBytes(16).toString('base64').replace(/=+/, '').replace(/\+/g, '-').replace(/\//g, '_');
}
@AndrianBdn
AndrianBdn / git-sparse-clone.sh
Last active May 4, 2022 23:06
git-sparse-clone.sh
#!/bin/sh
#
# This script can clone/checkout a single folder from git repository
# - Might be used for checking out micro-services from monolithic git repository
#
# - You can even do checkout into home directory, for example
# git-sparse-clone.sh git@github.com:readdle/fluix-web.git /home/login login
#
# This will cause the shell to exit immediately if a simple command exits with a nonzero exit value.
@AndrianBdn
AndrianBdn / keybase.md
Created June 16, 2014 09:09
keybase.md

Keybase proof

I hereby claim:

  • I am andrianbdn on github.
  • I am andrianbdn (https://keybase.io/andrianbdn) on keybase.
  • I have a public key whose fingerprint is 90FC E4D7 3F39 7FF0 026B F66A BFEA C1EF 6C80 EF7B

To claim this, I am signing this object: