Jsc: My New Best Friend
furbo.org
furbo.org
The most fun I've ever had programming was in max/msp
things that are difficult to do in code, processing multiple simultaneous signals is done visually, running lines between object, but when you do want to write code, you open a code window and write javascript, and can then run visual patch cables to your javascript code representing the inputs and outputs.
C:\Windows\System32\cscript.exe (https://en.wikipedia.org/wiki/Windows_Script_Host)
Which run a less modern version of ECMA script, but does have access to COM objects
The only thing installed on the remote system I was given access to via RDP was SAS whose macro facility tends to be cumbersome. Since the original CSV files were also stored on the same NAS, I asked if could have any programming language installed in my home directory (there was absolutely no way for me to upload anything, the system had no internet access other than to allow RDP, and I wasn't going to violate any rules.
The sysadmin head read BOFH for career development in the 90s, so, the answer was a solid no. I had to only use what was available on the system. The problem was simple: Each run took about two days: Start the thing at 7 am one day so you can hope to have the results before 4 pm two days later kind of thing. That's when I remembered `cscript`.
Using that, built a "thing" that orchestrated the copying of data in 100 GB chunks to `%TEMP%` which was still on the precious 256 GB SSD :-), launching multiple jobs etc. Task manager screenshots: https://www.nu42.com/2013/12/happiness-is-making-most-out-of...
In less than a week, jobs were running in four hours. sysadmin remained happily oblivious. Had to explain what I had done to the rest of the group.
Yes, this is not as useful as people think it is. In real life, it ends up kneecapping productivity while enabling checkbox driven security.
Regardless, it was also part of the contract that one was not allowed to upload/download or use copy&paste.
I did point out they had forgotten to explicitly prohibit setting up a camera pointed at the screen, but the humor was not appreciated.
echo "something in turkish" | LC_ALL=tr_TR tr "[:lower:]" "[:upper:]"Kapı açık -> KAPı AçıK
However this worked: gawk '{ print toupper($0) }'
https://unix.stackexchange.com/questions/554901/how-to-chang...
It's not like it's the only scripting language available either, OSX comes with ruby, python2, python3 and perl by default.
Fairly niche, but not useless
I could also imagine some sort of Electron-alternative using the builtin JS interpreter for system stuff alongside the builtin webview for the UI
Except when Apple decides to remove it from the default setup.
% which perl
/usr/bin/perl
% which python2
/usr/bin/python2
% which python3
/usr/bin/python3
% which ruby
/usr/bin/ruby gjs -c "(() => print('hello'))()" jrunscript
jjs
Both invoke the nashorn javascript engine.https://www.oracle.com/java/technologies/java-se-support-roa...
Shops that care about LTS should be on 11 instead of clinging their teeth on 8.
It is nice to have basic JS functionality on the terminal without installing node, but it has fairly limited functionality