Linux Digital Clock Format (strftime)

To display seconds on the Raspberry Pi OS digital clock, you need to modify the clock settings on the taskbar. Here are the steps to achieve that:

Raspberry Pi OS Digital Clock Settings
  1. Accessing the Clock Settings: a. Right-click on the clock at the top-right corner of the Raspberry Pi OS desktop. b. From the context menu, select ‘Digital Clock Settings’ or a similar option (the name might vary slightly based on the version of Raspberry Pi OS you’re using).
  2. Adjusting Clock Format: a. In the Digital Clock Settings window, find the field named ‘Clock Format’ or ‘Format’. b. This field determines how the time is displayed. You’ll typically see some format strings like %H:%M which stands for Hour:Minute in 24-hour format. c. To add seconds, modify the string to %H:%M:%S. The %S denotes seconds. d. Once done, click ‘OK’ or ‘Apply’ to save the changes.
  3. The digital clock on your taskbar should now display hours, minutes, and seconds.

Note: The format strings are based on the strftime function format. You can further customize the time and date format using various codes. If you’re interested, you can look up strftime format codes online for more details.

The strftime function in the C programming language provides a way to format time and date. It’s used in various systems and software, and many programming languages provide similar functionality based on the C’s strftime.

Here’s a list of common strftime codes:

  • %a : Abbreviated weekday name (e.g., Wed).
  • %A : Full weekday name (e.g., Wednesday).
  • %b : Abbreviated month name (e.g., Jan).
  • %B : Full month name (e.g., January).
  • %c : Locale’s appropriate date and time representation.
  • %C : Century (year divided by 100, range 00 to 99).
  • %d : Day of the month as a zero-padded decimal number (e.g., 01 to 31).
  • %D : Equivalent to %m/%d/%y (e.g., 04/08/21).
  • %e : Day of the month as a space-padded number (e.g., 1 to 31).
  • %F : Equivalent to %Y-%m-%d (e.g., 2021-04-08).
  • %H : Hour (24-hour clock) as a zero-padded decimal number (e.g., 00 to 23).
  • %I : Hour (12-hour clock) as a zero-padded decimal number (e.g., 01 to 12).
  • %j : Day of the year as a zero-padded decimal number (e.g., 001 to 366).
  • %m : Month as a zero-padded decimal number (e.g., 01 to 12).
  • %M : Minute as a zero-padded decimal number (e.g., 00 to 59).
  • %p : Locale‚Äôs equivalent of either AM or PM.
  • %r : Time in AM or PM notation (e.g., 08:08:08 PM).
  • %R : Equivalent to %H:%M.
  • %S : Second as a zero-padded decimal number (e.g., 00 to 59).
  • %T : Equivalent to %H:%M:%S.
  • %u : Weekday as a number, where Monday is 1 and Sunday is 7.
  • %U : Week number of the year (Sunday as the first day of the week) as a zero-padded decimal number.
  • %V : ISO 8601 week number of the year with Monday as the first day of the week.
  • %w : Weekday as a decimal number, where Sunday is 0 and Saturday is 6.
  • %W : Week number of the year (Monday as the first day of the week).
  • %x : Locale’s appropriate date representation.
  • %X : Locale’s appropriate time representation.
  • %y : Last two digits of the year (e.g., 21 for 2021).
  • %Y : Full year (e.g., 2021).
  • %z : UTC offset in the form +HHMM or -HHMM.
  • %% : A literal % character.

You can combine these codes in various ways to create custom date and time formats. For example, %A, %B %d, %Y would produce “Wednesday, April 08, 2021”.

Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Performance benchmarking with hashcat and sysbench

You can compare performance between linux systems using hashcat.

Install using sudo apt-get install hashcat

Run with hashcat -b

A series of cryptographic hashing algorithms are run and the resulting hashes/second reported.

Example output from LG Gram 17 laptop:

hashcat benchmark LG Gram 17

Example output from Raspberry Pi 4 Model B (8GB)

hashcat benchmark Raspberry Pi 4 Model B (8GB)

Before using sysbench, first you need to determine the number of CPU cores in your system.

Two ways to do this, either grep -c ^processor /proc/cpu or lscpu

Determine the number of CPU Cores

Then sysbench cpu –threads=4 run replacing 4 with the number of cores in your system, e.g. on Raspberry Pi 4 Model B…

sysbench cpu benchmark tool

On a LG Gram 17 laptop,

LG Gram 17 16 Cores
LG Gram 17
Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Working with QR Codes

Consider this a crash course in working with QR codes on Linux.

A QR code is an image that represents a URL. It can be quickly and conveniently scanned by the camera on a mobile device to open the link, rather than having to type it in manually.

The following packages will need to be installed.

sudo apt-get install qrencode zbarimg feh 

Creating a QR Code

qrencode -o "./cyberfella.png" "https://www.cyberfella.co.uk" 

Viewing a QR Code

feh ./cyberfella.png

Reading a QR Code

zbarimg ./cyberfella.png

Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Installing Tailscale VPN client on Linux

Tailscale is a very slick, free VPN solution that places all your devices inside your home LAN, even when you’re out and about.

Each device is assigned an IPv4 address so you can communicate with all the devices and services in your home network from anywhere.

The client for Android is available in the Play Store.

The commands below get you up and running on your Linux Mint 20.3 and/or Ubuntu 20.4.5.

curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/focal.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyr
ing.gpg >/dev/null
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/focal.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailsca
le.list
sudo apt-get update
sudo apt-get install tailscale
sudo tailscale up
tailscale ip -4

Tailscale is free to use for personal use and is available in the Umbrel App Store, if you’re running your own Umbrel Bitcoin and Lightning Validator Node and want to connect your wallet to it from anywhere.

Once installed, log in here to see all your tailscale connected devices.

The Umbrel app store also contains Samourai Dojo Server so you can connect your Bitcoin Samourai wallet to your own Dojo Server and perform transactions privately using Bitcoin’s CoinJoin privacy feature.

Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Fix Ledger Nano X USB connection issues on Linux

Ledger Nano X Review (2022) - Is the Ledger Nano X Safe?

ADD THE NECESSARY UDEV RULES

wget -q -O - https://raw.githubusercontent.com/LedgerHQ/udev-rules/master/add_udev_rules.sh | sudo bash

https://support.ledger.com/hc/en-us/articles/115005165269-Fix-USB-connection-issues-with-Ledger-Live?support=true

Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Fan Speed Control on Dell XPS 15 running Linux

Add dell-smm-hwmon sensors to kernel modules

sudo su
echo "options dell-smm-hwmon restricted=0 force=1" > /etc/modprobe.d/dell-smm-hwmon.conf
echo "dell-smm-hwmon" > /etc/modules
exit
sudo update-initramfs -u

Reboot, and the fans should be visible with:

sensors
dell_smm-virtual-0
Adapter: Virtual device
fan1: 0 RPM
fan2: 0 RPM

Control System i8kutils

Install i8kutils to take control of the fans.

sudo apt install i8kutils
sudo su
echo "i8k" > /etc/modules
echo "options i8k force=1" > /etc/modprobe.d/i8k.conf
exit

Reboot

sudo modprobe i8k force=1


Configure i8kutils

sudo vi /etc/i8kmon.conf

I left the config file at the defaults and the fans stayed under control as did the temps. check the temps and fan speeds at any time with the sensors command

sensors
45 – 50 degrees C and 2500 RPM fan speeds whilst running Brave and Virtual Box
Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Enabling Snaps in Linux Mint 20+

Linux MInt has taken the decision to disable the ability to install snapd and subsequently containerised apps (or snaps) from the Ubuntu Snap Store.

Linux Mint users are met with an error when attempting to install snapd or snap store applications

You can disable the block on installing snapd as follows.

sudo rm /etc/apt/preferences.d/nosnap.pref
sudo apt update
sudo apt install snapd

This will allow you to install those specific containerised versions of apps that you want, e.g. Whatsdesk (a containerised Whatsapp client for your Linux desktop).

sudo snap install whatsdesk
Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Expand the existing Swapfile on Linux

Note that this only applies if you’re using a swapfile as opposed to a swap partition. This will apply if you’re using full disk encryption since the swap file is then also encrypted. Most modern linux distro’s will behave in this way by default.

Ignore the first dd command since it contains a typo (shown)

If you’re using KDE Plasma as your desktop environment, for entertainment purposes, open Memory.

The Memory Information dialog opens to look like this.

Now expand the window by dragging a corner and you’ll see some neat graphs of memory usage…

Memory and Swap Usage graphs in KDE Plasma Desktop Environments “Memory” app

Now with your Konsole to one side of the graphs, observe the changes going on on the system as you execute each command. Really quite cool. KDE Plasma is great. By far my favourite desktop environment. I recommend it but live in it for a week and figure it all out since it’s quite comprehensive. You’ll likely not go back!

Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Basic Linux Commands

Here are some Linux commands that everyone should be familiar with. In fact, you could argue that these are the first commands to memorise and build out your repertoire from there.

#BASIC LINUX COMMANDS

#Clear the terminal window
  clear
#Show kernel version
  uname -a
#Show all tunable kernel parameters in the /proc/sys directory
  sudo /sbin/sysctl -a
#Set a kernel parameter on the fly without persistence
  sudo /sbin/sysctl -w kernel.sysrq="1"
#Set a kernel parameter with persistence
  /etc/sysctl.conf
#Kernel parameters startup script
  /etc/rc.d/rc.sysinit
#Show network interfaces
  ifconfig
  ip addr show
#Configure network interface with persistence
  /etc/sysconfig/network
  /etc/sysconfig/network-scripts/ifcfg-eth0
#Show all filesystems and space
  df -ah
#Show service status
  service udev status
  systemctl status udev
#How much disk space is used by a given directory
  du ~/Downloads
#What TCP and UDP ports is the listem listening on?
  netstat -tulpn
  sudo netstat -tulpn #gives more info on process name
#Show information about a given process
  ps aux | grep containerd
#Show free memory stats
  free
#List block storage devices known to the system
  lsblk
#Show mounted storage devices
  mount
#Show filesystems that should be mounted at boot
  cat /etc/fstab
#Mount everything in /etc/fstab
  mount -a
#Mount a block storage device
  mount /dev/sdb1 /mnt
#LVM Commands
  pvdisplay pvcreate  pvremove  pvchange
  vgdisplay vgcreate  vgextend  vgremove  vgchange
  lvdisplay lvcreate  lvextend  lvremove  lvchange
  mkfs.ext4
#Copy files
  cp
  rsync
  dd
#Show command history
  history
#Look up a command
  man -k <search-string>
  man grep
Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Savage leaky programs

It’s come to my attention recently that despite a fresh install of Linux Mint, certain programs seem to leak like a basket and hang around after they’re closed too.

I’d noticed my machine freezing intermittently and adding the memory monitor panel item revealed that the system memory was filling up.

The blue mem bar fills up over time when Brave is left open. Disappointing for such an otherwise excellent Web Browser.

xreader and brave seemed to be the main culprits but since rebuilding my desktop machine, I’ve not been using many other programs apart from ledger live to track the value of my crypto currency portfolio while the fed prints money ad infinitum during the coronavirus pandemic. I digress.

Killing processes gets old really quick, so I wrote a quick’n’dirty little shell script to do it for me. Rather than killing individual processes, it savages all processes by the same name.

I shall call it savage.sh and share it with the world, right here. Not on github.

Killing all running processes for ledger and brave using savage.sh
#!/bin/bash
# savage.sh finds all process ID's for the specified program running under your own user account and kills them
# in order to free up system resources.  Some programs have severe memory leaks and consume vast amount of RAM and 
# swap if left running over time.
#
# Usage: savage.sh 
#
# Written by M. D. Bradley during Coronavirus pandemic, March 2020

#Variables
user=`whoami`
memfree=`free | grep Mem | awk {'print $4'}`
#Code
echo "Program to kill e.g. xreader?: "
read program
pidcount=`ps -fu $user | grep $program | awk {'print$program'} | wc -l`
ps -fu $user | grep $program | awk {'print$2'} | while read eachpid; do 
	kill $eachpid >/dev/null 2>&1
done
memfree2=`free | grep Mem | awk {'print $4'}`
freedmem=$(( memfree2 - memfree ))
if [ $pidcount -eq 1 ] 
then
	echo "Found $pidcount process running for $program"
	echo "Killed it.  Freed up $freedmem bytes."
fi
if [ $pidcount -gt 1 ] 
then
	echo "Found $pidcount processes running for $program"
	echo "Savaged them. Freed up $freedmem bytes."
fi
Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:
Social Media Auto Publish Powered By : XYZScripts.com