Unix
Operating System
Articles
Curl Set User Agent Command on Linux or Unix
A user agent is nothing but software agent that is acting on behalf of a user.
Change user agent with curl
The syntax is as follows for the curl command:
curl -A...
Error: when trying to upload file using Nginx web server
First, you need to edit the /etc/nginx/nginx.conf file by typing the vi command:
$ sudo vi /etc/nginx/nginx.conf
In HTTP (server/location) section add the...
FreeBSD Change Hostname without Reboot
To change the hostname on FreeBSD without a reboot, run two commands as root: hostname server1.example.com changes it immediately, and sysrc...
How to Copy a Folder Recursively with scp, Exclude Files and Skip Existing Files
To copy a folder recursively, use scp -r. scp has no option to exclude files and no option to skip files that already exist: it always sends everything and overwrites...
How to List Users on Unix, Linux, FreeBSD and macOS
To list all users on a Unix-like system, run getent passwd (Linux, FreeBSD and most other Unix systems) or print just the names with cut -d: -f1 /etc/passwd. Most of...
How to Run awk on a File and Print the File Name
To run awk on a file, put the file name after the program: awk '{ print $1 }' file.txt. To print the name of the file awk is reading, use the built-in variable...
How to Schedule Tasks in Linux: Cron Jobs and Systemd Timers
To schedule a recurring task in Linux, add a cron job: run crontab -e, add a line such as 0 3 * * * /usr/local/bin/backup.sh (every day at 03:00), save and exit. Cron...
How to Secure memcached Against DDoS Amplification Attacks
In 2018, memcached servers that were open to the internet over UDP were used for record-breaking DDoS attacks: a small spoofed request made the server send a huge...
How to backup FreeNAS configuration file and restore it?
NOTE that this is NOT a back up of your data stored in your storage array(s) this is simply a back up of your FreeNAS configuration in the event of a failed boot usb....
How to change theme in Ubuntu 16.04/17.10?
Ubuntu 16.04 and 17.10 are end of life. On Ubuntu 24.04 (GNOME desktop) you change the look in Settings.
Light or dark style and accent colour
Open Settings ›...
How to create FreeNAS Jails with iocage?
iocage is a jail or container manager tool for FreeBSD. It is also available on FreeNAS based NAS system. It comes with some of best features and technologies the...
How to patch Meltdown and Spectre vulnerabilities on FreeBSD
Step 1: Find your current FreeBSD version
#freebsd-version11.1-RELEASE-p4
Note down the current version.
Step 2: Update your vulnerable system via a binary...
How to patch Meltdown vulnerability on OpenBSD Unix?
Patch Meltdown vulnerability on OpenBSD
The Meltdown vulnerability backported to the OpenBSD version 6.1 and 6.2 (amd64) releases, and the syspatch update for version...
How to set and use sudo password for Ansible Vault?
You can create encrypted passwords with Ansible playbooks and use it. You need to pass --extra-vars variable to ansible-playbook. Let us see two different methods to...
Installing KornShell (KSH) on FreeBSD
KornShell (KSH) is still common on older Unix systems and for scripting, even though most modern Linux systems default to bash. Installing it on FreeBSD is quick.
What...
Keeping FreeBSD Packages Up-to-Date
If you’re new to FreeBSD, updating your installed software is essential. The pkg tool makes it easy to manage and upgrade software packages. This guide shows you a...
Root Password on a Mac: Enable or Change It, and Change Passwords in Terminal
A Mac has no default root password: according to Apple, the root user is disabled by default. For admin tasks you use sudo in Terminal, and it asks for your own...
UnixBench: To gain system performance
The goal of UnixBench is to present a basic sign of the performance of a Unix-like system; hence, various tests are used to test multiple aspects of the system's...
What does rm -rf command do on a Linux or Unix?
The rm command removes each given FILE on the command line. By default, it does not remove directories.
The syntax to delete the file for rm command is as follows:...