1 <?xml version=
"1.0" encoding=
"utf-8"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/' xmlns:
atom=
"http://www.w3.org/2005/Atom">
4 <title>Petter Reinholdtsen
</title>
5 <description></description>
6 <link>https://people.skolelinux.org/pere/blog/
</link>
7 <atom:link href=
"https://people.skolelinux.org/pere/blog/index.rss" rel=
"self" type=
"application/rss+xml" />
10 <title>45 orphaned Debian packages moved to git,
391 to go
</title>
11 <link>https://people.skolelinux.org/pere/blog/
45_orphaned_Debian_packages_moved_to_git__391_to_go.html
</link>
12 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/
45_orphaned_Debian_packages_moved_to_git__391_to_go.html
</guid>
13 <pubDate>Thu,
25 Apr
2024 22:
00:
00 +
0200</pubDate>
14 <description><p
>Nine days ago, I started migrating orphaned Debian packages with no
15 version control system listed in debian/control of the source to git.
16 At the time there were
438 such packages. Now there are
391,
17 according to the UDD. In reality it is slightly less, as there is a
18 delay between uploads and UDD updates. In the nine days since, I have
19 thus been able to work my way through ten percent of the packages. I
20 am starting to run out of steam, and hope someone else will also help
21 brushing some dust of these packages. Here is a recipe how to do it.
23 I start by picking a random package by querying the UDD for a list of
24 10 random packages from the set of remaining packages:
26 <blockquote
><pre
>
27 PGPASSWORD=
"udd-mirror
" psql --port=
5432 --host=udd-mirror.debian.net \
28 --username=udd-mirror udd -c
"select source from sources \
29 where release =
'sid
' and (vcs_url ilike
'%anonscm.debian.org%
' \
30 OR vcs_browser ilike
'%anonscm.debian.org%
' or vcs_url IS NULL \
31 OR vcs_browser IS NULL) AND maintainer ilike
'%packages@qa.debian.org%
' \
32 order by random() limit
10;
"
33 </pre
></blockquote
>
35 <p
>Next, I visit http://salsa.debian.org/debian and search for the
36 package name, to ensure no git repository already exist. If it does,
37 I clone it and try to get it to an uploadable state, and add the Vcs-*
38 entries in d/control to make the repository more widely known. These
39 packages are a minority, so I will not cover that use case here.
</p
>
41 <p
>For packages without an existing git repository, I run the
42 following script
<tt
>debian-snap-to-salsa
</tt
> to prepare a git
43 repository with the existing packaging.
</p
>
45 <blockquote
><pre
>
48 # See also https://bugs.debian.org/
804722#
31
52 # Move to this Standards-Version.
57 if [ -z
"$PKG
" ]; then
58 echo
"usage: $
0 <pkgname
>"
62 if [ -e
"${PKG}-salsa
" ]; then
63 echo
"error: ${PKG}-salsa already exist, aborting.
"
67 if [ -z
"ALLOWFAILURE
" ] ; then
71 # Fetch every snapshotted source package. Manually loop until all
72 # transfers succeed, as
'gbp import-dscs --debsnap
' do not fail on
74 until debsnap --force -v $PKG || $ALLOWFAILURE ; do sleep
1; done
75 mkdir ${PKG}-salsa; cd ${PKG}-salsa
78 # Specify branches to override any debian/gbp.conf file present in the
80 gbp import-dscs --debian-branch=master --upstream-branch=upstream \
81 --pristine-tar ../source-$PKG/*.dsc
83 # Add Vcs pointing to Salsa Debian project (must be manually created
85 if ! grep -q ^Vcs- debian/control ; then
86 awk
"BEGIN { s=
1 } /^\$/ { if (s==
1) { print \
"Vcs-Browser: https://salsa.debian.org/debian/$PKG\
"; print \
"Vcs-Git: https://salsa.debian.org/debian/$PKG.git\
" }; s=
0 } { print }
" < debian/control
> debian/control.new
&& mv debian/control.new debian/control
87 git commit -m
"Updated vcs in d/control to Salsa.
" debian/control
90 # Tell gbp to enforce the use of pristine-tar.
91 inifile +inifile debian/gbp.conf +create +section DEFAULT +key pristine-tar +value True
92 git add debian/gbp.conf
93 git commit -m
"Added d/gbp.conf to enforce the use of pristine-tar.
" debian/gbp.conf
95 # Update to latest Standards-Version.
96 SV=
"$(grep ^Standards-Version: debian/control|awk
'{print $
2}
')
"
97 if [ $SV_LATEST != $SV ]; then
98 sed -i
"s/\(Standards-Version: \)\(.*\)/\
1$SV_LATEST/
" debian/control
99 git commit -m
"Updated Standards-Version from $SV to $SV_LATEST.
" debian/control
102 if grep -q pkg-config debian/control; then
103 sed -i s/pkg-config/pkgconf/ debian/control
104 git commit -m
"Replaced obsolete pkg-config build dependency with pkgconf.
" debian/control
107 if grep -q libncurses5-dev debian/control; then
108 sed -i s/libncurses5-dev/libncurses-dev/ debian/control
109 git commit -m
"Replaced obsolete libncurses5-dev build dependency with libncurses-dev.
" debian/control
111 </pre
></blockquote
>
113 Some times the debsnap script fail to download some of the versions.
114 In those cases I investigate, and if I decide the failing versions
115 will not be missed, I call it using ALLOWFAILURE=true to ignore the
116 problem and create the git repository anyway.
</p
>
118 <p
>With the git repository in place, I do a test build (gbp
119 buildpackage) to ensure the build is actually working. If it does not
120 I pick a different package, or if the build failure is trivial to fix,
121 I fix it before continuing. At this stage I revisit
122 http://salsa.debian.org/debian and create the project under this group
123 for the package. I then follow the instructions to publish the local
124 git repository. Here is from a recent example:
</p
>
126 <blockquote
><pre
>
127 git remote add origin git@salsa.debian.org:debian/perl-byacc.git
128 git push --set-upstream origin master upstream pristine-tar
130 </pre
></blockquote
>
132 <p
>With a working build, I have a look at the build rules if I want to
133 remove some more dust. I normally try to move to debhelper compat
134 level
13, which involves removing debian/compat and modifying
135 debian/control to build depend on debhelper-compat (=
13). I also test
136 with
'Rules-Requires-Root: no
' in debian/control and verify in
137 debian/rules that hardening is enabled, and include all of these if
138 the package still build. If it fail to build with level
13, I try
139 with
12,
11,
10 and so on until I find a level where it build, as I do
140 not want to spend a lot of time fixing build issues.
</p
>
142 <p
>Some times, when I feel inspired, I make sure debian/copyright is
143 converted to the machine readable format, often by starting with
144 'debhelper -cc
' and then cleaning up the autogenerated content until
145 it matches realities. If I feel like it, I might also clean up
146 non-dh-based debian/rules files to use the short style dh build
149 <p
>Once I have removed all the dust I care to process for the package,
150 I run
'gbp dch
' to generate a debian/changelog entry based on the
151 commits done so far, run
'dch -r
' to switch from
'UNRELEASED
' to
152 'unstable
' and get an editor to make sure the
'QA upload
' marker is in
153 place and that all long commit descriptions are wrapped into sensible
154 lengths, run
'debcommit --release -a
' to commit and tag the new
155 debian/changelog entry, run
'debuild -S
' to build a source only
156 package, and
'dput ../perl-byacc_2.0-
10_source.changes
' to do the
157 upload. During the entire process, and many times per step, I run
158 'debuild
' to verify the changes done still work. I also some times
159 verify the set of built files using
'find debian
' to see if I can spot
160 any problems (like no file in usr/bin any more or empty package). I
161 also try to fix all lintian issues reported at the end of each
162 'debuild
' run.
</p
>
164 <p
>If I find Debian specific patches, I try to ensure their metadata
165 is fairly up to date and some times I even try to reach out to
166 upstream, to make the upstream project aware of the patches. Most of
167 my emails bounce, so the success rate is low. For projects with no
168 Homepage entry in debian/control I try to track down one, and for
169 packages with no debian/watch file I try to create one. But at least
170 for some of the packages I have been unable to find a functioning
171 upstream, and must skip both of these.
</p
>
173 <p
>If I could handle ten percent in nine days, twenty people could
174 complete the rest in less then five days. I use approximately twenty
175 minutes per package, when I have twenty minutes spare time to spend.
176 Perhaps you got twenty minutes to spare too?
</p
>
178 <p
>As usual, if you use Bitcoin and want to show your support of my
179 activities, please send Bitcoin donations to my address
180 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
182 <p
><strong
>Update
2024-
05-
04:
</strong
> There is
183 <a href=
"https://people.skolelinux.org/pere/blog/images/
2024-
05-
04-debian-snap-to-salsa.sh
">an
184 updated edition of my migration script
</a
>, last updated
185 2024-
05-
04.
</p
>
190 <title>RAID status from LSI Megaraid controllers in Debian
</title>
191 <link>https://people.skolelinux.org/pere/blog/RAID_status_from_LSI_Megaraid_controllers_in_Debian.html
</link>
192 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/RAID_status_from_LSI_Megaraid_controllers_in_Debian.html
</guid>
193 <pubDate>Wed,
17 Apr
2024 17:
00:
00 +
0200</pubDate>
194 <description><p
>I am happy to report that
195 <a href=
"https://github.com/namiltd/megactl
">the megactl package
</a
>,
196 useful to fetch RAID status when using the LSI Megaraid controller,
197 now is available in Debian. It passed NEW a few days ago, and is now
198 <a href=
"https://tracker.debian.org/pkg/megactl
">available in
199 unstable
</a
>, and probably showing up in testing in a weeks time. The
200 new version should provide Appstream hardware mapping and should
201 integrate nicely with isenkram.
</p
>
203 <p
>As usual, if you use Bitcoin and want to show your support of my
204 activities, please send Bitcoin donations to my address
205 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
211 <title>Time to move orphaned Debian packages to git
</title>
212 <link>https://people.skolelinux.org/pere/blog/Time_to_move_orphaned_Debian_packages_to_git.html
</link>
213 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/Time_to_move_orphaned_Debian_packages_to_git.html
</guid>
214 <pubDate>Sun,
14 Apr
2024 09:
30:
00 +
0200</pubDate>
215 <description><p
>There are several packages in Debian without a associated git
216 repository with the packaging history. This is unfortunate and it
217 would be nice if more of these would do so. Quote a lot of these are
218 without a maintainer, ie listed as maintained by the
219 '<a href=
"https://qa.debian.org/developer.php?email=packages%
40qa.debian.org
">Debian
220 QA Group
</a
>' place holder. In fact,
438 packages have this property
221 according to UDD (
<tt
>SELECT source FROM sources WHERE release =
'sid
'
222 AND (vcs_url ilike
'%anonscm.debian.org%
' OR vcs_browser ilike
223 '%anonscm.debian.org%
' or vcs_url IS NULL OR vcs_browser IS NULL) AND
224 maintainer ilike
'%packages@qa.debian.org%
';
</tt
>). Such packages can
225 be updated without much coordination by any Debian developer, as they
226 are considered orphaned.
</p
>
228 <p
>To try to improve the situation and reduce the number of packages
229 without associated git repository, I started a few days ago to search
230 out candiates and provide them with a git repository under the
231 'debian
' collaborative Salsa project. I started with the packages
232 pointing to obsolete Alioth git repositories, and am now working my
233 way across the ones completely without git references. In addition to
234 updating the Vcs-* debian/control fields, I try to update
235 Standards-Version, debhelper compat level, simplify d/rules, switch to
236 Rules-Requires-Root: no and fix lintian issues reported. I only
237 implement those that are trivial to fix, to avoid spending too much
238 time on each orphaned package. So far my experience is that it take
239 aproximately
20 minutes to convert a package without any git
240 references, and a lot more for packages with existing git repositories
241 incompatible with git-buildpackages.
</p
>
243 <p
>So far I have converted
10 packages, and I will keep going until I
244 run out of steam. As should be clear from the numbers, there is
245 enough packages remaining for more people to do the same without
246 stepping on each others toes. I find it useful to start by searching
247 for a git repo already on salsa, as I find that some times a git repo
248 has already been created, but no new version is uploaded to Debian
249 yet. In those cases I start with the existing git repository. I
250 convert to the git-buildpackage+pristine-tar workflow, and ensure a
251 debian/gbp.conf file with
"pristine-tar=True
" is added early, to avoid
252 uploading a orig.tar.gz with the wrong checksum by mistake. Did that
253 three times in the begin before I remembered my mistake.
</p
>
255 <p
>So, if you are a Debian Developer and got some spare time, perhaps
256 considering migrating some orphaned packages to git?
</p
>
258 <p
>As usual, if you use Bitcoin and want to show your support of my
259 activities, please send Bitcoin donations to my address
260 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
265 <title>Plain text accounting file from your bitcoin transactions
</title>
266 <link>https://people.skolelinux.org/pere/blog/Plain_text_accounting_file_from_your_bitcoin_transactions.html
</link>
267 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/Plain_text_accounting_file_from_your_bitcoin_transactions.html
</guid>
268 <pubDate>Thu,
7 Mar
2024 18:
00:
00 +
0100</pubDate>
269 <description><p
>A while back I wrote a small script to extract the Bitcoin
270 transactions in a wallet in the
271 <ahref=
"https://plaintextaccounting.org/
">ledger plain text accounting
272 format
</a
>. The last few days I spent some time to get it working
273 better with more special cases. In case it can be useful for others,
274 here is a copy:
</p
>
276 <p
><blockquote
><pre
>
278 # -*- coding: utf-
8 -*-
279 # Copyright (c)
2023-
2024 Petter Reinholdtsen
281 from decimal import Decimal
288 def format_float(num):
289 return numpy.format_float_positional(num, trim=
'-
')
292 u
'amount
' :
'Assets:BTC:main
',
296 '<some address
>' :
'Assets:bankkonto
',
297 '<some address
>' :
'Assets:bankkonto
',
301 proc = subprocess.Popen(cmd,stdout=subprocess.PIPE)
302 j = json.loads(proc.communicate()[
0], parse_float=Decimal)
306 # get all transactions for all accounts / addresses
311 cmd = [
'bitcoin-cli
',
'listtransactions
',
'*
', str(limit)]
313 txs.extend(exec_json(cmd))
315 # Useful for debugging
316 with open(
'transactions.json
') as f:
317 txs.extend(json.load(f, parse_float=Decimal))
319 for tx in sorted(txs, key=lambda a: a[
'time
']):
320 # print tx[
'category
']
321 if
'abandoned
' in tx and tx[
'abandoned
']:
323 if
'confirmations
' in tx and
0 >= tx[
'confirmations
']:
325 when = time.strftime(
'%Y-%m-%d %H:%M
', time.localtime(tx[
'time
']))
326 if
'message
' in tx:
327 desc = tx[
'message
']
328 elif
'comment
' in tx:
329 desc = tx[
'comment
']
330 elif
'label
' in tx:
331 desc = tx[
'label
']
334 print(
"%s %s
" % (when, desc))
335 if
'address
' in tx:
336 print(
" ; to bitcoin address %s
" % tx[
'address
'])
338 print(
" ; missing address in transaction, txid=%s
" % tx[
'txid
'])
339 print(f
" ; amount={tx[
'amount
']}
")
340 if
'fee
'in tx:
341 print(f
" ; fee={tx[
'fee
']}
")
342 for f in accounts.keys():
343 if f in tx and Decimal(
0) != tx[f]:
345 print(
" %-
20s %s BTC
" % (accounts[f], format_float(amount)))
346 if
'fee
' in tx and Decimal(
0) != tx[
'fee
']:
347 # Make sure to list fee used in several transactions only once.
348 if
'fee
' in tx and tx[
'txid
'] in txidfee \
349 and tx[
'fee
'] == txidfee[tx[
'txid
']]:
352 fee = tx[
'fee
']
353 print(
" %-
20s %s BTC
" % (accounts[
'amount
'], format_float(fee)))
354 print(
" %-
20s %s BTC
" % (
'Expences:BTC-fee
', format_float(-fee)))
355 txidfee[tx[
'txid
']] = tx[
'fee
']
357 if
'address
' in tx and tx[
'address
'] in addresses:
358 print(
" %s
" % addresses[tx[
'address
']])
360 if
'generate
' == tx[
'category
']:
361 print(
" Income:BTC-mining
")
363 if amount
< Decimal(
0):
364 print(f
" Assets:unknown:sent:update-script-addr-{tx[
'address
']}
")
366 print(f
" Assets:unknown:received:update-script-addr-{tx[
'address
']}
")
370 print(
"# Found %d transactions
" % c)
372 print(f
"# Warning: Limit {limit} reached, consider increasing limit.
")
378 </pre
></blockquote
></p
>
380 <p
>It is more of a proof of concept, and I do not expect it to handle
381 all edge cases, but it worked for me, and perhaps you can find it
382 useful too.
</p
>
384 <p
>To get a more interesting result, it is useful to map accounts sent
385 to or received from to accounting accounts, using the
386 <tt
>addresses
</tt
> hash. As these will be very context dependent, I
387 leave out my list to allow each user to fill out their own list of
388 accounts. Out of the box,
'ledger reg BTC:main
' should be able to
389 show the amount of BTCs present in the wallet at any given time in the
390 past. For other and more valuable analysis, a account plan need to be
391 set up in the
<tt
>addresses
</tt
> hash. Here is an example
392 transaction:
</p
>
394 <p
><blockquote
><pre
>
395 2024-
03-
07 17:
00 Donated to good cause
396 Assets:BTC:main -
0.1 BTC
397 Assets:BTC:main -
0.00001 BTC
398 Expences:BTC-fee
0.00001 BTC
399 Expences:donations
0.1 BTC
400 </pre
></blockquote
></p
>
402 <p
>It need a running Bitcoin Core daemon running, as it connect to it
403 using
<tt
>bitcoin-cli listtransactions *
100000</tt
> to extract the
404 transactions listed in the Wallet.
</p
>
406 <p
>As usual, if you use Bitcoin and want to show your support of my
407 activities, please send Bitcoin donations to my address
408 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
413 <title>RAID status from LSI Megaraid controllers using free software
</title>
414 <link>https://people.skolelinux.org/pere/blog/RAID_status_from_LSI_Megaraid_controllers_using_free_software.html
</link>
415 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/RAID_status_from_LSI_Megaraid_controllers_using_free_software.html
</guid>
416 <pubDate>Sun,
3 Mar
2024 22:
40:
00 +
0100</pubDate>
417 <description><p
>The last few days I have revisited RAID setup using the LSI
418 Megaraid controller. These are a family of controllers called PERC by
419 Dell, and is present in several old PowerEdge servers, and I recently
420 got my hands on one of these. I had forgotten how to handle this RAID
421 controller in Debian, so I had to take a peek in the
422 <a href=
"https://wiki.debian.org/LinuxRaidForAdmins
">Debian wiki page
423 "Linux and Hardware RAID: an administrator
's summary
"</a
> to remember
424 what kind of software is available to configure and monitor the disks
425 and controller. I prefer Free Software alternatives to proprietary
426 tools, as the later tend to fall into disarray once the manufacturer
427 loose interest, and often do not work with newer Linux Distributions.
428 Sadly there is no free software tool to configure the RAID setup, only
429 to monitor it. RAID can provide improved reliability and resilience in
430 a storage solution, but only if it is being regularly checked and any
431 broken disks are being replaced in time. I thus want to ensure some
432 automatic monitoring is available.
</p
>
434 <p
>In the discovery process, I came across a old free software tool to
435 monitor PERC2, PERC3, PERC4 and PERC5 controllers, which to my
436 surprise is not present in debian. To help change that I created a
437 <a href=
"https://bugs.debian.org/
1065322">request for packaging of the
438 megactl package
</a
>, and tried to track down a usable version.
439 <a href=
"https://sourceforge.net/p/megactl/
">The original project
440 site
</a
> is on Sourceforge, but as far as I can tell that project has
441 been dead for more than
15 years. I managed to find a
442 <a href=
"https://github.com/hmage/megactl
">more recent fork on
443 github
</a
> from user hmage, but it is unclear to me if this is still
444 being maintained. It has not seen much improvements since
2016. A
445 <a href=
"https://github.com/namiltd/megactl
">more up to date
446 edition
</a
> is a git fork from the original github fork by user
447 namiltd, and this newer fork seem a lot more promising. The owner of
448 this github repository has replied to change proposals within hours,
449 and had already added some improvements and support for more hardware.
450 Sadly he is reluctant to commit to maintaining the tool and stated in
451 <a href=
"https://github.com/namiltd/megactl/pull/
1">my first pull
452 request
</A
> that he think a new release should be made based on the
453 git repository owned by hmage. I perfectly understand this
454 reluctance, as I feel the same about maintaining yet another package
455 in Debian when I barely have time to take care of the ones I already
456 maintain, but do not really have high hopes that hmage will have time
457 to spend on it and hope namiltd will change his mind.
</p
>
459 <p
>In any case, I created
460 <a href=
"https://salsa.debian.org/debian/megactl
">a draft package
</a
>
461 based on the namiltd edition and put it under the debian group on
462 salsa.debian.org. If you own a Dell PowerEdge server with one of the
463 PERC controllers, or any other RAID controller using the megaraid or
464 megaraid_sas Linux kernel modules, you might want to check it out. If
465 enough people are interested, perhaps the package will make it into
466 the Debian archive.
</p
>
468 <p
>There are two tools provided, megactl for the megaraid Linux kernel
469 module, and megasasctl for the megaraid_sas Linux kernel module. The
470 simple output from the command on one of my machines look like this
471 (yes, I know some of the disks have problems. :).
</p
>
475 a0 PERC H730 Mini encl:
1 ldrv:
2 batt:good
476 a0d0
558GiB RAID
1 1x2 optimal
477 a0d1
3067GiB RAID
0 1x11 optimal
478 a0e32s0
558GiB a0d0 online errs: media:
0 other:
19
479 a0e32s1
279GiB a0d1 online
480 a0e32s2
279GiB a0d1 online
481 a0e32s3
279GiB a0d1 online
482 a0e32s4
279GiB a0d1 online
483 a0e32s5
279GiB a0d1 online
484 a0e32s6
279GiB a0d1 online
485 a0e32s8
558GiB a0d0 online errs: media:
0 other:
17
486 a0e32s9
279GiB a0d1 online
487 a0e32s10
279GiB a0d1 online
488 a0e32s11
279GiB a0d1 online
489 a0e32s12
279GiB a0d1 online
490 a0e32s13
279GiB a0d1 online
495 <p
>In addition to displaying a simple status report, it can also test
496 individual drives and print the various event logs. Perhaps you too
497 find it useful?
</p
>
499 <p
>In the packaging process I provided some patches upstream to
500 improve installation and ensure
501 <ahref=
"https://github.com/namiltd/megactl/pull/
2">a Appstream
502 metainfo file is provided
</a
> to list all supported HW, to allow
503 <a href=
"https://tracker.debian.org/isenkram
">isenkram
</a
> to propose
504 the package on all servers with a relevant PCI card.
</p
>
506 <p
>As usual, if you use Bitcoin and want to show your support of my
507 activities, please send Bitcoin donations to my address
508 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
514 <title>Frokostseminar om Noark
5 i Oslo tirsdag
2024-
03-
12</title>
515 <link>https://people.skolelinux.org/pere/blog/Frokostseminar_om_Noark_5_i_Oslo_tirsdag_2024_03_12.html
</link>
516 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/Frokostseminar_om_Noark_5_i_Oslo_tirsdag_2024_03_12.html
</guid>
517 <pubDate>Tue,
27 Feb
2024 15:
15:
00 +
0100</pubDate>
518 <description><p
>Nikita-prosjektet, der jeg er involvert, inviterer i samarbeid med
519 Oslo Byarkiv, forskningsgruppen METAINFO og foreningen NUUG, til et
520 frokostseminar om Noark
5 og Noark
5 Tjenestegrensesnitt tirsdag
521 2024-
03-
12. Seminaret finner sted ved Oslo byarkiv. Vi håper å få
522 til videostrømming via Internett av presentasjoner og paneldiskusjon.
523 Oppdatert program og lenker til påmeldingsskjema er
524 <a href=
"https://noark.codeberg.page/noark5-seminars/
2023-
03-
12-noark-workshop.html
">tilgjengelig
525 fra Nikita-prosjektet
</a
>. Arrangementet er gratis.
527 <p
>Som vanlig, hvis du bruker Bitcoin og ønsker å vise din støtte til
528 det jeg driver med, setter jeg pris på om du sender Bitcoin-donasjoner
530 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>. Merk,
531 betaling med bitcoin er ikke anonymt. :)
</p
>
536 <title>Welcome out of prison, Mickey, hope you find some freedom!
</title>
537 <link>https://people.skolelinux.org/pere/blog/Welcome_out_of_prison__Mickey__hope_you_find_some_freedom_.html
</link>
538 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/Welcome_out_of_prison__Mickey__hope_you_find_some_freedom_.html
</guid>
539 <pubDate>Mon,
1 Jan
2024 21:
00:
00 +
0100</pubDate>
540 <description><p align=
"center
"><img src=
"https://people.skolelinux.org/pere/blog/images/
2024-
01-
01-mikke-verk-i-det-fri.jpeg
"/
></p
>
542 <p
>Today, the animation figure Mickey Mouse finally was released from
543 the corporate copyright prison, as the
1928 movie
544 <a href=
"https://en.wikipedia.org/wiki/Steamboat_Willie
">Steamboat
545 Willie
</a
> entered the public domain in USA. This movie was the first
546 public appearance of Mickey Mouse. Sadly the figure is still on
547 probation, thanks to trademark laws and a the Disney corporations
548 powerful pack of lawyers, as described in the
2017 article
549 in
<a href=
"https://priceonomics.com/how-mickey-mouse-evades-the-public-domain/
">"How
550 Mickey Mouse Evades the Public Domain
"</a
> from Priceonomics. On the
551 positive side, the primary driver for repeated extentions of the
552 duration of copyright has been Disney thanks to Mickey Mouse and the
553 2028 movie, and as it now in the public domain I hope it will cause
554 less urge to extend the already unreasonable long copyright
557 <p
>The first book I published, the
2004 book
<a
558 href=
"https://free-culture.cc/
">"Free Culture
" by Lawrence Lessig
</a
>,
560 <a href=
"https://people.skolelinux.org/pere/publisher/#frikultur
">English,
561 French and Norwegian Bokmål
</a
>, touch on the story of Disney pushed
562 for extending the copyright duration in USA. It is a great book
563 explaining problems with the current copyright regime and why we need
564 Creative Commons movement, and I strongly recommend everyone to read
567 <p
>This movie (with
568 <a href=
"https://www.imdb.com/title/tt0019422/
">IMDB ID tt0019422
</a
>)
569 is now available from the Internet Archive. Two copies have been
570 uploaded so far, one uploaded
571 <a href=
"https://archive.org/details/SteamboatWillie
">2015-
11-
04</a
>
572 (
<a href=
"https://archive.org/download/SteamboatWillie/SteamboatWillie_archive.torrent
">torrent
</a
>)
574 <a href=
"https://archive.org/details/steamboat-willie-mickey
">2023-
01-
01</a
>
575 (
<a href=
"https://archive.org/download/steamboat-willie-mickey/steamboat-willie-mickey_archive.torrent
">torrent
</a
>) - see
576 <a href=
"https://people.skolelinux.org/pere/blog/VLC_bittorrent_plugin_still_going_strong__new_upload_2_14_4.html
">VLC
577 bittorrent plugin
</a
> for streaming the video using the torrent link.
578 I am very happy to see
579 <a href=
"https://people.skolelinux.org/pere/blog/Legal_to_share_more_than_16_000_movies_listed_on_IMDB_.html
">the
580 number of public domain movies
</a
> increasing. I look forward to
581 when those are the majority. Perhaps it will reduce the urge of the
582 copyright industry to control its customers.
</p
>
585 <a href=
"https://publicdomainreview.org/features/entering-the-public-domain/
2024/
">comprehensive
586 list of works entering the public domain in
2024</a
> is available from
587 the Public Domain Review.
</p
>
589 <p
>As usual, if you use Bitcoin and want to show your support of my
590 activities, please send Bitcoin donations to my address
591 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
596 <title>VLC bittorrent plugin still going strong, new upload
2.14-
4</title>
597 <link>https://people.skolelinux.org/pere/blog/VLC_bittorrent_plugin_still_going_strong__new_upload_2_14_4.html
</link>
598 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/VLC_bittorrent_plugin_still_going_strong__new_upload_2_14_4.html
</guid>
599 <pubDate>Sun,
31 Dec
2023 10:
45:
00 +
0100</pubDate>
600 <description><p
>The other day I uploaded a new version of
601 <a href=
"https://tracker.debian.org/pkg/vlc-plugin-bittorrent
">the VLC
602 bittorrent plugin
</a
> to Debian, version
2.14-
4, to fix a few
603 packaging issues. This plugin extend VLC allowing it to stream videos
604 directly from a bittorrent source using both torrent files and magnet
605 links, as easy as using a HTTP or local file source. I believe such
606 protocol support is a vital feature in VLC, allowing efficient
607 streaming from sources such at the
11 million movies in
608 <a href=
"https://archive.org/
">the Internet Archive
</a
>. Bittorrent is
609 one of the most efficient content distribution protocols on the
610 Internet, without centralised control, and should be used more.
</p
>
612 <p
>The new version is now both in Debian Unstable and Testing, as well
613 as Ubuntu. While looking after the package, I decided to ask the VLC
614 upstream community if there was any hope to get Bittorrent support
615 into the official VLC program, and was very happy to learn that
616 someone is already working on it. I hope we can see some fruits of
617 that labour next year, but do not hold my breath. In the mean time we
618 can use the plugin, which is already
619 <a href=
"https://qa.debian.org/popcon.php?package=vlc-plugin-bittorrent
">installed
620 by
0.23 percent of the Debian population
</a
> according to
621 popularity-contest. It could use a new upstream release, and I hope
622 the upstream developer soon find time to polish it even more.
</p
>
624 <p
>It is worth noting that the plugin store the downloaded files in
625 <tt
>~/Downloads/vlc-bittorrent/
</tt
>, which can quickly fill up the
626 user home directory during use. Users of the plugin should keep an
627 eye with disk usage when streaming a bittorrent source.
</p
>
629 <p
>As usual, if you use Bitcoin and want to show your support of my
630 activities, please send Bitcoin donations to my address
631 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
636 <title>«Når «på» blir «pÃ¥»: Et reservoar av tegn sett fra depotet» i tidsskriftet Aksess
</title>
637 <link>https://people.skolelinux.org/pere/blog/_N_r__p___blir__p_____Et_reservoar_av_tegn_sett_fra_depotet__i_tidsskriftet_Aksess.html
</link>
638 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/_N_r__p___blir__p_____Et_reservoar_av_tegn_sett_fra_depotet__i_tidsskriftet_Aksess.html
</guid>
639 <pubDate>Wed,
15 Nov
2023 09:
20:
00 +
0100</pubDate>
640 <description><p
>For noen uker siden skrev en kamerat og meg
641 <a href=
"https://www.aksess-tidsskrift.no/fordypning/
175530">en
642 artikkel om tegnsett
</a
> i
643 <a href=
"https://www.aksess-tidsskrift.no/
">arkivtidsskriftet
644 Aksess
</a
> både på web og i papirutgave nr.
3 2023. Her er det som
645 nettopp ble publisert.
</p
>
649 <p
><strong
>Når «på» blir «pÃ¥»: Et reservoar av tegn sett fra
650 depotet
</strong
></p
>
652 <p
>av Thomas Sødring og Petter Reinholdtsen
</p
>
654 <p
>De færreste av oss tenker over hva som skjer dypere i datamaskinen
655 mens vi sitter der og skriver noe på tastaturet. Når du trykker på
656 tasten «Å», så vises bokstaven Å. Men noen ganger blir det
657 feil. Hvorfor det – og hva er viktig å være klar over i
658 arkivsammenheng?
</p
>
660 <p
>Dersom bokstaver tolkes forskjellig mellom systemer, blir det fort
661 rot, dette kalles mojibake blant kjennere, etter det japanske
662 uttrykket for tegnomforming. Det er en lang historie her som tidvis
663 har vært preget av rot. Noen husker kanskje tilbake til en tid der
664 bokstavene æ, ø og å ofte var ødelagt i e-poster – et klassisk
665 eksempel på tegnsettproblemstilling.
</p
>
667 <p id=
"tegnsett_access_nå_og_før
"><strong
>«Nå» og «før»
</strong
></p
>
669 <p
>Tid er et skjult problem for depot fordi vi danner dokumentasjon i
670 en kontekst som er preget av å være «nå». Vår forståelse av verden og
671 bruken av teknologi er utgangspunktet for denne konteksten. Tenk selv
672 hvordan verden har utviklet seg de siste
20 årene, hva samfunnet er
673 opptatt av, og hvordan vi bruker teknologi i hverdagen. Tid er et
674 skjult problem fordi når vi trekker dokumentasjon ut av systemer og
675 deponerer for langtidsbevaring, er konteksten til materialet «nå», men
676 verden går videre. Ettersom teknologien og måten vi bruker den på,
677 utvikler seg, blir «nå» til «før», og dokumentasjonen befinner seg
678 snart i en «før»-kontekst.
</p
>
680 <p
>Dette med «før» og «nå» i forhold til dokumentasjonens kontekst er
681 noe vi er veldig lite bevisste på, men det er en problemstilling
682 depotarkivene eier og forvalter. En av disse utfordringene er hvorfor
683 «Ø» ikke nødvendigvis er det samme som «Ø», og hvorfor det i det hele
684 tatt gir mening å si noe sånt. Vi snakker her om noe som heter
685 tegnsett, som er en avtalt måte å representere bokstaver, tall og
686 andre symboler på slik at vi på en feilfri måte kan utveksle tekst
687 mellom datasystemer.
</p
>
689 <p
>Tegnsettproblemstillingen er satt sammen av fire fasetter;
690 repertoar, representasjon, koding og uttegning.
</p
>
692 <p id=
"tegnsett_access_repertoarer
"><strong
>Repertoarer
</strong
></p
>
694 <p
>Repertoar er en samling med tegn og symboler som kan
695 representeres. Tenk norsk alfabet eller japanske piktogrammer, men
696 også matematiske og elektroniske symboler. Bokstaven «stor a» kan være
697 en oppføring i et slikt repertoar. For å kunne brukes i en datamaskin
698 trenger hver oppføring i et slikt repertoar en representasjon, hvilket
699 i datamaskinsammenheng betyr at det tilordnes et tall. Tallet kan
700 lagres på ulike vis i en eller flere kodingsformater. For eksempel kan
701 en skrive tallet ti som både
10, X og A, i henholdsvis
702 titallssystemet, romertallssystemet og sekstentallssystemet.
</p
>
704 <p
>Hvis en skal kunne lese inn filer og vite hvilket tall og hvilken
705 representasjon og instans i et repertoar det er snakk om, så må en
706 vite hvordan tallet er kodet. Sist, men ikke minst, for å kunne bruke
707 symbolet til noe må det kunne være kjent hvordan det skal se ut eller
708 tegnes på ark. Det finnes utallige skrifttyper med norske bokstaver,
709 alle litt forskjellige, og skal en kunne tegne en stor A på skjermen,
710 så må datamaskinen vite hva den skal tegne. Skrifttyper inneholder
711 informasjon om hvordan ulike tall skal tegnes. De inneholder ikke
712 alltid alle symbolene som er brukt i en tekst, hvilket gjør at ikke
713 alle forståtte tegn vil kunne vises på skjerm eller ark.
</p
>
715 <p
>Hver av disse fasettene må være avklart for å kunne ta vare på og vise
716 frem tekst med en datamaskin. Kombinasjon av repertoar, representasjon
717 og koding er det en kaller et tegnsett. Kombinasjonen av
718 representasjon og uttegning kalles en skrifttype. De fleste
719 skrifttyper har også informasjon om repertoar, men det finnes
720 skrifttyper som kun kobler mellom tallkode og uttegning, uten å
721 fortelle noe om hvordan tallkodene egentlig skal tolkes.
</p
>
723 <p id=
"tegnsett_access_fra_ascii_til_iso_8859
"><strong
>Fra ASCII til ISO-
8859</strong
></p
>
725 <p
>Vi begynner historien med ASCII (American Standard Code for
726 Information Interchange) som har en historie som spores tilbake til
727 1963. Utgangspunktet til ASCII var at det kunne kode opp til
128
728 forskjellige symboler i vanlig bruk i USA. De visuelle symbolene i
729 ASCII er de små og store bokstavene (a til z og A til Z), tall (
0 til
730 9) og tegnsettingssymboler (for eksempel semikolon, komma og
731 punktum). ASCII har også noen usynlige symboler som ble brukt for
732 bl.a. kommunikasjon. Før ASCII var det for eksempel teleks-tegnsett
733 med plass til bare
32 tegn og EBCDIC med plass til
256 tegn, alle med
734 en helt annen rekkefølge på symbolene enn ASCII, men de har vært lite
735 brukt de siste femti årene. Et eksempel på noen utvalgte symboler i
736 repertoaret til ASCII vises i tabell
1.
</p
>
738 <table align=
"center
" width=
"50%
">
740 <caption
>Tabell
1. Eksempel på utvalgte symboler hentet fra
741 ASCII-tegnsettet. Kolonnen «Binær» viser symbolets verdi i
742 totallssystemet (
1 og
0 tall), mens kolonnen «Desimal» viser symbolets
743 verdi i titallssystemet.
</caption
>
747 <th
>Grafisk
</th
>
748 <th
>Binær
</th
>
749 <th
>Desimal
</th
>
752 <td
>A
</td
>
753 <td
>1000001</td
>
754 <td align=
"right
">65</td
>
757 <td
>M
</td
>
758 <td
>1001101</td
>
759 <td align=
"right
">77</td
>
762 <td
>Z
</td
>
763 <td
>1011010</td
>
764 <td align=
"right
">90</td
>
767 <td
>a
</td
>
768 <td
>1100001</td
>
769 <td align=
"right
">97</td
>
772 <td
>m
</td
>
773 <td
>1101101</td
>
774 <td align=
"right
">109</td
>
777 <td
>z
</td
>
778 <td
>1111010</td
>
779 <td align=
"right
">122</td
>
782 <td
>0</td
>
783 <td
>0110000</td
>
784 <td align=
"right
">48</td
>
787 <td
>9</td
>
788 <td
>0111001</td
>
789 <td align=
"right
">58</td
>
792 <td
>;
</td
>
793 <td
>0111011</td
>
794 <td align=
"right
">59</td
>
799 <p
>Det opprinnelige ASCII-tegnsettet ble også omtalt som ASCII-
7 og
800 brukte
7 bits (
0 og
1) for å representere symboler. Datamaskiner er
801 ofte konfigurert til å jobbe med enheter der bits er gruppert som
4
802 eller
8 bits . Det lå en mulighet i å ta i bruk bit åtte. En slik
803 endring ville gjøre det mulig for datamaskiner å øke antall symboler
804 de kunne representere, noe som ga en økning fra
128 forskjellige
805 symboler til
256 forskjellige symboler. Det ble åpnet for å innlemme
806 de nordiske bokstavene sammen med ASCII, og dette ble etter hvert
807 standardisert som ISO-
8859-
1. Tabell
2 viser deler av ISO-
8859-
1 som
808 støtter de norske bokstavene.
</p
>
810 <p
>Det sier seg selv at muligheten til å representere inntil
256 symboler
811 ikke holder når vi snakker om en global verden, og det ble gjort et
812 standardiseringsløp som tok utgangspunkt i ASCII-
7 med en utvidelse
813 til å bruke den åttende biten for ulike språkgrupper. Denne standarden
814 heter ISO-
8859 og er inndelt i opptil
16 varianter, altså fra
815 ISO-
8859-
1 til ISO-
8859-
16.
</p
>
817 <table align=
"center
" width=
"50%
">
819 <caption
>Tabell
2. Koding av de norske symbolene slik de er definert i
820 ISO-
8859-
1 tegnsettet.
</caption
>
824 <th
>Grafisk
</th
>
825 <th
>Binær
</th
>
826 <th
>Desimal
</th
>
829 <td
>Æ
</td
>
830 <td
>11000110</td
>
831 <td align=
"right
">198</td
>
834 <td
>Ø
</td
>
835 <td
>11011000</td
>
836 <td align=
"right
">216</td
>
839 <td
>Å
</td
>
840 <td
>11000101</td
>
841 <td align=
"right
">197</td
>
844 <td
>æ
</td
>
845 <td
>11100110</td
>
846 <td align=
"right
">230</td
>
849 <td
>ø
</td
>
850 <td
>11111000</td
>
851 <td align=
"right
">248</td
>
854 <td
>å
</td
>
855 <td
>11100101</td
>
856 <td align=
"right
">229</td
>
861 <p
>Norske tegn er definert i ISO-
8859-
1, som også omtales som Latin
1, de
862 fleste samiske tegn er definert i ISO-
8859-
4 (Latin
4) mens tilgang
863 til €-symbolet kom med ISO-
8859-
15 (Latin
9). ISO-
8859-
15 er en
864 revisjon av ISO-
8859-
1 som fjerner noen lite brukte symboler og
865 erstatter bokstaver som er mer brukt, og introduserer €-symbolet. Det
866 er viktig å merke at alle ISO-
8859-variantene har overlapp med
867 ASCII-
7, noe som ga samvirke med de engelskspråklige landene som ikke
868 trengte å gjøre noe. Det innebærer også at de første
128 verdiene i
869 ISO-
8859-variantene representerer de samme symbolene. Det er først når
870 du kommer til tolkningen av de resterende
128 verdiene med nummer
128
871 til
255, at det oppsto tolkningsutfordringer mellom
872 ISO-
8859-variantene.
</p
>
874 <p
>ISO-
8859-verdenen fungerte godt så lenge tegnsettet som ble brukt når
875 innhold ble skapt, også ble brukt når innhold ble gjengitt og du ikke
876 trengte å kombinere innhold fra forskjellige tegnsett i samme
877 dokument. Utfordringen med bruken av ISO-
8859-variantene ble raskt
878 tydelig i en mer globalisert verden med utveksling av tekst på tvers
879 av landegrenser der tekstlig innhold i dokumenter, e-poster og
880 websider kunne bli skrevet med ett tegnsett og gjengitt med et annet
883 <table align=
"center
" width=
"60%
">
885 <caption
>Tabell
3. Viser tolkning av verdiene som er tilegnet de
886 norske symbolene i ISO-
8859-
1 i de andre ISO
8859-variatene. Merk
887 ISO-
8859-
12 ikke finnes da arbeidet ble avsluttet.
<sup
>[
<a id=
"tegnsett_access_footnoteref_1
" href=
"#tegnsett_access_footnotedef_1
" title=
"View footnote.
">1</a
>]
</sup
></caption
>
891 <th
>Binærverdi
</th
>
892 <th
>1</th
>
893 <th
>2</th
>
894 <th
>3</th
>
895 <th
>4</th
>
896 <th
>5</th
>
897 <th
>6</th
>
898 <th
>7</th
>
899 <th
>8</th
>
900 <th
>9</th
>
901 <th
>10</th
>
902 <th
>11</th
>
903 <th
>13</th
>
904 <th
>14</th
>
905 <th
>15</th
>
906 <th
>16</th
>
909 <td
>11000110</td
>
910 <td
>Æ
</td
>
911 <td
>Ć
</td
>
912 <td
>Ĉ
</td
>
913 <td
>Æ
</td
>
914 <td
>Ц
</td
>
915 <td
>ئ
</td
>
916 <td
>Ζ
</td
>
917 <td
></td
>
918 <td
>Æ
</td
>
919 <td
>Æ
</td
>
920 <td
>ฦ
</td
>
921 <td
>Ę
</td
>
922 <td
>Æ
</td
>
923 <td
>Æ
</td
>
924 <td
>Æ
</td
>
927 <td
>11011000</td
>
928 <td
>Ø
</td
>
929 <td
>Ř
</td
>
930 <td
>Ĝ
</td
>
931 <td
>Ø
</td
>
932 <td
>и
</td
>
933 <td
>ظ
</td
>
934 <td
>Ψ
</td
>
935 <td
></td
>
936 <td
>Ø
</td
>
937 <td
>Ø
</td
>
938 <td
>ุ
</td
>
939 <td
>Ų
</td
>
940 <td
>Ø
</td
>
941 <td
>Ø
</td
>
942 <td
>Ű
</td
>
945 <td
>11000101</td
>
946 <td
>Å
</td
>
947 <td
>Ĺ
</td
>
948 <td
>Ċ
</td
>
949 <td
>Å
</td
>
950 <td
>Х
</td
>
951 <td
>إ
</td
>
952 <td
>Ε
</td
>
953 <td
></td
>
954 <td
>Å
</td
>
955 <td
>Å
</td
>
956 <td
>ล
</td
>
957 <td
>Å
</td
>
958 <td
>Å
</td
>
959 <td
>Å
</td
>
960 <td
>Ć
</td
>
963 <td
>11100110</td
>
964 <td
>æ
</td
>
965 <td
>ć
</td
>
966 <td
>ĉ
</td
>
967 <td
>æ
</td
>
968 <td
>ц
</td
>
969 <td
>ن
</td
>
970 <td
>ζ
</td
>
971 <td
>ז
</td
>
972 <td
>æ
</td
>
973 <td
>æ
</td
>
974 <td
>ๆ
</td
>
975 <td
>ę
</td
>
976 <td
>æ
</td
>
977 <td
>æ
</td
>
978 <td
>v
</td
>
981 <td
>11111000</td
>
982 <td
>ø
</td
>
983 <td
>ř
</td
>
984 <td
>ĝ
</td
>
985 <td
>ø
</td
>
986 <td
>ј
</td
>
987 <td
></td
>
988 <td
>ψ
</td
>
989 <td
>ר
</td
>
990 <td
>ø
</td
>
991 <td
>ø
</td
>
992 <td
>๘
</td
>
993 <td
>ų
</td
>
994 <td
>ø
</td
>
995 <td
>ø
</td
>
996 <td
>ű
</td
>
999 <td
>11100101</td
>
1000 <td
>å
</td
>
1001 <td
>ĺ
</td
>
1002 <td
>ċ
</td
>
1003 <td
>å
</td
>
1004 <td
>х
</td
>
1005 <td
>م
</td
>
1006 <td
>ε
</td
>
1007 <td
>ו
</td
>
1008 <td
>å
</td
>
1009 <td
>å
</td
>
1010 <td
>ๅ
</td
>
1011 <td
>å
</td
>
1012 <td
>å
</td
>
1013 <td
>å
</td
>
1014 <td
>ć
</td
>
1019 <p
>Denne problemstillingen er illustrert i tabell
3, der vi ser verdiene
1020 tilegnet de norske symbolene i ISO-
8859-
1 i kolonne «
1». I de øvrige
1021 kolonnene ser vi hvilket symbol verdien får i de andre
1022 ISO-
8859-variantene. Tar vi utgangspunkt i tabell
3, kan vi se at
1023 ordet lærlingspørsmål gjengitt med ISO-
8859-
2 (kolonne
2) blir
1024 lćrlingspřrsmĺl, mens det blir lζrlingspψrsmεl med ISO-
8859-
7
1025 (kolonne
7). Med ISO-
8859-
2 blir «æ» til «ć», «ø» til «ř» og «å» til
1026 «ĺ». I ISO-
8859-
7 blir «æ» til «ζ», «ø» til «ψ», mens «å» blir «ε».
</p
>
1028 <p
>Det er egentlig ingen utfordring med dette så lenge du vet hvilket
1029 tegnsett innholdet ditt er representert med, og det ikke har skjedd
1030 omforminger som du ikke er klar over. Det er det siste som er
1031 problematisk, spesielt de datasystemene som har vært i bruk de siste
1032 20 årene, som ikke har noe innebygd funksjonalitet for å forvalte
1033 tegnsettproblematikken. Et godt eksempel på dette er
1034 Microsoft-tegnsettet Windows-
1252, som ble forvekslet som
100 %
1035 kompatibel med ISO-
8859-
1, men hadde byttet ut plassene fra
127 til
1036 159. Historisk vil det finnes en del variasjon i hvilket tegnsett som
1037 har vært i bruk, og hvor vellykket konvertering mellom tegnsett har
1040 <p id=
"tegnsett_access_unicode_som_løsning
"><strong
>Unicode som løsning
</strong
></p
>
1042 <p
>Tegnsettforvirring ble etter hvert et irritasjonsmoment og
1043 samvirkeproblem. Ofte fikk man en e-post der æøå var erstattet av rare
1044 symboler fordi e-posten hadde vært innom et eller annet datasystem som
1045 ikke brukte samme tegnsett.
</p
>
1047 <p
>For å løse dette samvirkeproblemet for tegnsett ble det startet et
1048 arbeid og en ny standard så dagens lys etter hvert. Denne standarden
1049 fikk navnet Unicode (ISO/ IEC
10646) og skulle resultere i et tegnsett
1050 som alle skulle være enige om. Unicode er et repertoar og en
1051 representasjon, dvs. navngivning og tilordning av tallverdi til alle
1052 symboler i bruk i verden i dag. Oppføringer i Unicode skrives gjerne
1053 U+XXXX der XXXX er tallkoden i sekstentallssystemet som oppføringen
1054 har i Unicode-katalogen. Her finner vi tegn brukt av både levende og
1055 døde språk, konstruerte språk, tekniske symboler, morsomme tegninger
1056 (såkalte emojier) og tegn ingen vet hva betyr eller skal brukes
1057 til. Et morsomt eksempel er i nettartikkelen: U+
237C ⍼ RIGHT ANGLE
1058 WITH DOWNWARDS ZIGZAG ARROW, av Jonathan Chan.
<sup
>[
<a id=
"tegnsett_access_footnoteref_2
" href=
"#tegnsett_access_footnotedef_2
" title=
"View footnote.
">2</a
>]
</sup
></p
>
1060 <p
>Sammen med Unicode kom det tre måter å kode disse tallene på; UTF-
8,
1061 UTF-
16 og UTF-
32. Av datatekniske årsaker er UTF-
8 mye brukt, spesielt
1062 når det gjelder utveksling av tekst over Internett, mens UTF-
16 er
1063 brukt en del til tekstfiler lagret på Windows. En utfordring med
1064 Unicode og UTF-variantene er at disse gir flere måter å kode samme
1065 symbol på med en kombinasjonsmekanisme. Dette kan gi utfordringer ved
1066 søk, hvis en skal søke etter et ord som har ett eller flere symboler
1067 som kan skrives på ulikt vis, så er det ikke sikkert at søkesystemet
1068 vil finne alle forekomster. For eksempel kan bokstaven U+
00F8 «Latin
1069 Small Letter O with Stroke» kodes som den tradisjonelle norske tegnet
1070 ø, men også som o kombinert med skråstrek U+
0338. Begge deler er
1071 gyldig bruk av Unicode, selv om det er tradisjon for å foretrekke å
1072 «normalisere» kombinasjoner som enkelttegn der det er mulig, nettopp
1073 for å forenkle søk.
</p
>
1075 <p id=
"tegnsett_access_bare_unicode_fremover
"><strong
>Bare Unicode fremover
</strong
></p
>
1077 <p
>Forvaltningens bruk av tegnsett er regulert i Forskrift om
1078 IT-standarder i offentlig forvaltning
<sup
>[
<a id=
"tegnsett_access_footnoteref_3
" href=
"#tegnsett_access_footnotedef_3
" title=
"View footnote.
">3</a
>]
</sup
>. Her står det: «Ved all
1079 utveksling av informasjon mellom forvaltningsorganer og fra
1080 forvaltningsorgan til innbyggere og næringsliv skal tegnsettstandarden
1081 ISO/IEC
10646 representert ved UTF8 benyttes.» Det er forskjellige
1082 bruksområder til UTF-
8, UTF-
16 og UTF-
32, men UTF-
8 er kodingen vi
1083 kjenner mest til. Det er flere grunner at UTF-
8 «vant» konkurransen
1084 til å bli den utvalgte. Den kanskje viktigste er at UTF-
8 er fullt
1085 samvirkende med ASCII-
7, slik at den engelskspråklige delen av verden
1086 kunne rulle ut UTF-
8 uten å merke noe forskjell. En tekstfil med kun
1087 ASCII-tekst vil være identisk på disken hvis den lagres som UTF-
8 og
1088 ASCII. UTF-
16 og UTF-
32 byr på noen optimaliseringer som gjør dem
1089 relevant for spesifikke problemområder, men for det meste vil vi aldri
1090 oppleve disse standardene på nært hold i hverdagen. Det er uansett kun
1091 bruken av UTF-
8 som er lovregulert i Norge.
</p
>
1093 <p
>Det er ikke slik at hele verden bruker ISO/IEC
10646 og UTF-
8. Kina
1094 har egne standarder for tegnsett, mye brukt er GB
18030, som er
1095 Unicode med en annen koding enn UTF-
8, mens Taiwan og andre asiatiske
1096 land gjerne bruker Big5 eller andre tegnsett.
</p
>
1098 <p
>UTF-
8 er dominerende i Norge, men det er tidsperioder der forskjellige
1099 datasystemer utvekslet data i henhold til ISO-
8859-
1, ISO-
8859-
15,
1100 Windows-
1252, Codepage
865 og ISO-
646-
60 / Codepage
1016 mens
1101 overgangen til UTF-
8 pågikk. Det er ikke slik at et datasystem enkelt
1102 kan tvinges til å bruke et tegnsett, da det er flere lag i et
1103 datasystem som må settes opp til å bruke riktig tegnsett, og
1104 tegnsettproblemet fort oppstår når det er et eller annet i
1105 datasystemet som bruker feil tegnsett.
</p
>
1107 <p
>Et klassisk eksempel på problemet er en utveksling av tekst mellom to
1108 systemer der teksten i utgangspunktet er kodet i UTF-
8, men går
1109 gjennom noe som er ISO-
8859-
1 underveis. Dette kan vises med at ordet
1110 «på» i et slik scenario ender opp som «pÃ¥». Det er mulig å spore
1111 dette tilbake til verdiene symbolene er tilordnet i tegnsettene. «på»
1112 blir til «pÃ¥» fordi «å» i UTF-
8 er representert med U+C3AF, og dersom
1113 vi ser på hva disse verdiene representerer, ser vi at
1114 sekstentallssystemverdien C3 er
1100 0011 i totallssystemet og
1115 symbolet med dette tallet i ISO-
8859-
1 er Ã.
</p
>
1117 <p
>Vi ser det samme med sekstentallssystemverdien A5, som er
1010 0101 i
1118 totallssystemet, og tilsvarende symbol i ISO-
8859-
1 er ¥. Slik
1119 mojibake kan lett skje hvis «på» i utgangspunktet var representert med
1120 UTF-
8, men ble behandlet med et system som bruker ISO-
8859-
1. Det er
1121 ingen automatikk i å fange opp slike ødeleggelser mens tekstlig
1122 innhold utveksles mellom datasystemer.
</p
>
1124 <p
>En utfordring for depotarkivene er at bruken av tegnsett ikke alltid
1125 har vært regulert, og at det kan finnes flere dokumentasjonssamlinger
1126 som er opprettet med varierende tegnsett før gjeldende forskrift
1127 inntraff – uten at det er mulig å avlede fra filene hvilket tegnsett
1128 som ble brukt. Et eksempel på dette er €-symbolet, som kom først etter
1129 at ISO-
8859-
1 var tatt i bruk. Det kan bli en utfordring for et
1130 depotarkiv, men så lenge det er kjent hvilket tegnsett var i bruk, så
1131 bør det gå bra. Riksarkivarens
1132 forskrift
<sup
>[
<a id=
"tegnsett_access_footnoteref_4
" href=
"#tegnsett_access_footnotedef_4
" title=
"View footnote.
">4</a
>]
</sup
>
1133 formaliserer dette ved å kreve følgende:
</p
>
1136 <p
>§
5-
11. Tegnsett i arkivuttrekk
</p
>
1139 <li
>Arkivuttrekk og medfølgende struktur- og innholdsbeskrivelser skal
1140 overføres som ren tekst i ukryptert form, og benytte godkjent
1141 tegnsett.
</li
>
1143 <li
>Godkjente tegnsett er:
1145 <li
>Unicode UTF-
8<br
>
1146 (ISO/IEC
10646-
1:
2000 Annex D)
</li
>
1147 <li
>ISO
8859-
1:
1998, Latin
1</li
>
1148 <li
>ISO
8859-
4:
1998, Latin
4 for samiske tegn.
</li
>
1149 </ol
></li
>
1151 <li
>Andre tegnsett aksepteres bare etter avtale med Arkivverket.
</li
>
1155 <p id=
"tegnsett_access_ditt_ansvar
"><strong
>Ditt ansvar
</strong
></p
>
1157 <p
>På mange måter burde ikke tegnsett være et problem i
2023, men sånn er
1158 det nok ikke. Land som har oppgradert til UTF-
8 som primærtegnsett for
1159 utveksling av tekstlig innhold, begrenser problematikken betraktelig,
1160 men globalt sett så er tegnsettutfordringen ikke løst fordi ikke alle
1161 er enige om å bruke samme tegnsett. Det kan være geopolitiske eller
1162 kulturelle hensyn som ligger til grunn for dette.
</p
>
1164 <p
>Det er uansett verdt å merke at selv om bruken av UTF-
8 skulle bli
1165 100% utbredt, så er det et historisk perspektiv (ASCII-
7,
1166 ISO-
8859-variantene, UTF-
8) her som gjør tegnsett til et problemområde
1167 arkivarene må forstå og håndtere. Som danningsarkivar har du et
1168 ansvar for å vite hvilket tegnsett systemene og databasene dere
1169 forvalter, er i samsvar med. Det er noe IT-avdelingen din eller
1170 programvareleverandørene enkelt skal kunne svare på, og svaret skal
1171 være UTF-
8 for alle nye systemer.
</p
>
1175 <p id=
"tegnsett_access_footnotedef_1
"><a href=
"#tegnsett_access_footnoteref_1
">1</a
>. Tegnsettkilde
<a href=
"https://en.wikipedia.org/wiki/ISO/IEC_8859
">https://en.wikipedia.org/wiki/ISO/IEC_8859
</a
></p
>
1177 <p id=
"tegnsett_access_footnotedef_2
"><a href=
"#tegnsett_access_footnoteref_2
">2</a
>.
<a href=
"https://ionathan.ch/
2022/
04/
09/angzarr.html
">https://ionathan.ch/
2022/
04/
09/angzarr.html
</a
></p
>
1179 <p id=
"tegnsett_access_footnotedef_3
"><a href=
"#tegnsett_access_footnoteref_3
">3</a
>.
<a href=
"https://lovdata.no/dokument/SF/forskrift/
2013-
04-
05-
959/%C2%A78#%C2%A78
">https://lovdata.no/dokument/SF/forskrift/
2013-
04-
05-
959/%C2%A78#%C2%A78
</a
></p
>
1181 <p id=
"tegnsett_access_footnotedef_4
"><a href=
"#tegnsett_access_footnoteref_4
">4</a
>.
<a href=
"https://lovdata.no/forskrift/
2017-
12-
19-
2286/§
5-
11">https://lovdata.no/forskrift/
2017-
12-
19-
2286/§
5-
11</a
></p
>
1185 <p
>For øvrig burde varsleren Edward Snowden få politisk asyl i Norge.
</p
>
1187 <p
>Som vanlig, hvis du bruker Bitcoin og ønsker å vise din støtte til
1188 det jeg driver med, setter jeg pris på om du sender Bitcoin-donasjoner
1190 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>. Merk,
1191 betaling med bitcoin er ikke anonymt. :)
</p
>
1196 <title>New and improved sqlcipher in Debian for accessing Signal database
</title>
1197 <link>https://people.skolelinux.org/pere/blog/New_and_improved_sqlcipher_in_Debian_for_accessing_Signal_database.html
</link>
1198 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/New_and_improved_sqlcipher_in_Debian_for_accessing_Signal_database.html
</guid>
1199 <pubDate>Sun,
12 Nov
2023 12:
00:
00 +
0100</pubDate>
1200 <description><p
>For a while now I wanted to have direct access to the
1201 <a href=
"https://signal.org/
">Signal
</a
> database of messages and
1202 channels of my Desktop edition of Signal. I prefer the enforced end
1203 to end encryption of Signal these days for my communication with
1204 friends and family, to increase the level of safety and privacy as
1205 well as raising the cost of the mass surveillance government and
1206 non-government entities practice these days. In August I came across
1208 <a href=
"https://www.yoranbrondsema.com/post/the-guide-to-extracting-statistics-from-your-signal-conversations/
">recipe
1209 on how to use sqlcipher to extract statistics from the Signal
1210 database
</a
> explaining how to do this. Unfortunately this did not
1211 work with the version of sqlcipher in Debian. The
1212 <a href=
"http://tracker.debian.org/sqlcipher/
">sqlcipher
</a
>
1213 package is a
"fork
" of the sqlite package with added support for
1214 encrypted databases. Sadly the current Debian maintainer
1215 <a href=
"https://bugs.debian.org/
961598">announced more than three
1216 years ago that he did not have time to maintain sqlcipher
</a
>, so it
1217 seemed unlikely to be upgraded by the maintainer. I was reluctant to
1218 take on the job myself, as I have very limited experience maintaining
1219 shared libraries in Debian. After waiting and hoping for a few
1220 months, I gave up the last week, and set out to update the package. In
1221 the process I orphaned it to make it more obvious for the next person
1222 looking at it that the package need proper maintenance.
</p
>
1224 <p
>The version in Debian was around five years old, and quite a lot of
1225 changes had taken place upstream into the Debian maintenance git
1226 repository. After spending a few days importing the new upstream
1227 versions, realising that upstream did not care much for SONAME
1228 versioning as I saw library symbols being both added and removed with
1229 minor version number changes to the project, I concluded that I had to
1230 do a SONAME bump of the library package to avoid surprising the
1231 reverse dependencies. I even added a simple
1232 autopkgtest script to ensure the package work as intended. Dug deep
1233 into the hole of learning shared library maintenance, I set out a few
1234 days ago to upload the new version to Debian experimental to see what
1235 the quality assurance framework in Debian had to say about the result.
1236 The feedback told me the pacakge was not too shabby, and yesterday I
1237 uploaded the latest version to Debian unstable. It should enter
1238 testing today or tomorrow, perhaps delayed by
1239 <a href=
"https://bugs.debian.org/
1055812">a small library
1240 transition
</a
>.
</p
>
1242 <p
>Armed with a new version of sqlcipher, I can now have a look at the
1243 SQL database in ~/.config/Signal/sql/db.sqlite. First, one need to
1244 fetch the encryption key from the Signal configuration using this
1245 simple JSON extraction command:
</p
>
1247 <pre
>/usr/bin/jq -r
'.
"key
"' ~/.config/Signal/config.json
</pre
>
1249 <p
>Assuming the result from that command is
'secretkey
', which is a
1250 hexadecimal number representing the key used to encrypt the database.
1251 Next, one can now connect to the database and inject the encryption
1252 key for access via SQL to fetch information from the database. Here
1253 is an example dumping the database structure:
</p
>
1256 % sqlcipher ~/.config/Signal/sql/db.sqlite
1257 sqlite
> PRAGMA key =
"x
'secretkey
'";
1259 CREATE TABLE sqlite_stat1(tbl,idx,stat);
1260 CREATE TABLE conversations(
1261 id STRING PRIMARY KEY ASC,
1269 , profileFamilyName TEXT, profileFullName TEXT, e164 TEXT, serviceId TEXT, groupId TEXT, profileLastFetchedAt INTEGER);
1270 CREATE TABLE identityKeys(
1271 id STRING PRIMARY KEY ASC,
1275 id STRING PRIMARY KEY ASC,
1278 CREATE TABLE sessions(
1279 id TEXT PRIMARY KEY,
1280 conversationId TEXT,
1282 , ourServiceId STRING, serviceId STRING);
1283 CREATE TABLE attachment_downloads(
1284 id STRING primary key,
1289 CREATE TABLE sticker_packs(
1290 id TEXT PRIMARY KEY,
1294 coverStickerId INTEGER,
1296 downloadAttempts INTEGER,
1297 installedAt INTEGER,
1300 stickerCount INTEGER,
1302 , attemptedStatus STRING, position INTEGER DEFAULT
0 NOT NULL, storageID STRING, storageVersion INTEGER, storageUnknownFields BLOB, storageNeedsSync
1303 INTEGER DEFAULT
0 NOT NULL);
1304 CREATE TABLE stickers(
1305 id INTEGER NOT NULL,
1306 packId TEXT NOT NULL,
1310 isCoverOnly INTEGER,
1315 PRIMARY KEY (id, packId),
1316 CONSTRAINT stickers_fk
1317 FOREIGN KEY (packId)
1318 REFERENCES sticker_packs(id)
1321 CREATE TABLE sticker_references(
1324 CONSTRAINT sticker_references_fk
1326 REFERENCES sticker_packs(id)
1329 CREATE TABLE emojis(
1330 shortName TEXT PRIMARY KEY,
1333 CREATE TABLE messages(
1334 rowid INTEGER PRIMARY KEY ASC,
1340 schemaVersion INTEGER,
1341 conversationId STRING,
1342 received_at INTEGER,
1344 hasAttachments INTEGER,
1345 hasFileAttachments INTEGER,
1346 hasVisualMediaAttachments INTEGER,
1347 expireTimer INTEGER,
1348 expirationStartTimestamp INTEGER,
1351 messageTimer INTEGER,
1352 messageTimerStart INTEGER,
1353 messageTimerExpiresAt INTEGER,
1356 sourceServiceId TEXT, serverGuid STRING NULL, sourceDevice INTEGER, storyId STRING, isStory INTEGER
1357 GENERATED ALWAYS AS (type IS
'story
'), isChangeCreatedByUs INTEGER NOT NULL DEFAULT
0, isTimerChangeFromSync INTEGER
1358 GENERATED ALWAYS AS (
1359 json_extract(json,
'$.expirationTimerUpdate.fromSync
') IS
1
1360 ), seenStatus NUMBER default
0, storyDistributionListId STRING, expiresAt INT
1363 expirationStartTimestamp + (expireTimer *
1000),
1365 )), shouldAffectActivity INTEGER
1366 GENERATED ALWAYS AS (
1370 'change-number-notification
',
1371 'contact-removed-notification
',
1372 'conversation-merge
',
1373 'group-v1-migration
',
1374 'keychange
',
1375 'message-history-unsynced
',
1376 'profile-change
',
1378 'universal-timer-notification
',
1379 'verified-change
'
1381 ), shouldAffectPreview INTEGER
1382 GENERATED ALWAYS AS (
1386 'change-number-notification
',
1387 'contact-removed-notification
',
1388 'conversation-merge
',
1389 'group-v1-migration
',
1390 'keychange
',
1391 'message-history-unsynced
',
1392 'profile-change
',
1394 'universal-timer-notification
',
1395 'verified-change
'
1397 ), isUserInitiatedMessage INTEGER
1398 GENERATED ALWAYS AS (
1402 'change-number-notification
',
1403 'contact-removed-notification
',
1404 'conversation-merge
',
1405 'group-v1-migration
',
1406 'group-v2-change
',
1407 'keychange
',
1408 'message-history-unsynced
',
1409 'profile-change
',
1411 'universal-timer-notification
',
1412 'verified-change
'
1414 ), mentionsMe INTEGER NOT NULL DEFAULT
0, isGroupLeaveEvent INTEGER
1415 GENERATED ALWAYS AS (
1416 type IS
'group-v2-change
' AND
1417 json_array_length(json_extract(json,
'$.groupV2Change.details
')) IS
1 AND
1418 json_extract(json,
'$.groupV2Change.details[
0].type
') IS
'member-remove
' AND
1419 json_extract(json,
'$.groupV2Change.from
') IS NOT NULL AND
1420 json_extract(json,
'$.groupV2Change.from
') IS json_extract(json,
'$.groupV2Change.details[
0].aci
')
1421 ), isGroupLeaveEventFromOther INTEGER
1422 GENERATED ALWAYS AS (
1423 isGroupLeaveEvent IS
1
1425 isChangeCreatedByUs IS
0
1427 GENERATED ALWAYS AS (
1428 json_extract(json,
'$.callId
')
1430 CREATE TABLE sqlite_stat4(tbl,idx,neq,nlt,ndlt,sample);
1432 id TEXT PRIMARY KEY,
1433 queueType TEXT STRING NOT NULL,
1434 timestamp INTEGER NOT NULL,
1437 CREATE TABLE reactions(
1438 conversationId STRING,
1441 messageReceivedAt INTEGER,
1442 targetAuthorAci STRING,
1443 targetTimestamp INTEGER,
1445 , messageId STRING);
1446 CREATE TABLE senderKeys(
1447 id TEXT PRIMARY KEY NOT NULL,
1448 senderId TEXT NOT NULL,
1449 distributionId TEXT NOT NULL,
1451 lastUpdatedDate NUMBER NOT NULL
1453 CREATE TABLE unprocessed(
1454 id STRING PRIMARY KEY ASC,
1461 serverTimestamp INTEGER,
1462 sourceServiceId STRING
1463 , serverGuid STRING NULL, sourceDevice INTEGER, receivedAtCounter INTEGER, urgent INTEGER, story INTEGER);
1464 CREATE TABLE sendLogPayloads(
1465 id INTEGER PRIMARY KEY ASC,
1467 timestamp INTEGER NOT NULL,
1468 contentHint INTEGER NOT NULL,
1470 , urgent INTEGER, hasPniSignatureMessage INTEGER DEFAULT
0 NOT NULL);
1471 CREATE TABLE sendLogRecipients(
1472 payloadId INTEGER NOT NULL,
1474 recipientServiceId STRING NOT NULL,
1475 deviceId INTEGER NOT NULL,
1477 PRIMARY KEY (payloadId, recipientServiceId, deviceId),
1479 CONSTRAINT sendLogRecipientsForeignKey
1480 FOREIGN KEY (payloadId)
1481 REFERENCES sendLogPayloads(id)
1484 CREATE TABLE sendLogMessageIds(
1485 payloadId INTEGER NOT NULL,
1487 messageId STRING NOT NULL,
1489 PRIMARY KEY (payloadId, messageId),
1491 CONSTRAINT sendLogMessageIdsForeignKey
1492 FOREIGN KEY (payloadId)
1493 REFERENCES sendLogPayloads(id)
1496 CREATE TABLE preKeys(
1497 id STRING PRIMARY KEY ASC,
1499 , ourServiceId NUMBER
1500 GENERATED ALWAYS AS (json_extract(json,
'$.ourServiceId
')));
1501 CREATE TABLE signedPreKeys(
1502 id STRING PRIMARY KEY ASC,
1504 , ourServiceId NUMBER
1505 GENERATED ALWAYS AS (json_extract(json,
'$.ourServiceId
')));
1506 CREATE TABLE badges(
1507 id TEXT PRIMARY KEY,
1508 category TEXT NOT NULL,
1510 descriptionTemplate TEXT NOT NULL
1512 CREATE TABLE badgeImageFiles(
1513 badgeId TEXT REFERENCES badges(id)
1516 'order
' INTEGER NOT NULL,
1521 CREATE TABLE storyReads (
1522 authorId STRING NOT NULL,
1523 conversationId STRING NOT NULL,
1524 storyId STRING NOT NULL,
1525 storyReadDate NUMBER NOT NULL,
1527 PRIMARY KEY (authorId, storyId)
1529 CREATE TABLE storyDistributions(
1530 id STRING PRIMARY KEY NOT NULL,
1533 senderKeyInfoJson STRING
1534 , deletedAtTimestamp INTEGER, allowsReplies INTEGER, isBlockList INTEGER, storageID STRING, storageVersion INTEGER, storageUnknownFields BLOB, storageNeedsSync INTEGER);
1535 CREATE TABLE storyDistributionMembers(
1536 listId STRING NOT NULL REFERENCES storyDistributions(id)
1539 serviceId STRING NOT NULL,
1541 PRIMARY KEY (listId, serviceId)
1543 CREATE TABLE uninstalled_sticker_packs (
1544 id STRING NOT NULL PRIMARY KEY,
1545 uninstalledAt NUMBER NOT NULL,
1547 storageVersion NUMBER,
1548 storageUnknownFields BLOB,
1549 storageNeedsSync INTEGER NOT NULL
1551 CREATE TABLE groupCallRingCancellations(
1552 ringId INTEGER PRIMARY KEY,
1553 createdAt INTEGER NOT NULL
1555 CREATE TABLE IF NOT EXISTS
'messages_fts_data
'(id INTEGER PRIMARY KEY, block BLOB);
1556 CREATE TABLE IF NOT EXISTS
'messages_fts_idx
'(segid, term, pgno, PRIMARY KEY(segid, term)) WITHOUT ROWID;
1557 CREATE TABLE IF NOT EXISTS
'messages_fts_content
'(id INTEGER PRIMARY KEY, c0);
1558 CREATE TABLE IF NOT EXISTS
'messages_fts_docsize
'(id INTEGER PRIMARY KEY, sz BLOB);
1559 CREATE TABLE IF NOT EXISTS
'messages_fts_config
'(k PRIMARY KEY, v) WITHOUT ROWID;
1560 CREATE TABLE edited_messages(
1561 messageId STRING REFERENCES messages(id)
1565 , conversationId STRING);
1566 CREATE TABLE mentions (
1567 messageId REFERENCES messages(id) ON DELETE CASCADE,
1572 CREATE TABLE kyberPreKeys(
1573 id STRING PRIMARY KEY NOT NULL,
1574 json TEXT NOT NULL, ourServiceId NUMBER
1575 GENERATED ALWAYS AS (json_extract(json,
'$.ourServiceId
')));
1576 CREATE TABLE callsHistory (
1577 callId TEXT PRIMARY KEY,
1578 peerId TEXT NOT NULL, -- conversation id (legacy) | uuid | groupId | roomId
1579 ringerId TEXT DEFAULT NULL, -- ringer uuid
1580 mode TEXT NOT NULL, -- enum
"Direct
" |
"Group
"
1581 type TEXT NOT NULL, -- enum
"Audio
" |
"Video
" |
"Group
"
1582 direction TEXT NOT NULL, -- enum
"Incoming
" |
"Outgoing
1583 -- Direct: enum
"Pending
" |
"Missed
" |
"Accepted
" |
"Deleted
"
1584 -- Group: enum
"GenericGroupCall
" |
"OutgoingRing
" |
"Ringing
" |
"Joined
" |
"Missed
" |
"Declined
" |
"Accepted
" |
"Deleted
"
1585 status TEXT NOT NULL,
1586 timestamp INTEGER NOT NULL,
1587 UNIQUE (callId, peerId) ON CONFLICT FAIL
1589 [ dropped all indexes to save space in this blog post ]
1590 CREATE TRIGGER messages_on_view_once_update AFTER UPDATE ON messages
1592 new.body IS NOT NULL AND new.isViewOnce =
1
1594 DELETE FROM messages_fts WHERE rowid = old.rowid;
1596 CREATE TRIGGER messages_on_insert AFTER INSERT ON messages
1597 WHEN new.isViewOnce IS NOT
1 AND new.storyId IS NULL
1599 INSERT INTO messages_fts
1602 (new.rowid, new.body);
1604 CREATE TRIGGER messages_on_delete AFTER DELETE ON messages BEGIN
1605 DELETE FROM messages_fts WHERE rowid = old.rowid;
1606 DELETE FROM sendLogPayloads WHERE id IN (
1607 SELECT payloadId FROM sendLogMessageIds
1608 WHERE messageId = old.id
1610 DELETE FROM reactions WHERE rowid IN (
1611 SELECT rowid FROM reactions
1612 WHERE messageId = old.id
1614 DELETE FROM storyReads WHERE storyId = old.storyId;
1616 CREATE VIRTUAL TABLE messages_fts USING fts5(
1618 tokenize =
'signal_tokenizer
'
1620 CREATE TRIGGER messages_on_update AFTER UPDATE ON messages
1622 (new.body IS NULL OR old.body IS NOT new.body) AND
1623 new.isViewOnce IS NOT
1 AND new.storyId IS NULL
1625 DELETE FROM messages_fts WHERE rowid = old.rowid;
1626 INSERT INTO messages_fts
1629 (new.rowid, new.body);
1631 CREATE TRIGGER messages_on_insert_insert_mentions AFTER INSERT ON messages
1633 INSERT INTO mentions (messageId, mentionAci, start, length)
1635 SELECT messages.id, bodyRanges.value -
>> 'mentionAci
' as mentionAci,
1636 bodyRanges.value -
>> 'start
' as start,
1637 bodyRanges.value -
>> 'length
' as length
1638 FROM messages, json_each(messages.json -
>> 'bodyRanges
') as bodyRanges
1639 WHERE bodyRanges.value -
>> 'mentionAci
' IS NOT NULL
1641 AND messages.id = new.id;
1643 CREATE TRIGGER messages_on_update_update_mentions AFTER UPDATE ON messages
1645 DELETE FROM mentions WHERE messageId = new.id;
1646 INSERT INTO mentions (messageId, mentionAci, start, length)
1648 SELECT messages.id, bodyRanges.value -
>> 'mentionAci
' as mentionAci,
1649 bodyRanges.value -
>> 'start
' as start,
1650 bodyRanges.value -
>> 'length
' as length
1651 FROM messages, json_each(messages.json -
>> 'bodyRanges
') as bodyRanges
1652 WHERE bodyRanges.value -
>> 'mentionAci
' IS NOT NULL
1654 AND messages.id = new.id;
1659 <p
>Finally I have the tool needed to inspect and process Signal
1660 messages that I need, without using the vendor provided client. Now
1661 on to transforming it to a more useful format.
</p
>
1663 <p
>As usual, if you use Bitcoin and want to show your support of my
1664 activities, please send Bitcoin donations to my address
1665 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>