Skip to content

Instantly share code, notes, and snippets.

carles san agustin carlessanagustin

Block or report user

Report or block carlessanagustin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@carlessanagustin
carlessanagustin / update-playbook.sh
Last active Nov 11, 2019
Quick Bash script for running Ansible Playbooks
View update-playbook.sh
#!/usr/bin/env bash
########################## REQUIREMENTS
# sudo apt-get install ansible unzip
########################## VARIBLES
PLAYBOOK_GZ="playbook.zip"
PLAYBOOK_FILE="update.yml"
INVENTORY_FILE="all"
EXTRA_ARGS="--list-tasks --list-hosts"
View Nginx_Cheat_Sheet.md
@carlessanagustin
carlessanagustin / challenge.yaml
Created Oct 7, 2019
Kubernetes app challenge
View challenge.yaml
---
apiVersion: v1
kind: Service
metadata:
name: frontend
labels:
app: guestbook
tier: frontend
namespace: web
spec:
@carlessanagustin
carlessanagustin / tmux-cheatsheet.markdown
Last active Oct 7, 2019 — forked from MohamedAlaa/tmux-cheatsheet.markdown
TMUX: tmux shortcuts & cheatsheet
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@carlessanagustin
carlessanagustin / .tmux.conf
Last active Oct 7, 2019
Custom TMUX - curl -L https://goo.gl/xDv6Hv -o $HOME/.tmux.conf
View .tmux.conf
# split panes using | and -, make sure they open in the same path
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# To enable mouse scroll in tmux pane
set -g mouse on
# Tmux to support colors
@carlessanagustin
carlessanagustin / jenkins-plugins.md
Last active Sep 22, 2019
This is a list of interesting plugins to use with Jenkins
View jenkins-plugins.md

Jenkins plugins

You can read more about each plugin using the SEARCH box at Jenkins homepage.

  • ChuckNorris Plugin: Displays a picture of Chuck Norris (instead of Jenkins the butler) and a random Chuck Norris 'The Programmer' fact on each build page.

Maintenance

  • thinBackup: This plugin simply backs up the global and job specific configurations (not the archive or the workspace).
  • JobConfigHistory Plugin: Saves copies of all job and system configurations.
@carlessanagustin
carlessanagustin / get_docker.sh
Last active Sep 12, 2019
Install Docker Engine & Docker Compose in Ubuntu 18 LTS - wget -O - https://bit.ly/2YAnUp8 | bash
View get_docker.sh
#!/usr/bin/env bash
#DOCKER_VERSION=18.06.1~ce~3-0~ubuntu
COMPOSE_VERSION=1.23.2
# TOOLS
sudo apt-get -y install curl wget make jq git make tree htop conntrack bash-completion build-essential python-pip python-virtualenv rsync unzip apache2-utils
# DOCKER ENGINE
sudo groupadd -f docker
@carlessanagustin
carlessanagustin / chronograf_dashboard.sh
Created Dec 7, 2018
Chronograf dashboard import/export tool - EXPERIMENTAL
View chronograf_dashboard.sh
#!/usr/bin/env bash
URL=$2 # http://localhost:8888
FILENAME=$3 # dashboard.json
if [ $1 == "export" ]; then
curl -i -X GET $URL/chronograf/v1/dashboards > $FILENAME
elif [ $1 == "import" ]; then
curl -i -X POST -H "Content-Type: application/json" $URL/chronograf/v1/dashboards -d @$FILENAME
else
@carlessanagustin
carlessanagustin / kubernetes.md
Created Mar 15, 2017
Kubernetes tutorial steps
View kubernetes.md

1. Create cluster

Cluster up and running

minikube version
minikube start
kubectl version
View aws-cli-filtering.md

Via AWS CLI using jq

(https://github.com/mwilliamson/jq.py)

aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.KeyName == "MyKey") | select(.State.Code != 48) | select(.Tags[]|select(.Key=="Name")|select(.Value=="InstanceName")) | [ .PublicIpAddress]'
 
aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.KeyName == "MyKey") | select(.State.Code != 48) | select(.Tags[]|select(.Key=="Name")|select(.Value=="InstanceName")) | [ .PublicIpAddress, (.Tags[]|select(.Key=="Name").Value)]'

aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.KeyName == "MyKey") | select(.State.Code != 48) | select(.Tags[]|select(.Key=="InventoryGroup").Value) | [ .PublicIpAddress, (.Tags[]|select(.Key=="Name").Value)]'
You can’t perform that action at this time.