Skip to main content

Posts

Showing posts with the label scripting

A script to announce new chat messages in Zoom

Available at https://github.com/hmijail/announce-zoom-chat-messages . It's so disheartening to see AppleScript to stay so ... unloved. It was never easy to deal with it, enough so that I decided this time to force myself to get into the newish JavaScript syntax. And yes, that eases the syntax; but the whole ecosystem feels so devolved since the last time I used it. Even Apple's own Accessibility Inspector has lost capabilities. osacompile works but the resulting app does something different. I didn't try looking for new Scripting Additions, and in fact it wasn't needed; good old System Events was enough. But, gosh... even Smile was last released on 2013 . I wonder how would I do something like this announcer without AppleScript. What do Windows users do? Well, who cares for Windows ;P, what do Linux users do? Maybe next time I'll have to research it.

User-site-installed python packages, and PATH modification

Python makes it apparently easy to install packages. Just use pip , or any of the other more-or-less old and deprecated ways to install them, right? (heh) The first difficulty is that maybe your system's Python needs sudo to install those packages, and you don't want (or even can't) use it. The definitive solution is to use virtual environments, but that can feel like going too far in the "local" direction. You might just want to have something at the user level, without having the risks of using sudo , but still global for everything that the user does. Well, turns out that PEP 370 allows you to have user-local installs of packages. You're supposed to run pip --user install whatever . But now you have to remember to always use the --user flag! Kinda breaks the purpose of having something "global for everything that the user does".

List the DTrace providers in your machine

I don't see any official way to list the DTrace providers; you can seemingly only list ALL the probes, the >300K of them (in my Mac right now), and then you have to deal with the multitude of providers instantiated multiple times for different PIDs. So here's a small AWK script to list the unique providers, how many instances of each are there, and how many providers are attached to each PID:

6 tips to survive Codility tests

Well, it happened. When applying for a job, I got sent to a Codility test. And even though I already had some good practice with them, I managed to do badly in stupid ways – ways that 2 years ago I had already identified and even taken notes on. Just, in the heat of the moment I forgot about those rules of thumb. And in fact I think these hints should be given by Codility themselves – because otherwise you are practically ambushed, even more so if you didn't take the time to thoroughly explore how they work. So here are my hints-to-self, now for everyone. The summary is: don't think of Codility as a coding interview; this is primarily about getting something (anything!) working, ASAP.

Custom software for interfacing via USB with multimeters UNI-T UT81B

These multimeters are rather pocket oscilloscopes. Quite an interesting package. And the possibility of interfacing via USB with a computer should multiply the possibilities. Alas, the included software could hardly be crappier. (why do so many manufacturers do something justifiably interesting and then neuter it by blowing up what should be a minor part of the whole?)

Semi-automating piece-wise translating texts through Google Translate

I am having to translate a horribly old program (1992?, DOS' Turbo Pascal)… and in german, to make it funnier… to an only-slightly-less-horribly-old environment (Delphi 4, circa 1999). To think that I was complaining about how outdated Borland's C++ Builder 5 felt… oh my. I guess/hope/fear that later there will be a more modern target. But that will be easy, given that by then I should understand everything and the program itself is not complicated.