The Kernal Guy With A Computer

5 Amazing Zsh Plugins To Make Your Life Easier

Zsh is a fast, easy to use, and extensible shell for Linux and BSD based operating systems. And while yes, being fast and easy to use are very important qualities in a shell, most people switch to Zsh because of how darn customizable it is. There are hundreds of useful plugins and beautiful themes that you can install without breaking a sweat. So, if you use Zsh, and would like to improve your workflow with a couple super-useful plugins, I have compiled 5 of my personal favorites that will work on any operating system.

zsh-interactive-cd

After getting really used to similar functionality in Eshell, I found this plugin extremely useful. When using cd, if you enter something that isn’t a complete directory, and you hit TAB, a menu will pop up, listing all of the current directories that you can cd into. Then, you can make use of the arrow keys to select a directory and enter it. This is especially useful for when you are working with a large amount of directories and can’t be expected to remember them all or use the traditional TAB autocomplete. It is really just a small quality of life change that makes the command line a little more tolerable, for when you can’t be expected to use a file manager.

ZSHCDPLUGIN

vi-mode

Bash’s built in vi mode is extremely useful for people who spend the majority of their time using Vim and Vim like applications. So it only makes sense that people would like to bring that same functionality to ZSH. I have to say, after messing around with vi-mode on ZSH, and doing some basic commands, I found the experience near;y identical to Bash’s vi mode. You have the basic ‘input’ ‘visual’ and ‘normal’ modes, along with Vi keybindings for moving around and editing. There really is no better feeling than moving around with hjkl, switching modes, and using all of the fancy Vi commands without even having to launch Vim.

thefuck

The name aside, this is an extremely useful plugin that saves a lot of time. Just by double-clicking esc, ‘thefuck’ will attempt to find the error in your command, and correct it for automatically. For example,

if I were to type,

sudo aot update

then ‘thefuck’ will find the spelling mistake and fix it for me.

sudo apt update

Think of it like spellcheck, but instead of correcting a simple wird word, it can correct your whole command.

extract

Extracting files from the terminal is extremely complicated, especially when compared to extracting files in a file manager. You have to remember what command to use for every binary, zip file, tar file, and all 10,000 other types of archives. But thankfully, there is a silver bullet for every type of archive. ‘extract’ will extract almost any file you can think of. It’s as simple as running

extract file.type

You don’t even need to specify what file type the file is, just run ‘extract’ and it will do the rest.

aliases

Aliasing common commands is something that saves a lot of time. But, personally, I have a hard time remembering all of the aliases that I’ve set. And it’s really frustrating when you know that you have an alias for something, but can’t remember what it is. But with this plugin, all you have to do is type acs, and all of your aliases will be laid out in front of you. You can even search using acs 'KEYWORD', and it will show you a list of all your aliases associated with that keyword. You should really consider installing this one if you are as forgetful as me.

ZSHALIASPLUGIN

Conclusion

These 5 plugins provide a faster, more efficient way to use your shell while being OS agnostic and super easy to use. They allow you to extend your shell in a useful way, without bloating your shell to the point that it gets a stomach ache. Install all of the plugins, try them out, and if you aren’t a fan, you’re only a # away from getting rid of them.

Table of Contents

  1. zsh-interactive-cd
  2. vi-mode
  3. thefuck
  4. extract
  5. aliases
  6. Conclusion

Kakoune, A Better Vim

Vim has been the darling child of the Linux community since its conception. Vim is, apart from Vi, probably the most used text editor on Linux. And that’s for good reason. Vim is super fast, extremely efficient, and has very sensible, albeit, hard to adjust to keybindings. But even though Vim is without flaws, it isn’t without some room for improvement. In fact, there is another text editor, that takes the core fundamentals of Vim, and builds on them to make an even better, even more programmer friendly editor. And it is very possible that you’ve never heard of it before. Kakoune is a super fast, easy to adapt to, and very efficient text editor that allows you to do everything that you would need to do in Vim, faster and with less keystrokes. I installed and played around with this editor, and I am going to give the overall rundown of how to use it, some of it’s features, and some things that make it so unique.

Clippy

Clippy is the creation of Microsoft, and it seems like blasphemy to use it in a FOSS text editor. But, unlike Microsoft’s Clippy, the Clippy in Kakoune is actually helpful, and doesn’t get in your way. When you go to run a command in Kakoune, much like you would in Vim, Clippy shows up as a little bit of ACII art in the bottom right corner, and explains what that command will do. This is super helpful if you are a new user switching over from Vim, and need to know that everything means. Clippy even helps with your keybindings. For example, if you press ‘G’, Clippy will show you all of the keybindings associated with ‘G’, and will explain to you what they will do.

Modes

Kakoune is a lot like Vim, so it makes a lot of sense that Kakoune would share the traditional Vi input, normal, and command mode’s. However one thing you may notice right away is the lack of visual mode. Kakoune is designed in such a way that you’ll be selecting text constantly, so there is no need for a visual mode. You can simply select a word, paragraph, line, or sentence, and either use ‘y’ to yank it, or you ‘d’ to delete your selection.

Keybindings

Although Kakoune is very similar, it is not Vim. Many of the keybindings aren’t the same. So although most people will have a very easy time switching over, one will have to re-learn a few things. For example, many of the traditional Vim keybindings are flip-flopped. This may confuse new users switching over from Vim at first, but eventually, it starts to make sense. In Kakoune, you can only do a command on something once you have selected it. You use “wd” instead of “dw”, because you need to select the word before you delete it. And while there are some more minor differences, as long as you have a knowledge of Vim, and grasp that concept, you should be fine.

Look & Feel

Any editor that has Clippy is bound to be stylish. And Kakoune delivers on all of the eye candy that you’ll ever need. It comes pre-installed with a wide variety of popular themes (Nord, Gruvbox, etc.), and doesn’t even require you to edit a config file to switch between them. And the autocomplete feature has a reasonable, easy to use, and easy to understand popup allowing you to autocomplete a word. The only part of this text editor that isn’t absolutely gorgeous is the status bar, but I would by no means say that it looks bad.

Extensiblity

In many cases, niche text editors are extensible, but don’t actually have any plugins. And I am happy to say that for Kakoune, this isn’t the case. There are tons of plugins available, including some of your favorites from Vim. Kakoune has their own version of NerdTree, Powerline, Plug, Todo, and every colorscheme under the sun. They even have their own website, where you can easilly download over 250 plugins.

Conclusion

Kakoune is an editor, that until a day ago, I had never heard of before. But now that I have gotten a chance to use it, I am in love. I am not going to switch over, however I plan to use it on some Ubuntu servers where I can’t install Emacs. It is lightweight, easy to use, and just so, soooooo smooth. If you are currently using Vim, and have an open mind, I would 100% recommend just giving Kakoune a try. You won’t regret it.

Ditch Your Window Manager. Here Is How You Can Live In The Tty

A Linux users window manager, much like their text editor or browser, is a piece of software that they’ll defend till their grave. There are hundreds of them, and each one comes with a different language, philosophy, and many unique features. And so many people are so busy arguing, many of them haven’t considered, maybe it’s better not to use any window manager at all? Depending on what you do with your computer, and your proficiency with the command line, it may be best for you to completely switch to using the TTY full time. In fact, I myself have been using the TTY exclusively, and have been having a great experience. So, to help you wayward souls who may be curious about a life without Xorg, I am going to explain some of the customizations that I’ve made, and how I overcome some of the challenges of living the terminal.

Making Everything Look Good

TTY

I personally opted to use Nord, as it is the colorscheme that I am most familiar with. And as it turns out, theming the TTY itself is not hard at all. Just download the file, and put ‘source FILENAME’ in your .bashrc.

And if you are going to use Tmux like me, I would recommend theming it too, as it makes your ‘desktop’ look much more cohesive. It is a little more difficult to theme than the TTY, as you have to work with some plugins, but it is doable. If you want to use the Nord theme for Tmux, you can install it yourself right {here}(github.com/arcticicestudio/nord-tmux).

Making Tmux Usable

While Tmux is great, you have to do some configuring if you would like for it to look good and have some sensible keybindings. And since I personally didn’t want to go through the work of configuring it myself, I took someone else’s configuration. I know, it’s cheap, but this configuration is really super easy to use and comfy. Especially as someone who uses Vim on the regular. It has Vim keybindings, an amazing status bar, improved pane maximizing, and much more. If you are interested, you can install it here.

Multimedia

Watching Video

The thing that I was the most concerned about, turned out to be extremely easy. For a while, I tried to get VLC to run in X without a window manager. But as it turns out, MPV has amazing support for Framebuffer. You just have to run MPV with these options to get it to run without X.

mpv –vo=drm FILE.FORMAT

Viewing Images

This is another one that I was worried would not work. However, after doing some research, I stumbled on two image viewers that use Framebuffer, ‘fim’ and ‘fbi’. These are both very similar, so whichever you would like to use is up to you, however I have had a better time with ‘fim’. They support all major file types, including JPEG and PNG. They are also both very straightforward, and both work without any flags or configuration necessary.

Playing Music

Music is extremely easy to get running on a TTY, as there is no Framebuffer needed. I would recommend MPD+MPC, as it is one of the oldest, most reliable music players out there. I even wrote a blog about how to use it, and you can check it out right here.

Using Xorg Apps

While most things can be done in the TTY, there are some exceptions. Graphic and Video editing is almost impossible. And while you can use a terminal based browser for a lot, interacting with the modern web is all but impossible without a graphical browser. But, as it turns out, you can still absolutely use some graphical apps without issue. Personally, the only GUI app that I use is Firefox, so I just have an alias for it in my ~/.bashrc. Here is the command that I use to launch it, and feel free to replace “firefox-esr” with anything you want.

xinit /usr/bin/firefox-esr $* – :0 vt$XDG_VTNR”

Conclusion

A life in a TTY is not for most people. It requires you to have a intimacy with the command line, do plenty of troubleshooting, and forces you to switch over to many TUI alternatives to all of your apps. However, if you’re willing to put in the effort, and make some sacrifices, working entirely in the TTY may not just be possible, but could also be a very enjoying experience. And as an added benefit, if an amateur tries to break into your computer, they will have no idea what to do.

How To Auto Update Ubuntu Servers (with Email Notifications)

If you are a tech savvy Linux user, chances are you are self hosting a couple services on either your main machine, a Raspberry Pi, an older Laptop/PC, or even a VPS. I myself have a server seeding various Torrents, running a TOR relay, OpenVPN, and even Nextcloud. However, it can be a little annoying having to SSH into your server every day just to run a simple ‘apt update && apt upgrade’. Sometimes, you just want to set it and forget it. But luckily, if you’re like me and use Ubuntu for your servers, you can quite easily have automatic updates applied every day. So, I am going to show you how you can install and get automatic updates, with the ability to send notifications directly to your Email.

Installing ‘unattended-upgrades’

Whether you are using Ubuntu server or Desktop, this should already be installed. But just in case, you can run this command to install it.

sudo apt install unattended-upgrades 

Enabling Auto Updates Every Day

You can manually edit the “/etc/apt/apt.conf.d/20auto-upgrades” file, and if you don’t want to update every day, it’s your only option. However, I personally would recommend this method, as it is much less complex. Simply copy this command into the terminal.

sudo dpkg-reconfigure -plow unattended-upgrades

It will show a screen that looks like this.

TUI

Just select yes, and it will immediately edit the file for you, setting all of the values to “1”, causing your system to update every day.

However, if you would like to, you can create/edit the file yourself, replacing the “1’s” with however many days you would like to go between updating. Here is an example, if you don’t already have the file.

FILE

Setting Up Email Notifications

As the updates are automatic, there is always some risk, as there would be if you were installing the updates manually. But if something goes wrong, you would like to be notified, right? Thankfully, you can send yourself an Email using Mailx without too much hassle. To start off, install Mailx. On Ubuntu, you can install the BSD version with this command.

sudo apt install bsd-mailx

Now, open “/etc/apt/apd.conf.d/50unattended-upgrades” and get ready to edit. You should see a line that looks like this.

//Unattended-Upgrade::Mail "";

Uncomment it, and put your Email address in those quotes. The line should look like this, but obviously with the Email address switched out for an actual Email.

EMAIL

You did it!!

Now, every day, or however long you set between updates, your server will update all on its own, and send you a handy Email to go along with it. This is super helpful if you have a large amount of severs, or like me, are just lazy. If anything, it beats coming back from a long trip and having your server break after it amassed hundreds of outdated packages, which wold obviously never happen.

Nova Linux, Cuba's State Sponsored Distro

Many governments have tried to abandon Windows. It is not only expensive, but due to its closed source nature can compromise national security. So far, there have been some successes. Pardus Linux has especially formed into a complete, easy to use, Windows replacement for Turkey; and Ubuntu Kylin is one of the most popular OS’s in China . Yet, there is one state sponsored Linux distro that has managed to slip under everyone’s nose. Nova Linux is a Cuban, Ubuntu based distro that has had its fair share of troubles through the years, but ultimately, seems to be doing pretty good. So, I, an American that doesn’t speak a lick of Spanish, gave it a whirl, and will explain some of the little quirks and benefits of this pretty cool, unique distro.

Instillation

First off, being honest, I used the Ligero version of Nova, so I don’t know if the experience is different on Escritorio. However, I found the installer quite abysmal for a new user. It is a TUI based installer that can be compared to Void Linux or Slackware. It’s not too hard, but can and will easily scare away new users. The installer even continued to use Spanish despite English being selected as the Keyboard layout and system language. But on the plus side, it was pretty quick, only taking around 20 minutes for the whole process.

Resource Usage

Nova, including the Ligero desktop, was extremely lightweight. My VM had 2 CPU cores available, and a little less than 4GB of RAM. In terms of RAM, Nova hovered around 250-260MB on idle with Xorg running, and around 190-200 when booted into the TUI. The CPU usage is also impressive, with both CPU cores sporadically jumping to 0.5-0.7% usage, never surpassing 1% until an app is opened. It isn’t bad at all.

Desktop

Again, I only used the Ligero version, so I can’t speak on what Escritorio looks or acts like, but I have done a little digging in the desktop on Ligero. While Distrowatch claims that the Ligero version uses Nova’s own custom baked desktop called “Guano”, it appears to be nothing more than a themed LXDE. Apart from using the custom Nova GTK theme (which is pretty great by the way), there is nothing of note. It looks good, acts like what you would expect, and tries to be beginner friendly. You can even see a picture below.

ThemedLXDE

History

Nova began in Cuba’s capitol, Havana, where it started as a Gentoo based distro. Then, in its second ever release, it transitioned to an Ubuntu base. However, it has been shut down and discontinued before. Many people considered Nova discontinued, because throughout 2016-2018 there was no news on a new version, and it wasn’t until 2018 that version 6 came out. And perhaps more frightening, in 2018, Nova’s repositories were shut down completely, and didn’t come back for several months. So if you would like to use Nova as a long-term workstation or server, be sure to take this into consideration.

Conclusion

Nova, while being a state sponsored Linux distro, seems to have a lot of potential. Although I wouldn’t recommend it to most people, if you are a Spanish speaker, and would like a relatively lightweight distro, Nova is not a bad option. And while it is not the best Linux distro in my opinion, it is still nice to see more adoption of Linux, even if it’s in Cuba.