Skip to main content

Apache version

Using a Centos 6 or 7 server, how to check the current version of Apache?

httpd -v

This command will return a string that is similar to the following:

Server version: Apache/2.4.6 (CentOS)
Server built:   Nov 16 2020 16:18:20

If you want to find where the httpd binaries are located use the following:

whereis httpd

This command will return something like:

Composer PHP version part 2

As outlined in an earlier article composer php version, when installing the latest version of Drupal the Plesk version and the server version can be different.  In plesk, the version of PHP is 7.3.18, whereas, on the Centos server a check through Terminal (php -v) shows PHP 7.1.33 (cli).

When attempting to install Drupal 9 through composer, the following errors will be shown:

Realm object with NSPredicate

What to do when you want to filter a Realm object, using NSPredicate in SwiftUI or in Swift.  

Applying the filter to a simple condition in one line

let exists = realm.objects(ExampleObj.self).filter(NSPredicate(format: "uid = %ld", uid))

Creating a variable predicate that will be injected as a condition

Uploading plist data to the server using an API

I had an instance where I needed to move content from a plist to the server database.  To achieve this step, I added a few lines of code where the plist was called and added a call to the API so the data would be on the server.

The original code appeared as:

Registering users via REST

Registering a user via REST is an important process particularly when the requests come from a mobile device.

In working through the process you might have come across error message like:

403 Forbidden : "Only anonymous users can register a user."

422 Unprocessable Entity : "A Password cannot be specified. It will be generated on login."

So how did I get these and what to do?

Applying a patch via Terminal

As a process I apply patches locally first, then using git upload the update(s) to a development site on the server.  Once the testing has been completed, the final step to apply the patch to the production site.  

Using Terminal or your preferred shell program, navigate to the correct directory.  Then run this command using the name of the patch file (example.patch):

CDN error on pod update

Today while in Terminal, I ran a regular script pod update.  However, this time I received the following error

[!] CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/d/a/2/Alamofire/5.1.0/Alamofire.podspec.json Response: Timeout was reached

I read on GitHub that it could be a cache issue, so I ran:

Creating a new SwiftUI project

Creating a new SwiftUI project is a quick process.  There are already thousands of sites outlining how to do these steps.  Rather than repeat this steps at the top of each article, we will refer to this article to get you across the line if you don't know or need a refresher.

Step 1

Open Xcode and either click Create a new Xcode project in Xcode’s startup window, or choose File > New > Project.

SwiftUI adding a background image with a gradient tint

I'm going to take you on a journey about adding a gradient tint to a background image.  The journey will go through text modifiers with regular and semibold font weights, and font colour.  Using an image from Unsplash.  Adding a black tint, then transform it to a gradient using a colour array.  If you get lost along the journey, the final result is available on GitHub.

Centos server restart

I'm receiving a server not found when logging in to Plesk from shell or Terminal.  Specifically the error message I'm receiving is

Can't connect to the server

My first reference for this fix is to run the command 

sudo service httpd restart

Running this command you will see the following in Terminal

Subscribe to