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 / 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
View Nginx_Cheat_Sheet.md
@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)]'
@carlessanagustin
carlessanagustin / jenkins-plugins.md
Last active Jul 21, 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 / ansible.md
Last active Jul 17, 2019
Ansible best practices for startups to enterprises
View ansible.md
@carlessanagustin
carlessanagustin / remote-ssh.sh
Created Mar 21, 2016
Configuring SSH remote access
View remote-ssh.sh
# local instance
ssh-keygen -b 2048 -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
# remote instance
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.1.1
# more: https://www.digitalocean.com/community/tutorials/how-to-use-ssh-to-connect-to-a-remote-server-in-ubuntu
@carlessanagustin
carlessanagustin / update-playbook.sh
Last active Jun 17, 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"
@carlessanagustin
carlessanagustin / ansible-path.md
Last active Jun 12, 2019
updating PATH with ansible - system wide
View ansible-path.md

Option 1

- name: compile sources
  shell:
    coffee -o lib -c src 
    chdir=${mysourcedir}
  environment:
    PATH: $PATH:/opt/node/bin
You can’t perform that action at this time.