Skip to content

Instantly share code, notes, and snippets.

View fernandoaleman's full-sized avatar

Fernando Aleman fernandoaleman

View GitHub Profile
@fernandoaleman
fernandoaleman / 1_how-to-check-swap-space.md
Last active August 25, 2024 23:11
How to check, view, create and remove a swap file on Linux

How to Check Swap Space

There are several ways to check swap space in Linux.

  • The free command with the -h tag shows the total, available, and used swap space in a human-readable format.
$ free -h
@fernandoaleman
fernandoaleman / how-to-install-php-5.6-on-ubuntu-22.04.md
Last active November 14, 2024 19:51
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 -y ppa:ondrej/php

Update repository index

@fernandoaleman
fernandoaleman / how-to-disable-ubuntu-22.04-pop-up-daemons.md
Created November 14, 2023 21:25
How to disable Ubuntu 22.04 "Daemons using outdated libraries" popup

Problem

When using apt to install or update packaged, Ubuntu 22.04 now pops up a Daemons using outdated libraries box.

lAFlE

Solution

To disable this pop up box, edit

@fernandoaleman
fernandoaleman / mysql-8.0-gpg-fix.md
Last active October 3, 2024 07:47
The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.

Problem

The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.

Solution

rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
@fernandoaleman
fernandoaleman / mysql2-apple-silicon-macos-sonoma.md
Created November 2, 2023 16:32
How to install mysql2 gem on apple silicon M1, M2 or M3 macOS Sonoma

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 / 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 / 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 / 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-install-and-run-clamav-on-centos7.md
Last active April 10, 2024 09:55
How to install and run ClamAV on CentOS 7

How To Install and Run ClamAV on CentOS 7

ClamAV is an open-source antivirus. It is used to detect viruses, trojans, and malware.

Install ClamAV

Install EPEL repository

yum install -y epel-release
@fernandoaleman
fernandoaleman / how-to-manually-update-chef-server-ssl-certificates.md
Last active April 19, 2024 21:16
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 combined certificate.

Make sure SSL certificate includes DigiCert ca root certificate

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

Reconfigure chef server