Skip to content

Instantly share code, notes, and snippets.

View niradler's full-sized avatar
🎮

Nir Adler niradler

🎮
View GitHub Profile
@niradler
niradler / README.md
Created April 24, 2024 23:30 — forked from dominikwilkowski/README.md
ANSI codes for cli controled output

ANSI escape codes

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.

Content

@niradler
niradler / ssh_key.tf
Created August 31, 2021 14:46 — forked from irvingpop/ssh_key.tf
Terraform external data source example - dynamic SSH key generation
# 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
@niradler
niradler / git-submodules.md
Created June 29, 2019 10:49 — forked from u840903/git-submodules.md
Github Submodule Cheat Sheet

Add a submodule

git submodule add https://github.com/janjarfalk/canvasrunner.git components/canvasrunner/

Update all submodules

git submodule foreach git pull origin master
cd ..
git commit . -m "Updated submodules"