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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
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
// dump.json is the result of a mongoexport using --jsonArray | |
cat dump.json | sed '/"_id":/s/"_id":[^,]*,//' > new-dump.json | |
// Regex for global replace | |
"_id":{[^,]+, |
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
# list files on a remote machine | |
# make empty local files using those filenames | |
# | |
# -n1 execute for each line | |
# -I alias for the output of the piped command | |
ssh swarm4 ls /srv/mssql/backup | xargs -n1 -I {} touch srv/mssql/backup/{} |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac | |
# don't put duplicate lines or lines starting with space in the history. | |
# See bash(1) for more options |
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
# valid for 365 days | |
# ref: https://letsencrypt.org/docs/certificates-for-localhost/ | |
openssl req -x509 -out localhost.crt -keyout localhost.key \ | |
-newkey rsa:2048 -nodes -sha256 \ | |
-subj '/CN=localhost' -extensions EXT -config <( \ | |
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") \ | |
-days 365 | |
# https://containo.us/blog/traefik-2-tls-101-23b4fbee81f1/ | |
# add to ca-certificates |
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
# docker-compose | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0-rc3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose |
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
# Assumptions | |
# node_modules installed under /opt | |
# application installed under /opt/app | |
# Simple Build Commands | |
docker image build -t ultimate:dev --target dev . | |
docker image build -t ultimate:test --target test . # update below for MICROSCANNER | |
docker image build -t ultimate:prod --target prod . | |
# MUST pass ARGs as --build-arg |
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
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' zscaler.pem | |
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' zscaler.pem | sed "s/^/\"/;s/$/\"/" |
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
{ | |
/* | |
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
*/ | |
"New Module": { | |
"prefix": "newmod", |
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
# resource group is set to "dev-roller" | |
# OFF (deallocated) | |
az vm deallocate --ids $(az vm list -g dev-roller --query "[].id" -o tsv) | |
# ON | |
az vm start --ids $(az vm list -g dev-roller --query "[].id" -o tsv) |