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
Show all tabs:
Show trailing whitespace:
Show trailing whitespace only after some text (ignores blank lines):
Show spaces before a tab:
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, sys.argv)) try: conn=socket.create_connection((sys.argv,sys.argv),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...
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.