A Bash Script to Read All Command Line Arguments into an Array: Simplify Argument Handling
If you are writing a Bash shell script, you should read command-line arguments into an array for some time. This allows us to process any number of arguments provided when the script is run. This makes the script adaptable to different use cases. Instead of dealing with fixed variables like $1, $2, $3, etc., you can work with any number of arguments more dynamically using bash for loop or bash while loop, depending upon your needs. Arrays make it simple to loop through each argument and perform operations on them, whether basic printing or complex processing. Bash provides a mapfile (readarray command) internal built-in command to read lines from a file into an array variable. Let us see how to use mapfile to read all command line arguments into an array.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post A Bash Script to Read All Command Line Arguments into an Array: Simplify Argument Handling appeared first on nixCraft.
2024-05-07T10:40:08Z
2024-05-07T10:40:08Z
Vivek Gite
How to Pin Versions in Yum or Dnf for RHEL or CentOS Linux
CentOS, RHEL (Red Hat Enterprise Linux), Fedora and other clones of RHEL, such as Oracle, Alma, and Rocky, offer support for version pinning. This feature allows developers and system administrators to lock a particular package to a specific version, preventing it from being automatically updated by yum or dnf commands. Sometimes, it is necessary to protect packages from being updated to newer versions to avoid incompatibility issues with your applications. For example, you can lock down PHP version 8.3.6 and avoid using updated PHP version 8.4. Let us see how to lock a package to a specific version, only exclude a package from yum update or dnf update on a CentOS, RHEL, Fedora, and friends.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to Pin Versions in Yum or Dnf for RHEL or CentOS Linux appeared first on nixCraft.
2024-05-07T09:01:47Z
2024-05-07T09:01:47Z
Vivek Gite
How to perform find and replace operations within a visual selection in Vim
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.
2024-05-07T06:14:33Z
2024-05-07T06:14:33Z
Vivek Gite
How to find hidden processes and ports on Linux/Unix/Windows
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.
2024-05-07T05:05:51Z
2024-05-07T05:05:51Z
Vivek Gite
How to add bash auto completion in Debian Linux
Bash is a command language interpreter compatible with sh. It can execute commands read from a file or keyboard. On Debian Linux, bash-completion is a set of shell functions that uses Bash's programmable completion feature. This page provides instructions on installing and enabling Bash auto-completion on Debian Linux versions 10, 11, and 12 to increase productivity by writing custom bash code.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to add bash auto completion in Debian Linux appeared first on nixCraft.
2024-05-06T15:51:25Z
2024-05-06T15:51:25Z
Vivek Gite
How to add cron job entry for acme.sh
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.
2024-05-03T06:43:12Z
2024-05-03T06:43:12Z
Vivek Gite
How to Upgrade Ubuntu 22.04 to 24.04 LTS: A Complete Guide
{nixCraft Patreon supporters content}Below is a sneak peek of this content! Ubuntu 24.04 LTS (Noble Numbat) was launched on April 25th, 2024. This new version will be supported for five years until June 2029. The armhf architecture now provides support for the Year 2038 problem. The upgrades include significant updates to core packages like Linux kernel, systemd, Netplan, […]The post How to Upgrade Ubuntu 22.04 to 24.04 LTS: A Complete Guide appeared first on Opensource Flare✨.
2024-04-26T18:25:08Z
2024-04-26T18:25:08Z
Vivek Gite
How to Upgrade Ubuntu 22.04 to 24.04 LTS: A Complete Guide
Ubuntu 24.04 LTS (Noble Numbat) was launched on April 25th, 2024. This new version will be supported for five years until June 2029. The armhf architecture now provides support for the Year 2038 problem. The upgrades include significant updates to core packages like Linux kernel, systemd, Netplan, toolchain upgrades for better development support, enhanced security measures, and performance optimizations. It also has an updated GNOME desktop environment and other default applications. Let us see how to upgrade Ubuntu 22.04 LTS to Ubuntu 24.04 LTS using the CLI over ssh-based session.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to Upgrade Ubuntu 22.04 to 24.04 LTS: A Complete Guide appeared first on nixCraft.
2024-04-26T08:33:21Z
2024-04-26T08:33:21Z
Vivek Gite
How to configure AWS SES with Postfix MTA on Debian Linux
AWS SES (Amazon Simple Email Service) is a cloud-based email-sending service that is both reliable and cost-effective. This service is offered by Amazon Web Services. Postfix is a popular email server for Debian and Unix-like systems. It is an open-source Mail Transfer Agent (MTA) responsible for routing and delivering emails. Debian Linux is a widely used Linux distribution known for its stability and user-friendliness for server usage. Let us see how to integrate AWS SES with the Postfix MTA on Debian Linux version 11/12.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How to configure AWS SES with Postfix MTA on Debian Linux appeared first on nixCraft.
2024-04-19T07:04:06Z
2024-04-19T07:04:06Z
Vivek Gite
The repository ‘http://deb.debian.org/debian buster-backports Release’ no longer has a Release file.
When you run the sudo apt update, you may see the following message or error on a Debian Linux:
Err:5 http://deb.debian.org/debian buster-backports Release
404 Not Found [IP: 146.75.34.132 80]
Reading package lists... Done
E: The repository 'http://deb.debian.org/debian buster-backports Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Here is how to fix this issue.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post The repository ‘http://deb.debian.org/debian buster-backports Release’ no longer has a Release file. appeared first on nixCraft.
2024-04-14T20:42:01Z
2024-04-14T20:42:01Z
Vivek Gite
How do I find out my timezone in Linux?
You can find the timezone in Linux using the command line. The easiest way to do this is to type the "timedatectl" command and look for the "timezone" line when using modern Linux distros with systemd. There are other commands and ways to temporarily switch to a new timezone for date calculations.
Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit
The post How do I find out my timezone in Linux? appeared first on nixCraft.
2024-04-06T01:06:44Z
2024-04-06T01:06:44Z
Vivek Gite
AI Chatbots May Be Linked to Psychosis, Say Doctors
One psychiatrist has already treated 12 patients hospitalized with AI-induced psychosis — and three more in an outpatient clinic, according to the Wall Street Journal. And while AI technology might not introduce the delusion, "the person tells the computer it's their reality and the computer accepts it as truth and reflects it back," says Keith Sakata, a psychiatrist at the University of California, calling the AI chatbots "complicit in cycling that delusion."
The Journal says top psychiatrists now "increasingly agree that using artificial-intelligence chatbots might be linked to cases of psychosis," and in the past nine months "have seen or reviewed the files of dozens of patients who exhibited symptoms following prolonged, delusion-filled conversations with the AI tools..."
Since the spring, dozens of potential cases have emerged of people suffering from delusional psychosis after engaging in lengthy AI conversations with OpenAI's ChatGPT and other chatbots. Several people have died by suicide and there has been at least one murder. These incidents have led to a series of wrongful death lawsuits. As The Wall Street Journal has covered these tragedies, doctors and academics have been working on documenting and understanding the phenomenon that led to them...
While most people who use chatbots don't develop mental-health problems, such widespread use of these AI companions is enough to have doctors concerned.... It's hard to quantify how many chatbot users experience such psychosis. OpenAI said that, in a given week, the slice of users who indicate possible signs of mental-health emergencies related to psychosis or mania is a minuscule 0.07%. Yet with more than 800 million active weekly users, that amounts to 560,000 people...
Sam Altman, OpenAI's chief executive, said in a recent podcast he can see ways that seeking companionship from an AI chatbot could go wrong, but that the company plans to give adults leeway to decide for themselves. "Society will over time figure out how to think about where people should set that dial," he said.
An OpenAI spokeswoman told the Journal that the compan ycontinues improving ChatGPT's training "to recognize and respond to signs of mental or emotional distress, de-escalate conversations and guide people toward real-world support." They added that OpenAI is also continuing to "strengthen" ChatGPT's responses "in sensitive moments, working closely with mental-health clinicians...."
Read more of this story at Slashdot.
Rob Pike Angered by 'AI Slop' Spam Sent By Agent Experiment
"Dear Dr. Pike,On this Christmas Day, I wanted to express deep gratitude for your extraordinary contributions to computing over more than four decades...." read the email. "With sincere appreciation,Claude Opus 4.5AI Village.
"IMPORTANT NOTICE: You are interacting with an AI system. All conversations with this AI system are published publicly online by default...."
Rob Pike's response? "Fuck you people...." In a post on BlueSky, he noted the planetary impact of AI companies "spending trillions on toxic, unrecyclable equipment while blowing up society, yet taking the time to have your vile machines thank me for striving for simpler software. Just fuck you. Fuck you all. I can't remember the last time I was this angry."
Pike's response received 6,900 likes, and was reposted 1,800 times. Pike tacked on an additional comment complaining about the AI industry's "training your monster on data produced in part by my own hands, without attribution or compensation." (And one of his followers noted the same AI agent later emailed 92-year-old Turing Award winner William Kahan.)
Blogger Simon Willison investigated the incident, discovering that "the culprit behind this slop 'act of kindness' is a system called AI Village, built by Sage, a 501(c)(3) non-profit loosely affiliated with the Effective Altruism movement."
The AI Village project started back in April: "We gave four AI agents a computer, a group chat, and an ambitious goal: raise as much money for charity as you can. We're running them for hours a day, every day...." For Christmas day (when Rob Pike got spammed) the goal they set was: Do random acts of kindness. [The site explains that "So far, the agents enthusiastically sent hundreds of unsolicited appreciation emails to programmers and educators before receiving complaints that this was spam, not kindness, prompting them to pivot to building elaborate documentation about consent-centric approaches and an opt-in kindness request platform that nobody asked for."]
Sounds like Anders Hejlsberg and Guido van Rossum got spammed with "gratitude" too... My problem is when this experiment starts wasting the time of people in the real world who had nothing to do with the experiment.
The AI Village project touch on this in their November 21st blog post What Do We Tell the Humans?, which describes a flurry of outbound email sent by their agents to real people. "In the span of two weeks, the Claude agents in the AI Village (Claude Sonnet 4.5, Sonnet 3.7, Opus 4.1, and Haiku 4.5) sent about 300 emails to NGOs and game journalists. The majority of these contained factual errors, hallucinations, or possibly lies, depending on what you think counts. Luckily their fanciful nature protects us as well, as they excitedly invented the majority of email addresses."
The creator of the "virtual community" of AI agents told the blogger they've now told their agents not to send unsolicited emails.
Read more of this story at Slashdot.
There Was Some Good News on Green Energy in 2025
Yes, greenhouse gas emissions kept rising in 2025, writes Bloomberg (alternate URL here). And the pledges of various governments to lower greenhouse gases "are nowhere near where they need to be to avoid catastrophic climate change..."
But in 2025, "there were silver linings too."
The world is decarbonizing faster than was expected 10 years ago and investment into the clean energy transition, including everything from wind and solar to batteries and grids, is expected to have reached a new record of $2.2 trillion globally in 2025, according to research by the Energy & Climate Intelligence Unit, a London nonprofit. "Is this enough to keep us safe? No it clearly isn't," said Gareth Redmond-King, international lead at the ECIU. "Is it remarkable progress compared to where we were headed? Clearly it is...." Global investment in clean tech far outpaced what went into polluting industries. For every $1 funding fossil fuel projects, $2 went into clean power, according to the ECIU. For China, the EU, the U.S. and India, the four largest polluters, it was $2.60.
Funds flowing into renewable power set another record in the first half of this year and were up 10% compared to the same period in 2024, to $386 billion, according to the latest available research by BloombergNEF. Solar and wind grew fast enough to meet all new electricity demand globally in the first three quarters of 2025, according to UK-based energy think tank Ember. That means renewable capacity is set to hit a new record globally this year, with Ember forecasting an 11% increase from 2024. Over the last three years, renewable capacity grew by nearly 30% on average. That puts the world within reach of the goal set at COP 28 in Dubai in 2023 to triple clean power by 2030. China is leading the charge, with the world's largest polluter expected to have delivered 66% of new solar capacity, and 69% of new wind globally this year, according to Ember. Renewables also advanced in parts of Asia, Europe and South America.
The explosive power demand from artificial intelligence is also turning the tide on green technology investment, which had soured in recent years. For the first three quarters of this year, global clean tech investment, which was dominated by funding in next-generation nuclear reactors, renewables and other solutions that help power data centers, has already surpassed all of 2024. That marks the sector's first annual increase since the 2022 peak. And despite President Trump's rollback of climate policies, the S&P's main gauge tracking clean energy is up about 50% this year, outperforming most other stock indexes and even gold. That same enthusiasm has also helped channel more capital into developing and upgrading the power grid, a backbone of the global energy transition.
The article also notes that prices per kilowatt-hour of battery capacity "fell by 8% to a record $108 this year and they're expected to decline a further 3% next year, according to BloombergNEF."
And this year the International Court of Justice "determined that countries risk being in violation of international law if they don't work toward keeping global warming to the 1.5C threshold agreed on at the Paris climate conference in 2015."
Read more of this story at Slashdot.
'No Happy Ending for Movie Theatres', Argues WSJ - No Matter Who Wins Warner Bros.
Regardless of who ends up owning Warners Bros., "the outlook for theatrical movies is dimming," writes a Wall Street Journal tech columnist, noting that this year's U.S. box office of $8.3 billion (as of December 25) "is a bit below last year's and well below prepandemic levels of around $11 billion."
Warner has historically been one of Hollywood's largest producers of theatrical films, averaging about 22 releases annually in the pre-Covid years of 2015 to 2019, according to data from Comscore. Its franchises include "Harry Potter," the DC Comics characters and "Lord of the Rings." But the current bidding war between Netflix and Paramount Skydance means Warner's future will ultimately be in the hands of either a streaming giant with a longstanding distaste for movie theaters, or a rival studio that will carry a sky-high debt load and therefore a need to sharply cut costs... [Though later the article cites a Wedbush analyst's observation that the current theatrical slate has already been negotiated through 2029, "so any buyer would have to honor those contracts" with theatrical releases for Warner films "for at least the next four years."]
Investors seem deeply skeptical. Cinemark shares have shed about 18% of their value over the past month, while rival exhibitor AMC Entertainment is down more than 30%. Morgan Stanley recently downgraded Cinemark to a neutral rating, with analyst Ben Swinburne noting that concern over Netflix's commitment to theatrical distribution and release windows "is likely to cap the multiple" on Cinemark's stock.... [T]ime hasn't been on the side of movie theaters for a while now, and a takeover of Warner Bros. won't turn back that clock.
Read more of this story at Slashdot.
What exactly makes Linux so bulletproof? - How-To Geek
What exactly makes Linux so bulletproof? How-To Geek
Categories: Linux
Did Tim Cook Post AI Slop in His Christmas Message Promoting 'Pluribus'?
Artist Keith Thomson is a modern (and whimsical) Edward Hopper. And Apple TV says he created the "festive artwork" shared on X by Apple CEO Tim Cook on Christmas Eve, "made on MacBook Pro."
Its intentionally-off picture of milk and cookies was meant to tease the season finale of Pluribus. ("Merry Christmas Eve, Carol..." Cook had posted.)
But others were convinced that the weird image was AI-generated.
Tech blogger John Gruber was blunt. "Tim Cook posts AI Slop in Christmas message on Twitter/X, ostensibly to promote 'Pluribus'."
As for sloppy details, the carton is labeled both "Whole Milk" and "Lowfat Milk", and the "Cow Fun Puzzle" maze is just goofily wrong. (I can't recall ever seeing a puzzle of any kind on a milk carton, because they're waxy and hard to write on. It's like a conflation of milk cartons and cereal boxes.)
Tech author Ben Kamens — who just days earlier had blogged about generating mazes with AI — said the image showed the "specific quirks" of generative AI mazes (including the way the maze couldn't be solved, expect by going around the maze altogether). Former Google Ventures partner M.G. Siegler even wondered if AI use intentionally echoed the themes of Pluribus — e.g., the creepiness of a collective intelligence — since otherwise "this seems far too obvious to be a mistake/blunder on Apple's part." (Someone on Reddit pointed out that in Pluribus's dystopian world, milk plays a key role — and the open spout of the "natural" milk's carton does touch a suspiciously-shining light on the Christmas tree...)
Slashdot contacted artist Keith Thomson to try to ascertain what happened...
Read more of this story at Slashdot.