Skip to content

Instantly share code, notes, and snippets.

Fernando Aleman fernandoaleman

  • Dallas, TX
Block or report user

Report or block fernandoaleman

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
View how-to-create-an-rpm-repository.sh
# How to create an RPM repository
# This is for Redhat 64 bit versions of Linux. You can create your own RPM repository # to host your custom RPM packages.
#
# See "How to create an RPM from source with spec file" for more information.
# https://gist.github.com/1376973
# Step: 1
# Install createrepo
@fernandoaleman
fernandoaleman / rpm-from-source.sh
Created Nov 18, 2011
How to create an RPM from source with spec file
View rpm-from-source.sh
# How to create an RPM from source with spec file
# This is for Redhat versions of linux. Sometimes when you search for an rpm package,
# it is either outdated or not available. The only thing available is the source code.
# You can create a custom RPM package from source.
#
# For this example, I'll be using the latest version of Git, currently v.1.7.7.3
# Step: 1
# Install rpmbuild
@fernandoaleman
fernandoaleman / nginx_init_script_centos
Created Oct 3, 2011
An Nginx init script for CentOS
View nginx_init_script_centos
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /opt/nginx/conf/nginx.conf
# pidfile: /opt/nginx/logs/nginx.pid
@fernandoaleman
fernandoaleman / INSTALL.txt
Last active Dec 24, 2019
Shell script to sync remote branches from upstream and push them up to forked origin
View INSTALL.txt
1. Copy 'git-sync-fork' script code from gist
2. Create a file called 'git-sync-fork' in any 'bin' directory in your $PATH
3. Paste script into this new file 'git-sync-fork' and save
4. Make the file executable `chmod +x git-sync-fork`
5. Run the script inside your locally forked git repo
Example:
git-sync-fork upstream origin
View mysql-master-slave-replication-centos-7.md

MySQL Master-Slave Replication on CentOS 7

Install and configure MySQL with master-slave replication. The benefits of this include high availability, backups, disaster recovery and reporting.

Enable MySQL Repository

Select a MySQL repository version to enable

MySQL 8.0

@fernandoaleman
fernandoaleman / chef-error-running-exception-handlers.md
Created Oct 1, 2018
Solving Chef ERROR: Running exception handlers - 403 Forbidden
View chef-error-running-exception-handlers.md

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 / reduce-lvm-partition-centos-7.md
Last active Jun 4, 2019
Reduce an LVM partition on CentOS 7
View reduce-lvm-partition-centos-7.md

Reduce LVM Partition on CentOS 7

Sometimes when creating a new CentOS 7 server, the drive is partioned with the root, boot and swap, and then all the rest of the space is given to the home directory.

Here, we are going to reduce the size of the /home partition and allocate the remaining space back to the root partition.

List Block Devices

List the current block devices

@fernandoaleman
fernandoaleman / mysql-5.7-master-slave-replication-centos-7.md
Last active Jun 4, 2019
MySQL 5.7 Master-Slave Replication on CentOS 7
View mysql-5.7-master-slave-replication-centos-7.md

MySQL 5.7 Master-Slave Replication on CentOS 7

Install and configure MySQL 5.7 with master-slave replication. The benefits of this include high availability, backups, disaster recovery and reporting.

Install MySQL 5.7

Enable MySQL repository

yum localinstall -y https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
@fernandoaleman
fernandoaleman / redid-cannot-allocate-memory.txt
Created Dec 7, 2016
redis bgsave failed because fork Cannot allocate memory
View redid-cannot-allocate-memory.txt
Modify /etc/sysctl.conf and add
vm.overcommit_memory=1
Then restart sysctl by:
$ sudo sysctl -p /etc/sysctl.conf
View auto-install-ruby-with-rbenv.zsh
# This snippet checks your current directory for a .ruby-version file
# and if it exists, it then checks to see if that version of ruby is
# installed. If not, it will ask you if you want to install it.
#
# Add this snippet to $HOME/.zshrc
# In zsh, the chpwd will run a command every time you change directories.
function chpwd {
# Check if a .ruby-version file exists
if [[ -f "$PWD/.ruby-version" ]]; then
You can’t perform that action at this time.