The pg_trgm PostgreSQL extension is not present. The extension is required by Drupal 10

I got this pg_trgm PostgreSQL error after trying to run Drupal and Postgres using Docker compose for testing purposes. After taking the NYC subway to my home office I decided to look into this.

The solution for this error was to install the missing extension in Postgres. Not sure why this is not installed by default. Maybe that’s a topic for a different post.

To quickly install the missing postgres extension and fix this pg_trgm PostgreSQL error I logged into my docker container by running the below command:

docker exec -it <nameOfContainer> bash

I then logged into postgres using:

psql -U <DB_USERNAME>

then switch to the database you want to install the extension:

\c <DB_NAME>

Run the below command to install the extension:

CREATE EXTENSION pg_trgm;

Logout and if you get further errors try installing the module for your Linux OS:

Ubuntu/Debian:

sudo apt install postgresql-contrib

Fedora:

sudo dnf install postgresql-contrib

Research your OS documentation for installing this postgres extension.

Clean Install macOS Without a USB

Performing a clean install macOS without a USB is fairly easy compared to other operating systems. I know traditionally most IT admins (IT Handy men) think about using a USB to quickly wipe and re-install a OS. But, some times there is NO USB available or the laptop does NOT have a USB port anymore or you might not have an adapter handy(This sucks!)

After brewing my own coffee at home and taking a walk around NYC and noticing so many red fire police call boxes I decided to put this brief tutorial together.

This is easy to do.

Before you start to Clean install macOS

Always! Always! backup, backup and backup your DATA. This process will erase all data. There’s NO going back.

Start the process

  1. Restart your mac or turn it OFF and the ON. While the mac is starting hold down Command + R keys.
  2. Release the keys when you see the Apple logo.
  3. You will see a “macOS Utilities” window. Select Disk Utility and Erase you main mac hard disk.
  4. Once the disk has been erased close Disk Utility window. You will be taken back to the “macOS Utilities” window.
  5. Now, connect your mac to the internet via Wifi or Ethernet cable(if possible).
  6. Select Reinstall macOS in the “macOS Utilities” window.
  7. Follow the instructions and make sure you select the HD you erased previously. This is the target drive macOS will boot from.
  8. The re-install process will begin. This may take some time due to your internet speed.

When done you will setup macOS as you normally do. Enjoy!

Manage WiFi using macOS Terminal

A customer called asking if I could disable WiFi for some of his new iMacs at the office. He wanted his users to connect via Ethernet cable. After digging around I found a way to manage WiFi using macos Terminal.

There are a few simple steps you can take. First, a great cup of coffee!

Then, open your macOS Terminal.

First you need to find the network interface name by running the following command:

networksetup -listallhardwareports
Manage WiFi using macOS Terminal
Manage WiFi using macOS Terminal

This Terminal command gives you a nice layout of all your network interfaces.

After you find the network interface for your WiFi you can turn it off by running:

networksetup - setairportpower en0 off

Let’s say you changed your mind and you want to turn back ON your WiFi using the Terminal you run:

networksetup - setairportpower en0 on

For example, if you like to join a different WiFi network you can run the following command in the Terminal to view available networks:

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport scan

To join one of those WiFi networks you found:

networksetup -setairportnetwork en0 SSID_YOU_WANT_TO_JOIN WIFI_PASS

There’s a space between SSID_YOU_WANT_TO_JOIN and WIFI_PASS.

I’m not sure why Apple doesn’t like to publish much documentation about running these task to make IT handy man lives easier. Anyways, hope this post helps someone out there.

Remember to check my IT coffee mugs and T-Shirt shop. I make my own designs. You can also contact me if you have any questions.

Clear Other Storage in macOS

A macOS customer contacted me the other day asking how to clear other storage in macos. Some of the customer’s laptops were taking significant disk space in this ‘other’ mysterious storage.

While riding the New York City Subway I started researching how to clear other storage in macos.

There are some cleaning tools out there, but as usual I prefer to do things myself and learn while at it. I found out that Cache files, documents not needed, DMG files, Application logs and Support files, browser’s plugins and extensions form part of this ‘other storage in macOS’.

Delete cached files using the Terminal

  1. Open your Terminal
  2. Type ~/Library/Caches (this is the user’s path)
  3. Remove the cache files you want to delete by using the rm command
  4. You can also try /Library/Caches(system caches)


I highly recommend that you have a backup before running the above.

Remove unneeded files including DMG one

  1. Open Finder and search using the upper right corner icon
  2. Type .dmg in the box and select Disk Image for Kind
  3. Delete any DMG files and remember to empty your Trash
  4. You can do the same process for other files such as .pdf, .doc, .psd and more..
  5. Always select ‘This Mac’ when searching for large files.
  6. You can always sort by File size.

Remove Application Logs and Support Files

  1. Open your Terminal or use Finder if you like
  2. Browse to these locations:
    • ~/Library/Application support
    • ~/Library/Logs
    • ~/Library/Containers
    • /Library/Application support
    • /Library/Logs
    • /Library/Containers
  3. Now delete what you don’t need.

Delete your browser’s plugin and extensions

  1. Go to each browser and locate plugins/extensions
  2. Delete the ones you don’t need.

Hopefully this can help someone having this issue. You can always contact me if you have any questions. Also, remember to see my T-Shirt and coffee mugs shop. I make my own designs. Enjoy!

How to Install pkg Using Terminal macOS

A client wanted to install some new Multi-factor Authentication software on the background while users where working. After brewing a great cup of Catuai coffee at home I found how to install a .pkg using the Terminal macOS.

This is a simple command. Open your Terminal and ssh to the desired macOS you need to install the .pkg. Run the following command:

sudo installer -pkg /path/to/package.pkg -target /

I usually run the above installer command from the location the .pkg lives. Enter your admin password and it should install without an issue. You should see an output as below:

Install pkg Using Terminal macOS
macOS Terminal installer pkg output

Find macOS Serial Number using Terminal

  1. You need to open your Terminal. Either by going to your Applications>Utilities>Terminal or by simply using Spotlight Search (type Command + Space on your keyboard) then type Terminal and press enter.
  2. Type the below command into your Terminal and press enter:
system_profiler SPHardwareDataType

The Terminal will display your serial number as shown below:

Find macOS Serial Number using Terminal
Find macOS Serial Number using Terminal

This command in macOS will also show you more details about your machine. These include Model, Chip, Memory, Total number of cores and more.

Contact me if you have any questions. You can also check out my ITPro Helper shop. I make my own T-shirts and mugs designs in New York City.

Start Tomcat at boot time in Red Hat 8

The other day I installed a Tomcat server in Red Hat 8 for a client. The client had to reboot the server and couldn’t find a way to start it. I found a way to start Tomcat at boot time in Red Hat 8.

As usual, I needed to go for a walk around New York City in Brooklyn before taking on this one.

First, we need to create a startup script file for Tomcat in:

/etc/init.d

You can name this file tomcat and enter the below:

#!/bin/sh
export CATALINA_HOME="/usr/local/tomcat"
ERROR=0
case "$1" in
 start)
            echo $"Starting Tomcat"
            sh $CATALINA_HOME/bin/startup.sh
            ;;
 stop)
           echo $"Stopping Tomcat"
           sh $CATALINA_HOME/bin/shutdown.sh
           ;;
 restart)
           sh $CATALINA_HOME/bin/shutdown.sh
           sh $CATALINA_HOME/bin/startup.sh
            ;;
 *)
         echo $"Usage: $0 {start|stop|restart}"
 exit 1
 ;;
esac
exit $ERROR

Assigned the permissions below:

chomod 755 tomcat

Next, create a symbolic link of the tomcat script inside the rc.d directory:

ln -s /etc/init.d/tomcat /etc/rc.d/rc6.d/K24tomcat 
ln -s /etc/init.d/tomcat /etc/rc.d/rc0.d/K28tomcat
ln -s /etc/init.d/tomcat /etc/rc.d/rc3.d/S80tomcat
ln -s /etc/init.d/tomcat /etc/rc.d/rc2.d/S81tomcat
ln -s /etc/init.d/tomcat /etc/rc.d/rc5.d/S81tomcat

Go ahead and reboot your server and see if Tomcat starts automatically.

You can always contact me if you have any questions. Also, remember to visit my ITPro Helper shop where I created unique T-Shirts and coffee mugs designs.

How to Configure SSH Server in Ubuntu

A client called me asking me to setup and configure SSH on a new Ubuntu server they got for a project. They needed the server to be accessed by a remote Web Developer they hired.

After having a great cup of coffee Villa Sarchi varietal I decided to take on this one.

Install SSH Server in Ubuntu

New Ubuntu installs do not have SSH service by default. You need to install it. It very easy. Run the below command on your Terminal:

sudo apt update

Then do:

sudo apt install openssh-server

Select ‘yes’ when asked. This last command will install SSH server in Ubuntu. Once the installation is done the SSH service will be started. You can check this by running this command:

sudo systemctl status ssh

Make the SSH server more secure using UFW in Ubuntu

UFW (Uncomplicated FireWall) is Ubuntu’s default firewall. Allow SSH port 22, port 8000, port 5000(these two are for testing only) on your Ubuntu server:

sudo ufw allow ssh
sudo ufw allow 8000
sudo ufw allow 5000

Then enable the firewall:

sudo ufw enable

To see what’s configured under your ufw rules:

sudo ufw status

This will give you a summary as the one below:

Configure SSH Server in Ubuntu
UFW status command output

Next, I needed to create a Linux user with sudo rights. You can tap on that link to see the steps necessary to do that. After you’re done you should be able to connect to the server using the following ssh command:

ssh youruser@yourserverIP

For example:

ssh pepe@192.168.2.11

You can also add your public key to the Ubuntu server. This way you don’t need to enter a password when you SSH. You can also add this server to a config file in your .ssh/config

I will be adding more details about security for SSH server. For now, visit my ITPro shop to see cool IT inspired T-Shirts and coffee mugs I designed.

Open VS Code from macOS Terminal

A client called me the other day asking me how to open VS code from macOS terminal. The user started doing some Web Development and wanted to make his environment run smoothly.

After I finished my meeting with my friend coffee farmer from Finca Perseverancia in Honduras I decided to put together this brief tutorial to Open VS Code from macOS Terminal.

First, you need to start VS Code. If you don’t have it you can download it here. Then, run Command + Shift + P. You should see the below:

VS Code command palette
VS Code command palette

This area in VS Code is called the ‘VS Code command palette’. This will let you change settings.

Next, type in the command palette the below and hit Enter:

shell

It should look like the screenshot below. The option Install ‘code’ command in PATH should be selected. This will do all changes you need.

You should see a confirmation window saying:

Shell command 'code' successfully installed in PATH.

That’s all. Contact me if you have any questions. You can also leave a comment below. If you like to support me visit my ITPro Helper shop. I made some cool T-Shirt and coffee mugs designs.

Windows 11 not Accepting File Names Over 260 Characters

The new Windows 11 is another Microsoft release. As usual, I’m not impressed at all. Anyways, a client was having issues when trying to clone a git repo on her new Windows 11 machine. the client kept getting error “Destination path too long” error message.

There are some suggestions online to make a registry and or use the Group Policy Editor. Both did not work for me. The suggested registry change is to change the value of the below registry key to ‘1’:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

I rebooted and still got the same error above. I did not even try Local Group Policy since this was a Windows 11 Home edition.

After having some great coffee from Colombia, I found a way to make this work.

I created a folder directly on the root (C: drive). For example, C:\work_here

On the Windows 11 command prompt I change directories to the above and did a git clone. All works now.

Contact me if you have any questions. Remember to check my T-shirt and Coffee mugs shop.