Wednesday, 29 April 2020

Top Rated FTP Service for Linux: proftpd

Many are using 'vsftpd', however, it isn't as good and simple as 'proftpd'. vsftpd requires complex config after installation and may be even not working.

proftpd is simple, install and run immediately by using available system users.

Installation:
sudo yum install proftpd -y
sudo systemctl start proftpd
sudo systemctl enable proftpd

Make sure the username is not listed in /etc/ftpusers
Use any FTP client to connect.

Get SSL/TLS from a Website and Identify the Expiry Date

Install utility executables:
sudo yum install gnutls-utils -y
sudo apt install gnutls-bin -y

Get the cert:
true | gnutls-cli --print-cert $Domain 2>/dev/null | \
openssl x509 >temp.pem;

"true" to make 'gnutls-cli' end.
"2>/dev/null" to remove errors.
"openssl x509" to extract the cert only.

Get the expiry date:
openssl x509 -enddate -noout -in temp.pem;

Tuesday, 28 April 2020

Suggested Browsers for 2020

In the old days, the world had Netscape, Internet Explorer (now no more, replaced by Edge Legacy, then Edge), Opera, Mozilla (now as Firefox), some have not been lingering on.

Modern browsers of 2020:
  • Vivaldi (Recommended, with mouse gesture)
  • Chrome (Recommended, very popular)
  • Firefox (Recommended, with tabs in full screen, with 'Switch to New Tab' on mobile)
  • Edge (Recommended, Chromium-based, for downloading other browsers)
  • Edge Legacy (Recommended for downloading other browsers)
Headless browser by popularity:
  • Chrome
  • Chromium

Micro, the New Superb Code Editor for Linux Terminal

Everybody ever used 'vim', 'nano', 'mcedit'; but for now, Micro is the ultimate superb code editor just like Sublime Text for terminal.

It is the recreation based on Sublime Text for text mode. The editor is very fast, and with lots of features, including file manager panel on the left side installed as plugin.

Install Micro from:
https://micro-editor.github.io

Useful Tools for System Management and Engineering

htop
This htop is the advanced replacement for 'top' command on Linux, htop is not available by default on multiple Linux distros but can be simply installed using OS package manager.

CentOS/Red Hat:
sudo yum install htop -y

Ubuntu/Debian:
sudo apt install htop -y

Netdata
A very useful system monitoring tool with smooth performance charts. The only limitation is that Netdata doesn't show charts per process, shows per machine only. For performance per process, use htop.

Install from:
https://netdata.cloud

WinSCP
A powerful file browser for browsing server files on Windows with multiple protocol, the most important one is SSH ie. SFTP, allows editing server-side files directly and uploads the file on save (Ctrl+S). WinSCP is not available on Mac.

Install from:
https://winscp.net

CyberDuck
Replacement for WinSCP on Mac.

Install from:
https://cyberduck.io

PuTTY
A terminal for Windows to access Linux servers before the era of Windows 10 that comes with LXSS Linux Subsystem (or WSL, Windows Subsystem for Linux) and true Linux terminal. Although WSL terminal is there but PuTTY is still useful for generating .ppk file to use in WinSCP.

Install from:
https://putty.org

TortoiseGit
Use Git with GUI instead of git commands in terminal.

Install from:
https://tortoisegit.org

XMinG
Turns Windows GUI into the combination of Windows+Linux, both Windows apps and Linux apps shown on the same task bar and Task View. XMinG activates a display on local machine and uses X11 forwarding for forwarding graphics from server to the display.

Install from:
https://sf.net/projects/xming

Friday, 24 April 2020

Funny Logic in JavaScript: Type of NaN (Not a Number) is Number

This fun doesn't affect programming in this JavaScript language but it's just funny:

console.log(typeof NaN);
--> "number"

Thursday, 23 April 2020

Tell Doxygen to Skip a Group of Lines

Doxygen documents all lines in a file, however, it's possible to tell Doxygen to ignore some lines when using qdoc commands to make descriptions for items.

Put this before to-be-ignored lines:
/*!\cond SOME_NON_EXISTING_DOXYGEN_VAR*/

Put this after those lines:
/*!\endcond*/

In full:
/*!\cond HIDE*/
CODE LINES HERE...
/*!\endcond*/

How to Add a Website/Webapp as Desktop App

Chrome Browser allows adding any website/webapp as desktop application. It's easy and useful:
  • Desktop app can be pinned to Start Menu/Start Screen
  • Shown in browser app page at chrome://apps
  • Shown in Windows All Apps >> Chrome Apps
  • No tab bar, no address bar
  • Website icon is shown on task bar instead of browser icon.
Add as desktop app with these steps:
  • Click Chrome menu button
  • More tools >> Create shortcut...
  • Enter app name
  • Tick 'Open as window'
Screenshot:

Thursday, 16 April 2020

Minimal Files for a Proper Progressive Web App (PWA)

All 3 files below must be served from HTTPS.

Web contents
app.html:
<!DOCTYPE html>
<html>
  <head>
    <title>App</title>
    <link rel="manifest" href="manifest.json"/>
  </head>
  <body>
    body-contents
  </body>
</html>
<!--EOF-->

Configurations
manifest.json:
{
  "name":       "My App",
  "short_name": "My App",
  "start_url":  "app.html",
  "display":    "standalone",

  "icons": [
    {
      "src":   "/pwa/icon144.png",
      "type":  "image/png",
      "sizes": "144x144"
    }
  ]
}

At least 1 icon (must be 144 on Vivaldi)
and the real image size must be 144x144 too:
icon144.png