Skip to content

Instantly share code, notes, and snippets.

View fernandoaleman's full-sized avatar

Fernando Aleman fernandoaleman

View GitHub Profile
@fernandoaleman
fernandoaleman / create-repo-metadata.sh
Created November 18, 2011 17:42
Script to create rpm repository metadata
#!/bin/sh
# This is for Redhat 64 bit versions of Linux with `createrepo` installed. If you
# do not have createrepo, you can install it with:
# yum install -y createrepo
# Change DESTDIR path to RPMS directory of your repo
DESTDIR="/var/www/repo/rhel/6"
for ARCH in x86_64
@fernandoaleman
fernandoaleman / update-chef-version.md
Last active April 26, 2023 20:00
How to update version of chef client on node

Update Chef Version

How to update version of chef client on node

curl -L https://chef.io/chef/install.sh | sudo bash -s -- -v 18.2.7
@fernandoaleman
fernandoaleman / how-to-create-an-rpm-repository.sh
Created November 18, 2011 17:57
How to create an RPM repository
# 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 / chef-workstation-too-many-files-open.md
Created April 12, 2023 17:27
/opt/chef-workstation/embedded/lib/ruby/gems/3.1.0/gems/chef-config-18.2.7/lib/chef-config/workstation_config_loader.rb:123:in `pwd': Too many open files - getcwd (Errno::EMFILE)

Problem

If you get the following error, the Mac ulimit is set too low.

/opt/chef-workstation/embedded/lib/ruby/gems/3.1.0/gems/chef-config-18.2.7/lib/chef-config/workstation_config_loader.rb:123:in `pwd': Too many open files - getcwd (Errno::EMFILE)
	from /opt/chef-workstation/embedded/lib/ruby/gems/3.1.0/gems/chef-config-18.2.7/lib/chef-config/workstation_config_loader.rb:123:in `locate_local_config'
	from /opt/chef-workstation/embedded/lib/ruby/gems/3.1.0/gems/chef-config-18.2.7/lib/chef-config/workstation_config_loader.rb:55:in `config_location'
	from /opt/chef-workstation/embedded/lib/ruby/gems/3.1.0/gems/chef-config-18.2.7/lib/chef-config/workstation_config_loader.rb:77:in `load'
@fernandoaleman
fernandoaleman / mysql-5.7-master-slave-replication-centos-7.md
Last active April 4, 2023 03:51
MySQL 5.7 Master-Slave Replication on CentOS 7

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 / redis-cannot-allocate-memory.txt
Last active March 1, 2023 14:14
redis bgsave failed because fork Cannot allocate memory
Modify /etc/sysctl.conf and add
vm.overcommit_memory=1
Then restart sysctl by:
$ sudo sysctl -p /etc/sysctl.conf
@fernandoaleman
fernandoaleman / fix-docker-systemd-failed-to-get-d-bus-connection.md
Created January 30, 2023 18:52
Docker for Mac Failed to get D-Bus connection: No such file or directory

Problem

Running systemd commands in Docker for Mac returns the following error:

Failed to get D-Bus connection: No such file or directory

Solution

@fernandoaleman
fernandoaleman / install-rabbitmq-ubuntu1604.md
Last active November 21, 2022 04:09
Install RabbitMQ on Ubuntu 16.06

Install RabbitMQ on Ubuntu 16.04

Install Erlang

wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update -y
sudo apt-get install -y erlang erlang-nox
@fernandoaleman
fernandoaleman / download-url-to-file.rb
Created October 11, 2022 18:13 — forked from johnjohndoe/download-url-to-file.rb
Ruby script to download a number of files from individual URLs via HTTP/HTTPS/FTP specified in an external file.
#!/usr/bin/env ruby
#
# Ruby script to download a number of files
# from individual URLs via HTTP/HTTPS/FTP
# specified in an external file.
#
# Author: Tobias Preuss
# Revision: 2013-04-18 16:26 +0100 UTC
# License: Creative Commons Attribution-ShareAlike 3.0 Unported
@fernandoaleman
fernandoaleman / how-to-manually-update-chef-server-ssl-certificates.md
Created August 1, 2022 15:02
How To Manually Update Chef Server SSL Certificates

How To Manually Update Chef Server SSL Certificates

Replace the contents of /var/opt/opscode/nginx/ca/www.yourdomain.com.crt with your ssl certificate.

Replace the contents of /var/opt/opscode/nginx/ca/www.yourdomain.com.key with your ssl key.

Reconfigure chef server

chef-server-ctl reconfigure