Thursday, November 29, 2018

Performing spell-check via right-click in XFCE

Rev 11/30/18 (see Revision Notes)


XFCE's default text editor, Mousepad, doesn't have a spell-checker, but most types of Linux include Aspell, an excellent spell-checker which runs in the terminal. You could use LibreOffice Writer (typically included with XFCE) as a spell-checker, but it's a massive program which takes a long time to load and is cumbersome to use as a spell-checker, whereas Aspell is small, quick, and easy to use. The problem with Aspell is that to use it, you would normally right-click in the directory which contains the file to be spell-checked, select "open terminal here," and enter the command "aspell -c <filename>" or "aspell check <filename>," and it might be a pain to enter the filename. So, I decided to try to find a way to use Aspell to spell-check a file by simply right-clicking on the file and selecting "Spell-check" in the resulting menu. Fortunately, XFCE's file manager includes a "Custom Actions" feature which allows custom "bash" programs (bash is the command-line interpreter) to be added to Thunar's right-click menu. I'm not a bash programmer, and I couldn't find a pre-fabbed solution, so I flailed around until I stumbled onto a solution, which can be implemented as follows:


In Thunar (the XFCE file manager), click on Edit, then on Configure Custom Actions.

In the Custom Actions window which appears, click on the "+" button in the column of buttons on the right.

In the window which appears, enter the following in the designated fields (the command must be used exactly as shown, including the quotation-marks, unless you have a better solution):

name: Spell-check
description: perform spell-check with aspell
command: xfce4-terminal -e "aspell check %n" (This command causes Thunar to open the terminal and enter the command enclosed in quotes, with the name of the file of interest substituted for %n. This is necessary because Aspell runs in the terminal, meaning that it uses the terminal as its means of interacting with the user, which in this case is initially Thunar.)

In the Appearance Conditions tab, enter "*" into the File Patterns field and below, select Text Files only.

Click on OK, then click on Close in the Custom Actions window.

Close the file manager.

Open the file manager and navigate to the text file to be spell-checked.

Right-click on the text file and click on "Spell-check" in the menu which appears. That should do it.


Notes
Revisions

11/30/18 - Clarified and embellished the 1st paragraph and the passage "(This command causes Thunar....)."

Thursday, July 26, 2018

Protecting USB flash drives and ports when USB drives are plugged into desktop-PC front-panel ports


I recently assembled a desktop PC from an APU, mobo, case, supply, drives, etc., courtesy of Amazon's amazing selection and reasonable prices, to get the greatest bang-per-buck. I added a front panel with USB ports, for a total of 4 up front (I wanted to make use of all of the USB ports provided by the mobo, and to avoid using a USB hub, in hopes of getting better performance when, for example, transferring a lot of data from one USB drive to another.) Although it's no gaming-PC, it has gobs of power and can for example transfer a Linux ISO from its SSD to its HDD in a few seconds. I put Kubuntu 16.04 (from ShopLinuxOnline.com) on it, mainly because I wanted to install certain KDE software (such as Kdenlive, which is excellent and apparently the only Linux video editor worth having at this point) without having to download enormous amounts of data via my metered internet connection. I ended up liking Kubuntu more than I expected because it's very polished and just works well.

However, when USB drives were plugged into the front of the PC, they were vulnerable to impacts from the top, bottom, and sides, and could end up being destroyed. So, I wracked my brains over how to protect the drives, and the USB ports/jacks, from such impacts. I'm fairly certain that I considered every possibility, and the result is shown in the attached photos, which are worth thousands of words, and in my case, dozens of revisions. Note how it wraps around the sides of the PC. I could stand on this thing without straining it, but I'd probably end up falling off and getting injured. The cover simply sits on top of the 2x4's when needed. The gaps around the front of the cover allow me to plug cables into the front panel, and to see the drive-activity LED, even when the cover is in place. They also make it easy to grab the cover to remove it. The top 1x3 was supposed to be flush with the top of the plywood, but I cut the side-1x3's too short. One of my criteria was easy assembly without any special hardware, so that it can be made from scrap wood and parts on hand without any special equipment. If your PC is ventilated in front, you could just make the frame wide enough to create gaps for air to get around the sides of the PC.



Thursday, June 14, 2018

Using Kdenlive to extract segments from videos

This is a simple procedure, but it took me long time to figure out how to do it because I couldn't find any instructions. So, here they are:


A) Click on Project in the main menu, then click on Add Clip, then on the source-file of interest, which then becomes known as a "clip."

B) Play the clip in the CLIP monitor (not the Project monitor) and pause the clip at the beginning of the segment to be extracted. (You can also simply drag the current-position marker under the clip monitor to the start-point of the segment.) If you're trying to extract a short segment from a long video, you might have to extract a segment, and then extract a segment from the segment, to get a sufficient degree of precision.

C) Click on the "left-arrow" button on the left in the row of buttons under the clip monitor. This marks the beginning of the segment or "zone" to be extracted.

E) Somehow get the aforementioned current-position marker to the end of the zone of interest (play the clip and pause it, or pause the clip and drag the marker), and then click on the "right-arrow" button next to the aforementioned left-arrow button to mark the end of the zone to be extracted.

F) Right-click on the display-area of the clip monitor and select "Extract Zone" in the menu which appears.

G) The rest should be obvious.

Sunday, June 3, 2018

Using Ethernet-to-wifi bridges to connect Linux installations to wifi hotspots

I recently ran afoul of the problem of connecting some types of Linux installations to wifi via USB adapters. After working my way into the maze of useless information on this subject, which appears to be intended to overwhelm us (the obviously-desired information, such as a list of adapters whose drivers are built into the Linux kernel, and to which manufacturers could add their devices for fairness, is nowhere to be found), it occurred to me that it might be possible to find an Ethernet-to-wifi adapter, and use the Ethernet port to get to the point where I could use a USB port.

It turns out that such things exist, and I got one by an outfit named Vonets (vonets.com) from Amazon for $20. Setting it up is easy - just connect the device to your PC (Ethernet port, and a USB port for power), and it will find any wifi hotspots in the area. To connect, you just open a web-browser, enter a certain address (192.168.254.254 for the typical Vonets device), enter the default user ID and password (admin in both cases) and then select one of the hotspots which the adapter found, and enter its password. After doing this once, it's ready to go from then on - just hook it up and wait a bit.

XFCE live user ID, password

If you're using some XFCE-based distribution of Linux as a live installation, and it times out and goes to sleep, you might need a user ID and password to wake it up. I ran into this problem, and just kept trying stuff until I found the magical combination, which is "user," and "live."

Wednesday, January 10, 2018