Compiling 32-bit C/C++ Programs on 64-bit
By default, gcc will compile your c/c++ program to 64-bit instructions. In order to compile to 32-bit you need to add a -m32 flag to the command line. For example, to compile a file called hello-world.c using a Linux terminal, you would do something like this:
$ gcc -m32 hello-world.c -o hello-world
If you get the following error:
fatal error: bits/predefs.h: No such file or directory
How to Clean Up the Fedora Root Folder
OK, so you’re running Fedora and you’re getting warnings that you’re running out of disk space on the root folder. What are your options?
The first thing to consider is resizing the root partition size. For that you can find instructions here
If that is not an option, then the next thing you probably should do is find out which folders/directories are causing the issue. You can use the du command and some piping to figure this out:
Install Spotify using Flatpak using Command Line
If Flatpak is not installed, then install it:
$ sudo dnf install -y flatpak # Fedora$ sudo apt install flatpak # Ubuntu-based$ sudo zypper install flatpak # SUSE$ sudo pacman -S flatpak # Arch-based
Since flathub.org is the most popular flatpak repository we will use the command line to enable it:
How to reveal dot files in finder?
Here’s one from my archives. To reveal dot files in macOS Finder, open your Terminal (/Applications/Utilities) application and then enter,
defaults write com.apple.finder AppleShowAllFiles YES
Then restart Finder by holding down Option and Control, or right-clicking on the Finder’s icon in your Dock and choosing “Relaunch”.
To revert this behavior, simply change the YES to NO in that defaults command.
Install Epson ET-3850 Printer Driver on Slackware 15.0
I recently bought an Epson ET-3850 printer from Costco to replace my HP OfficeJet which was about 10 years old and the family was starting to have issues with establishing a wi-fi connection to it on their Windoze laptops. It took quite a while to setup. The Epson seems to be doing the job. Time will tell, however I discovered that setting it up for Slackware would also take a bit of effort. Drivers are only available on the Epson website in RPM or DEB format so I had to create a Slackware package to install it. Here’s how I went about doing that.
Vim Keyboard Shortcuts
ggMove to the first line of the fileGMove to the last linegg=GReindent the whole filegvReselect the last visual selection<Jump to beginning of last visual selection>Jump to end of last visual selection^Move to first non-blank character of the lineg_Move the last non-blank character of the line (but you remove trailing whitespace, right)g_lDDelete all the trailing whitespace on the lineeaAppend to the end of the current wordgfJump to the file name under the cursorxpSwap character forwardXpSwap character backwardyypDuplicate the current lineyapPDuplicate the current paragraphdatDelete around an HTML tag, including the tagditDelete inside an HTML tag, excluding the tagwMove one word to the rightbMove one word to the leftddDelete the current linezcClose current foldzoOpen current foldzaToggle current foldziToggle folding entirely<<Outdent current line>>Indent current linez=Show spelling correctionszgAdd to spelling dictionaryzwRemove from spelling dictionary~Toggle case of current charactergUwUppercase until end of word (u for lower, ~ to toggle)gUiwUppercase entire word (u for lower, ~ to toggle)gUUUppercase entire linegu$Lowercase until the end of the lineda"Delete the next double-quoted string+Move to the first non-whitespace character of the next lineSDelete current line and go into insert modeIinsert at the beginning of the lineci"Change what’s inside the next double-quoted stringca{Change inside the curly braces (try [, (, etc.)vawVisually select worddapDelete the whole paragraphrReplace a character[Jump to beginning of last yanked text]Jump to end of last yanked textg;Jump to the last change you madeg,Jump back forward through the change list&Repeat last substitution on current lineg&Repeat last substitution on all linesZZSave the current file and quit Vim
Linkers
If you’re a developer who is interested in “how the sausage is made” then you might want to check out Ian Lance Taylor’s blog which contains a series of articles discussed on Klaatu’s GNU World Order Episode 400 about the linker
Here are the links to the articles:
Linkers part 1 Linkers part 2 Linkers part 3 Linkers part 4 Linkers part 5 Linkers part 6
Mounting a Remote Drive using FUSE
If you have FUSE (Filessystem in Userspace) installed, you can use SSH to mount a remote drive locally. This is very simple to do and you don’t need to be root. You just need SSH access to the remote system. Just create a directory to mount the system and use the sshfs command to connect the remote to it.
Here I will mount my home directory on my remote server named slacker locally to a directory on my laptop’s home directory:
Install Joplin on Slackware 15.0
On a recent episode of Hacker Public Radio, the host, Lee listed several note-taking apps that he had tried to use. One of them was Joplin which I have been using for several years now. I feel that it is probably one of the best note-taking apps available that:
- Supports Markdown
- Is cross-platform
- Supports vim keyboard mappings (I can’t live without this)
- Integrates with multiple cloud storage environments.
I use it on a daily basis for almost all of my notes but it also supports checklists on my iPhone, iPad, Windoze laptop, and all of my Slackware devices (desktop and laptops). Give it a try!
SlackBuilds: Where Are They Located?
You should find a file in /var/log/packages for each SlackBuild that you have installed. You can distinguish the SlackBuilds package from standard Slackware packages by the substring SBo embedded in the filename. So you can create a list of all of the SlackBuilds installed on your machine by just doing an ls *SBo* in that directory.
ls /var/log/packages | grep SBo
or
ls /var/log/packages/*SBo