This page is used to 'host' a personnal Knowledge Base with some short gists, cheatsheets and bookmarked-urls.

sql> select * from KB_cards where tags like '%linux%'
All KB cards
Source: vim.wikia.com Show all tabs: /\t Show trailing whitespace: /\s\+$ Show trailing whitespace only after some text (ignores blank lines): /\S\zs\s\+$ Show spaces before a tab: / \+\ze\t
The systemd daemon allows to manage custom services and run a script as a daemon service if it needs to be executed continuously (For instance: a REST API server). Create the unit file Create a unit file with the extension .service on the following path: /etc/systemd/system (For instance: /etc/systemd/system/my-custom-service.service) Once created, configure the unit file with the following sections: Unit, Service and Install. Unit section [Unit] Description="My custom service" After="network-online.target" The description of the custom...
On some editor’s Linux based appliance(s), there is not telnet binary installed. To test TCP netwotk flows, it’s possible to use python’s socket module with a short script: #!/usr/bin/python import socket import sys if len(sys.argv) != 3: print("usage: telnet.py IPADDRESS PORT") exit(-1) print("Opening connection on %s port %s" % (sys.argv[1], sys.argv[2])) try: conn=socket.create_connection((sys.argv[1],sys.argv[2]),timeout=30) except socket.timeout: print("Connection error: timeout") exit(-1) except: print("Connection error: unknown") exit(-1) print("Connection succeed") exit(0) Usage: $ python telnet.py usage: telnet.py IPADDRESS PORT...
Bookmark – Crontab generator

If you want to periodically perform a task (e.g. sending Emails, backing up database, doing regular maintenance, etc.) at specified times and dates on a Linux or Unix system, you will probably need to use a Cron. The configuration file is quite simple but it is possible to have some doubt about the date/time order to use:

Here is a crontab-generator.