Transfering Files Using netcat
You can use netcat to transfer a file from one machine to another machine.
On the receiving machine enter the following command:
$ netcat -l 12345 > file.txt or
$ netcat -l -p 12345 > file.pdf
Then, on the sending machine use this command:
$ netcat $MY_IP_ADDRESS 12345 < file.txt
Install Openbox on Slackware
I have been running blackbox on my Slackware desktop and decided that I’d try a different ‘flavor’ called openbox which are in the SBo repositories. I started by executing sbopkg at the root prompt and found these packages available:
There is the primary openbox package and there are 4 optional packages listed:
- openbox
- libfm-extra
- lxmenu-data
- menu-cache
- openbox-menu
And several theme packages:
- arc-openbox
- openbox-simple-theme
The openbox-menu and openbox-simple-theme downloads failed but I was able to get away with using obconf and obmenu tools.
How to Use DNF History
If you are using a Red Hat/Fedora-based distro, here are some tips on how to use the dnf tool to query your install history:
Retrieve a list of manually installed packages:
$ dnf history userinstalled
Retrieve a list of all transactions:
$ dnf history list all
List the changes in a particular transaction:
$ history list <num>
Undo/rollback a transaction:
$ dnf history undo <num>
Windows Terminal Keyboard Shortcuts
I have to use Windows where I work but I use the terminal as often as possible. Microsoft’s Windows Terminal application makes that experience tolerable. You can even think that you’re using tmux at times…well, not really, but you get the idea.
Here are some of the keyboard shortcuts that I use:
Split current terminal window
Alt Shift - split pane horizontal
Alt Shift - split pane vertical
Jump to other console
Install Kooha on Ubuntu 21.04
Kooha is a GTK-based screen recorder for Linux for recording screens and audio from your desktop or microphone. It is very simple to use
Install flathub from the Ubuntu software repository:
$ sudo apt install flatpak from the repository:
Install Koohu from the command line:
$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
$ flatpak install flathub io.github.seadve.Kooha
You should now see an icon for Kooha in you GNOME applications window.
Update Slackware Broadcom Driver
It doesn’t happen often, but whenever there’s a new kernel package for Slackware on my laptop I need to update the Broadcom driver. To do this:
- Update your OS, as usual.
- Reboot
- Plug in the ethernet cable, if necessary
- Login as root
- Perform sbopkg -i broadcom-sta
- Done
You can read more about it on the Slackware wiki here
Installing Foliate Ebook Reader on Slackware 15
I don’t know about you, but I love reading ebooks and I’ve used Foliate before on other distributions but can’t find it for my OS of choice, Slackware. So, here’s how to install it from source:
- Download the foliate software tarball from here
- Install appstream-glib (which provides dependency appstream-util) using sboinstall
- Install webkit2gtk (which provides dependency WebKit2) using sboinstall
- Build foliate. Instructions are on the GitHub page or just extract the tarball, cd into the directory and then execute the following on the command line:
$ tar zxvf foliate-2.6.4.tar.gz $ cd foliate-2.6.4 $ meson build –prefix=/usr $ ninja -c build $ ninja -C build $ su -c “ninja -C build install”
Archive Only Files In a Directory
If you want to create a tar archive of only the files of a directory and exclude any subdirectories you can use the ls -la command and pipe the output to awk. However you need to remove the first 8 fields from the output and leave all of the remaining parts of the line in case there are spaces in the filename. One quick and dirty way of doing that is to set each of the 8 fields to a blank and then use sed to trim the leading spaces. You can optionally add quotation marks around the filename in your output too.
Edit a Remote File Using Vim
To edit a file remotely using the vim editor, just do the following in a terminal window:
$ scp://username@IP-address//path/to/file.txt
The user must have access to the file being edited.
Echo File Until a Blank Line Is Reached
You can use the awk program to search and print lines in a file. If you wanted to print a file until the first blank line is reached you can use the following command to do that:
awk '$0 ~ /^$/ {exit;} {print $0;}' somefile.txt