This file contains hidden or 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 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}" |
This file contains hidden or 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
| # 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") |
This file contains hidden or 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
| import os | |
| if os.environ.get('LC_CTYPE', '') == 'UTF-8': | |
| os.environ['LC_CTYPE'] = 'en_US.UTF-8' | |
| from awscli.clidriver import create_clidriver | |
| driver = create_clidriver() | |
| driver.main('s3 mv source_bucket target_bucket --recursive'.split()) |
This file contains hidden or 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
| npm i -g strin loop-pipe | |
| find . -name package.json | grep -v node_modules | strin replace --t="package.json" --v="" --sr="ig" | lp "(cd {v} && npm i)" |
This file contains hidden or 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
| GOCMD=go | |
| GOTEST=$(GOCMD) test | |
| GOVET=$(GOCMD) vet | |
| BINARY_NAME=example | |
| VERSION?=0.0.0 | |
| SERVICE_PORT?=3000 | |
| DOCKER_REGISTRY?= #if set it should finished by / | |
| EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true | |
| GREEN := $(shell tput -Txterm setaf 2) |
This file contains hidden or 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
| substitutions: | |
| devicename: ttgocam | |
| friendly_name: test esp32cam | |
| ip_address: 192.168.1.230 | |
| esphome: | |
| name: $devicename | |
| platform: ESP32 | |
| board: esp-wrover-kit |
This file contains hidden or 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
| var dbName = 'memex'; | |
| var version = 1; | |
| var conn = indexedDB.open(dbName, version) // change the name and version as needed | |
| function exportToJson(idbDatabase) { | |
| return new Promise((resolve, reject) => { | |
| const exportObject = {} | |
| if (idbDatabase.objectStoreNames.length === 0) { | |
| resolve(JSON.stringify(exportObject)) |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| sudo apt-get install libcap2-bin | |
| sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\`` | |
| # or | |
| sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 900 -j REDIRECT --to-port 3000 |
This file contains hidden or 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
| sudo apt update | |
| sudo apt upgrade | |
| free -h | |
| df -h | |
| sudo fallocate -l 1G /swapfile | |
| ls -lh /swapfile | |
| sudo chmod 600 /swapfile | |
| ls -lh /swapfile | |
| sudo mkswap /swapfile |