Shirish Agarwal: Debian on Phone
. The system talks about a back key but what back key I have no clue.
I've been using Borg backup for a couple of years and it has
seemingly worked very well for me. One difference I really appreciate from my
previous arrangement (rdiff-backup) is the freedom to move large
files or file hierarchies around (including between different filesystems)
without provoking large backup incrementals.
About a week ago I had my first real problem with Borg: backups started to
fail with the following complaints:
Creating archive at "/backup/borg:: hostname -home-jon- now:%Y-%m-%dT%H:%M:%S.%f "
segment 61916 not found, but listed in compaction data
[ further, similar lines ]
Local Exception
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4690, in main
exit_code = archiver.run(args)
File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4622, in run
return set_ec(func(args))
File "/usr/lib/python3/dist-packages/borg/archiver.py", line 177, in wrapper
return method(self, args, repository=repository, **kwargs)
File "/usr/lib/python3/dist-packages/borg/archiver.py", line 595, in do_create
create_inner(archive, cache)
File "/usr/lib/python3/dist-packages/borg/archiver.py", line 560, in create_inner
archive.save(comment=args.comment, timestamp=args.timestamp)
File "/usr/lib/python3/dist-packages/borg/archive.py", line 530, in save
self.repository.commit()
File "/usr/lib/python3/dist-packages/borg/repository.py", line 475, in commit
self.compact_segments()
File "/usr/lib/python3/dist-packages/borg/repository.py", line 835, in compact_segments
assert segments[segment] == 0, 'Corrupted segment reference count - corrupted index or hints'
AssertionError: Corrupted segment reference count - corrupted index or hints
At about the same time I had managed to fill the backup host's root filesystem.
I thought the two issues must be related. Although all the files Borg is
backing up, and the backup repository it writes to, are located on different
partitions, Borg's client-side of things does maintain some caching in
/root/.cache/borg. My first idea was that this must have been corrupted by
an aborted write, but zapping it did not cure the above problem.
It occurred to me that I run Borg via the convenience wrapper Borgmatic, and
it was possible that was failing, but after a short investigation I ruled
that out.
Various attempts at running borg check or borg check --repair didn't help
either. The underlying filesystem (XFS) passed a filesystem check. There wasn't
any obvious complaints about IO errors from the kernel or anything reported in
the HDD's SMART data.
What did work, in the end, was removing the file matching $BORG_REPO/*hint*
and trying again. Although this is read/written to on the backup partition, it
seems filling the root partition caused Borg (1.1.16-3) to corrupt that file.
Everything seems fine following that. I have recently started trying to semi-
automatically verify backups on a monthly basis, on a machine independent from
the NAS; all the tests I have written so far passed.
Haskell is a pure and lazy programming language, and the laziness allows us to write some algorithms very elegantly, by recursively referring to already calculated values. A typical example is the following definition of the Fibonacci numbers, as an infinite stream:
import qualified Data.Set as S import qualified Data.Map as M type Graph = M.Map Int [Int] transitive1 :: Graph -> Graph transitive1 g = M.map S.toList sets where sets :: M.Map Int (S.Set Int) sets = M.mapWithKey (\v vs -> S.insert v (S.unions [ sets M.! v' v' <- vs ])) g
sets recursively: The set of reachable vertices from a vertex v is v itself, plus those reachable by its successors vs, for which we query sets.
And, despite this apparent self-referential recursion, it works!
transitive2 :: Graph -> Graph transitive2 g = M.fromList [ (v, S.toList (go S.empty [v])) v <- M.keys g ] where go :: S.Set Int -> [Int] -> S.Set Int go seen [] = seen go seen (v:vs) v S.member seen = go seen vs go seen (v:vs) = go (S.insert v seen) (g M.! v ++ vs)
seen/todo recursion idiom so often in the past, I can almost write it blindly And indeed, this code handles cyclic graphs just fine:
ghci> transitive2 $ M.fromList [(1,[2,3]),(2,[1,3]),(3,[])]
fromList [(1,[1,2,3]),(2,[1,2,3]),(3,[3])]
But this is a bit anticlimactic Haskell is supposed to be a declarative language, and transitive1 declares my intent just fine!
transitive1, and still get the right result in all cases, and I have just published a possible implementation as rec-def. In the module Data.Recursive.Set we find an API that resembles that of Set, with a type RSet a, and in addition to conversion functions from and to sets, we find the two operations that we needed in transitive1:
insert :: Ord a => a -> RSet a -> RSet a
unions :: Ord a => [RSet a] -> RSet a
get :: RSet a -> Set aimport qualified Data.Recursive.Set as RS transitive2 :: Graph -> Graph transitive2 g = M.map (S.toList . RS.get) sets where sets :: M.Map Int (RS.RSet Int) sets = M.mapWithKey (\v vs -> RS.insert v (RS.unions [ sets M.! v' v' <- vs ])) g
ghci> transitive2 $ M.fromList [(1,[3]),(2,[1,3]),(3,[])]
fromList [(1,[1,3]),(2,[1,2,3]),(3,[3])]
ghci> transitive2 $ M.fromList [(1,[2,3]),(2,[1,3]),(3,[])]
fromList [(1,[1,2,3]),(2,[1,2,3]),(3,[3])]
To show off some more, here are small examples:
ghci> let s = RS.insert 42 s in RS.get s
fromList [42]
ghci> :
let s1 = RS.insert 23 s2
s2 = RS.insert 42 s1
in RS.get s1
:
fromList [23,42]
RSet a type will be the topic of a future blog post; let me just briefly mention that it uses unsafe features under the hood, and just keeps applying the equations you gave until a fixed-point is reached. Because it starts with the empty set and all operations provided by Data.Recursive.Set are monotonous (e.g. no difference) it will eventually find the least fixed point.
Data.Recursive.Set is itself nicely safe, and does not destroy Haskell s nice properties like purity, referential transparency and equational reasoning. If you disagree, I d like to hear about it (here, on Twitter, Reddit or Discourse)! There is a brief discussion at the end of the tutorial in Data.Recursive.Example.
Data.Recursive.Bool for recursive equations with booleans (preferring False) and Data.Recursive.DualBool (preferring True), and some operations like member :: Ord a => a -> RSet a -> RBool can actually connect different types. I plan to add other data types (natural numbers, maps, Maybe, with suitable orders) as demand arises and as I come across nice small example use-cases for the documentation (e.g. finding shortest paths in a graph).
I believe this idiom is practically useful in a wide range of applications (which of course all have some underlying graph structure but then almost everything in Computer Science is a graph). My original motivation was a program analysis. Imagine you want to find out from where in your program you can run into a division by zero. As long as your program does not have recursion, you can simply keep track of a boolean flag while you traverse the program, keeping track a mapping from function names to whether they can divide by zero all nice and elegant. But once you allow mutually recursive functions, things become tricky. Unless you use RBool! Simply use laziness, pass the analysis result down when analyzing the function s right-hand sides, and it just works!
And before anybody comments, I know that Android is no longer interested in supporting FOSS, their loss, not ours but that is entirely a blog post/article in itself. so let s leave that aside for now.
nncp-xfer -rx to process incoming packets from the USB (or other media) device. This moves them into the NNCP inbound queue, deleting them from the media device, and verifies the packet integrity.nncp-ack -node $NODE to create ACK packets responding to the packets we just loaded into the rx queue. It writes a list of generated ACKs onto fd 4, which we save off for later use.nncp-toss -seen to process the incoming queue. The use of -seen causes NNCP to remember the hashes of packets seen before, so a duplicate of an already-seen packet will not be processed twice. This command also processes incoming ACKs for packets we ve sent out previously; if they pass verification, the relevant packets are removed from the local machine s tx queue.nncp-xfer -keep -tx -mkdir -node $NODE to send outgoing packets to a given node by writing them to a given directory on the media device. -keep causes them to remain in the outgoing queue.nncp-rm -node $NODE -pkt < $FILE to remove those specific packets from the outbound queue. The reason is that there will never be an ACK of ACK packet (that would create an infinite loop), so if we don t delete them in this manner, they would hang around forever.nncp-toss, there is a chance of a race condition between steps 1 and 2 (if nncp-toss gets to it first, it might not get an ack generated). This would sort itself out eventually, presumably, as the sender would retransmit and it would be ACKed later.
#!/bin/bash
set -eo pipefail
MEDIABASE="/media/$USER"
# The local node name
NODENAME=" hostname "
# All nodes. NODENAME should be in this list.
ALLNODES="node1 node2 node3"
RUNNNCP=""
# If you need to sudo, use something like RUNNNCP="sudo -Hu nncp"
NNCPPATH="/usr/local/nncp/bin"
ACKPATH=" mktemp -d "
# Process incoming packets.
#
# Parameters: $1 - the path to scan. Must contain a directory
# named "nncp".
procrxpath ()
while [ -n "$1" ]; do
BASEPATH="$1/nncp"
shift
if ! [ -d "$BASEPATH" ]; then
echo "$BASEPATH doesn't exist; skipping"
continue
fi
echo " *** Incoming: processing $BASEPATH"
TMPDIR=" mktemp -d "
# This rsync and the one below can help with
# certain permission issues from weird foreign
# media. You could just eliminate it and
# always use $BASEPATH instead of $TMPDIR below.
rsync -rt "$BASEPATH/" "$TMPDIR/"
# You may need these next two lines if using sudo as above.
# chgrp -R nncp "$TMPDIR"
# chmod -R g+rwX "$TMPDIR"
echo " Running nncp-xfer -rx"
$RUNNNCP $NNCPPATH/nncp-xfer -progress -rx "$TMPDIR"
for NODE in $ALLNODES; do
if [ "$NODE" != "$NODENAME" ]; then
echo " Running nncp-ack for $NODE"
# Now, we generate ACK packets for each node we will
# process. nncp-ack writes a list of the created
# ACK packets to fd 4. We'll use them later.
# If using sudo, add -C 5 after $RUNNNCP.
$RUNNNCP $NNCPPATH/nncp-ack -progress -node "$NODE" \
4>> "$ACKPATH/$NODE"
fi
done
rsync --delete -rt "$TMPDIR/" "$BASEPATH/"
rm -fr "$TMPDIR"
done
proctxpath ()
while [ -n "$1" ]; do
BASEPATH="$1/nncp"
shift
if ! [ -d "$BASEPATH" ]; then
echo "$BASEPATH doesn't exist; skipping"
continue
fi
echo " *** Outgoing: processing $BASEPATH"
TMPDIR=" mktemp -d "
rsync -rt "$BASEPATH/" "$TMPDIR/"
# You may need these two lines if using sudo:
# chgrp -R nncp "$TMPDIR"
# chmod -R g+rwX "$TMPDIR"
for DESTHOST in $ALLNODES; do
if [ "$DESTHOST" = "$NODENAME" ]; then
continue
fi
# Copy outgoing packets to this node, but keep them in the outgoing
# queue with -keep.
$RUNNNCP $NNCPPATH/nncp-xfer -keep -tx -mkdir -node "$DESTHOST" -progress "$TMPDIR"
# Here is the key: that list of ACK packets we made above - now we delete them.
# There will never be an ACK for an ACK, so they'd keep sending forever
# if we didn't do this.
if [ -f "$ACKPATH/$DESTHOST" ]; then
echo "nncp-rm for node $DESTHOST"
$RUNNNCP $NNCPPATH/nncp-rm -debug -node "$DESTHOST" -pkt < "$ACKPATH/$DESTHOST"
fi
done
rsync --delete -rt "$TMPDIR/" "$BASEPATH/"
rm -rf "$TMPDIR"
# We only want to write stuff once.
return 0
done
procrxpath "$MEDIABASE"/*
echo " *** Initial tossing..."
# We make sure to use -seen to rule out duplicates.
$RUNNNCP $NNCPPATH/nncp-toss -progress -seen
proctxpath "$MEDIABASE"/*
echo "You can unmount devices now."
echo "Done."
kubeadm install.
| AWS | OpenShift | OpenShift upstream project |
|---|---|---|
| Cloud Trail | Kubernetes API Server audit log | Kubernetes |
| Cloud Watch | OpenShift Monitoring | Prometheus |
| AWS Artifact | Compliance Operator | OpenSCAP |
| AWS Trusted Advisor | Insights | |
| AWS Marketplace | OpenShift Operator Hub | |
| AWS Identity and Access Management (IAM) | Red Hat SSO | Keycloack |
| AWS Elastisc Beanstalk | OpenShift Source2Image (S2I) | Source2Image (S2I) |
| AWS S3 | ODF Rados Gateway | Rook RGW |
| AWS Elastic Bloc Storage | ODF Rados Block Device | Rook RBD |
| AWS Elastic File System | ODF Ceph FS | Rook CephFS |
| Amazon Simple Notification Service | OpenShift Streams for Apache Kafka | Apache Kafka |
| Amazon Guard Duty | API Server audit log review, ACS Runtime detection | Stackrox |
| Amazon Inspector | Quay.io container scanner, ACS Vulnerability Assessment | Clair, Stackrox |
| AWS Lambda | Openshift Serverless* |
Knative |
| AWS Key Management System | could be done with Hashicorp Vault | Vault |
| AWS WAF | NGINX Ingress Controller Operator with ModSecurity | NGINX ModSecurity |
| Amazon Elasticache | Redis Enterprise Operator | Redis, memcached as alternative |
| AWS Relational Database Service | Crunchy Data Operator | PostgreSQL |
* OpenShift Serverless requires the application to be packaged as a container, something AWS Lamda does not require.
Mahendra, Akshat, Shirish and Sagar Sukhose (Mangesh s friend) at Bal Gandharva..
Electric scooter as shared by Akshat seen in Albania
Somebody making a real-life replica of Wall Street on F.C. Road (Commercial, all glass)
Ganesh Idol near my house
Wearing new clothes

CONNECT 2400. Now your computer was bridged to the other; anything going out your serial port was encoded as sound by your modem and decoded at the other end, and vice-versa.
But what, exactly, was the other end?
It might have been another person at their computer. Turn on local echo, and you can see what they did. Maybe you d send files to each other. But in my case, the answer was different: PC Magazine.
71510,1421. CompuServe had forums, and files. Eventually I would use TapCIS to queue up things I wanted to do offline, to minimize phone usage online.
CompuServe eventually added a gateway to the Internet. For the sum of somewhere around $1 a message, you could send or receive an email from someone with an Internet email address! I remember the thrill of one time, as a kid of probably 11 years, sending a message to one of the editors of PC Magazine and getting a kind, if brief, reply back!
But inevitably I had
complete.org, as well. At the time, the process was a bit lengthy and involved downloading a text file form, filling it out in a precise way, sending it to InterNIC, and probably mailing them a check. Well I did that, and in September of 1995, complete.org became mine. I set up sendmail on my local system, as well as INN to handle the limited Usenet newsfeed I requested from the ISP. I even ran Majordomo to host some mailing lists, including some that were surprisingly high-traffic for a few-times-a-day long-distance modem UUCP link!
The modem client programs for FreeBSD were somewhat less advanced than for OS/2, but I believe I wound up using Minicom or Seyon to continue to dial out to BBSs and, I believe, continue to use Learning Link. So all the while I was setting up my local BBS, I continued to have access to the text Internet, consisting of chiefly Gopher for me.
The seventeenth release of littler as a CRAN package just landed, following in the now sixteen year history (!!) as a package started by Jeff in 2006, and joined by me a few weeks later.
littler is the first command-line interface for R as it predates Rscript. It allows for piping as well for shebang scripting via #!, uses command-line arguments more consistently and still starts faster. It also always loaded the methods package which Rscript only started to do in recent years.
littler lives on Linux and Unix, has its difficulties on macOS due to yet-another-braindeadedness there (who ever thought case-insensitive filesystems as a default were a good idea?) and simply does not exist on Windows (yet the build system could be extended see RInside for an existence proof, and volunteers are welcome!). See the FAQ vignette on how to add it to your PATH. A few examples are highlighted at the Github repo, as well as in the examples vignette.
This release, the first since last December, further extends install2.r accept multiple repos options thanks to Tatsuya Shima, overhauls and substantially extends installBioc.r thanks to Pieter Moris, and includes a number of (generally smaller) changes I added (see below).
The full change description follows.
My CRANberries service provides a comparison to the previous release. Full details for the littler release are provided as usual at the ChangeLog page, and also on the package docs website. The code is available via the GitHub repo, from tarballs and now of course also from its CRAN page and viaChanges in littler version 0.3.16 (2022-08-28)
- Changes in package
- The
configurecode checks for two more headers- The RNG seeding matches the current version in R (Dirk)
- Changes in examples
- A
cowu.r'check Window UCRT' helper was added (Dirk)- A
getPandoc.rdownloader has been added (Dirk)- The
-roption tpinstall2.rhas been generalzed (Tatsuya Shima in #95)- The
rcc.rcode / package checker now hasvalgrindoption (Dirk)install2.rnow installs to first element in.libPaths()by default (Dirk)- A very simple
r2u.rhelp has been added (Dirk)- The
installBioc.rhas been generalized and extended similar toinstall2.r(Pieter Moris in #103)
install.packages("littler"). Binary packages are available directly in Debian as well as soon via Ubuntu binaries at CRAN thanks to the tireless Michael Rutter.
Comments and suggestions are welcome at the GitHub repo.
If you like this or other open-source work I do, you can now sponsor me at GitHub.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Under Canadian Radio-television and Telecommunications Commission (CRTC) rules in place since 2017, telecom networks are supposed to ensure that cellphones are able to contact 911 even if they do not have service.I could personally confirm that my phone couldn't reach 911 services, because all calls would fail: the problem was that towers were still up, so your phone wouldn't fall back to alternative service providers (which could have resolved the issue). I can only speculate as to why Rogers didn't take cell phone towers out of the network to let phones work properly for 911 service, but it seems like a dangerous game to play. Hilariously, the CRTC itself didn't have a reliable phone service due to the service outage:
Please note that our phone lines are affected by the Rogers network outage. Our website is still available: https://crtc.gc.ca/eng/contact/https://mobile.twitter.com/CRTCeng/status/1545421218534359041 I wonder if they will file a complaint against Rogers themselves about this. I probably should. It seems the federal government is thinking more of the same medicine will fix the problem and has told companies should "help" each other in an emergency. I doubt this will fix anything, and could actually make things worse if the competitors actually interoperate more, as it could cause multi-provider, cascading failures.
He pulls from Ethan Zuckerman s idea of a web that is plural in purpose that just as pool halls, libraries and churches each have different norms, purposes and designs, so too should different places on the internet. To achieve this, Tarnoff wants governments to pass laws that would make the big platforms unprofitable and, in their place, fund small-scale, local experiments in social media design. Instead of having platforms ruled by engagement-maximizing algorithms, Tarnoff imagines public platforms run by local librarians that include content from public media.(Links mine: the Washington Post obviously prefers to not link to the real web, and instead doesn't link to Zuckerman's site all and suggests Amazon for the book, in a cynical example.) And in another example of how the private sector has failed us, there was recently a fluke in the AMBER alert system where the entire province was warned about a loose shooter in Saint-Elz ar except the people in the town, because they have spotty cell phone coverage. In other words, millions of people received a strongly toned, "life-threatening", alert for a city sometimes hours away, except the people most vulnerable to the alert. Not missing a beat, the CAQ party is promising more of the same medicine again and giving more money to telcos to fix the problem, suggesting to spend three billion dollars in private infrastructure.
My youngest has a cute little wooden Rocket puzzle, made by a French company
called Janod.
Sadly, at some point, we lost the nose cone part, so I designed and printed a
replacement.
It's substantially based on one module from an OpenSCAD "Nose Cone Library" by
Garrett
Goss,
which he kindly released to the public domain.
I embellished the cone with a top pointy bit and a rounded brim. I also
hollowed out the bottom to make space for a magnet. Originally I designed an
offset-from-centre slot for the magnet, the idea being, you would insert the
magnet off-centre and it would slot into position and be partly held in by the
offset, and you could then stick a blob of glue or similar to finish the job.
Unfortunately I had a layer shift during the print, so that didn't work. I
reamed out a small alcove instead. The white trim is adapted from the lid from
some kitchen herbs, trimmed back. I secured the magnet and glued the lid over
the bottom.
Here it is: rocket.scad. My contributions are under the terms
of Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA
4.0).
dmesg or lsusb). Two months
later, the laptop short-circuits and completely dies. And here goes
another RMA, this time without a shipping label or cross shipping, so
I had to pay shipping fees.
Now the third laptop in as many years is as good as dead. The left
hinge basically broke off. Earlier this year, I had noticed something
was off with the lid: it was wobbly. I figured that it was just the
way that laptop was, "they don't make it as sturdy as they did in the
good old days, do they". But it was probably a signal of some much
worse problem. Eventually, the bottom panel actually cracked open, and
I realized that some internal mechanism had basically exploded.
The hinges of the Librem are screwed into little golden sprockets that
are fitted in plastic shims of the laptop casing. The shims had
exploded: after opening the back lid, they litterally fell off
(alongside the tiny golden sprocket). Support confirmed that I needed
a case replacement, but unfortunately they were "out of stock" of
replacement cases for the Librem 13, and have been for a while. I am
13 on the waiting list, apparently.
So this laptop is basically dead for me right now: it's my travel
laptop. It's primary purpose is to sit at home until I go to a
conference or a meeting or a cafe or upstairs or wherever to do some
work. I take the laptop, pop the lid, tap-tap some work, close the
lid. Had I used that laptop as my primary device, I would probably have
closed and opened that lid thousands of times. But because it's a
travel laptop, that number is probably in the hundreds, which means
this laptop is not designed to withstand prolonged use.
I have now ordered a framework laptop, 12th generation. I have
some questions about their compatibility with Debian (and Linux in
general), and concerns about power usage, but it certainly can't be
worse than the Purism, in any case. And it can only get better over
time: the main board is fully replaceable, and they have replacement
hinges on stock, although the laptop itself is currently in pre-order
(slated for September). I will probably post a full review when I
actually lay my hand on this device.
In the meantime, I strongly discourage anyone from buying Purism
products, as I previously
did. You can the full
maintenance history of the laptop in the review
page as well.
After I wrote hledger, I got some good feedback, both from a friend
in-person and also on Twitter.
My in-person friend asked, frankly, do I really try to manage money like
this: tracking every single expense? Which affirms my suspicion, that many
people don't, and that it perhaps isn't essential to do so.
Combined with the details below, 3/4 of the way through my experiment with
using hledger, I'm not convinced that it has been a good idea.
I'm quoting my Twitter feedback here in order to respond. The context is
handling when I have used the "wrong" card to pay for something: a card
affiliated with my family expenses for something personal, or vice versa. With
double-entry book-keeping, and one pair of transactions, the destination
account can either record the expense category:
2022-08-20 coffee
family:liabilities:creditcard -3
jon:expenses:coffee 3
or the fact it was paid for on the wrong card
2022-08-20 coffee
family:liabilities:creditcard -3
family:liabilities:jon 3 ; jon owes family
but not easily both.
https://twitter.com/pranesh/status/1516819846431789058:
When you accidentally use the family CV for personal expenses, credit the account "family:liabilities:creditcard:jon" instead of "family:liabilities:creditcard". That'll allow you to track w/ 2 postings.This is an interesting idea: create a sub-account underneath the credit card, and I would have a separate balance representing the money I owed. Before:
$ hledger bal -t
-3 family:liabilities:creditcard
3 jon:expenses:coffee
transaction
2022-08-20 coffee
family:liabilities:creditcard:jon -3
jon:expenses:coffee 3
Corresponding balances
$ hledger bal -t
-3 family:liabilities:creditcard
-3 jon
3 jon:expenses:coffee
Great. However, what process would clear the balance on that sub-account? In
practice, I don't make a separate, explicit payment to the credit card from
my personal accounts. It's paid off in full by direct debit from the family
shared account. In practice, such dues are accumulated and settled with one
off bank transfers, now and then.
Since the sub-account is still part of the credit card heirarchy, I can't
just use a set of virtual postings to consolidate that value with other
liabilities, or cover it. Any transaction in there which did not correspond
to a real transaction on the credit card would make the balance drift away
from the real-word credit statements. The only way I could see this working
would be if the direct debit that settles the credit card was artificially
split to clear the sub-account, and then the amount owed would be lost.
https://twitter.com/pranesh/status/1516819846431789058:
Else, add: family:assets:receivable:jon $3A "receivable" account would function like the "dues" accounts I described in hledger (except "receivable" is an established account type in double-entry book-keeping). Here I think Pranesh is proposing using these two accounts in addition to the others on a posting. E.g.
jon:liabilities:family:cc $-3
2022-08-20 coffee
family:liabilities:creditcard -3
jon:expenses:coffee 3
family:assets:receivable:jon 3
jon:liabilities:family -3
This balances, and we end up with two other accounts, which are tracking the
exact same thing. I only owe 3, but if you didn't know that the accounts were
"views" onto the same thing, you could mistakenly think I owed 6.
I can't see the advantage of this over just using a virtual, unbalanced posting.
Dues, Liabilities
I'd invented accounts called "dues" to track moneys owed. The more correct
term for this in accounting parlance would be "accounts receivable", as in
one of the examples above. I could instead be tracking moneys due; this is
a classic liability. Liabilities have negative balances.
jon:liabilities:family -3
This means, I owe the family 3.
Liability accounts like that are identical to "dues" accounts. A positive
balance in a Liability is a counter-intuitive way of describing moneys owed
to me, rather than by me. And, reviewing a lot of the coding I did this year,
I've got myself hopelessly confused with the signs, and made lots of errors.
Crucially, double-entry has not protected me from making those mistakes:
of course, I'm circumventing it by using unbalanced virtual postings in many
cases (although I was not consistent in where I did this), but even if I used
a pair of accounts as in the last example above, I could still screw it up.
Two years ago I blogged a photo of my study. I'd been planning
to revisit that for a while but I'd been somewhat embarrassed by the state of
it, but I've finally decided to bite the bullet.
What's changed
The supposedly-temporary 4x4 KALLAX has become a permanent feature. I managed
to wedge it on the right-hand side far wall, next to the bookcase. They fit
snugly together. Since I'd put my turntable on top, I've now dedicated the top
row of four spaces to 12" records. (There's a close-up pic here).
My hi-fi speakers used to be in odd places: they're now on my desktop. Also on
my desktop: a camera, repurposed as a webcam, and a 90s old Creative Labs beige
microphone; both to support video conferencing.
The desktop is otherwise, largely unchanged. My Amiga 500 and Synthesiser had
continued to live there until very recently when I had an accident with a pot of
tea. I'm in two minds as to whether I'll bring them back: having the desk clear
is quite nice.
There's a lot of transient stuff and rubbish to sort out: the bookcase visible
on the left, the big one behind my chair on the right (itself to get rid of); and
the collection of stuff on the floor. Sadly, the study is the only room in our
house where things like this can be collected prior to disposal: it's disruptive,
but less so than if we stuffed them in a bedroom.
You can't easily see the "temporary" storage unit for Printer(s) that used to be
between bookcases on the right-hand wall. It's still there, situated behind my
desk chair. I did finally get rid of the deprecated printer (and I plan to change
the HP laser too, although that's a longer story). The NAS, I have recently moved
to the bottom-right Kallax cube, and that seems to work well. There's really no
other space in the Study for the printer.
Also not pictured: a much improved ceiling light.
What would I like to improve
First and foremost, get rid of all the transient stuff! It's a simple matter of
not putting the time in to sort it out
If I manage that, I've been trying to think about how to best organise material
relating to ongoing projects. Some time ago I salivated over this home office
tour for an embedded
developer.
Jay has an interesting project tray system. I'm thinking of developing something
like that, with trays or boxes I can store in the Kallax to my right.
I'd love to put a comfortable reading chair, perhaps a wing-backed thing, and a
reading light, over on the left-hand side near the window. And/or, a bench at a
height enabling me to do the occasional bit of standing work, and/or to support
the Alesis Micron (or a small digital Piano).
prefork-interp, I found the result very straightforward to deploy.
prefork-interp
prefork-interp is a small C program which wraps a script, plus a scripting language library to cooperate with the wrapper program. Together they achieve the following:
#! line.prefork-interp.AF_UNIX socket (hopefully in /run/user/UID, but in ~ if not) for rendezvous. We can try to connect without locking, but we must protect the socket with a separate lockfile to avoid two concurrent restart attempts.
We want stderr from the script setup (pre-initialisation) to be delivered to the caller, so the script ought to inherit our stderr and then will need to replace it later. Twice, in fact, because the daemonic server process can t have a stderr.
When a script is restarted for any reason, any old socket will be removed. We want the old server process to detect that and quit. (If hung about, it would wait for the idle timeout; if this happened a lot - eg, a constantly changing set of services - we might end up running out of pids or something.) Spotting the socket disappearing, without polling, involves use of a library capable of using inotify (or the equivalent elsewhere). Choosing a C library to do this is not so hard, but portable interfaces to this functionality can be hard to find in scripting languages, and also we don t want every language binding to have to reimplement these checks. So for this purpose there s a little watcher process, and associated IPC.
When an invoking instance of prefork-interp is killed, we must arrange for the executing service instance to stop reading from its stdin (and, ideally, writing its stdout). Otherwise it s stealing input from prefork-interp s successors (maybe the user s shell)!
Cleanup ought not to depend on positive actions by failing processes, so each element of the system has to detect failures of its peers by means such as EOF on sockets/pipes.
Obtaining prefork-interp
I put this new tool in my chiark-utils package, which is a collection of useful miscellany. It s available from git.
Currently I make releases by uploading to Debian, where prefork-interp has just hit Debian unstable, in chiark-utils 7.0.0.
Support for other scripting languages
I would love Python to be supported. If any pythonistas reading this think you might like to help out, please get in touch. The specification for the protocol, and what the script library needs to do, is documented in the source code
Future plans for chiark-utils
chiark-utils as a whole is in need of some tidying up of its build system and packaging.
I intend to try to do some reorganisation. Currently I think it would be better to organising the source tree more strictly with a directory for each included facility, rather than grouping compiled and scripts together.
The Debian binary packages should be reorganised more fully according to their dependencies, so that installing a program will ensure that it works.
I should probably move the official git repo from my own git+gitweb to a forge (so we can have MRs and issues and so on).
And there should be a lot more testing, including Debian autopkgtests.
edited 2022-08-23 10:30 +01:00 to improve the formattingNext.