brew install mtr
sudo mtr -rw
grep -r $1 /etc/*
grep -r $1 ~/.*
View gke kubernetes
# add temporary access from (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
View dos2unix or crlf2lf
curl -sL \
| bash -s /path/to/windows/or/dos/file
for line in $(gcloud compute instances list | \
grep -v NAME | awk '{print $1}'); \
do echo $line; (gcloud compute ssh $line -- curl -s; \
done &&
for line in $(kubectl get pods | \
grep -v NAME | awk '{print $1}'); \
do echo $line; (kubectl exec -ti $line -- curl -s; \
View fullstack javascript class diagram
sudo npm install wavi -g
node `which wavi` /path/to/api /tmp/api.svg
node `which wavi` /path/to/fe /tmp/frontend.svg
# @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
View MSSQL From Linux
# To install tsql: sudo apt install freetds-bin
TDSVER=8.0 tsql -H $host -p $port -D $database -U $user -P
#!/bin/bash -e
# @author: Nestor Urquiza
# @date: 20121221
nonce=`cat /dev/urandom | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1`
timestamp=`date +%s`
View gitlab production installation: good bye subversion
# Installation
* See the restore instructions if you need to restore from backups
* Make sure /srv/gitlab/ is completely removed in the host
* Use the below ~/docker-compose.yml file. The gitlab root user takes effect *only* for brand new installations
image: 'gitlab/gitlab-ce:8.7.0-ce.0'
restart: always
hostname: ''
container_name: 'gitlab'