Assign Output of Shell Command To Variable in Bash

var=$(command-name-here)
var=$(command-name-here arg1)
var=$(/path/to/command)
var=$(/path/to/command arg1 arg2)

OR use backticks based syntax as follows to assign output of a Linux command to a variable:

var=`command-name-here`
var=`command-name-here arg1`
var=`/path/to/command`
var=`/path/to/command arg1 arg2`

Examples

## store date command output to $now  ##
now=$(date)
## alternate syntax ##
now=`date`

To display back result (or output stored in a variable called $now) use the echo or printf command:

echo "$now"
printf "%s\n" "$now"

References
https://www.cyberciti.biz/faq/unix-linux-bsd-appleosx-bash-assign-variable-command-output/

Tweaks for Firefox

Enable Hardware Acceleration

  1. Go to about:preferences
  2. In General, scroll down to Performance
  3. Uncheck the box for Use recommended performance settings
  4. Check the box for Use hardware acceleration when available

Disable Data Collection and Telemetry

  1. Go to about:preferences
  2. Go to Privacy & Security, and scroll down to Firefox Data Collection and Use
  3. Uncheck all boxes in this section
  4. Restart Firefox

Essential About:Config Tweaks

  • Set browser.download.animateNotifications to False
  • Set security.dialog_enable_delay to 0
  • Set network.prefetch-next to False (Only on slow internet connections)
  • Set browser.newtabpage.activity-stream.feeds.telemetry to false
  • Set browser.newtabpage.activity-stream.telemetry to false
  • Set browser.ping-centre.telemetry to false
  • Set toolkit.telemetry.archive.enabled to false
  • Set toolkit.telemetry.bhrPing.enabled to false
  • Set toolkit.telemetry.enabled to false
  • Set toolkit.telemetry.firstShutdownPing.enabled to false
  • Set toolkit.telemetry.hybridContent.enabled to false
  • Set toolkit.telemetry.newProfilePing.enabled to false
  • Set toolkit.telemetry.reportingpolicy.firstRun to false
  • Set toolkit.telemetry.shutdownPingSender.enabled to false
  • Set toolkit.telemetry.unified to false
  • Set toolkit.telemetry.updatePing.enabled to false

Remove Built-in Firefox Add-ons

  • In about:config, set reader.parse-on-load.enabled to False
  • In about:config, set reader.parse-on-load.force-enabled to False
  • In about:config, set browser.pocket.enabled to False
  • In about:config, set loop.enabled to False

References
https://www.makeuseof.com/tag/speed-up-firefox-immediately-with-these-6-simple-tweaks/

MySQL Error: : ‘Access denied for user ‘root’@’localhost’

sudo mysql
-- for MySQL
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

-- for MariaDB
ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('root');

With a single query we are changing the auth_plugin to mysql_native_password and setting the root password to root and there isn’t any need to restart mysqld or start it with special privileges.

References
https://stackoverflow.com/questions/41645309/mysql-error-access-denied-for-user-rootlocalhost