Tag: utility

Everything and fsearch

Everything and fsearch

Everything File SearchI’m currently operating on a Linux laptop as the M2 SSD on my new desktop PC decided to stop working the other day.  But I thought I’d mention a couple of utilities that I’ve recently started using.

My new PC, just three months old when working has a 1TB M2 SSD with Windows on it. Most software is installed here. All the data, backups, everything else is stored on a 10 TB Hard disk. This is my 10th PC since 1989 so it has the name PC10. Yes, original I know.

I have been copying everything I’ve created and written since 1989 and like a snowball rolling down a hill it has grown. When I finished copying everything from my old PC; a process that took a large chunk of four days, I’d used 2.3 TB out of the 10 TB hard disk.   I just copied across the Gigabit network connection and it maxxed out at 113 MB/S. That’s even with anti-virus running. Of course Windows has an overhead so sometimes the transfer speed drops down to KB/S for small files. I worked it out that over the 48 hours (4 days- 12 hours a day), it copied at 13 MB/S average.

In future it might make sense to zip up folders with small files in them. In the meantime I need to do a bit of pruning of files, removing duplicates etc.

Everything

I’d been looking for a utility to let me find files quickly and somebody had suggested Everything. It’s brilliant. It tells me that I have just over 4 million files. I can filter on document types, images, music files or just search on matching names. And it is very very fast. If you want to find the massive file that’s eating up disk space or duplicates, it does it. But it’s only for Windows. Lacking a Windows system at the mo, I’ve just borrowed the image from the Everything home page.

Fsearch

FSearch window

Developer Christian Boxdörfer also liked Everything and decided to create a Unix clone of it which is FSearch. And it’s written in C. That’s it on the left.

I set it to find all C files and sorted by size.

 

Kilo- a thousand lines text editor in C

Kilo- a thousand lines text editor in C

Antirez kilo text editorDeveloped by Salvatore Sanfilippo aka antirez and licensed under the BSD 2 licence, kilo is a simple text editor in one file.

If you are learning C and want to see how to write a utility, this might be a good example to follow. Warning though he does use pointers so make sure you’ve learnt them first!

I had a stab at writing one quite a few years ago but it wasn’t very good. I have a suspicion that writing a good text editor depends upon you first creating a good implementation of the text storage. Solve that and it’s downhill for the rest.

I’ve added this to my curated library of C code, on the C Code link on the top menu.

 

A command line editor in C

A command line editor in C

Thompson Davis Editor (TDE)The screenshot is of an open source command line editor for Dos, Windows and Linux called TDE which is short for Thomson Davis Editor.

As the website says “TDE is a simple, public domain, multi-file/multi-window binary and text file editor written for IBM PCs and close compatibles running DOS, Win32 (console) or Linux. TDE is suitable for editing batch files, binary files, text files, and various computer language source code files (with configurable syntax highlighting). The only limit on the number and size of files that TDE can handle is the amount of memory. Likewise, the only limit on the number of windows is the amount of memory. There is no preset maximum number of files or windows that may be open at any one time.

What interested me with this was that the editor should work for Linux. It includes a viewer mode where files are loaded read-only,  file search (text or regular), can load files as binary, run a file as a Macro and display several source files with formatting. It certainly sounds a loty better than nano which is a terminal editor.

 

Raspberry Pi – a couple more tips

Raspberry Pi – a couple more tips

Cogs
Image by Arek Socha from Pixabay

I have my Pi networked via a switch to my main (Windows) PC. I use WinSCP or my PC for copying files both ways but it means I’m not using the Pi for periods of 15 or 20 minutes.

Unfortunately the default display timeout on the Pi is 10 minutes. It’s not a bad thing but I decided I wanted an hour.

This fix seems to work. It came from this page on the Raspberry Pi forums.  To save you the effort of reading through a few different suggestions, the one that worked for me is this in a terminal (From the answer at 1.02 am). The 3600 is the time period in seconds in case you hadn’t guessed!

Apparently there are two timeout mechanism hence two commands are needed.

xset s 3600
xset dpms 3600 3600 3600

You can view the settings with

xset q

However to make these settings permanent, you need to edit the file:

sudo nano /etc/xdg/lxsession/LXDE/autostart

That way they are set at boot time.

Note. I’m not really a fan of nano. From Ubuntu I’ve used gedit quite a bit and it is a visual full-screen editor, not line by line like nano. Yeah you could use VS Code if it were open but then on files where you have to use sudo, it’s easier to use gedit.

So

sudo apt install gedit

will install it. Just gedit or sudo gedit (for those awkward files!)