Quantcast
Channel: sleeplessbeastie's notes
Browsing all 770 articles
Browse latest View live
↧

How to create shell script for a cron job with hidden debug information

Create shell script for a cron job with hidden debug information that will be shown only when execudted inside terminal.The idea behind this is quite simple as we need to verify if stdin (file...

View Article


How to compute and verify file checksum

Compute SHA message digest of a file to verify that its contents have not been altered.You have two possible ways to perform this operation. You can use single shasum Perl script provided by the perl...

View Article


How to verify file integrity using GnuPG signature

Verify file integrity using GnuPG signature without touching your local GnuPG configuration.I will use ejabberdrobust, scalable and extensible XMPP Server Debian package provided by ProcessOne as an...

View Article

How to calculate how fast data is copied to the specified directory

Calculate how fast data is copied to the specified directory to determine how long it would take finish the whole process.Create shell script that will calculate how much data was copied to specified...

View Article

How to log dropped connections from iptables firewall using netfilter...

Log dropped connections from iptables firewall using netfilter userspace logging daemon for further analysis and troubleshooting.Check out if nf_log modules for IPv4 and IPv6 are loaded. $ cat...

View Article


How to find symbolic link by a target name

Find symbolic link by a target name. It sounds simple and it definitely is.Find symbolic links inside /usr directory whose case-sensitive content is exactly ssh. $ find /usr/ -type l -lname "ssh" -exec...

View Article

How to download public key used to verify GnuPG signature for the repository

Configuring and using supplementary repositories requires APT public key management to validate Release file and downloaded packages.Basic dependenciesInstall dirmngr using the following command to...

View Article

How to perform different operations depending on the shell script name

This technique is very common. To be honest, it is more common than I initially thought, so I will show you how to create single shell script that will display, create or destroy temporary file system...

View Article


Image may be NSFW.
Clik here to view.

How to reset admin password on UniFi controller

Reset admin password on UniFi controller to access wireless configuration.UniFi controller - login formInstall whois package to use overfeatured front end to crypt(3). $ sudo apt-get install whois...

View Article


How to delete Nextcloud bookmarks using API

Delete Nextcloud bookmarks using API. Notice, data is paginated in this case, so this particar case is more interesting than regular add/remove operations.PrerequisitesInstall curl utility to perform...

View Article

How to use content-dispositon header to determine filename

Use Content-Disposition HTTP response header to determine filename and use it to store downloaded file.Inspect HTTP headers for a file that will be used in the following examples. $ curl --head...

View Article

How to configure command-line tab completion for known SSH hosts

Configure and enable command-line tab completion for known SSH hosts to ease day-to-day operations from personal notebook. You do need to configure or enable this on Debian based distributions, but it...

View Article

Image may be NSFW.
Clik here to view.

How to install and configure external dashboard for Icinga2

Install and configure Dashing with Icinga 2 to use external board for your Icinga2 instance.Dashing with Icinga 2Icinga2 configurationAdd an API user for dashboard. $ cat << EOF | sudo tee -a...

View Article


Image may be NSFW.
Clik here to view.

How to remove useless localizations

Install and configure localepurge package which provides a fancy shell script to recover disk space used by useless localizations.Install required softwareUpdate package index. $ sudo apt-get update...

View Article

How to download in advance the public key used to sign repository signatures

There are those rare situations where you do not know the public key that is required to verify repository signatures, but want to add repository and a public key used to sign it. Hopefully, there is...

View Article


Image may be NSFW.
Clik here to view.

How to make iptables configuration persistent

Make iptables configuration persistent using basic system utilities or a designated boot-time loader.Use basic system utilitiesThis simple solution is most suitable for a system with a single network...

View Article

How to perform incremental backup using rdiff-backup

Perform simple incremental backup using rdiff-backup utility.Required softwareInstall rdiff-backup utility. $ sudo apt-get install rdiff-backup Reading package lists... Done Building dependency tree...

View Article


How to read and insert new values into the debconf database

I have already described how to copy answers to the configuration questions for Debian packages, but there is an easier way to read and insert new values into the debconf database.You will need...

View Article

How to make iptables configuration persistent using custom service file

Make iptables configuration persistent using custom service file with additional features like configurable wait time, so you can safely interrupt execution and test mode that will disable firewall...

View Article

How to display reverse package dependencies

Display reverse dependencies to inspect which packages are depends on given application or library.Use apt-cache utility to display reverse dependenciesDisplay reverse dependencies for particular...

View Article
Browsing all 770 articles
Browse latest View live