by grumpy-cowboy · 6y ago · 0 comments
- Tabular data : TSV (almost all Un*x/GNU tools handle this out of the box)
- Simple "records" : GNU Recutils format (https://www.gnu.org/software/recutils/)
- Formatted texts : Markdown, LaTeX, ...
- ...
If I need some hierarchical kind of information, I use a folder structure to handle this.I know that not everything can be stored as text. But I try to use open, well documented and future proof formats. Examples:
- Images : PNG
- Music : FLAC, Ogg, ...
- If I really need to preserve orignal format/design of a web page: PDF
Nothing's perfect but stay away from any closed/obscure/proprietary formats.And of course interacting with those files using the vast ecosystem of countless simple commandline tools and using the same efficient text editor to edit almost all of my documents makes the whole thing a much better experience than all alternatives - at least when text is viable; imho diagrams etc. are still too cumbersome compared to a quick free-hand sketch.
Unless Apple and Microsoft decide that the ability to view and manage files directly is too confusing and dangerous for users and removes your ability to have portable raw text files.
And then all the HN users rejoice about how much simpler life has become when they let tech companies make choices for them and how files were never that good anyway.
Wow thanks for this recommendation. I've got a few things lying around that I've been using awk/bash for and where even sqlite is overkill but it looks like this solves the same issues in a much better and more concise way. I might try converting these this afternoon. Can't wait to give the csv conversion a try too.
I think PDF is complicated, though. (However, there are simpler subsets defined which omit some complicated stuff.) (If you really need to store the contents of a page, PNG might do.)
The SQLite version 3 database format is also unlikely to change I think and it is documented. (SQLite is also in the public domain, which also helps. You can avoid WAL and that other stuff if you want to ensure working in future, I suppose.) (If it does change a lot, probably it won't be called version 3, any more, I think.)
I agree, SQLite will live forever, thanks to its public domain status.
* http://jdebp.uk./Softwares/nosh/guide/commands/console-flat-...
> by no means a format for the long term.
I would take that bet :)
Is this an acceptable case of non-text format? And if it is, what makes it different?
Practically speaking, I'm fine with a constraint where the systemd database format + tools need to be roughly kept in sync. I can't think of a realistic example where this wouldn't be the case. Most of the logs in this database are supposed to be ephemeral.
If you're in banking or medicine or something and are required to keep certain logs for a decade+, you should figure out what you actually want to keep and put it in a format that would be reasonable to access on that kind of timeline.
That can only happen in practice if you take the logger and tools from the same group of developers. Yet another case of forced lock-in from Systemd.
[1] https://www.freedesktop.org/wiki/Software/systemd/export
The premise is that somehow binary logs buys you something. Either more precise data or faster access or something else.
Truth is, it could all have been done in ascii and it would have been more portable, accessible and resilient to failure.
To answer your question, I thought and still think it was a bad choice. The only time I would ever be interested in the contents are during early-boot failures, exactly the time when the toolset is limited and most folks aren't familiar with what's available - exactly when simple text is easiest to work with without finding another machine to stare at the `journalctl` man page.
The rationalization about detecting record corruption makes very little sense to me. (Now, there is a valid concern about potential log forgery, enabled by poorly written apps that directly log user input without sanitation. But that's better mitigated in the buggy app, which almost certainly is doing other unsafe things with user input. And if that were actually the concern, they had other choices that would have been far less annoying.)
I'd love to use CherryTree[1] because it supports encryption and is more functional, but it stores everything in a single XML/SQLite file. Neither Zim or CherryTree[1] have mobile apps.
I really tried to use Joplin[2], which saves markdown too and has mobile apps, but the desktop app is huge. I prefer to use those resources for Keybase.