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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.define "vagrant-windows-10-enterprise-x64-eval" | |
config.vm.box = "peru/windows-10-enterprise-x64-eval" | |
config.vm.communicator = "winrm" | |
# Admin username and password (see also WSL username/password setup in WSL_Ubuntu_Setup.ps1) |
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
unless Vagrant.has_plugin?("vagrant-sshfs") | |
raise 'vagrant-sshfs plugin is not installed!' | |
end | |
unless Vagrant.has_plugin?("vagrant-reload") | |
raise 'vagrant-reload plugin is not installed!' | |
end | |
# hack: https://github.com/hashicorp/vagrant/issues/8878#issuecomment-345112810 | |
class VagrantPlugins::ProviderVirtualBox::Action::Network |
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
1. docker run -v $PWD/output:/app/output/ -p 8080:8080 -it aliashraf/map-tiles-downloader | |
2. navigate to http://localhost:8080 and follow the on-screen prompts | |
3. cd ./output/############/## | |
4. for DIR in 9*; do pushd "$DIR"; convert -append *.png ../$DIR.png; popd; done | |
5. convert 9*.png +append ../../../all.png | |
6. may need to edit /etc/ImageMagick-6/policy.xml |
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 | |
[[ "$(uname -s)" = 'Darwin' ]] && REALPATH=grealpath || REALPATH=realpath | |
[[ "$(uname -s)" = 'Darwin' ]] && DIRNAME=gdirname || DIRNAME=dirname | |
if ! (type "$REALPATH" && type "$DIRNAME") > /dev/null; then | |
echo "$(basename "${BASH_SOURCE[0]}") requires $REALPATH and $DIRNAME" | |
exit 1 | |
fi | |
SCRIPT_PATH="$($DIRNAME $($REALPATH -e "${BASH_SOURCE[0]}"))" |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.define "vagrant-windows-10-enterprise-x64-eval" | |
config.vm.box = "peru/windows-10-enterprise-x64-eval" | |
config.vm.communicator = "winrm" | |
# Admin username and password |
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
› ssh-keygen -t ed25519-sk | |
Generating public/private ed25519-sk key pair. | |
You may need to touch your authenticator to authorize key generation. | |
Enter PIN for authenticator: | |
You may need to touch your authenticator (again) to authorize key generation. | |
Enter file in which to save the key (/home/mmguero/.ssh/id_ed25519_sk): | |
Enter passphrase (empty for no passphrase): | |
Enter same passphrase again: | |
Your identification has been saved in /home/mmguero/.ssh/id_ed25519_sk | |
Your public key has been saved in /home/mmguero/.ssh/id_ed25519_sk.pub |
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://gist.github.com/mmguero/ee69524da6a93296d888530f1a55c178 | |
# generate self-signed CA, server, and client .crt/.key files and dhparam.pem | |
# can test with: | |
# openssl s_server -Verify 999 -CAfile ca.crt -key server.key -cert server.crt -accept 44330 -www | |
# openssl s_client -CAfile ca.crt -key client.key -cert client.crt -showcerts -connect localhost:44330 |
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://gist.github.com/mmguero/29e93d47bc7b967e2dc85dbfd352c9d1 | |
# create an SQLite3 database and store (or retrieve) a unique value in it | |
set -e | |
set -u | |
set -o pipefail | |
shopt -s nocasematch |
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 | |
# "git clone" all of a GitHub user's or organization's repositories (up to 100) | |
# if the repo is a GitHub fork, add the parent fork as an upstream remote. | |
# https://gist.github.com/mmguero/04bbbc8660e0b554740cae938069d527/edit | |
ENCODING="utf-8" | |
GIT_API_URL_PREFIX="https://api.github.com" |
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 | |
# extract all subtitles from an MKV/MP4 file | |
# https://gist.github.com/mmguero/efea277a272aacceca60bcccf1a15563 | |
shopt -s nocasematch | |
toolPath='' |