ANSI escape codes can be printed to a shell to as instructions. The below is a list of codes I have used often in my CLI programs and I find myself looking up over and over again.
A great article about it can be found here.
ANSI escape codes can be printed to a shell to as instructions. The below is a list of codes I have used often in my CLI programs and I find myself looking up over and over again.
A great article about it can be found here.
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use: | |
# "${data.external.ssh_key_generator.result.public_key}" (contents) | |
# "${data.external.ssh_key_generator.result.private_key}" (contents) | |
# "${data.external.ssh_key_generator.result.private_key_file}" (path) | |
data "external" "ssh_key_generator" { | |
program = ["bash", "${path.root}/../ssh_key_generator.sh"] | |
query = { | |
customer_name = "${var.customer_name}" | |
customer_group = "${var.customer_group}" |
# shellman options | |
# Usage: options=("one" "two" "three"); inputChoice "Choose:" 1 "${options[@]}"; choice=$?; echo "${options[$choice]}" | |
function inputChoice() { | |
echo "${1}" | |
shift | |
echo $(tput dim)-"Change option: [up/down], Select: [ENTER]" $(tput sgr0) | |
local selected="${1}" | |
shift | |
ESC=$(echo -e "\033") |
substitutions: | |
devicename: ttgocam | |
friendly_name: test esp32cam | |
ip_address: 192.168.1.230 | |
esphome: | |
name: $devicename | |
platform: ESP32 | |
board: esp-wrover-kit |
chsh -s /bin/bash | |
sudo apt-get update | |
sudo apt upgrade | |
sudo apt install zsh | |
sudo apt-get install powerline fonts-powerline | |
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh | |
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc |