By marcom on Thursday, February 16, 2023
YubiKey 5C NFC - Two Factor Authentication USB and NFC Security Key

In the digital age, passwords are one of the primary methods used for securing our online accounts and devices. However, the effectiveness of passwords in securing our personal data and digital assets is often questioned due to the increasing prevalence of data breaches and cyber-attacks. This has led to the search for alternatives to traditional passwords, and passkeys have emerged as a viable replacement.

Tags
By marcom on Wednesday, February 15, 2023
black laptop computer turned on on table

For the single-byte encoded (binary) strings:

substr($username, 0, 1);
// or 
$username[0] ?? null;

For the multi-byte encoded strings, such as UTF-8:

mb_substr($username, 0, 1);
Tags
By marcom on Tuesday, February 14, 2023
black and red laptop computer

X.509 is a standard format for public key certificates, digital documents that securely associate cryptographic key pairs with identities such as websites, individuals, or organizations. However, this can also be converted to .pem files using OpenSSL.

By marcom on Tuesday, February 7, 2023
ChatGPT

ChatGPT is a language model developed by OpenAI, a leading artificial intelligence research company. It is based on the transformer architecture and has been trained on a massive dataset of text from the internet to produce human-like responses to a wide range of topics.

By marcom on Thursday, December 2, 2021
 Leonie Vuilleumier

Part of any website are the domains and URLs that users type in their browsers in order to reach a web page. However, it can be challenging to manage should it need to be changed. Thankfully, there are URL redirects for that.

URL redirect (forwarding) allows you to forward your domain visitors to any URL of your choice, either to a new domain or a different website altogether.

In an Apache web server, use the following rewrite rules in your .htaccess file.

Tags
By marcom on Friday, December 16, 2022
Key with "Duplication Prohibited" on it

Generating an SSH key

  1. Open Terminal
  2. Generate your key pair using your email address
    $ ssh-keygen -t ed25519 -C "your.email@example.com"
    Generating public/private ed25519 key pair
  3. When prompted to "Enter a file in which to save the key," press Enter to accept the default file location
    $ Enter file in which to save the key (~/.ssh/id_ed25519): ~/.ssh/[id_keyfile]
  4. At the prompt, simply press enter for an empty passphrase
    $ Enter passphrase (empty for no passphrase): [press enter]
    $
Tags
By marcom on Thursday, March 18, 2021
Matt Artz @mattartz

In July of 2020, GitHub announced its intent to require the use of token-based authentication for all Git operation and on August 13, 2021, the password authentication will be deprecated. With SSH keys, you can connect to GitHub, including Drupal, without supplying your username and password each time you push or pull changes to or from the repo.

Follow the steps below to connect to GitHub and Drupal with SSH keys from your local environment.

Tags
By marcom on Thursday, September 17, 2020
AltumCode

"Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you." - getcomposer.org

By marcom on Saturday, October 15, 2022
Tobias Fischer Unsplash

Export database

Export your database to create a backup using the following command:

$ mysqldump --opt --hex-blob [-h host] -u [user] -p [database] > [database].sql

Compress with gzip

You can also compress your database on-the-fly with gzip:

mysqldump --opt --hex-blob [-h host] -u [user] -p [database] | gzip -c > [database].sql.gz

Show progress

To show progress, you can use pv:

By marcom on Thursday, April 16, 2020
Matrix code on laptop screen

GnuPG is a complete and free implementation of the OpenPGP standard encryption. 

Installing GPG

GPG is available in Windows and many distributions of Linux, including a graphical user interface (GUI) that is easy to use. However, I prefer using the command line tools instead.

Red Hat / CentOS

sudo yum install gnupg

Ubuntu / Debian

sudo apt-get install gnupg

Note: Use gpg2 (version 2.x)

By marcom on Saturday, September 5, 2020
Copy files with rsync in Linux

Rsync (remote sync) is a linux utility to synchronize local and remote files and directories, mainly used in terminal.

I use this mainly in downloading/uploading files and directories from and to remote servers or even local files. I use rsync as well with shell scripts for backups that are ran automatically daily using the crontab utility.

By marcom on Monday, February 22, 2021
Laptop with encryted code - Markus Spiske

When installing a SSL certificate with a private key that is encrypted with a passphrase, you must decrypt the private key first. You can identify whether a private key is encrypted or not by opening the private key (.key or .pem file) using a text editor or command line. You should see the text ENCRYPTED if the private key is encrypted.