Category: Uncategorized

How to Switch (su) to Another User Account without Password

In this guide, we will show how to switch to another or a specific user account without requiring a password. For example, we have a user account called postgres (the default PostgreSQL superuser system account), we want every user (typically our PostgreSQL database and system administrators) in the group called postgres to switch to the postgres account using the su command without entering a password. By default, …

Start reading How to Switch (su) to Another User Account without Password

Security Flaw in MacOS

Security Flaw in MacOS

Security researcher Linus Henzedemoed a zero-day macOS exploit impacting the Keychain password management system which can store passwords for applications, servers, and websites, as well as sensitive information related to banking accounts. All the data stored in the macOS Keychain app is encrypted by default, blocking other users or third-party apps from gaining access to it without proper …

Start reading Security Flaw in MacOS

Querying a HSQL database on the command line with hsqldb-sqltool

If you have a HyperSQL (HSQL) database stored in a file, it is often useful to be able to query that database from the command line. This can be done using the following command: By default, user SA with no password will exist for each database file. If the database does not exist, it will be created …

Start reading Querying a HSQL database on the command line with hsqldb-sqltool

Running multiple programs in a Docker container from the command line

With Docker, you can specify the command to run inside the container on the command line. But what if you want to run multiple commands? You can’t escape the && syntax, or wrap the command in quotes, as Docker won’t recognise it. The trick here is to use For example, to run date and whoami in a vanilla ubuntu container, we would run …

Start reading Running multiple programs in a Docker container from the command line

Accessing fields by index in Awk

In awk, fields are accessed by number; $1 for the first field, $2 for the second, etc. But sometimes the field number you want to access is not known until run time. In these cases, you can access the field using the $(<index>) syntax. The constant NF contains the number of fields available. For example, you can print all fields with their field …

Start reading Accessing fields by index in Awk