This post provides an excellent resource for those wanting to theme their Plasma desktop environments.
Whilst looking for a potential daily-driver distro replacement for ElementaryOS, I found this KDE based distro, “KDE Neon“.
I’m quite hopeful that it could be the answer to my future desktop aspirations and will be giving it a whirl in the coming days. More on KDE Neon here.
Did you like this? Tip cyberfella with Cryptocurrency
Cascadia Code is an open-source monospaced font made by Microsoft first released in 2020 and serves as the default typeface for the official Windows Terminal app.
Similar to Intel’s One Mono, JetBrains’ Mono and IBM’s Plex, Cascadia Code is an clear, legible, modern monospaced font tailored for terminal and code editing and offering a wide range of programming ligatures.
Earlier this month the font received its first update in nearly 3 years and, as per release announcement, it’s a sizeable uplift.
Check out other popular Nerd Fonts here and if you’re a Linux user, maybe try replacing bash with zsh and customise it with oh-my-zsh, p10k and a Nerd font of your choice (MesloLGS NF recommended).
The Linux shell can be replaced with zsh to open up a world of extra plugins, features and themes. And it’s a pretty nice UX/UI upgrade from bash tbh.
My zsh shown below, has been complimented with oh-my-zsh and the p10k theme with customised prompt elements.
The left-side prompt elements are: battery (86%), os_icon (ElementaryOS), dir, disk_usage (8%).
The right-side prompt elements are: status (exit status 0), load (load average 1.11), time (11:02:59).
There are other prompt elements available and they are listed at the end of this post. Have fun!
Your mileage may vary between different terminals, e.g. blackbox, gnome-terminal etc. Try opening alternative terminal emulators once zsh is set up to see the differences if any, and just stick with the one that works best for you.
Installation
sudo apt-get update && sudo apt-get install zsh git
chsh -s $(which zsh)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts
curl -fLo "MesloLGS NF Regular.ttf" https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
curl -fLo "MesloLGS NF Bold.ttf" https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
curl -fLo "MesloLGS NF Italic.ttf" https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
curl -fLo "MesloLGS NF Bold Italic.ttf" https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf
fc-cache -fv
In your terminal of choice, replace the default font with "MesloLGS NF"
You could also try Cascadia Code Nerd Font or some of the others listed here
Install oh-my-zsh
Install oh-my-zsh to enable a framework that allows easy customisation of zsh.
sudo apt install curl wget
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Use the omz command to administer oh-my-zsh
After modification to the ~/.zshrc file, reload the config with,
source ~/.zshrc
When you first run the shell with the p10k theme installed, there is no config file set up, so a convenient wizard will automatically ask you some questions. More on the wizard here, but it’s fairly self-explanatory.
p10k has a number of customisable prompt elements. You will be prompted by a wizard upon first execution of the theme and it will run through various options/choices to create the .p10k.zsh config file sourced by your .zshrc file.
vi ~/.p10k.zsh and edit the left and right prompt elements contained in the following two sections.
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
os_icon
dir
vcs
...
)
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
status
command_execution_time
background_jobs
...
)
After any changes,
source ~/.p10k.zsh
Add syntax-highlighting, auto-suggestion and auto-correction
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Auto-correctionexemptions
If you make a mistake, zsh will offer a correction. If you have certain commands or words that are repeatedly prompted with autocorrection options, you can add them to the exemption list in ~/.oh-my-zsh/lib/correction so those words will be ignored.
Find and edit the load plugins line in ~/.zshrc
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
source ~/.zshrc
If you're happy everything works, change your default shell in /etc/passwd for your user to /usr/bin/zsh permanently. This will not affect the root user when you sudo su - to elevate your privs to change to the root user for your system.
Prompt Elements
os_icon: Operating system icon.
dir: Current directory.
vcs: Version control system (e.g., Git status).
prompt_char: Prompt character.
status: Exit status of the last command.
command_execution_time: Duration of the last command.
background_jobs: Indicator for background jobs.
history: Command history number.
time: Current time.
date: Current date.
battery: Battery status.
user: Current user.
hostname: Hostname of the machine.
ip: IP address.
load: System load.
disk_usage: Disk usage.
ram: RAM usage.
swap: Swap usage.
cpu: CPU usage.
kubecontext: Kubernetes context.
node_version: Node.js version.
python_version: Python version.
ruby_version: Ruby version.
go_version: Go version.
php_version: PHP version.
java_version: Java version.
aws: AWS profile.
azure: Azure account.
gcloud: Google Cloud account.
terraform: Terraform workspace.
nix_shell: Nix shell.
context: Context (e.g., user@hostname).
Did you like this? Tip cyberfella with Cryptocurrency
Running Kali as a daily driver is doable since it’s Debian Linux, but is it suitable or really necessary. No. Not really. You should have a dedicated laptop for running it and only run it to use the tools when ethical or approved to do so.
But there are some features in the Kali UX that you might want to see in your daily driver distro.
One of these features for me is the zsh prompt. I really like the Kali prompt but I use bash.
To make your Linux bash prompt look like the zsh one in Kali Linux, you need to customize the Bash prompt by modifying the .bashrc file in your home directory. The Kali Linux terminal prompt is typically configured to display the username, hostname, and current working directory with specific colors and formats. Here’s how you can achieve a similar look:
Open the Terminal: Open your terminal on your Linux distribution.
Edit the .bashrc File: Use a text editor to open the .bashrc file in your home directory. You can use nano, vim, or any other text editor you prefer. Here, we will use nano:
nano ~/.bashrc
Modify the PS1 Variable: Find the line that defines the PS1 variable. It might look something like this:
PS1=’${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ‘ Comment it out (never delete anything!) with a hash and replace it with the following configuration to mimic the Kali Linux prompt:
Note: You can limit the number of components in the working directory path by setting the PROMPT_DIRTRIM environment variable in your ~/.bashrc file. This is worth doing if you work with exceptionally deep directory paths.
Here’s what each part of this configuration does:
[\033[01;32m]: Sets the color to green. \u: Displays the username. @: Adds the “@” character. \h: Displays the hostname. [\033[00m]: Resets the color. :: Adds a colon character. [\033[01;34m]: Sets the color to blue. \w: Displays the current working directory. [\033[00m]: Resets the color. \$ : Adds the dollar sign for normal users or a hash for the root user, followed by a space. Save the Changes: Save the changes in nano by pressing Ctrl+O, then Enter, and exit by pressing Ctrl+X.
Apply the Changes: To apply the changes you made to the .bashrc file, either close and reopen the terminal or source the .bashrc file:
source ~/.bashrc After completing these steps, your terminal prompt should look similar to the one in Kali Linux, displaying the username, hostname, and current working directory with the specified colors.
This cool little website allows you to generate custom PS1 prompts for bash that contain just the elements you want. Alternatively, just install zsh and enjoy the additional features that come with it.
Did you like this? Tip cyberfella with Cryptocurrency
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.
One of my first ever posts was about conky and wbar on crunchbang linux.
Crunchbang has since been replaced with a community led fork, Bunsenlabs, and it’s well worth checking out. I’m so impressed with it that it’s my laptop OS of choice, giving me very little grief installing onto my disappointingly-not-particularly-linux-friendly Dell XPS 15, unlike other popular distros. Suffice to say, Bunsenlabs has saved my XPS15 from the financial damage limitation exercise known as ebay.
In any case, I thought I’d include a link to my own .conkyrc file. It’s simple and neat, nothing too fancy.
The download file is called conkyrc. Once downloaded, just rename it to .conkyrc i.e. put the dot in front (hidden file and the conky default), and copy it to your home directory, remembering to back up any existing .conkyrc file already in your home directory first.
If you want to edit yours to make it your own, the man page for conky is very good, but I find this better.
Did you like this? Tip cyberfella with Cryptocurrency
The terminal can get a little tiresome by the end of a full working week, so why not use cowsay to add a little fun to your stdout?
Just be sure to check its actually installed before you start calling it from your shell scripts. I found it was installed by default on Debian based distros but not on a Centos7 VM i spun up using vagrant, so you’re mileage may vary as they say.
Installation
sudo apt-get install cowsay
Basic usage
cowsay “hello”
View all the possible “cows”
ls -1 /usr/share/cowsay/cows | cut -d . -f1 | while read eachline; do cowsay -f $eachline “$eachline”; done
There’s loads of them and more to choose from online too. In the meantime, here’s a couple dragons to whet your appetite…
Did you like this? Tip cyberfella with Cryptocurrency
A major annoyance with the Sony Playstation 4 is that intermittently the PS4 won’t log in to PSN. And unless it successfully logs into the PlayStation Network, pretty much all your apps are useless. It’s really annoying that the PSN needlessly gets in the way of my ability to watch a programme on All4 or BBC iPlayer etc that have no dependency on the PSN whatsoever.
This is extremely frustrating when you know its connected to the internet and iPlayer or All4 service is operating normally, but you can’t do what you want to do, because you have a stupid (No)Play Station. GRRRR!!! It’s so Sony to do this too. Not a fan.
If it wasn’t for my Gran Turismo addiction, I’d bin it.
So. To improve matters, you need to set up your network connection again, only this time do it a little differently, specifying the DNS and MTU settings manually.
Primary DNS: 8.8.8.8
Secondary DNS: 8.8.4.4
MTU: 1473
Settings, Network, Set Up Internet Connection
Choose Wi-Fi or Cabled connection
Choose Custom
Automatic should be fine but I find it connects to the internet faster using a static IP Address. If you do specify an address make sure it an address outside the scope on the DHCP server to prevent a potential IP address conflict on the network. You may need to log onto the router and reduce the default DHCP scope accordingly, or set a reservation for the PS4. Make sure your subnet mask is 255.255.255.0 unless you know better and your gateway likely looks like 192.168.x.1 where x is either 0 or 1.
Manually set the DNS addresses to those of the Google DNS Servers
Leave DHCP settings alone unless you want to receive an IP address from a DHCP server on your LAN other than the one on your wifi & router supplied by your ISP.
Set the MTU manually. This pertains to the message transfer unit size on the network. The default is 1500, but 1473 works better.
That’s it for the networking config.
Make sure it’s set to connect to the Internet
Something else you can check is in Settings, Users, Login Settings for your User, make sure the check box “Automatically log in to PS4 automatically” is checked.
Reset PSN Account Password
The thing that ultimately made the difference for me, was in Settings, Account Settings, Re-enter your PSN Password. I don’t know what happens “behind the scenes” when you do this, but boom! it logged straight into the PlayStation Network no problem and my apps all work perfectly.
Did you like this? Tip cyberfella with Cryptocurrency
The danger with USB hard disk drives is that when you have more than one plugged into your workstation, the device name assigned to it by the operating system might not be consistent between reboots. i.e. /dev/sdb1 and /dev/sdb2 might swap places. Potential disaster if you rsync data from one to the other on a periodic basis.
If permanently mounting usb hard disks, it’s much safer to mount according to the UUID of the disk instead of the device name assigned by the OS.
If you change to root using sudo su – and cd into /dev/disk you’ll see that there are multiple links in there, organised into different folders. The unique unit id is written in /dev/disk/by-uuid and links the device name to the unique id.
You can see what device name is mounted where using df -h. Then use the output of ls -al of /dev/dsk/by-uuid to correlate uuid to filesystem mount. There’s probably other ways to match filesystem to uuid but this is quick and easy enough to do.
Note that I’ve also taken the liberty of piping the commands through grep to reduce output, just showing me what I want to know, i.e. the uuid’s mounted to devices named /sda1, /sda2, /sdb1 etc.
Once you’re confident you know what UUID is what disk, then you can permanently mount the disk or disks that are permanent fixtures by creating a mount point in the filesystem and adding a line to /etc/fstab
finally, mount -a will pick up the UUID and mount it into the mount point.
Did you like this? Tip cyberfella with Cryptocurrency