Skip to content

Instantly share code, notes, and snippets.

@jandradap
jandradap / README-Template.md
Created July 21, 2016 19:31 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisities

@jandradap
jandradap / install_docker-ce_redhat7.sh
Last active July 31, 2017 10:39
install docker-ce in redhat7
#!/bin/bash
# -*- ENCODING: UTF-8 -*-
#
# ------------------------------------------------------------------
# [Jorge Andrada Prieto] [jandradap@gmail.com]
# Title: install_docker-ce_redhat7.sh
# Description: instala docker-ce en redhat7
# recomendable usar CentOS ya que puede ser deprecated en el futuro
# https://docs.docker.com/engine/installation/#server
# https://docs.docker.com/engine/installation/linux/docker-ce/centos/#install-from-a-package
@jandradap
jandradap / galera_stretch.md
Created July 27, 2017 22:14 — forked from eoldavix/galera_stretch.md
Clúster MariaDB con Galera en Debian 9 Stretch

Clúster MariaDB con Galera en Debian 9 Stretch from scratch

Suponiendo dos servidores con IP's 10.1.0.1 (galera1) y 10.1.0.2 (galera2), la instalación de un cluster MariaDB es bien sencilla.

  • Instalamos mariadb-server en nuestros nodos: apt install mariadb-server
  • Paramos el servicio mariadb.service en todos los nodos: systemctl stop mariadb.service
  • Nos creamos en todos los nodos el fichero /etc/mysql/conf.d/galera.conf con el siguiente contenido (modificando en cada nodo la configuración específica):
#!/bin/bash
# rename-files.sh Files #Specify Directory Name
#print usage
if [ -z $1 ];then
echo "Usage :$(basename $0) parent-directory"
exit 1
fi
#process all subdirectories and files in parent directory
docker images -a | grep -iv "repo" | grep -v "none" | awk -F " " '{print$1":"$2}' | xargs -t -L1 docker pull
#alias para .bashrc
#alias update_images="docker images -a | grep -iv 'repo' | grep -iv 'none' | awk -F \" \" '{print\$1\":\"\$2}' | xargs -t -L1 docker pull"
## credit: http://fabian-affolter.ch/blog/the-lineinfile-module-of-ansible/
---
- hosts: alpine_install
user: root
tasks:
# - name: create a complete empty file
# command: /usr/bin/touch /test/test.conf
- name: create a new file with lineinfile
echo "Acquire::Check-Valid-Until false;" > /etc/apt/apt.conf
echo "deb http://archive.debian.org/debian squeeze main contrib non-free" > /etc/apt/sources.list
echo "deb http://archive.debian.org/debian squeeze-lts main contrib non-free" >> /etc/apt/sources.list
@jandradap
jandradap / local-cpan-mirror.txt
Created May 29, 2018 06:56 — forked from reyjrar/local-cpan-mirror.txt
Local CPAN Mirror Setup, Simply
#=======================================
# Part 1 is Setting up the Mirror Server
# Install CPAN::Mini
$ curl -L http://cpanmin.us | perl - --sudo CPAN::Mini
# Select a CPAN Mirror URL from http://mirrors.cpan.org/
# - We'll use http://cpan.pair.com
# Pick a directory to mirror to, I'll use /var/www/cpan
@jandradap
jandradap / ansible-summary.md
Created September 4, 2018 10:58 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@jandradap
jandradap / update_git_repos.sh
Last active November 2, 2018 23:26
Update all git repos in the path
#!/bin/bash
# -*- ENCODING: UTF-8 -*-
#
# ------------------------------------------------------------------
# [Jorge Andrada Prieto] [jandradap@gmail.com]
# Title: update_git_repos.sh
# Fecha: 02/11/2018
# Description: Update all git repos in the path
# If the repositories are https, need to configure user and pass/token:
#