≡ Menu

UNIX

How to add to bash $PATH permanently on Linux

I am a new Linux and bash shell user. How do I permanently set $PATH on Linux? How can I permanently add a directory to shell PATH on Linux?
[click to continue…]

Sysadmin because even developers need heroes!!!

How to setup HTTP Strict Transport Security With Lighttpd Web Server

HTTP Strict Transport Security (HSTS) is a security feature that lets your web site tell client browsers that it should only be communicated with using HTTPS only. How can I setup HSTS using lighttpd web server on Linux or Unix-like system?
[click to continue…]

How to check if port is in use on Linux or Unix

How do I determine if a port is in use under Linux or Unix-like system? How can I verify which ports are listening on Linux server?
[click to continue…]

Linux kvm exit from a virsh console command

I installed KVM on Ubuntu server as described here. However, I am unable to get out of a ‘virsh console domain’ command. How can I exit from a “virsh console” connection over ssh based session?
[click to continue…]

How to remove all old and outdated brew packages on MacOS

I am using Homebrew to install packages on MacOS Sierra or Mac OS X. I noticed multiple version of bash or curl installed in /usr/local/Cellar/bash/. How can I delete an outdated version of brew packages and only keep the latest version on my system?
[click to continue…]

How to use curl command with http/2 on MacOS X

I am using a MacOS sierra (version 10.12.1). How do I use curl command with http2/ protocol? I am getting an error that read as follows:

            curl -I --http2 https://google.com
            curl: (1) Unsupported protocol

How do I solve this problem and use cURL with HTTP/2 on Mac OS X or MacOS Sierra?
[click to continue…]

How to automatically mount zfs file system on Linux/Unix/FreeBSD

I have created a zfs file system called data/vm_guests on Ubuntu Linux server. After the server reboot, zpools do not automatically mount at /data/vm_guests. It is failing my KVM guest machines. How can I mount my ZFS (zpool) automatically after the reboot?
[click to continue…]

How to apply patches on OpenBSD system/kernel and packages easily

I am a regular Linux system user. In Linux (especially CentOS), I am used to applying updates a few times a week using yum command, but how do I do that on my OpenBSD severer? How do I apply updates on OpenBSD operating system?
[click to continue…]

cron Error: bad username; while reading /etc/cron.d file on Linux

I am getting the following error in my cron job log file /var/log/cron.log:
       Aug 22 01:59:01 server2 cron[7510]: Error: bad username; while reading /etc/cron.d/backups
I have job entry as follows to run a job at 00:50 every day for root user:
       50 0 * * * /etc/cron.d/backups
How do I fix this problem on Linux or Unix-like system?
[click to continue…]

How to make disk image with dd on Linux or Unix

How do I create disk image using dd command? How do I perform disk cloning from a live Linux cd for backup or recovery purpose?
[click to continue…]