Curl is a command-line tool used to transfer data to and from servers. It supports various protocols including HTTP, HTTPS, FTP, SFTP, and many more. The tool can be used to download files, upload files, make requests to APIs, and more. In this article, we will explore the different options available in Curl and understand how to use them with examples.
How to Install Curl in Linux
Curl is…
Handy way to create zip archives from Windows' command-line
Handy way to create zip archives from Windows’ command-line
Here is a downloadable (< 1 Kb) Visual Basic script that leverages Windows 7+ built-in Cscript to allow you to create compressed zip format archives from the commandline. The readme.txt file included in the download explains the script's usage. Handy if you do much at the command-line, which I do. If not, just stick with 7zip.
Some code I've been meaning to perfect, but don't have the energy to.
I know this is a very sharp departure from what I used to post. I haven't had the energy to take them for a while; plus I'm fat now. Sorry about that. There was a good time when my boobs were big and the belly not as round -- more like triple-stacked -- but come on. We don't post nipples on this site.
I also didn't have enough energy to follow through on many of my things. A lot of them are still VERY USEFUL things to me at least, but everything's just too much of a drain. There's a possibility of someone also finding these things useful, so I figured a blog post will help make them somewhat findable with a search engine.
Well, I suppose GitHub pages would be a better place. But I've already got kind of a blog here...
Windows argument passing in node and cygwin
Python plistlib for openstep formats
Windows argument passing
The thing about command-line on Windows is that it's the wild west. Programs do not actually receive an argv[] array like you have been conditioned by C to believe; instead they get a "cmdline" string to do whatever the hell they want with it.
Still, in that sea of insanity, there is one constant. Regular programmers are lazy. They just use whatever the runtime library does with the command line. In these cases you get a somewhat predictable behavior -- "somewhat", because even amount Microsoft runtimes the behavior differs -- and you can write some sort of an escaping function.
Beyond the runtime, cmd.exe also has its own understanding of how quoting works. Most disgustingly, it understands where double-quoted parts start and end differently from msvcrt. I've got a trick for that.
Node
The node PR, at https://github.com/nodejs/node/pull/29576, is focused on quoting. It's got proper quoting for bash, pwsh, and cmd + msvcrt. It's got very strong test cases (throw them at other people's things: they might break!) and good documentation. What it didn't have is communication and rizz. You're advised to skip to the "files changed" tab.
The cmd "trick" is explained at https://github.com/Artoria2e5/node/blob/c0a6aff35cd3ff6d3bd0e3687776158e97466c93/lib/child_process.js#L850. The gist is that msvcrt and .NET treats two double-quotes as if it's an escaped double-quote. It's undocumented, sure, but Microsoft's own code relies on it.
doc/api/child_process.md has a good chunk of text explaining how Windows cmdline works and who deviates from the norm. And that leads to our next suspect: Cygwin.
Cygwin
Cygwin is the way to run POSIX things on Windows these days. Sure there's MSYS2, but guess what? It's a Cygwin fork. If you are using the official Windows build of git, you're using MSYS2, which in turn means you're using Cygwin code.
Cygwin is not msvcrt, obviously. But what's less obvious is that it doesn't process cmdline the same way. That bites you HARD when you want to run a Cygwin program on a file with weird characters.
The patchset at https://github.com/mirror/newlib-cygwin/pull/5, formerly a botched e-mail exchange ending with me being too tired to split the patchset (come on, it's almost impossible to have intermediate stages that build, let alone work!), was my answer to the problem. It rewrites the cmdline parser to be msvcrt-compatible, while still keeping the Unix-style globbing and @-expansion features.
It's fucking awesome is what it was. It's written in C++ with in-place processing. What else can you ask for.
Oh, in case you want to know what my current answer to the problem is: roll into a ball and cry.
Openstep plistlib
So if you use an Apple product and do things that Apple don't really like you to do, you have probably came across a "plist". Nowadays plists are either an opaque binary file or a very wordy XML. Back in the good old days plists were not like that at all: they read more like JSON, except they only supported strings and dicts.
Python's plistlib does not care about the old style. It should, because it's fucking beautiful. It's also as functional as the new stuff is, as long as you use the GNUStep extensions.
I wrote a Python package to do just that (or did I? does it work yet?). https://github.com/Artoria2e5/text-plistlib As far as I can recall it works on a round-trip smoke test, but some extension decisions needed to be hammered out. It uses tatsu though, so there's no chance of getting into the plistlib part of the standard library.
I think I've also got some other things related to this plist format open somewhere. I wanted to write a parser for opencore to cut down on this XML misery, but COME ON IT'S C. I can't even keep track of a plain recursive descent parser in Python (why else am I using a parser generator?), to do it in C? No way. I'm also too lazy to learn yacc, thank you very much.
Other things
something about https://marc.info/?l=openssh-unix-dev&m=168509072920594&w=2
Dream the DRM receiver/broadcaster has bad Opus options. Dev said I should open a branch. I think I can't, because I can't even get the official binary to run. I also lost my slightly illegal SDR kit.