Posts

Backing up my JDBC Crux: is this it?

If you inspect the JDBC database backing a Crux install, you will find it contains only one table – tx_events. Don’t be alarmed; it seems this really does contain the information that constitutes the document database so pg_dump will do its job. See Crux Zulip Thread

Google stuff breaking: setOnLoadCallback

I just had yet another case of stuff I am responsible to maintain breaking because of Google. My long-standing program has run with the following code: google.setOnLoadCallback(function() { /* ... */ }); This has worked for a decade, but finally it seems to have broken. Fortunately, I already had a suspicion that it was a google thing breaking on me as this has happened before. While I am not part of whatever update list is warning about these upcoming changes, they were at least decent enough to tell me that I need to load() charts first.

Debug Cron

Suddenly Cron wasn’t running my mail script; I verified that the script itself was still working, so than I began the venture into the unknown: how to debug Cron? Serverfault has a good answer. Everything seemed to checkout, and I verified that it was working to write to a tmp file. The file was being written. Finally, by removing the line that smothers output to /dev/null I was able to find the problem: the need for an absolute path name (as evidently the Cron user couldn’t run getmail without a full path).

User chattr to safeguard a file from erroneous updates

On Linux you can make files unalterable to anyone – including system processes. In particulary this helps me when my system keeps deleting my getmail program (which isn’t from a repo) with every system update. Make files immutable Make it immutable, so it cannot be changed or removed (preserving the fix I’ve made for the mistyping in mime subclasses) sudo chattr -V +i /usr/local/bin/getmail This makes it immutable. Check which attribute flags are at work on files See what attribute flags (like “immutable”) attributes:

Adding Custom Transit Handlers to re-frame-http-fx AJAX requests

Setting the Scene Transit is a seamless alternative to JSON (actually an extension of JSON). Why use Transit when JSON is so prevalent? For me, the simple reason was that it allows me to preserve my data types (mine are Clojure, but they are not necessarily such) over the wire. For me in particular this was my time types, and my uuids (which I wanted to standardize so they stop alternating between UUIDs, strings, and keywords, for matching purposes).

Org view html

I export to HTML fairly often with orgmode. In this case “export and open” resulting in viewing the code is almost never what I want; it would be much more useful like the export pdf option, which doesn’t view to the LaTeX code but right to the PDF. Answer As per https://emacs.stackexchange.com/questions/2387/browser-not-opening-when-exporting-html-from-org-mode A setting change fixed this. M-x customize-variable org-file-apps and for files of type \\.x?html?\\' I specified firefox %s. Now it does what I want.

Easy d3 tooltips in Clojure reagent

Working with d3js I found myself in need of a tooltip to explicate data as it is explored in a chart. The best way to use d3 with Reagent (react.js) is to use reagent to handle the DOM manipulations and d3 to handle more elaborate visualizaion calculations. We don’t follow the d3 model of adding an event to every dom element to trigger a tooltip item to be created, which duplication would behave poorly with React state maintenance.

orgmode auto-update todo-count

I have an orgmode item that looks like this: ** STARTED [#A] Planning, Emails & Social [48/56] <2020-03-23 Mon 08:15-09:00 +1d> This item is a target for my capture-from-email, so TODO items are constantly added beneath. The result is that the count always end up as [0/0] in my agenda until I manually visit the headline and do a C-c # to update it to the proper count; I’m not sure why this is, but I would love to fix it somehow.

Improving my elisp by building an API to my YOURLS shortener

Until recently I was well-served by now-derelict url-shortener which worked well. It’s a cool library – very general, supporting a variety of shortening options. But when it broke, it was annoyingly complex to fix. Plus, I needed the excuse to sharpen my elisp skills a bit. The result is below. I learned a lot of good things (big thanks to the Reddit emacs community), including: Using defcustom to create customs groups for use in emacs’ nice customization tooling Utilizing url-build-query-string to build my… well, you know.

gmail pop3 suddenly broken for getmail

For years I’ve been using pop3 to collect my gmails, without problem. However, since yesterday it is failing. I use getmail and have made no changes since originally getting it working. When I use getmail -vvv I get the following error: Retrieval error: server for SimplePOP3SSLRetriever:recent:«myaddress>@gmail.com@pop.gmail.com:995 is broken; offered message GmailId1718e4039279f0fe but failed to provide it. Please notify the administrator of the server. Skipping message… I don’t see any notification of recent changes, but my mail client is devoid of gmail functionality now.