Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Mauricio Sánchez mauricios

🎯
Focusing
Block or report user

Report or block mauricios

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
@mauricios
mauricios / install_openshift.sh
Last active Mar 3, 2019
Install OpenShift in Amazon Linux 2
View install_openshift.sh
# Configure variables
OPENSHIFT_PACKAGE=https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz
OPENSHIFT_HOSTNAME=openshift.xip.io
# Install Docker
sudo yum install docker -y
sudo usermod -aG docker ec2-user
# Add insecure registry to Docker
View gpg_useful_commands.md

Generate the GPG key pair

gpg --full-generate-key;

Export public GPG key

Look for your Key ID in using the following command:

View aplyca-email-signature.markdown
View 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
mauricios / text_manipulation.sh
Created Jan 8, 2018
Text manipulation commands
View text_manipulation.sh
!# /bin/bash
# Replace string in all files in a directory (macOS)
grep -Rnl "include:" **/*.yml | xargs sed -i "" 's/include:/include_tasks:/g'
@mauricios
mauricios / migrate_git_repo.sh
Last active Dec 28, 2017
Migrate Git repo from one remote to another
View migrate_git_repo.sh
#!/bin/bash
# Clone the old repo using the mirror option
git clone --mirror git@git.my-old-server.com:my-old-repo.git
# Enter the new clonned repo directory
cd my-old-repo.git
# Add the new remote repo
git remote add new_origin git@git.my-new-server.com:my-new-repo.git
@mauricios
mauricios / hyper.js
Last active Dec 25, 2018
Hyper terminal preferences
View hyper.js
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',
View resize_ebs_volume.md

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
@mauricios
mauricios / curl_time_format.txt
Last active Dec 18, 2018
CURL format file to summarize loading times results of a page
View curl_time_format.txt
Content Type: %{content_type}\n
HTTP Code: %{http_code}\n
HTTP Connect: %{http_connect}\n
Number Connects: %{num_connects}\n
Number Redirects: %{num_redirects}\n
Redirect URL: %{redirect_url}\n
Size Download: %{size_download}\n
Average speed download: %{speed_download}\n
Size Upload: %{size_upload}\n
SSL Verify: %{ssl_verify_result}\n
@mauricios
mauricios / varnish_useful_commands.sh
Last active Oct 14, 2017
Varnish useful commands
View varnish_useful_commands.sh
#!/bin/sh
# Check configuration file
sudo varnishd -C -f /path/to/default.vcl -p vcl_dir=/path/to/vcl_dir
# Ban/Purge a URL
sudo varnishadm "ban req.http.host ~ ^<hostname>$ && req.url ~ ^<url>$"
# Change configuration
## Show list of configurations
You can’t perform that action at this time.