Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View fernandoaleman's full-sized avatar

Fernando Aleman fernandoaleman

View GitHub Profile
@fernandoaleman
fernandoaleman / chef-cookstyle-delivery-error.md
Created February 8, 2022 21:58
Chef cookstyle delivery error

Problem

When running cookstyle locally on a Mac, you get the error:

Offenses:

metadata.rb:1:1: W: Chef/Deprecations/Delivery: Do not include a .delivery directory for the delivery command in your cookbooks. Chef Delivery (Workflow) went EOL Dec 31st 2021 and the delivery command was removed from Chef Workstation Feb 2022. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_delivery)
@fernandoaleman
fernandoaleman / mysql2-m1.md
Last active April 22, 2024 23:15
How to install mysql2 gem on m1 Mac

Problem

Installing mysql2 gem errors on Apple silicon M1, M2 or M3 Mac running macOS Sonoma.

Solution

Make sure mysql-client, openssl and zstd are installed on Mac via Homebrew.

Replace mysql-client with whichever mysql package you are using

@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-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 / pg_backup.config
Last active July 25, 2022 07:34
Postgres backup script
##############################
## POSTGRESQL BACKUP CONFIG ##
##############################
# Optional system user to run backups as. If the user the script is running as doesn't match this
# the script terminates. Leave blank to skip check.
BACKUP_USER=backup
# Optional hostname to adhere to pg_hba policies. Will default to "localhost" if none specified.
HOSTNAME=
@fernandoaleman
fernandoaleman / chefspec-invalid-data-bag-path-error.md
Last active February 28, 2021 21:22
chefspec invalid data bag path

Problem

Using chef_vault_item in a recipe and testing via ChefSpec returns the following error:

Chef::Exceptions::InvalidDataBagPath:
       Data bag path '/var/folders/5d/46p9wf6976l9xptq3fwsrj9r0000gp/T/d20210228-64571-1lao3dr/data_bags' not found. Please create this directory.

Solution

Keybase proof

I hereby claim:

  • I am fernandoaleman on github.
  • I am fernandoaleman (https://keybase.io/fernandoaleman) on keybase.
  • I have a public key ASAvmS_mMPd7J7hcMXaB0I-OHP_3ZuuAuOcFsRgyJSPQjQo

To claim this, I am signing this object:

@fernandoaleman
fernandoaleman / rabbitmqadmin
Created September 16, 2020 21:45
rabbitmqadmin - Install on Linux server under /usr/local/bin directory
#!/usr/bin/env python3
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# https://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
@fernandoaleman
fernandoaleman / how-to-clean-up-ubuntu.md
Last active April 22, 2024 07:57
How to clean up Ubuntu

How To Clean Up Ubuntu

Some simple ways to free up space on Ubuntu

Remove Unnecessary Packages and Dependencies

apt-get autoremove
@fernandoaleman
fernandoaleman / already-initialized-constant-etc.md
Created April 29, 2020 21:53
Chef command warning: already initialized constant Etc::

Problem

Chef command warnings concerning already initialized constants

warning: already initialized constant Etc::SC_AIO_LISTIO_MAX
warning: already initialized constant Etc::SC_AIO_MAX
warning: already initialized constant Etc::SC_AIO_PRIO_DELTA_MAX
warning: already initialized constant Etc::SC_ARG_MAX
warning: already initialized constant Etc::SC_ATEXIT_MAX