Skip to content

Instantly share code, notes, and snippets.

View stiliajohny's full-sized avatar
🦜
Catching Parrots

John Stilia stiliajohny

🦜
Catching Parrots
View GitHub Profile
@stiliajohny
stiliajohny / avatar.sh
Last active August 8, 2022 14:48
make avatar image
!#/bin/bash
# tile="arch.png"
# face_image="face.png"
tile="$1"
face_image="$2"
output="$3"
@stiliajohny
stiliajohny / docker-via-vagrant.sh
Created November 11, 2021 10:33
Docker via vagrant
# Install VirtualBox
brew install --cask virtualbox
brew install --cask virtualbox-extension-pack
# Install Vagrant and the vbguest plugin to manage VirtualBox Guest Additions on the VM
brew install vagrant
vagrant plugin install vagrant-vbguest
# Install Docker CLI
brew install docker
@stiliajohny
stiliajohny / minicube-docker.sh
Created November 11, 2021 10:31
Docker via minicube
# Install hyperkit and minikube
brew install hyperkit
brew install minikube
# Install Docker CLI
brew install docker
brew install docker-compose
# Start minikube
minikube start --cpus 2 --disk-size 50g --memory 5000 --insecure-registry registry-1.docker.io
@stiliajohny
stiliajohny / macos-init.sh
Last active October 28, 2021 09:35
MacOS init provision
#!/usr/bin/env bash
defaults write com.apple.finder AppleShowAllFiles YES; # show hidden files
defaults write com.apple.dock persistent-apps -array; # remove icons in Dock
defaults write com.apple.dock tilesize -int 36; # smaller icon sizes in Dock
defaults write com.apple.dock autohide -bool true; # turn Dock auto-hidng on
defaults write com.apple.dock autohide-delay -float 0; # remove Dock show delay
defaults write com.apple.dock autohide-time-modifier -float 0; # remove Dock show delay
defaults write com.apple.dock orientation bottom; # place Dock on the right side of screen
defaults write NSGlobalDomain AppleShowAllExtensions -bool true; # show all file extensions
@stiliajohny
stiliajohny / rsync-retry.sh
Created October 21, 2021 18:25
rsync script with max retries
#!/bin/bash
### ABOUT
### Runs rsync, retrying on errors up to a maximum number of tries.
### Simply edit the rsync line in the script to whatever parameters you need.
# Trap interrupts and exit instead of continuing the loop
trap "echo Exited!; exit;" SIGINT SIGTERM
MAX_RETRIES=50

Keybase proof

I hereby claim:

  • I am stiliajohny on github.
  • I am stiliajohny (https://keybase.io/stiliajohny) on keybase.
  • I have a public key ASCuGp8wf-apzmZ3neQ8e4DtfnCzW5y5-gGl0_vBUIle5Ao

To claim this, I am signing this object:

@stiliajohny
stiliajohny / ssh-key.sh
Created June 15, 2021 15:42
SSH Key list - Detailed
#!/bin/env bash
for F in $(ssh -Q help); do
printf "=== $F ===\n"
ssh -Q $F
echo ""
done

Yubikey as an SSH key

As of 2020-05-09 Filippo Valsorda has released yubikey-agent. I am now recommending this method over using PKCS#11, however if you still wish to use the native ssh-agent, read on.

All other guides I've seen (https://github.com/drduh/YubiKey-Guide being the most prolific) tell you to use the Yubikey's smartcard (PKCS#11) features with GnuPG via gpg-agent.

STOP THE MADNESS!

OpenSSH has supported OpenSC since version 5.4. This means that all you need to do is install the OpenSC library and tell SSH to use that library as your identity.

@stiliajohny
stiliajohny / website_scraper
Created February 10, 2021 19:55
Scrapping websites with Wget
#!/bin/bash
DOMAINS=$1
TMP_DIR=$2
if [[ "$DOMAINS" == "" || "$TMP_DIR" == "" ]] ; then
echo -e "Usage : script.sh DOMAINS.txt (with one domain per line) TMP_DIR"
echo -e "Example : ./script.sh mydomains.txt /tmp"
exit 1
fi
@stiliajohny
stiliajohny / Ansible_WinRM_configurator.ps1
Created January 22, 2021 15:42
Ansible WinRM configurator
$url = "https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1"
$file = "$env:temp\ConfigureRemotingForAnsible.ps1"
(New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file)
powershell.exe -ExecutionPolicy ByPass -File $file
winrm enumerate winrm/config/Listener