This file contains 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 install -g nsp | |
$ cd /path/to/project | |
$ nsp check | |
# To exclude errors create a file with exceptions (not recommended): | |
$ cat .nsprc | |
{ | |
"exceptions": [ | |
"https://nodesecurity.io/advisories/532", | |
"https://nodesecurity.io/advisories/536" | |
] |
This file contains 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 eslint | |
npm i -g eslint-plugin-security |
This file contains 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
{ | |
"parserOptions": { | |
"ecmaVersion": 2017 | |
}, | |
"env": { | |
"es6": true, | |
"browser": true, | |
"node": true | |
}, | |
"plugins": [ |
This file contains 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
brew install mtr | |
PATH=$PATH:/usr/local/sbin | |
sudo mtr -rw sample.com |
This file contains 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
grep -r $1 /etc/* | |
grep -r $1 ~/.* |
This file contains 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
# add temporary access from 0.0.0.0/0 (anywhere) to protected services pods connect to | |
# check cluster version | |
gcloud container clusters list | |
# switch to the specific project | |
gcloud config set project my-project | |
gcloud container clusters get-credentials my-project-cluster --zone us-east1-b --project my-project | |
# check available versions | |
gcloud container get-server-config | |
# upgrade cluster master. Note that you have to go up one minor version at a time, for example 1.5.7 needs to go up to 1.6.7 before being upgraded to 1.7.2 | |
gcloud container clusters upgrade my-project-cluster --master --cluster-version=1.7.6-gke.1 |
This file contains 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
curl -sL https://raw.githubusercontent.com/nestoru/pob-recipes/master/common/tools/crlf2lf.sh \ | |
| bash -s /path/to/windows/or/dos/file |
This file contains 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
for line in $(gcloud compute instances list | \ | |
grep -v NAME | awk '{print $1}'); \ | |
do echo $line; (gcloud compute ssh $line -- curl -s ifconfig.co); \ | |
done && | |
for line in $(kubectl get pods | \ | |
grep -v NAME | awk '{print $1}'); \ | |
do echo $line; (kubectl exec -ti $line -- curl -s ifconfig.co); \ | |
done |
This file contains 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 npm install wavi -g | |
node `which wavi` /path/to/api /tmp/api.svg | |
node `which wavi` /path/to/fe /tmp/frontend.svg |
This file contains 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
# aws-cross-region-replicate-all-lambda.py | |
# @author: Nestor Urquiza | |
# @date: 20161226 | |
# @description: Cross Region replication script. Use at your own risk! | |
# Customize this lambda looking for TOCHANGETHIS: identifier | |
import boto3 | |
import botocore | |
from pprint import pprint |