Skip to content

Instantly share code, notes, and snippets.

View mauricios's full-sized avatar
🎯
Focusing

Mauricio Sánchez mauricios

🎯
Focusing
View GitHub Profile
@mauricios
mauricios / text_manipulation.sh
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
mauricios / curl_time_format.txt
Last active February 17, 2022 18:21
CURL format file to summarize loading times results of a page
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 / aplyca-email-signature.markdown
Last active September 14, 2021 14:43
Aplyca Email Signature

Install Docker

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

make

@mauricios
mauricios / generate_ssh_key_pair.md
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 "my_email@mydomain.com" -f ~/.ssh/myserver.key -P ""

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

@mauricios
mauricios / resize_ebs_volume.md
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
@mauricios
mauricios / install_openshift.sh
Last active March 3, 2019 18:01
Install OpenShift in Amazon Linux 2
# 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
@mauricios
mauricios / s3fs-iam-bucket-policy.json
Last active February 25, 2019 18:24
AWS IAM Policy to access an S3 bucket from s3fs
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets"
],
"Resource": [
"arn:aws:s3:::my-bucket"
@mauricios
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
mauricios / gpg_useful_commands.md
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: