The bitterest tears shed over graves are for words left unsaid and deeds left undone.

Execute System Commands in Ruby


There are several ways to invoke system commands in Ruby: 1. Backquotes `` or `%x()`, 2. The `system` method, 3. The `File` class, 4. The Open3 lib. The difference between backquotes and `%x()` and `system` is that: `system` only returns true/false; while `%x` returns the stdout of the command when the command execution succeeds, and an empty string `""` when...

Invoke System TTS in Ruby


I want to make a small app where I give him a set of English words and he can randomly read out the words inside. The reason why I have such an idea is that when I was learning English, I wanted to find a word dictation app, but I couldn't find the right one, so I might as well...

Batch update file extensions in Linux


A colleague of mine organized several thousand pdf files and needed to perform some batch operations. After uploading to the server, only to find that the extensions inside are uppercase .PDF, some are lowercase .pdf. This brings some trouble, because we have a program on the server that only recognizes the lowercase extensions; The colleague is working with Windows OS,...