Skip to content

Instantly share code, notes, and snippets.

View mauricios's full-sized avatar

Mauricio Sánchez mauricios

View GitHub Profile

Install Docker

Downaload the makefile and execute the following command in the same directory


mauricios / aplyca-email-signature.markdown
Last active September 14, 2021 14:43
Aplyca Email Signature
mauricios /
Last active November 17, 2020 15:47
Generate SSH key pair

Generate SSH key pair

Use RSA encryption with 4096 bits

ssh-keygen -t rsa -b 4096 -C "" -f ~/.ssh/myserver.key -P ""

The command above will generate two files, the private key ~/.ssh/myserver.key and the public key ~/.ssh/

mauricios /
Last active March 3, 2019 18:01
Install OpenShift in Amazon Linux 2
# Configure variables
# Install Docker
sudo yum install docker -y
sudo usermod -aG docker ec2-user
# Add insecure registry to Docker
mauricios /
Created August 31, 2018 16:41
GPG useful commands

Generate the GPG key pair

gpg --full-generate-key;

Export public GPG key

Look for your Key ID in using the following command:

mauricios / vim_powers
Created February 16, 2018 02:01
Vim powers
- Search and replace: :%s/foo/bar/g
- Delete text block: ma + d'a
- Macro: qd, <commands>, then q, apply with @d and @@
- Write as sudo: :w !sudo tee %
- Increase/Decrease number: Ctl+A Ctl+X
mauricios /
Last active April 23, 2022 21:47
Text manipulation commands
!# /bin/bash
# Replace string in all files in a directory (macOS)
grep -Rnl "old_string" **/*.txt | xargs sed -i "" 's/old_string/new_string/g'
mauricios /
Last active December 28, 2017 15:48
Migrate Git repo from one remote to another
# Clone the old repo using the mirror option
git clone --mirror
# Enter the new clonned repo directory
cd my-old-repo.git
# Add the new remote repo
git remote add new_origin
mauricios / hyper.js
Last active December 25, 2018 22:44
Hyper terminal preferences
module.exports = {
config: {
fontSize: 14,
fontFamily: '"Fira Mono", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
cursorColor: 'cyan',
cursorShape: 'BEAM',
cursorBlink: false,
foregroundColor: '#ffffff',
backgroundColor: '#000000',
borderColor: '#000000',
mauricios /
Last active November 8, 2019 18:35
Resize EBS volume

Resize AWS EBS Disk partition

The following commands are rquiered to expoand a partition and resize the file system of an EBS volume. Those steps work in EBS volumes including root volumes and can be done while they are attached to a running instance (zero downtime)

Check the size of the partition

df -H