Skip to content

Instantly share code, notes, and snippets.

View fernandoaleman's full-sized avatar

Fernando Aleman fernandoaleman

View GitHub Profile
@fernandoaleman
fernandoaleman / how-to-backup-and-restore-redis.md
Last active February 27, 2024 07:09
How to backup and restore Redis

How To Backup and Restore Redis

Backup

Login to Redis

$ redis-cli
@fernandoaleman
fernandoaleman / mysql2-mojave.md
Last active February 7, 2024 19:19
Install mysql2 on MacOS Mojave

For MacOS Catalina, visit Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

@fernandoaleman
fernandoaleman / rpm-digital-signature.sh
Created November 18, 2011 15:18
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
@fernandoaleman
fernandoaleman / fix-libv8-mac.txt
Created May 5, 2016 15:14
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
@fernandoaleman
fernandoaleman / chef-error-running-exception-handlers.md
Created October 1, 2018 16:44
Solving Chef ERROR: Running exception handlers - 403 Forbidden

Error

Running handlers:
[2018-10-01T11:07:45-05:00] ERROR: Running exception handlers
Running handlers complete
[2018-10-01T11:07:45-05:00] ERROR: Exception handlers complete
Chef Client failed. 33 resources updated in 01 minutes 06 seconds
[2018-10-01T11:07:45-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2018-10-01T11:07:45-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
@fernandoaleman
fernandoaleman / how-to-install-php-5.6-on-ubuntu-22.04.md
Created November 14, 2023 21:42
How to install PHP 5.6 on Ubuntu 22.04

How To Install PHP 5.6 on Ubuntu 22.04

Add php apt repository

$ sudo add-apt-repository ppa:ondrej/php

Update repository index

@fernandoaleman
fernandoaleman / clone-git-repo.txt
Last active October 20, 2023 10:37
How to clone git repo with all branches and tags
# Clone repo
git clone --mirror git@github.com/fernandoaleman/app.git app/.git
# Change into app directory
cd app
# Update git config
git config --unset core.bare
# Checkout master branch
@fernandoaleman
fernandoaleman / gist:5083680
Last active October 17, 2023 12:02
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@fernandoaleman
fernandoaleman / check_mysql_memory_usage.sh
Created April 22, 2020 13:02
Check MySQL memory usage
#!/bin/sh
# you might want to add some user authentication here
mysql -e "show variables; show status" | awk '
{
VAR[$1]=$2
}
END {
MAX_CONN = VAR["max_connections"]
MAX_USED_CONN = VAR["Max_used_connections"]
BASE_MEM=VAR["key_buffer_size"] + VAR["query_cache_size"] + VAR["innodb_buffer_pool_size"] + VAR["innodb_additional_mem_pool_size"] + VAR["innodb_log_buffer_size"]
@fernandoaleman
fernandoaleman / mysql2-catalina.md
Last active July 11, 2023 02:11
Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Catalina with MySQL 5.7.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl