Skip to content

Instantly share code, notes, and snippets.

View grodrigo's full-sized avatar

Rodrigo Gil Lopetegui grodrigo

View GitHub Profile
@grodrigo
grodrigo / pomodoro.sh
Created November 7, 2021 02:55 — forked from AnderRasoVazquez/pomodoro.sh
[A simple pomodoro script for Bash shell] #shell #bash
#!/bin/bash
## pomodoro script by Ander Raso Vázquez anderraso@gmail.com
############## DOCUMENTATION ###################
## After a pomodoro of 25 min -> 5 min break
## After 4 pomodoros done -> 15 min break
##
## USAGE
## [command] [number of pomodoros]
## example:
{
"meta": {
"theme": "short"
},
"basics": {
"name": "Rodrigo Sebastián Gil",
"label": "DevOps en Ministerio de Producción y Trabajo de la Nación",
"image": "http://1.gravatar.com/avatar/e1fc555f33a36f70bb0c0fc5d7dd3f5e",
"email": "grodrigo.dev@gmail.com",
"phone": "2216359288",
@grodrigo
grodrigo / bagisto.md
Last active June 1, 2020 18:26
laravel bagisto create project with docker

Install bagisto laravel ecommerce with docker-compose

requierements: docker and docker-compose

## get the lastest docker image:
docker pull grodrigo/laravel
## first clone a general laravel setup:
git clone https://gitlab.com/grodrigo.dev/laravel.git bagisto
cd bagisto
cp .env.example .env
## edit .env file of docker, change
@grodrigo
grodrigo / playbook.yml
Created August 20, 2019 04:09
ansible playbook examples
---
- hosts: localhost
tasks:
- name: Create tmp folder path
file:
state: directory
path: /tmp/myfiles
- name: Ansible create multiple files example
file:
@grodrigo
grodrigo / git.md
Last active April 28, 2019 22:01
git tips

Git Tips

Git Flow

git flow init # setup project to use git-flow

git flow feature start <feature_name> # creates a new feature branch called <feature_name>

git flow feature finish <feature_name> # merge feature back into develop branch

git flow release start # merge develop to release

##
# Creates an alias called "git hist" that outputs a nicely formatted git log.
# Usage is just like "git log"
# Examples:
# git hist
# git hist -5
# git hist <branch_name>
# git hist <tag_name> -10
##
git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short"
@grodrigo
grodrigo / mongo_backup.sh
Last active March 27, 2019 04:49
bash select: dump or restor mongo from container
#!/bin/bash
PS3='Please enter your choice: '
options=("Dump lab database" "Restore dump from lab" "Quit")
PATHNAME="./backups"
CWD="${PWD##*/}"
MACHINE=$CWD
MACHINE+=_mongo_1
NOW=$(date +"%m-%d-%Y")
@grodrigo
grodrigo / update_branches.sh
Last active March 27, 2019 04:09
Copy a file from current branch to all branches with prefix
#!/bin/bash
if [ $# -lt 1 ]; then
echo "usage: $0 filename [branch-prefix] (where branch-prefix is optional)"
echo "e.g. $0 file.txt venv"
exit;
fi
#fetch and track remote branches
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done