pyinfra turns Python code into shell commands and runs them on your servers. Execute ad-hoc commands and write declarative operations. Target SSH servers, local machine and Docker containers. Fast and scales from one server to thousands.
We just released Execa 9, which is our biggest release so far.
If you're currently using Execa, you should check out the new features! Also, if you're currently using zx or Bun shell, you might be interesting in this alternative.
#Shell sold millions of 'phantom' #CarbonCredits to Canadian oil sands firms - FT
"Shell sold millions of carbon credits tied to CO2 removal that never took place to #Canada's largest oil sands companies, Financial Times reported Sunday, raising new doubts about a technology seen as important in reducing greenhouse gas emissions."
here's a tip if a command is taking a long time and you want a notification when it's done:
^Z fg; notify-send 'done'
pressing Ctrl-Z in a terminal emulator will pause the current running command. running "fg" will resume it in the foreground, but returning to the shell has the added benefit of allowing you to queue up multiple commands in a single line (technically you can do this by blindly typing the command while something else is running (as long as that command doesn't read from stdin), but i think this is more elegant.
notify-send is from libnotify, it allows sending a desktop notification from the command line.
PFA, Denmark’s 🇩🇰 biggest pension fund, has revealed it has divested its entire holding in #Shell, citing recent disappointment with the #oilandgas giant’s climate stance https://buff.ly/44mGPWU
After a while trying to understand if either ksh or zsh provided a way to prevent taking strings and undefined variables as 0 when doing arithmetic evaluation, there seems to be no feature specifically for it, sadly.
Closest is using set -o nounset (ksh) and setopt no_unset (zsh) to prevent undefined variables from evaluating to zero. If a "string" contains only numbers, a dot and whitespace, it will be treated as a number. Also, if it only contains the name of any other variable and whitespace, it evaluates to that.
Not that I expected shell languages to provide accurate arithmetic.
As a bonus though, it was cool learning about ksh's compound variables, force_float option and especially discipline functions.
I can finally say I’ve upgraded successfully to #Fedora40. It was not without hassle this time and it started with what seemed to be a system that did not even give me a prompt after #rebooting, although the update process had seemed to go smoothly and quickly. Luckily, the virtual screens were working and so I could #login to a #shell. Although #sddm didn’t seem to be working, #kdm was and so I was able to open a desktop session, but only in #Gnome
Hey fediverses, is there any good online shell scripting primer for non-programmers? Something like "automate your stuff with unix" or so, ideally focused on the methodology rather than gory details of shell scripting. #unix#shell#programming#learning
A one-liner for exporting your Conda environments for re-creation on another machine… but you might want to have a look at whether you actually need to recreate those environments.
for envs in $(conda env list | egrep -v "^#" | awk '{print $1}'); do echo "Exporting environment: $envs"; conda activate $envs; conda env export --no-builds | egrep -v "^prefix" > "$envs.yaml"; conda deactivate $envs; done; ls -l *.yaml
reading the tzselect shell script from the tzdata, there is a nice flag called -c to specify coordinates, the way the script does gps coordinates to timezones in awk is pretty impressive!
so if you travel a lot and have no idea where you are located and want to set your timezone quite easily you can do something like this to approximately know where you are (it's useless i know, just interesting):
"The Dutch Senate on Tuesday approved a law to permanently close the #Groningen gas field, following the government's promise that production will never be resumed to limit seismic risks in the region.
"Gas profits have delivered an estimated 363 billion euros ($385 billion) to the Dutch treasury since production started in the 1960s, while #Shell and #Exxon's profit from #Groningen was around 66 billion euros during that period."
Gas brought the Dutch a higher living standard, financed the Delta Works coastal storm barrier, and made the #Netherlands a poster child for Dutch disease (unlike Norway, they spent it all).