Jurassic Park, while beloved as a film, has been the subject of snarky memes for the infamous line in which one of the characters declares, "This is a Unix system, I know this!" while using a computer with an unusual 3D file manager interface.
Despite the memes, the film's production team was meticulous in accurately sourcing the right PCs (and adjacent details) for the sets—not too much of a surprise, given writer Michael Crichton's background with computing and his obsessive attention to detail in the book the film is based on.


Si vous utilisez un ordinateur portable à puce graphique AMD Radeon sous Linux, vous avez peut-être déjà vu l'écran se figer d'un coup, sans raison apparente, à peu près une fois par semaine. Ce bug agace les utilisateurs depuis des années, et un correctif vient enfin de pointer le bout de son nez.
Le coupable se cache dans AMDGPU, le pilote graphique libre qu'AMD maintient pour Linux. On parle ici du logiciel qui fait le lien entre la carte graphique et le système d'exploitation.
Le problème ne date pas d'hier. En fouillant l'historique du code, le développeur à l'origine du correctif a remonté la piste jusqu'à une modification introduite en 2017. Presque huit ans de gels d'écran.
Le symptôme typique, c'est une erreur "flip_done timed out" dans les journaux du système. Pour faire simple, l'ordinateur attend que l'écran affiche l'image suivante, ce signal n'arrive jamais. Et tout gèle.
Le souci touche plusieurs machines, bien connues du monde Linux, comme le Lenovo ThinkPad T14 Gen1 en version AMD ou le Framework Laptop 13 équipé d'un processeur Ryzen 7 7840U. Jusqu'ici, le seul remède consistait à désactiver le PSR, pour "Panel Self Refresh".
Cette fonction d'économie d'énergie laisse l'écran réafficher tout seul sa dernière image fixe sans réveiller la carte graphique, histoire d'économiser de la batterie. Pratique sur un portable, sauf que c'est précisément elle qui déclenchait les gels.
Le plus intéressant, c'est la méthode employée. Le correctif a été mis au point en "vibe debugging" avec Claude Code, l'assistant de programmation d'Anthropic, le concurrent direct d'OpenAI. Le développeur a décrit le bug à l'IA, qui l'a aidé à explorer le code et à affiner les correctifs, plutôt que de dérouler une procédure de débogage classique.
Concrètement, les patchs revoient la gestion du "vblank" et du "page-flip" dans le bloc d'affichage DCN, c'est-à-dire la mécanique interne qui synchronise le moment où une nouvelle image remplace l'ancienne à l'écran. D'autres tentatives avaient échoué par le passé, mais cette série semble enfin tenir la route.
Maintenant patience, rien n'est encore intégré dans le noyau Linux officiel. Les correctifs doivent passer par les tests et la validation des mainteneurs avant d'arriver chez tout le monde, ce qui peut quand même prendre plusieurs versions du kernel.
Bref, on est là devant un bug fantôme qui date d'lil y a huit ans, débusqué en discutant avec une IA, voilà qui résume assez bien l'année 2026 côté développement.
Source : Phoronix

Si vous avez bossé sous Unix dans les années 80, vous avez peut-être déjà croisé ce poster. Un sorcier barbu en robe noire, un chaudron qui déborde, des étagères couvertes de conteneurs étiquetés tar, awk, troff... C'est l'œuvre de Gary Overacre, publiée par UniTech Software dans les années 80 (apparemment 1986), et ce n'est qu'aujourd'hui qu'un dev nommé drio s'est dit que ce serait cool de cartographier chaque référence cachée sur unixmagic.net .
De ce que j'ai pu lire, le poster aurait été distribué en marge des conférences USENIX comme goodie et il n'y a visiblement jamais eu de réimpression. En 2021, le blogueur Jan-Piet Mens indiquait, après avoir contacté l'épouse de Gary Overacre et selon ses dires, il resterait environ 65 originaux du UNIX Magic chez les Overacre.
Overacre a aussi signé deux autres posters dans la foulée, encore plus rares (les titres listés varient selon les sources de revente : "Unix Feuds" ou "Computer Feuds", et "The View").
Computer Feuds (ou Unix Feuds selon les sources) - Gary Overacre.
Après si vous voulez l'un de ces visuels chez vous, deux options s'offrent à vous : Chasser un exemplaire sur eBay (et payer le prix d'un collector), ou imprimer la version 32 Mo dispo sur archive.org.
The View - Gary Overacre.
Maintenant, ce qui rend le poster culte, c'est pas juste sa rareté. C'est surtout la densité des blagues techniques planquées dedans. Selon les interprétations communautaires recensées sur unixmagic.net, le sorcier représente l'admin Unix maître du système, le chat noir perché à proximité serait cat, la fourche qu'il tient en main serait fork(), les tuyaux qui serpentent partout seraient les pipes (|), le crâne en bas du chaudron pointerait vers /dev/null là où les données vont mourir, et la botte qui traîne par terre serait un jeu visuel autour de boot (ou peut-être un sock/socket selon une autre annotation).
UNIX Magic - Gary Overacre, 1986. Source : archive.org / unixmagic.net
Sur les étagères, vous avez également des conteneurs avec les noms des outils Unix classiques : tar, awk, diff, uucp, troff, make. Et juste à côté, un détail que beaucoup ratent : un conteneur étiqueté C intact, et un autre étiqueté B... fissuré. Interprétation probable au fait que le langage C a remplacé son prédécesseur B (créé par Ken Thompson en 1969-1970 avant d'être supplanté par le C de Dennis Ritchie ). Il y a plein de petites subtilités comme ça.
Y'a aussi des initiales planquées un peu partout : dmr (Dennis M. Ritchie), kt (Ken Thompson), bwk (Brian Kernighan), soit trois grandes figures de la culture Unix dans un seul dessin. La robe du sorcier est également constellée de symboles shell, les caractères de redirection, le pourcentage du prompt csh, le dollar du prompt sh, l'astérisque du glob, le point d'exclamation de l'history expansion, les crochets... bref des symboles courants des shells Unix qu'on tape sans y penser en ligne de commande.
Même le titre du poster est présenté en grosses lettres bloc, comme la sortie de la commande banner. Et un peu plus loin, vous avez wall (l'utilitaire qui envoie un message à tous les utilisateurs connectés) représenté littéralement par un mur.
Voilà, le poster Unix Magic, c'est ce niveau de blagues visuelles partout.
Le projet de drio consiste donc à poser des marqueurs interactifs sur chaque détail du poster. À la date d'aujourd'hui, le site unixmagic.net affichait 41 références identifiées et documentées. C'est dans l'esprit, comparable à l'archéologie du Glider , ce symbole hacker dont je vous ai déjà parlé.
Et vous avez peut-être vu mais sur le poster, y'a aussi un sac d'origan posé dans un coin. C'est du folklore BSD non vérifié, mais d'après les spécialistes, ça ferait écho à une histoire de communauté où un acteur du milieu aurait été interpellé à la frontière canado-américaine avec un sac suspect dans ses bagages. Les douaniers étaient persuadés que c'était de la drogue alors que c'était de l'origan !
Et c'est ça, la vraie valeur du projet drio car sans ce travail de documentation, dans 20 ans, la référence au sac d'origan ou d'autres risquent de devenir impossibles à comprendre car les références se perdent avec les générations.
Après si en bon barbu survivant des années 80, vous reconnaissez un détail que personne n'a encore décodé, c'est le moment d'apporter votre pierre à l'édifice.
Et si vous voulez en faire un trophée mural, comme j'vous disais, archive.org a la version 32 Mo.

Wow! After years of hard work and countless commits, we have finally reached a huge milestone: GIMP 3.0 is officially released! I am excited as I write this and can't wait to share some incredible new features and improvements in this release. GIMP 2.10 was released in 2018, and the first development version of GIMP 3.0 came out in 2020. GIMP 3.0 released on 16/March/2025. Let us explore how to download and install GIMP 3.0, as well as the new features in this version.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post Download of the day: GIMP 3.0 is FINALLY Here! appeared first on nixCraft.
Sed is an acronym for "stream editor." A stream refers to a source or destination for bytes. In other words, sed can read its input from standard input (stdin), apply the specified edits to the stream, and automatically output the results to standard output (stdout). Sed syntax allows an input file to be specified on the command line. However, the syntax does not directly support output file specification; this can be achieved through output redirection or editing files in place while making a backup of the original copy optionally. Sed is one of the most powerful tools on Linux and Unix-like systems. Learning it is worthwhile, so in this tutorial, we will start with the sed command syntax and examples.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post Linux Sed Tutorial: Learn Text Editing with Syntax & Examples appeared first on nixCraft.
Rsync is a opensource command-line tool in Linux, macOS, *BSD and Unix-like systems that synchronizes files and directories. It is a popular tool for sending or receiving files, making backups, or setting up mirrors. It minimizes data copied by transferring only the changed parts of files, making it faster and more bandwidth-efficient than traditional copying methods provided by tools like sftp or ftp-ssl. Rsync versions 3.3.0 and below has been found with SIX serious vulnerabilities. Attackers could exploit these to leak your data, corrupt your files, or even take over your system. There is a heap-based buffer overflow with a CVSS score of 9.8 that needs to be addressed on both the client and server sides of rsync package. Apart from that info leak via uninitialized stack contents defeats ASLR protection and rsync server can make client write files outside of destination directory using symbolic links.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post Critical Rsync Vulnerability Requires Immediate Patching on Linux and Unix systems appeared first on nixCraft.
Multiplexing will boost your SSH connectivity or speed by reusing existing TCP connections to a remote host. This is useful when you frequently connect to the same server using SSH protocol for remote login, server management, using IT automation tools over SSH or even running hourly backups. However, sometimes your SSH command (client) will not respond or get hung up on the session when using multiplexing. Typically, this happens when your public IP changes (IPv4 to IPv6 changes when using DNS names), VPN issues, or firewall cuts connections. Hence, knowing SSH client control commands can save you time and boost your productivity when such gotchas occur.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to control the SSH multiplexing with the control commands appeared first on nixCraft.
How do I change MySQL root password under Linux, FreeBSD, OpenBSD and UNIX-like like operating system over the ssh session?
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post MySQL Change root Password Command appeared first on nixCraft.

Linux and Unix like operating systems comes with z* commands. These commands allow you to read gzip compressed text files using zless, zcat, zmore, and friends commands. The gzip command reduces the size of the files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension .gz while keeping the same ownership modes, access, and modification times. z* commands have some cool usage too, such as display the current time in different zonename.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post zcommands: Read gzip Compressed Text Files On a Fly on Linux and Unix appeared first on nixCraft.
I have lots of files in a directory called /disk2/images/. All files are in zip file format, so I am using the following command to extract zip files:
unzip *.zip
The command result into an error which read as follows:
caution: filename not matched
How do I unzip multiple or many zip files under a Linux/Unix-like system?
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How do I unzip multiple / many files under Linux? appeared first on nixCraft.
Most Linux and UNIX-like system configuration files are documented using comments, but sometimes I just need to see a line of configuration text in a config file. How can I view just the uncommented configuration file directives from squid.conf or httpd.conf file? How can I strip out comments and blank lines on a Linux or Unix-like system?
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post Linux / UNIX View Only Configuration File Directives ( Uncommented Lines of a Config File ) appeared first on nixCraft.
How do I perform DNS lookup under Linux, UNIX, or Apple macOS (OS X) operating systems without using 3rd party websites for troubleshooting DNS usage?
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post Linux / UNIX: DNS Lookup Command appeared first on nixCraft.
How can I copy one hard disk to another using the dd, ddrescue, or dcfldd commands?
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post Linux Copy One Hard Disk to Another Using dd Command appeared first on nixCraft.
Here is a handy and useful Linux and Unix shell script that reduce PDF file size using Ghostscript. No need to upload your PDF file to the shady third-party website. Just do it from the terminal. I tested it with both CentOS and Ubuntu/Debian Linux. It should work with macOS, FreeBSD and other Unix-like systems as long as you have the Ghostscript installed.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post Linux shell script to reduce PDF file size appeared first on nixCraft.
TTL is an acronym for Time-To-Live (TTL) in DNS. It sets the time in seconds that a DNS record is allowed to be cached by DNS resolvers (caching server) before it needs to be fetched again from the authoritative name server. In other words, longer TTL can reduce the load on authoritative DNS servers and improve response times by keeping records in the cache longer. The shorter TTL is useful for frequently changing DNS records, as it ensures that updates are propagated quickly across the Internet. Say you want to see the Time-To-Live (TTL) value for a given DNS record for A, AAAA, and MX. Here is a sample shell script that works on Linux, Unix, and macOS. You must have the bash and dig command installed.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post Shell script to see Time-To-Live (TTL) for a DNS record on Linux, Unix, macOS and FreeBSD appeared first on nixCraft.
Here is a simple shell script to notify secondary read-only replica (slave) MariaDB server health status failure via email and push notification. Master-slave data replication allows you to copy databases to multiple MariaDB servers. It is useful for backup, data recovery, load balancing, and much more. See how to configure SSL-protected MariaDB replication between a master and slave server.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post Shell script to monitor MariaDB replication and send email alert about server health status appeared first on nixCraft.
AWS offers various instance types, and sometimes, you need to know which one you are using or which one has been deployed by someone else (another developer or sysadmin) for a project. Don't worry. Here are some commands to find the EC2 instance type over SSH without logging into the AWS console. These commands works with any Linux distro or FreeBSD Unix systems.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to find out AWS EC2 instances type over SSH appeared first on nixCraft.
vnStat is a network traffic monitor for Linux and Unix-like systems. It logs network traffic at different intervals and doesn't require root permissions to run. The implementation involves two commands: vnstat for querying traffic information and vnstatd for data retrieval and storage. Let's see how to add a network interface to vnstat after installation for monitoring purposes.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to add interface to vnstat to database for monitoring appeared first on nixCraft.
I'm trying to login using ssh keys but server is only allows to login me using a password. The following message is logged into my Linux or Unix server /var/log/secure or /var/log/auth.log file:
Feb 25 06:36:50 ns5 sshd[26681]: Authentication refused: bad ownership or modes for file /home/user/.ssh/authorized_keys2
Here is another message:
May 24 18:28:35 ls-www-1 sshd[531320]: Connection closed by 18.1.2.3 port 43640 [preauth]
May 24 18:28:44 ls-www-1 sshd[531322]: Authentication refused: bad ownership or modes for file /home/admin/.ssh/authorized_keys
May 24 18:28:44 ls-www-1 sshd[531322]: Connection closed by authenticating user admin 18.1.2.3 port 43650 [preauth]
How do I fix this problem?
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post SSH Authentication refused: bad ownership or modes for file /home/user/.ssh/authorized_keys appeared first on nixCraft.
How do I capture a specific protocol or port, such as 80 (HTTP) or 443 (HTTPS), using the TCPDump tool under Linux/UNIX? How do I record traffic with TCPDump and find problems later on with my network or server issues? Let's dive into the nitty-gritty of capturing and analyzing your network traffic for trapshooting network and server issues.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post TCPDump: Capture and Record Specific Protocols / Port Traffic appeared first on nixCraft.
I have log files created whenever I patch or rebuild Linux containers. They are taking disk space. The logs are helpful if something fails. Otherwise, after a few weeks, those log files have no usage for me. So here is a quick tip on how to use the find command to delete all *.log files created in the last 90 days except for the previous 7 or 10 days. The commands mentioned in these tips are compatible with the Linux, FreeBSD, and macOS versions of the find command.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to use find command to delete all *.log files created in last 90 days except for last 7 days appeared first on nixCraft.
I am a new macOS Unix user. I am writing a small bash shell script. How do I download file directly from the command-line interface using curl? How can I download file with cURL on a Linux or Unix-like systems?
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to download a file with curl on Linux/Unix command line appeared first on nixCraft.
Here's a quick tip for vim users. You can perform find and replace operations within a visual selection in Vim for text or code block. Visual selection for finding and replacing text in Vim allows developers and Linux/Unix users precise and efficient text editing. It's handy when you want to change specific portions of text or code blocks within a larger file without affecting other occurrences. This method required to minimizing manual search and reducing the risk of unintended code or text modifications. Let us see how to find and replace in Vim visual mode selection.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to perform find and replace operations within a visual selection in Vim appeared first on nixCraft.
Unhide is a little handy forensic tool to find hidden processes and TCP/UDP ports by rootkits / LKMs or by another hidden technique. This tool works under Linux, Unix-like system, and MS-Windows operating systems.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to find hidden processes and ports on Linux/Unix/Windows appeared first on nixCraft.
Recently, I had a learning experience with cron jobs and acme.sh. acme.sh is an excellent tool that simplifies the management of Let's Encrypt TLS (SSL) certificates. It makes obtaining and renewing these essential security certificates for your web server easier.
Recently, I moved my server from Linode to AWS, which was a new environment for me. Initially, everything appeared to be working correctly, and I assumed everything was running smoothly. However, I forgot to migrate the cron job that acme.sh uses to renew the certificate automatically.
This oversight caused my Let's Encrypt certificates to expire, resulting in security warnings and potential disruptions for visitors to my website. Opps!
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to add cron job entry for acme.sh appeared first on nixCraft.
When you try to use the xclip command over the ssh-based session to copy and paste data, you will get the following message on screen:
Error: Can't open display: (null)
Here is how to fix this error by editing the ssh client and OpenSSH (SSHD server) configuration file.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to fix “Error: Can’t open display: (null)” with ssh and xclip command in headless mode appeared first on nixCraft.
A long time ago, I wrote a script or config file that included BASE64 encoded string like "Le_PreHook='__ACME_BASE64__START_L3Jvb3QvYmluL2xlL2N5YmVyY2l0aS5iaXovcHJlX2JlZm9yZV9vYnRhaW5pbmdfYW55X2NlcnRpZmljYXRlcy5zaA==__ACME_BASE64__END_". So I wanted to know what this string was to update my config script. Here is how to decode BASE64 in Linux or Unix-like systems.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to decode BASE64 string in Linux and Unix appeared first on nixCraft.
I have a valuable tip for you on extracting the filename and extension in Bash when using Linux, macOS, FreeBSD, or Unix-like systems. It's quick and easy to follow.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to get and extract filename extension in Bash appeared first on nixCraft.
Let us see how to check for ssh connectivity in a shell script running under macOS, FreeBSD, or Linux/Unix desktop using BatchMode=yes and ConnectTimeout=$VALUE options. This simple trick helps write a wrapper script that does other things, such as making a backup or running external command agents such as Salt or Ansible to do other tasks.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to check for ssh connectivity in a shell script appeared first on nixCraft.
While working on the bash shell script wrapper, I needed to ensure that I only passed an integer in the Bash script under Linux and Unix-like systems. Here is how to check if a number is an integer in Bash Linux or Unix script or at the command-line interface (CLI)
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post Bash see if an input number is an integer or not appeared first on nixCraft.
I have a tutorial that explains the basics of the SSH client configuration file and some of the most common configuration options for Linux and Unix developers or sysadmin. In this quick tip, I will explain how and why you sometimes need to ignore or exclude the ssh client config file under Linux, Unix, *BSD and macOS.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to tell ssh client to ignore ssh config file appeared first on nixCraft.
Sometimes you need to use the ls command on your Linux or Unix machine and match the pattern, interpreting upper- and lowercase letters as the same. In other words, I tell ls to find and list files regardless of their case insensitive. For instance, I am going to tell ls command command to ignore the case so that it can match files such as:
$ ls *service*.pdf
SERVICE.pdf
DELL-Service-M6700.pdf
hp-printer-Service-Manual.pdf
In this quick tip, I explain how to match case insensitive patterns with the ls command on your Linux, macOS, *BSD and Unix-like system.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to run ls command case insensitive mode on Linux/Unix appeared first on nixCraft.

As you may know, email spoofing allows attackers to pose as someone else to gain illegal profit. For example, I only use webmaster@cyberciti.biz for communication, but someone might create a spoofed-up email, say info@opensourceflare.com, to trick someone. This is called email spoofing with fake headers as follow:
Date: Thu, 24 Oct 2021 12:46:10 From: nixCraft <info@opensourceflare.com> Reply-To: info@opensourceflare-email.com To: <my@personal_gmail_com>
Correct headers are often not checked by receiving email servers, and my@personal_gmail_com may think the email is from me. Here is the thing I don't use opensourceflare.com for email communication at all. So how do I prevent illegitimate email traffic on my domain? In this tutorial, I will explain how to configure DNS settings that tell receiving email servers this domain is not configured for emailing purposes and the attacker maliciously sending email on my behalf.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post DNS settings to avoid email spoofing and phishing for unused domain appeared first on nixCraft.
Today I will talk about a common problem faced by many Linux or Unix sysadmins and developers. Typically modern apps and security devices heavily depend upon APIs and lists that feed data in JSON format. For example, a list of spamming or VPN CIDRs or a good list of verified bots' IP CIDRs is in JSON format. If they accept JSON format, you can take this list and upload it to your router or WAF. Unfortunately, not all devices accept JSON format. Hence, we can take JSON format and convert it to CSV format per our needs.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to convert JSON to CSV using Linux / Unix shell appeared first on nixCraft.

Like every other solo developer and sysadmin, I do stuff using ssh. Some stuff is automated using scripts, and others require ssh login. For example, one of my scripts logs into my Linux and FreeBSD server using public ssh keys and does a particular type of work for me. I have a dedicated user account for that purpose called autovivek on Raspberry PI 4 for Ansible and custom script automation. Here is how it works:
{rpi4:~}$ ssh autovivek@192.168.2.17 /path/to/taks1
In other cases, it sends scripts and then executes them on the remote server named 192.168.2.17. Sounds good, right? So, when I need to make backups and other tasks, I lock down the autovivek user account on the server so that it will not modify data on disks. For example, here is how to lock down a user account:
{linux-server:~}$ sudo usermod -L -e 1 autovivek
## OR ##
{freebsd-server:~}$ sudo pw lock -n autovivek
However, I soon discovered that a user named autovivek can still log into the server and make changes despite being locked down on both Linux and FreeBSD servers.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post A cautionary tale about locking Linux & FreeBSD user accounts appeared first on nixCraft.
So I have this specific use case where I get data in a comma-separated values (CSV) file. I pick up the company name, address, telephone, email, and some other data from that file. Once data is collected, I create a final pdf using a simple script. Unfortunately, data comes with unwanted leading and trailing white spaces in each field. So my final pdf file gets messed up because of those white space. Let us see how to trim leading and trailing white space for a string in Bash running on Linux or Unix machines.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to trim leading and trailing white space in bash appeared first on nixCraft.
Another day I wrote about setting up ssh public key password-less authentication for FreeBSD server version 12/13 with an optional 2FA hardware USB key (FIDO 2) for additional protection. However, FIDO2 and key type ecdsa-sk and ed25519-sk are not supported by the OpenSSH client and server version shipped with FreeBSD 12 or 13. But, fear not, we can safely upgrade the OpenSSH version using ports collection. This page explains how to install and configure the latest portable version of the OpenSSH client and server on FreeBSD 13.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to install and upgrade OpenSSH server on FreeBSD appeared first on nixCraft.

SSH is an essential tool for login into the FreeBSD Unix box. Without SSH, you cannot manage a remote server easily. Furthermore, SSH means secure shell, and it is a replacement for insecure protocols such as telnet. This page explains how to configure and set up ssh key-based password-less authentication on a FreeBSD server or workstation.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to set up ssh public key password-less on FreeBSD appeared first on nixCraft.
This page explains setting up a static IP address on the FreeBSD Unix system using the command-line options.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to configure static IP Address on FreeBSD appeared first on nixCraft.
I have multiple versions of PHP installed on my development VM. I am migrating all my projects from PHP 7.x to 8.x and testing it. However, this leads to specific problems. For example, my production Linux container is on PHP 7.4.26, while the development VM is on PHP 8.1. So they don't match and causes problem even in the dev environment because I have 7.x and 8.x. Here is how to tell the composer to use different PHP versions per project requirements.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to tell and force Composer to use a specific PHP version such as 7.x or 8.x appeared first on nixCraft.
The xz command on Linux, macOS, *BSD, and Unix-like systems offer excellent compression. It will outperform zip and other formats when we use xz with tar for maximum reduction in size. For instance, I compressed a directory having 37M size using both xz and zip. The zip file size was 31M, while the xz file was 16M after compression. Pretty impressive, isn't it? Let us see how to compress the whole directory using xz and tar.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to compress the whole directory using xz and tar appeared first on nixCraft.
This quick tutorial explains How to check the SHA1 hash of a file on Linux, FreeBSD, and Unix-like systems using the sha1sum or sha1 command.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to check SHA1 hash on Linux, FreeBSD and Unix appeared first on nixCraft.
First, there is no fsck command for ZFS, which Linux and Unix use for file system repair. However, ZFS comes with a scrub option. This subcommand is a root-initiated dynamic consistency check. It runs in the background on a mounted live filesystem. Hence, we use the zpool scrub command for ZFS storage and test file system integrity. Let us see how to check ZFS File system storage pool on Linux, FreeBSD or Unix-like systems using the command-line option.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to check ZFS File system storage pool on Linux/Unix appeared first on nixCraft.
Most of us use love and use the jq command. It works on Linux or Unix-like systems to extract data from JSON documents. Recently I found htmlq, which is like jq and written in Rust lang. Imagine being able to sed or grep for HTML data. We can search, slice, and filter HTML data with htmlq. Let us see how to install and use this handy tool on Linux or Unix and play with HTML data.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to use htmlq to extract content from HTML files on Linux, macOS or FreeBSD appeared first on nixCraft.
All supported versions of FreeBSD are affected by various security bugs that need to be applied ASAP. For example, a memory corruption bug exists in the bhyve hypervisor. Another overwrite the stack of ggatec and potentially execute arbitrary code. There are two issues fixed for OpenSSL in this security advisory too. Let us see what and how to fix these security vulnerabilities on FreeBSD.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post FreeBSD bhyve, OpenSSL, GEOM & libfetch security fixes released appeared first on nixCraft.
At a certain point, I needed to change the VLAN IP address such as 172.0.0.2 with 172.0.0.1 for ease of use. As you know, Linux and Unix-like operating system stores all IP addresses and config in plain text files. This page explains my little adventure where I had to find and find and replace ALL IP addresses with a new one on Linux.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to find and replace ALL IP addresses with a new one appeared first on nixCraft.
Sometimes we need to evaluate multiple when conditions in Ansible playbooks. Let us see how to define multiple when conditions in Ansible for a single task.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to define multiple when conditions in Ansible appeared first on nixCraft.
In Linux, how do I copy and transfer files remotely between two Linux machines? What command do I need to use to transfer files between Unix/macOS and Linux computers securely?
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to copy and transfer files remotely on Linux using scp and rsync appeared first on nixCraft.
We can easily convert all Linux man pages to HTML, text, or pdf format. To display online manual documentation pages in terminal on Linux, macOS, *BSD, and Unix-like systems, we use the man command. However, some man pages are long and might be hard to search when using less or most as a pager. Hence, we can convert them to HTML format and skimmed them in a web browser such as Firefox.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to convert man page to HTML on Linux and Unix appeared first on nixCraft.
Let us say you want to repeat a character such as '-' OR '=' multiple times while writing bash script. Please note that I needed a quick script to work on Linux, macOS, and FreeBSD server to repeat a string/character n times. One simple way to to repeat a string or character n times is simple use the echo command/printf command as follows:
echo '------------------------------------'
printf '%s\n' '------------------------------------'
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to repeat a character ‘n’ times in Bash appeared first on nixCraft.