brew install mkcert
mkcert -install
| import logging | |
| import boto3 | |
| from argparse import ArgumentParser, HelpFormatter | |
| from botocore.exceptions import ClientError, ProfileNotFound | |
| # logger config | |
| logger = logging.getLogger() | |
| logging.basicConfig(level=logging.INFO, | |
| format='%(message)s') |
| # https://docs.docker.com/compose/yml/ | |
| # Each service defined in docker-compose.yml must specify exactly one of | |
| # image or build. Other keys are optional, and are analogous to their | |
| # docker run command-line counterparts. | |
| # | |
| # As with docker run, options specified in the Dockerfile (e.g., CMD, | |
| # EXPOSE, VOLUME, ENV) are respected by default - you don't need to | |
| # specify them again in docker-compose.yml. | |
| # | |
| service_name: |
(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)
Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories
Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.
Save that list to some path
The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.
| #!/bin/sh | |
| # Set the macOS installer path as a variable | |
| MACOS_INSTALLER="/Applications/$(ls /Applications | grep "Install macOS")" | |
| MOUNT_POINT="$MACOS_INSTALLER/Contents/SharedSupport" | |
| echo "macOS installer is \"$MACOS_INSTALLER\"" | |
| # Set the target disk as a variable | |
| TARGET=$(diskutil info "$(bless --info --getBoot)" | awk -F':' '/Volume Name/ { print $2 }' | sed -e 's/^[[:space:]]*//') | |
| echo "Target disk is \"$TARGET\"" |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| VAGRANTFILE_API_VERSION = "2" | |
| cluster = { | |
| "master" => { :ip => "192.168.33.10", :cpus => 1, :mem => 1024 }, | |
| "slave" => { :ip => "192.168.33.11", :cpus => 1, :mem => 1024 } | |
| } | |
| """ | |
| image2ansi.py | |
| usage: image2ansi.py [-h] [--no-color] [--width WIDTH] path | |
| Display an image in ASCII with ANSI colors | |
| positional arguments: | |
| path the path to the image file | |
| optional arguments: | |
| -h, --help show this help message and exit | |
| --no-color no ANSI colors | |
| --width WIDTH output width in characters (Default 120) |
I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.
What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.
Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.
| file_to_disk = './tmp/large_disk.vdi' | |
| Vagrant::Config.run do |config| | |
| config.vm.box = 'base' | |
| config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024] | |
| config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
| end |