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>RAID status from LSI Megaraid controllers in Debian
</title>
11 <link>https://people.skolelinux.org/pere/blog/RAID_status_from_LSI_Megaraid_controllers_in_Debian.html
</link>
12 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/RAID_status_from_LSI_Megaraid_controllers_in_Debian.html
</guid>
13 <pubDate>Wed,
17 Apr
2024 17:
00:
00 +
0200</pubDate>
14 <description><p
>I am happy to report that
15 <a href=
"https://github.com/namiltd/megactl
">the megactl package
</a
>,
16 useful to fetch RAID status when using the LSI Megaraid controller,
17 now is available in Debian. It passed NEW a few days ago, and is now
18 <a href=
"https://tracker.debian.org/pkg/megactl
">available in
19 unstable
</a
>, and probably showing up in testing in a weeks time. The
20 new version should provide Appstream hardware mapping and should
21 integrate nicely with isenkram.
</p
>
23 <p
>As usual, if you use Bitcoin and want to show your support of my
24 activities, please send Bitcoin donations to my address
25 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
31 <title>Time to move orphaned Debian packages to git
</title>
32 <link>https://people.skolelinux.org/pere/blog/Time_to_move_orphaned_Debian_packages_to_git.html
</link>
33 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/Time_to_move_orphaned_Debian_packages_to_git.html
</guid>
34 <pubDate>Sun,
14 Apr
2024 09:
30:
00 +
0200</pubDate>
35 <description><p
>There are several packages in Debian without a associated git
36 repository with the packaging history. This is unfortunate and it
37 would be nice if more of these would do so. Quote a lot of these are
38 without a maintainer, ie listed as maintained by the
39 '<a href=
"https://qa.debian.org/developer.php?email=packages%
40qa.debian.org
">Debian
40 QA Group
</a
>' place holder. In fact,
438 packages have this property
41 according to UDD (
<tt
>SELECT source FROM sources WHERE release =
'sid
'
42 AND (vcs_url ilike
'%anonscm.debian.org%
' OR vcs_browser ilike
43 '%anonscm.debian.org%
' or vcs_url IS NULL OR vcs_browser IS NULL) AND
44 maintainer ilike
'%packages@qa.debian.org%
';
</tt
>). Such packages can
45 be updated without much coordination by any Debian developer, as they
46 are considered orphaned.
</p
>
48 <p
>To try to improve the situation and reduce the number of packages
49 without associated git repository, I started a few days ago to search
50 out candiates and provide them with a git repository under the
51 'debian
' collaborative Salsa project. I started with the packages
52 pointing to obsolete Alioth git repositories, and am now working my
53 way across the ones completely without git references. In addition to
54 updating the Vcs-* debian/control fields, I try to update
55 Standards-Version, debhelper compat level, simplify d/rules, switch to
56 Rules-Requires-Root: no and fix lintian issues reported. I only
57 implement those that are trivial to fix, to avoid spending too much
58 time on each orphaned package. So far my experience is that it take
59 aproximately
20 minutes to convert a package without any git
60 references, and a lot more for packages with existing git repositories
61 incompatible with git-buildpackages.
</p
>
63 <p
>So far I have converted
10 packages, and I will keep going until I
64 run out of steam. As should be clear from the numbers, there is
65 enough packages remaining for more people to do the same without
66 stepping on each others toes. I find it useful to start by searching
67 for a git repo already on salsa, as I find that some times a git repo
68 has already been created, but no new version is uploaded to Debian
69 yet. In those cases I start with the existing git repository. I
70 convert to the git-buildpackage+pristine-tar workflow, and ensure a
71 debian/gbp.conf file with
"pristine-tar=True
" is added early, to avoid
72 uploading a orig.tar.gz with the wrong checksum by mistake. Did that
73 three times in the begin before I remembered my mistake.
</p
>
75 <p
>So, if you are a Debian Developer and got some spare time, perhaps
76 considering migrating some orphaned packages to git?
</p
>
78 <p
>As usual, if you use Bitcoin and want to show your support of my
79 activities, please send Bitcoin donations to my address
80 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
85 <title>Plain text accounting file from your bitcoin transactions
</title>
86 <link>https://people.skolelinux.org/pere/blog/Plain_text_accounting_file_from_your_bitcoin_transactions.html
</link>
87 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/Plain_text_accounting_file_from_your_bitcoin_transactions.html
</guid>
88 <pubDate>Thu,
7 Mar
2024 18:
00:
00 +
0100</pubDate>
89 <description><p
>A while back I wrote a small script to extract the Bitcoin
90 transactions in a wallet in the
91 <ahref=
"https://plaintextaccounting.org/
">ledger plain text accounting
92 format
</a
>. The last few days I spent some time to get it working
93 better with more special cases. In case it can be useful for others,
94 here is a copy:
</p
>
96 <p
><blockquote
><pre
>
98 # -*- coding: utf-
8 -*-
99 # Copyright (c)
2023-
2024 Petter Reinholdtsen
101 from decimal import Decimal
108 def format_float(num):
109 return numpy.format_float_positional(num, trim=
'-
')
112 u
'amount
' :
'Assets:BTC:main
',
116 '<some address
>' :
'Assets:bankkonto
',
117 '<some address
>' :
'Assets:bankkonto
',
121 proc = subprocess.Popen(cmd,stdout=subprocess.PIPE)
122 j = json.loads(proc.communicate()[
0], parse_float=Decimal)
126 # get all transactions for all accounts / addresses
131 cmd = [
'bitcoin-cli
',
'listtransactions
',
'*
', str(limit)]
133 txs.extend(exec_json(cmd))
135 # Useful for debugging
136 with open(
'transactions.json
') as f:
137 txs.extend(json.load(f, parse_float=Decimal))
139 for tx in sorted(txs, key=lambda a: a[
'time
']):
140 # print tx[
'category
']
141 if
'abandoned
' in tx and tx[
'abandoned
']:
143 if
'confirmations
' in tx and
0 >= tx[
'confirmations
']:
145 when = time.strftime(
'%Y-%m-%d %H:%M
', time.localtime(tx[
'time
']))
146 if
'message
' in tx:
147 desc = tx[
'message
']
148 elif
'comment
' in tx:
149 desc = tx[
'comment
']
150 elif
'label
' in tx:
151 desc = tx[
'label
']
154 print(
"%s %s
" % (when, desc))
155 if
'address
' in tx:
156 print(
" ; to bitcoin address %s
" % tx[
'address
'])
158 print(
" ; missing address in transaction, txid=%s
" % tx[
'txid
'])
159 print(f
" ; amount={tx[
'amount
']}
")
160 if
'fee
'in tx:
161 print(f
" ; fee={tx[
'fee
']}
")
162 for f in accounts.keys():
163 if f in tx and Decimal(
0) != tx[f]:
165 print(
" %-
20s %s BTC
" % (accounts[f], format_float(amount)))
166 if
'fee
' in tx and Decimal(
0) != tx[
'fee
']:
167 # Make sure to list fee used in several transactions only once.
168 if
'fee
' in tx and tx[
'txid
'] in txidfee \
169 and tx[
'fee
'] == txidfee[tx[
'txid
']]:
172 fee = tx[
'fee
']
173 print(
" %-
20s %s BTC
" % (accounts[
'amount
'], format_float(fee)))
174 print(
" %-
20s %s BTC
" % (
'Expences:BTC-fee
', format_float(-fee)))
175 txidfee[tx[
'txid
']] = tx[
'fee
']
177 if
'address
' in tx and tx[
'address
'] in addresses:
178 print(
" %s
" % addresses[tx[
'address
']])
180 if
'generate
' == tx[
'category
']:
181 print(
" Income:BTC-mining
")
183 if amount
< Decimal(
0):
184 print(f
" Assets:unknown:sent:update-script-addr-{tx[
'address
']}
")
186 print(f
" Assets:unknown:received:update-script-addr-{tx[
'address
']}
")
190 print(
"# Found %d transactions
" % c)
192 print(f
"# Warning: Limit {limit} reached, consider increasing limit.
")
198 </pre
></blockquote
></p
>
200 <p
>It is more of a proof of concept, and I do not expect it to handle
201 all edge cases, but it worked for me, and perhaps you can find it
202 useful too.
</p
>
204 <p
>To get a more interesting result, it is useful to map accounts sent
205 to or received from to accounting accounts, using the
206 <tt
>addresses
</tt
> hash. As these will be very context dependent, I
207 leave out my list to allow each user to fill out their own list of
208 accounts. Out of the box,
'ledger reg BTC:main
' should be able to
209 show the amount of BTCs present in the wallet at any given time in the
210 past. For other and more valuable analysis, a account plan need to be
211 set up in the
<tt
>addresses
</tt
> hash. Here is an example
212 transaction:
</p
>
214 <p
><blockquote
><pre
>
215 2024-
03-
07 17:
00 Donated to good cause
216 Assets:BTC:main -
0.1 BTC
217 Assets:BTC:main -
0.00001 BTC
218 Expences:BTC-fee
0.00001 BTC
219 Expences:donations
0.1 BTC
220 </pre
></blockquote
></p
>
222 <p
>It need a running Bitcoin Core daemon running, as it connect to it
223 using
<tt
>bitcoin-cli listtransactions *
100000</tt
> to extract the
224 transactions listed in the Wallet.
</p
>
226 <p
>As usual, if you use Bitcoin and want to show your support of my
227 activities, please send Bitcoin donations to my address
228 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
233 <title>RAID status from LSI Megaraid controllers using free software
</title>
234 <link>https://people.skolelinux.org/pere/blog/RAID_status_from_LSI_Megaraid_controllers_using_free_software.html
</link>
235 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/RAID_status_from_LSI_Megaraid_controllers_using_free_software.html
</guid>
236 <pubDate>Sun,
3 Mar
2024 22:
40:
00 +
0100</pubDate>
237 <description><p
>The last few days I have revisited RAID setup using the LSI
238 Megaraid controller. These are a family of controllers called PERC by
239 Dell, and is present in several old PowerEdge servers, and I recently
240 got my hands on one of these. I had forgotten how to handle this RAID
241 controller in Debian, so I had to take a peek in the
242 <a href=
"https://wiki.debian.org/LinuxRaidForAdmins
">Debian wiki page
243 "Linux and Hardware RAID: an administrator
's summary
"</a
> to remember
244 what kind of software is available to configure and monitor the disks
245 and controller. I prefer Free Software alternatives to proprietary
246 tools, as the later tend to fall into disarray once the manufacturer
247 loose interest, and often do not work with newer Linux Distributions.
248 Sadly there is no free software tool to configure the RAID setup, only
249 to monitor it. RAID can provide improved reliability and resilience in
250 a storage solution, but only if it is being regularly checked and any
251 broken disks are being replaced in time. I thus want to ensure some
252 automatic monitoring is available.
</p
>
254 <p
>In the discovery process, I came across a old free software tool to
255 monitor PERC2, PERC3, PERC4 and PERC5 controllers, which to my
256 surprise is not present in debian. To help change that I created a
257 <a href=
"https://bugs.debian.org/
1065322">request for packaging of the
258 megactl package
</a
>, and tried to track down a usable version.
259 <a href=
"https://sourceforge.net/p/megactl/
">The original project
260 site
</a
> is on Sourceforge, but as far as I can tell that project has
261 been dead for more than
15 years. I managed to find a
262 <a href=
"https://github.com/hmage/megactl
">more recent fork on
263 github
</a
> from user hmage, but it is unclear to me if this is still
264 being maintained. It has not seen much improvements since
2016. A
265 <a href=
"https://github.com/namiltd/megactl
">more up to date
266 edition
</a
> is a git fork from the original github fork by user
267 namiltd, and this newer fork seem a lot more promising. The owner of
268 this github repository has replied to change proposals within hours,
269 and had already added some improvements and support for more hardware.
270 Sadly he is reluctant to commit to maintaining the tool and stated in
271 <a href=
"https://github.com/namiltd/megactl/pull/
1">my first pull
272 request
</A
> that he think a new release should be made based on the
273 git repository owned by hmage. I perfectly understand this
274 reluctance, as I feel the same about maintaining yet another package
275 in Debian when I barely have time to take care of the ones I already
276 maintain, but do not really have high hopes that hmage will have time
277 to spend on it and hope namiltd will change his mind.
</p
>
279 <p
>In any case, I created
280 <a href=
"https://salsa.debian.org/debian/megactl
">a draft package
</a
>
281 based on the namiltd edition and put it under the debian group on
282 salsa.debian.org. If you own a Dell PowerEdge server with one of the
283 PERC controllers, or any other RAID controller using the megaraid or
284 megaraid_sas Linux kernel modules, you might want to check it out. If
285 enough people are interested, perhaps the package will make it into
286 the Debian archive.
</p
>
288 <p
>There are two tools provided, megactl for the megaraid Linux kernel
289 module, and megasasctl for the megaraid_sas Linux kernel module. The
290 simple output from the command on one of my machines look like this
291 (yes, I know some of the disks have problems. :).
</p
>
295 a0 PERC H730 Mini encl:
1 ldrv:
2 batt:good
296 a0d0
558GiB RAID
1 1x2 optimal
297 a0d1
3067GiB RAID
0 1x11 optimal
298 a0e32s0
558GiB a0d0 online errs: media:
0 other:
19
299 a0e32s1
279GiB a0d1 online
300 a0e32s2
279GiB a0d1 online
301 a0e32s3
279GiB a0d1 online
302 a0e32s4
279GiB a0d1 online
303 a0e32s5
279GiB a0d1 online
304 a0e32s6
279GiB a0d1 online
305 a0e32s8
558GiB a0d0 online errs: media:
0 other:
17
306 a0e32s9
279GiB a0d1 online
307 a0e32s10
279GiB a0d1 online
308 a0e32s11
279GiB a0d1 online
309 a0e32s12
279GiB a0d1 online
310 a0e32s13
279GiB a0d1 online
315 <p
>In addition to displaying a simple status report, it can also test
316 individual drives and print the various event logs. Perhaps you too
317 find it useful?
</p
>
319 <p
>In the packaging process I provided some patches upstream to
320 improve installation and ensure
321 <ahref=
"https://github.com/namiltd/megactl/pull/
2">a Appstream
322 metainfo file is provided
</a
> to list all supported HW, to allow
323 <a href=
"https://tracker.debian.org/isenkram
">isenkram
</a
> to propose
324 the package on all servers with a relevant PCI card.
</p
>
326 <p
>As usual, if you use Bitcoin and want to show your support of my
327 activities, please send Bitcoin donations to my address
328 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
334 <title>Frokostseminar om Noark
5 i Oslo tirsdag
2024-
03-
12</title>
335 <link>https://people.skolelinux.org/pere/blog/Frokostseminar_om_Noark_5_i_Oslo_tirsdag_2024_03_12.html
</link>
336 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/Frokostseminar_om_Noark_5_i_Oslo_tirsdag_2024_03_12.html
</guid>
337 <pubDate>Tue,
27 Feb
2024 15:
15:
00 +
0100</pubDate>
338 <description><p
>Nikita-prosjektet, der jeg er involvert, inviterer i samarbeid med
339 Oslo Byarkiv, forskningsgruppen METAINFO og foreningen NUUG, til et
340 frokostseminar om Noark
5 og Noark
5 Tjenestegrensesnitt tirsdag
341 2024-
03-
12. Seminaret finner sted ved Oslo byarkiv. Vi håper å få
342 til videostrømming via Internett av presentasjoner og paneldiskusjon.
343 Oppdatert program og lenker til påmeldingsskjema er
344 <a href=
"https://noark.codeberg.page/noark5-seminars/
2023-
03-
12-noark-workshop.html
">tilgjengelig
345 fra Nikita-prosjektet
</a
>. Arrangementet er gratis.
347 <p
>Som vanlig, hvis du bruker Bitcoin og ønsker å vise din støtte til
348 det jeg driver med, setter jeg pris på om du sender Bitcoin-donasjoner
350 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>. Merk,
351 betaling med bitcoin er ikke anonymt. :)
</p
>
356 <title>Welcome out of prison, Mickey, hope you find some freedom!
</title>
357 <link>https://people.skolelinux.org/pere/blog/Welcome_out_of_prison__Mickey__hope_you_find_some_freedom_.html
</link>
358 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/Welcome_out_of_prison__Mickey__hope_you_find_some_freedom_.html
</guid>
359 <pubDate>Mon,
1 Jan
2024 21:
00:
00 +
0100</pubDate>
360 <description><p align=
"center
"><img src=
"https://people.skolelinux.org/pere/blog/images/
2024-
01-
01-mikke-verk-i-det-fri.jpeg
"/
></p
>
362 <p
>Today, the animation figure Mickey Mouse finally was released from
363 the corporate copyright prison, as the
1928 movie
364 <a href=
"https://en.wikipedia.org/wiki/Steamboat_Willie
">Steamboat
365 Willie
</a
> entered the public domain in USA. This movie was the first
366 public appearance of Mickey Mouse. Sadly the figure is still on
367 probation, thanks to trademark laws and a the Disney corporations
368 powerful pack of lawyers, as described in the
2017 article
369 in
<a href=
"https://priceonomics.com/how-mickey-mouse-evades-the-public-domain/
">"How
370 Mickey Mouse Evades the Public Domain
"</a
> from Priceonomics. On the
371 positive side, the primary driver for repeated extentions of the
372 duration of copyright has been Disney thanks to Mickey Mouse and the
373 2028 movie, and as it now in the public domain I hope it will cause
374 less urge to extend the already unreasonable long copyright
377 <p
>The first book I published, the
2004 book
<a
378 href=
"https://free-culture.cc/
">"Free Culture
" by Lawrence Lessig
</a
>,
380 <a href=
"https://people.skolelinux.org/pere/publisher/#frikultur
">English,
381 French and Norwegian Bokmål
</a
>, touch on the story of Disney pushed
382 for extending the copyright duration in USA. It is a great book
383 explaining problems with the current copyright regime and why we need
384 Creative Commons movement, and I strongly recommend everyone to read
387 <p
>This movie (with
388 <a href=
"https://www.imdb.com/title/tt0019422/
">IMDB ID tt0019422
</a
>)
389 is now available from the Internet Archive. Two copies have been
390 uploaded so far, one uploaded
391 <a href=
"https://archive.org/details/SteamboatWillie
">2015-
11-
04</a
>
392 (
<a href=
"https://archive.org/download/SteamboatWillie/SteamboatWillie_archive.torrent
">torrent
</a
>)
394 <a href=
"https://archive.org/details/steamboat-willie-mickey
">2023-
01-
01</a
>
395 (
<a href=
"https://archive.org/download/steamboat-willie-mickey/steamboat-willie-mickey_archive.torrent
">torrent
</a
>) - see
396 <a href=
"https://people.skolelinux.org/pere/blog/VLC_bittorrent_plugin_still_going_strong__new_upload_2_14_4.html
">VLC
397 bittorrent plugin
</a
> for streaming the video using the torrent link.
398 I am very happy to see
399 <a href=
"https://people.skolelinux.org/pere/blog/Legal_to_share_more_than_16_000_movies_listed_on_IMDB_.html
">the
400 number of public domain movies
</a
> increasing. I look forward to
401 when those are the majority. Perhaps it will reduce the urge of the
402 copyright industry to control its customers.
</p
>
405 <a href=
"https://publicdomainreview.org/features/entering-the-public-domain/
2024/
">comprehensive
406 list of works entering the public domain in
2024</a
> is available from
407 the Public Domain Review.
</p
>
409 <p
>As usual, if you use Bitcoin and want to show your support of my
410 activities, please send Bitcoin donations to my address
411 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
416 <title>VLC bittorrent plugin still going strong, new upload
2.14-
4</title>
417 <link>https://people.skolelinux.org/pere/blog/VLC_bittorrent_plugin_still_going_strong__new_upload_2_14_4.html
</link>
418 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/VLC_bittorrent_plugin_still_going_strong__new_upload_2_14_4.html
</guid>
419 <pubDate>Sun,
31 Dec
2023 10:
45:
00 +
0100</pubDate>
420 <description><p
>The other day I uploaded a new version of
421 <a href=
"https://tracker.debian.org/pkg/vlc-plugin-bittorrent
">the VLC
422 bittorrent plugin
</a
> to Debian, version
2.14-
4, to fix a few
423 packaging issues. This plugin extend VLC allowing it to stream videos
424 directly from a bittorrent source using both torrent files and magnet
425 links, as easy as using a HTTP or local file source. I believe such
426 protocol support is a vital feature in VLC, allowing efficient
427 streaming from sources such at the
11 million movies in
428 <a href=
"https://archive.org/
">the Internet Archive
</a
>. Bittorrent is
429 one of the most efficient content distribution protocols on the
430 Internet, without centralised control, and should be used more.
</p
>
432 <p
>The new version is now both in Debian Unstable and Testing, as well
433 as Ubuntu. While looking after the package, I decided to ask the VLC
434 upstream community if there was any hope to get Bittorrent support
435 into the official VLC program, and was very happy to learn that
436 someone is already working on it. I hope we can see some fruits of
437 that labour next year, but do not hold my breath. In the mean time we
438 can use the plugin, which is already
439 <a href=
"https://qa.debian.org/popcon.php?package=vlc-plugin-bittorrent
">installed
440 by
0.23 percent of the Debian population
</a
> according to
441 popularity-contest. It could use a new upstream release, and I hope
442 the upstream developer soon find time to polish it even more.
</p
>
444 <p
>It is worth noting that the plugin store the downloaded files in
445 <tt
>~/Downloads/vlc-bittorrent/
</tt
>, which can quickly fill up the
446 user home directory during use. Users of the plugin should keep an
447 eye with disk usage when streaming a bittorrent source.
</p
>
449 <p
>As usual, if you use Bitcoin and want to show your support of my
450 activities, please send Bitcoin donations to my address
451 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
456 <title>«Når «på» blir «pÃ¥»: Et reservoar av tegn sett fra depotet» i tidsskriftet Aksess
</title>
457 <link>https://people.skolelinux.org/pere/blog/_N_r__p___blir__p_____Et_reservoar_av_tegn_sett_fra_depotet__i_tidsskriftet_Aksess.html
</link>
458 <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>
459 <pubDate>Wed,
15 Nov
2023 09:
20:
00 +
0100</pubDate>
460 <description><p
>For noen uker siden skrev en kamerat og meg
461 <a href=
"https://www.aksess-tidsskrift.no/fordypning/
175530">en
462 artikkel om tegnsett
</a
> i
463 <a href=
"https://www.aksess-tidsskrift.no/
">arkivtidsskriftet
464 Aksess
</a
> både på web og i papirutgave nr.
3 2023. Her er det som
465 nettopp ble publisert.
</p
>
469 <p
><strong
>Når «på» blir «pÃ¥»: Et reservoar av tegn sett fra
470 depotet
</strong
></p
>
472 <p
>av Thomas Sødring og Petter Reinholdtsen
</p
>
474 <p
>De færreste av oss tenker over hva som skjer dypere i datamaskinen
475 mens vi sitter der og skriver noe på tastaturet. Når du trykker på
476 tasten «Å», så vises bokstaven Å. Men noen ganger blir det
477 feil. Hvorfor det – og hva er viktig å være klar over i
478 arkivsammenheng?
</p
>
480 <p
>Dersom bokstaver tolkes forskjellig mellom systemer, blir det fort
481 rot, dette kalles mojibake blant kjennere, etter det japanske
482 uttrykket for tegnomforming. Det er en lang historie her som tidvis
483 har vært preget av rot. Noen husker kanskje tilbake til en tid der
484 bokstavene æ, ø og å ofte var ødelagt i e-poster – et klassisk
485 eksempel på tegnsettproblemstilling.
</p
>
487 <p id=
"tegnsett_access_nå_og_før
"><strong
>«Nå» og «før»
</strong
></p
>
489 <p
>Tid er et skjult problem for depot fordi vi danner dokumentasjon i
490 en kontekst som er preget av å være «nå». Vår forståelse av verden og
491 bruken av teknologi er utgangspunktet for denne konteksten. Tenk selv
492 hvordan verden har utviklet seg de siste
20 årene, hva samfunnet er
493 opptatt av, og hvordan vi bruker teknologi i hverdagen. Tid er et
494 skjult problem fordi når vi trekker dokumentasjon ut av systemer og
495 deponerer for langtidsbevaring, er konteksten til materialet «nå», men
496 verden går videre. Ettersom teknologien og måten vi bruker den på,
497 utvikler seg, blir «nå» til «før», og dokumentasjonen befinner seg
498 snart i en «før»-kontekst.
</p
>
500 <p
>Dette med «før» og «nå» i forhold til dokumentasjonens kontekst er
501 noe vi er veldig lite bevisste på, men det er en problemstilling
502 depotarkivene eier og forvalter. En av disse utfordringene er hvorfor
503 «Ø» ikke nødvendigvis er det samme som «Ø», og hvorfor det i det hele
504 tatt gir mening å si noe sånt. Vi snakker her om noe som heter
505 tegnsett, som er en avtalt måte å representere bokstaver, tall og
506 andre symboler på slik at vi på en feilfri måte kan utveksle tekst
507 mellom datasystemer.
</p
>
509 <p
>Tegnsettproblemstillingen er satt sammen av fire fasetter;
510 repertoar, representasjon, koding og uttegning.
</p
>
512 <p id=
"tegnsett_access_repertoarer
"><strong
>Repertoarer
</strong
></p
>
514 <p
>Repertoar er en samling med tegn og symboler som kan
515 representeres. Tenk norsk alfabet eller japanske piktogrammer, men
516 også matematiske og elektroniske symboler. Bokstaven «stor a» kan være
517 en oppføring i et slikt repertoar. For å kunne brukes i en datamaskin
518 trenger hver oppføring i et slikt repertoar en representasjon, hvilket
519 i datamaskinsammenheng betyr at det tilordnes et tall. Tallet kan
520 lagres på ulike vis i en eller flere kodingsformater. For eksempel kan
521 en skrive tallet ti som både
10, X og A, i henholdsvis
522 titallssystemet, romertallssystemet og sekstentallssystemet.
</p
>
524 <p
>Hvis en skal kunne lese inn filer og vite hvilket tall og hvilken
525 representasjon og instans i et repertoar det er snakk om, så må en
526 vite hvordan tallet er kodet. Sist, men ikke minst, for å kunne bruke
527 symbolet til noe må det kunne være kjent hvordan det skal se ut eller
528 tegnes på ark. Det finnes utallige skrifttyper med norske bokstaver,
529 alle litt forskjellige, og skal en kunne tegne en stor A på skjermen,
530 så må datamaskinen vite hva den skal tegne. Skrifttyper inneholder
531 informasjon om hvordan ulike tall skal tegnes. De inneholder ikke
532 alltid alle symbolene som er brukt i en tekst, hvilket gjør at ikke
533 alle forståtte tegn vil kunne vises på skjerm eller ark.
</p
>
535 <p
>Hver av disse fasettene må være avklart for å kunne ta vare på og vise
536 frem tekst med en datamaskin. Kombinasjon av repertoar, representasjon
537 og koding er det en kaller et tegnsett. Kombinasjonen av
538 representasjon og uttegning kalles en skrifttype. De fleste
539 skrifttyper har også informasjon om repertoar, men det finnes
540 skrifttyper som kun kobler mellom tallkode og uttegning, uten å
541 fortelle noe om hvordan tallkodene egentlig skal tolkes.
</p
>
543 <p id=
"tegnsett_access_fra_ascii_til_iso_8859
"><strong
>Fra ASCII til ISO-
8859</strong
></p
>
545 <p
>Vi begynner historien med ASCII (American Standard Code for
546 Information Interchange) som har en historie som spores tilbake til
547 1963. Utgangspunktet til ASCII var at det kunne kode opp til
128
548 forskjellige symboler i vanlig bruk i USA. De visuelle symbolene i
549 ASCII er de små og store bokstavene (a til z og A til Z), tall (
0 til
550 9) og tegnsettingssymboler (for eksempel semikolon, komma og
551 punktum). ASCII har også noen usynlige symboler som ble brukt for
552 bl.a. kommunikasjon. Før ASCII var det for eksempel teleks-tegnsett
553 med plass til bare
32 tegn og EBCDIC med plass til
256 tegn, alle med
554 en helt annen rekkefølge på symbolene enn ASCII, men de har vært lite
555 brukt de siste femti årene. Et eksempel på noen utvalgte symboler i
556 repertoaret til ASCII vises i tabell
1.
</p
>
558 <table align=
"center
" width=
"50%
">
560 <caption
>Tabell
1. Eksempel på utvalgte symboler hentet fra
561 ASCII-tegnsettet. Kolonnen «Binær» viser symbolets verdi i
562 totallssystemet (
1 og
0 tall), mens kolonnen «Desimal» viser symbolets
563 verdi i titallssystemet.
</caption
>
567 <th
>Grafisk
</th
>
568 <th
>Binær
</th
>
569 <th
>Desimal
</th
>
572 <td
>A
</td
>
573 <td
>1000001</td
>
574 <td align=
"right
">65</td
>
577 <td
>M
</td
>
578 <td
>1001101</td
>
579 <td align=
"right
">77</td
>
582 <td
>Z
</td
>
583 <td
>1011010</td
>
584 <td align=
"right
">90</td
>
587 <td
>a
</td
>
588 <td
>1100001</td
>
589 <td align=
"right
">97</td
>
592 <td
>m
</td
>
593 <td
>1101101</td
>
594 <td align=
"right
">109</td
>
597 <td
>z
</td
>
598 <td
>1111010</td
>
599 <td align=
"right
">122</td
>
602 <td
>0</td
>
603 <td
>0110000</td
>
604 <td align=
"right
">48</td
>
607 <td
>9</td
>
608 <td
>0111001</td
>
609 <td align=
"right
">58</td
>
612 <td
>;
</td
>
613 <td
>0111011</td
>
614 <td align=
"right
">59</td
>
619 <p
>Det opprinnelige ASCII-tegnsettet ble også omtalt som ASCII-
7 og
620 brukte
7 bits (
0 og
1) for å representere symboler. Datamaskiner er
621 ofte konfigurert til å jobbe med enheter der bits er gruppert som
4
622 eller
8 bits . Det lå en mulighet i å ta i bruk bit åtte. En slik
623 endring ville gjøre det mulig for datamaskiner å øke antall symboler
624 de kunne representere, noe som ga en økning fra
128 forskjellige
625 symboler til
256 forskjellige symboler. Det ble åpnet for å innlemme
626 de nordiske bokstavene sammen med ASCII, og dette ble etter hvert
627 standardisert som ISO-
8859-
1. Tabell
2 viser deler av ISO-
8859-
1 som
628 støtter de norske bokstavene.
</p
>
630 <p
>Det sier seg selv at muligheten til å representere inntil
256 symboler
631 ikke holder når vi snakker om en global verden, og det ble gjort et
632 standardiseringsløp som tok utgangspunkt i ASCII-
7 med en utvidelse
633 til å bruke den åttende biten for ulike språkgrupper. Denne standarden
634 heter ISO-
8859 og er inndelt i opptil
16 varianter, altså fra
635 ISO-
8859-
1 til ISO-
8859-
16.
</p
>
637 <table align=
"center
" width=
"50%
">
639 <caption
>Tabell
2. Koding av de norske symbolene slik de er definert i
640 ISO-
8859-
1 tegnsettet.
</caption
>
644 <th
>Grafisk
</th
>
645 <th
>Binær
</th
>
646 <th
>Desimal
</th
>
649 <td
>Æ
</td
>
650 <td
>11000110</td
>
651 <td align=
"right
">198</td
>
654 <td
>Ø
</td
>
655 <td
>11011000</td
>
656 <td align=
"right
">216</td
>
659 <td
>Å
</td
>
660 <td
>11000101</td
>
661 <td align=
"right
">197</td
>
664 <td
>æ
</td
>
665 <td
>11100110</td
>
666 <td align=
"right
">230</td
>
669 <td
>ø
</td
>
670 <td
>11111000</td
>
671 <td align=
"right
">248</td
>
674 <td
>å
</td
>
675 <td
>11100101</td
>
676 <td align=
"right
">229</td
>
681 <p
>Norske tegn er definert i ISO-
8859-
1, som også omtales som Latin
1, de
682 fleste samiske tegn er definert i ISO-
8859-
4 (Latin
4) mens tilgang
683 til €-symbolet kom med ISO-
8859-
15 (Latin
9). ISO-
8859-
15 er en
684 revisjon av ISO-
8859-
1 som fjerner noen lite brukte symboler og
685 erstatter bokstaver som er mer brukt, og introduserer €-symbolet. Det
686 er viktig å merke at alle ISO-
8859-variantene har overlapp med
687 ASCII-
7, noe som ga samvirke med de engelskspråklige landene som ikke
688 trengte å gjøre noe. Det innebærer også at de første
128 verdiene i
689 ISO-
8859-variantene representerer de samme symbolene. Det er først når
690 du kommer til tolkningen av de resterende
128 verdiene med nummer
128
691 til
255, at det oppsto tolkningsutfordringer mellom
692 ISO-
8859-variantene.
</p
>
694 <p
>ISO-
8859-verdenen fungerte godt så lenge tegnsettet som ble brukt når
695 innhold ble skapt, også ble brukt når innhold ble gjengitt og du ikke
696 trengte å kombinere innhold fra forskjellige tegnsett i samme
697 dokument. Utfordringen med bruken av ISO-
8859-variantene ble raskt
698 tydelig i en mer globalisert verden med utveksling av tekst på tvers
699 av landegrenser der tekstlig innhold i dokumenter, e-poster og
700 websider kunne bli skrevet med ett tegnsett og gjengitt med et annet
703 <table align=
"center
" width=
"60%
">
705 <caption
>Tabell
3. Viser tolkning av verdiene som er tilegnet de
706 norske symbolene i ISO-
8859-
1 i de andre ISO
8859-variatene. Merk
707 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
>
711 <th
>Binærverdi
</th
>
712 <th
>1</th
>
713 <th
>2</th
>
714 <th
>3</th
>
715 <th
>4</th
>
716 <th
>5</th
>
717 <th
>6</th
>
718 <th
>7</th
>
719 <th
>8</th
>
720 <th
>9</th
>
721 <th
>10</th
>
722 <th
>11</th
>
723 <th
>13</th
>
724 <th
>14</th
>
725 <th
>15</th
>
726 <th
>16</th
>
729 <td
>11000110</td
>
730 <td
>Æ
</td
>
731 <td
>Ć
</td
>
732 <td
>Ĉ
</td
>
733 <td
>Æ
</td
>
734 <td
>Ц
</td
>
735 <td
>ئ
</td
>
736 <td
>Ζ
</td
>
737 <td
></td
>
738 <td
>Æ
</td
>
739 <td
>Æ
</td
>
740 <td
>ฦ
</td
>
741 <td
>Ę
</td
>
742 <td
>Æ
</td
>
743 <td
>Æ
</td
>
744 <td
>Æ
</td
>
747 <td
>11011000</td
>
748 <td
>Ø
</td
>
749 <td
>Ř
</td
>
750 <td
>Ĝ
</td
>
751 <td
>Ø
</td
>
752 <td
>и
</td
>
753 <td
>ظ
</td
>
754 <td
>Ψ
</td
>
755 <td
></td
>
756 <td
>Ø
</td
>
757 <td
>Ø
</td
>
758 <td
>ุ
</td
>
759 <td
>Ų
</td
>
760 <td
>Ø
</td
>
761 <td
>Ø
</td
>
762 <td
>Ű
</td
>
765 <td
>11000101</td
>
766 <td
>Å
</td
>
767 <td
>Ĺ
</td
>
768 <td
>Ċ
</td
>
769 <td
>Å
</td
>
770 <td
>Х
</td
>
771 <td
>إ
</td
>
772 <td
>Ε
</td
>
773 <td
></td
>
774 <td
>Å
</td
>
775 <td
>Å
</td
>
776 <td
>ล
</td
>
777 <td
>Å
</td
>
778 <td
>Å
</td
>
779 <td
>Å
</td
>
780 <td
>Ć
</td
>
783 <td
>11100110</td
>
784 <td
>æ
</td
>
785 <td
>ć
</td
>
786 <td
>ĉ
</td
>
787 <td
>æ
</td
>
788 <td
>ц
</td
>
789 <td
>ن
</td
>
790 <td
>ζ
</td
>
791 <td
>ז
</td
>
792 <td
>æ
</td
>
793 <td
>æ
</td
>
794 <td
>ๆ
</td
>
795 <td
>ę
</td
>
796 <td
>æ
</td
>
797 <td
>æ
</td
>
798 <td
>v
</td
>
801 <td
>11111000</td
>
802 <td
>ø
</td
>
803 <td
>ř
</td
>
804 <td
>ĝ
</td
>
805 <td
>ø
</td
>
806 <td
>ј
</td
>
807 <td
></td
>
808 <td
>ψ
</td
>
809 <td
>ר
</td
>
810 <td
>ø
</td
>
811 <td
>ø
</td
>
812 <td
>๘
</td
>
813 <td
>ų
</td
>
814 <td
>ø
</td
>
815 <td
>ø
</td
>
816 <td
>ű
</td
>
819 <td
>11100101</td
>
820 <td
>å
</td
>
821 <td
>ĺ
</td
>
822 <td
>ċ
</td
>
823 <td
>å
</td
>
824 <td
>х
</td
>
825 <td
>م
</td
>
826 <td
>ε
</td
>
827 <td
>ו
</td
>
828 <td
>å
</td
>
829 <td
>å
</td
>
830 <td
>ๅ
</td
>
831 <td
>å
</td
>
832 <td
>å
</td
>
833 <td
>å
</td
>
834 <td
>ć
</td
>
839 <p
>Denne problemstillingen er illustrert i tabell
3, der vi ser verdiene
840 tilegnet de norske symbolene i ISO-
8859-
1 i kolonne «
1». I de øvrige
841 kolonnene ser vi hvilket symbol verdien får i de andre
842 ISO-
8859-variantene. Tar vi utgangspunkt i tabell
3, kan vi se at
843 ordet lærlingspørsmål gjengitt med ISO-
8859-
2 (kolonne
2) blir
844 lćrlingspřrsmĺl, mens det blir lζrlingspψrsmεl med ISO-
8859-
7
845 (kolonne
7). Med ISO-
8859-
2 blir «æ» til «ć», «ø» til «ř» og «å» til
846 «ĺ». I ISO-
8859-
7 blir «æ» til «ζ», «ø» til «ψ», mens «å» blir «ε».
</p
>
848 <p
>Det er egentlig ingen utfordring med dette så lenge du vet hvilket
849 tegnsett innholdet ditt er representert med, og det ikke har skjedd
850 omforminger som du ikke er klar over. Det er det siste som er
851 problematisk, spesielt de datasystemene som har vært i bruk de siste
852 20 årene, som ikke har noe innebygd funksjonalitet for å forvalte
853 tegnsettproblematikken. Et godt eksempel på dette er
854 Microsoft-tegnsettet Windows-
1252, som ble forvekslet som
100 %
855 kompatibel med ISO-
8859-
1, men hadde byttet ut plassene fra
127 til
856 159. Historisk vil det finnes en del variasjon i hvilket tegnsett som
857 har vært i bruk, og hvor vellykket konvertering mellom tegnsett har
860 <p id=
"tegnsett_access_unicode_som_løsning
"><strong
>Unicode som løsning
</strong
></p
>
862 <p
>Tegnsettforvirring ble etter hvert et irritasjonsmoment og
863 samvirkeproblem. Ofte fikk man en e-post der æøå var erstattet av rare
864 symboler fordi e-posten hadde vært innom et eller annet datasystem som
865 ikke brukte samme tegnsett.
</p
>
867 <p
>For å løse dette samvirkeproblemet for tegnsett ble det startet et
868 arbeid og en ny standard så dagens lys etter hvert. Denne standarden
869 fikk navnet Unicode (ISO/ IEC
10646) og skulle resultere i et tegnsett
870 som alle skulle være enige om. Unicode er et repertoar og en
871 representasjon, dvs. navngivning og tilordning av tallverdi til alle
872 symboler i bruk i verden i dag. Oppføringer i Unicode skrives gjerne
873 U+XXXX der XXXX er tallkoden i sekstentallssystemet som oppføringen
874 har i Unicode-katalogen. Her finner vi tegn brukt av både levende og
875 døde språk, konstruerte språk, tekniske symboler, morsomme tegninger
876 (såkalte emojier) og tegn ingen vet hva betyr eller skal brukes
877 til. Et morsomt eksempel er i nettartikkelen: U+
237C ⍼ RIGHT ANGLE
878 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
>
880 <p
>Sammen med Unicode kom det tre måter å kode disse tallene på; UTF-
8,
881 UTF-
16 og UTF-
32. Av datatekniske årsaker er UTF-
8 mye brukt, spesielt
882 når det gjelder utveksling av tekst over Internett, mens UTF-
16 er
883 brukt en del til tekstfiler lagret på Windows. En utfordring med
884 Unicode og UTF-variantene er at disse gir flere måter å kode samme
885 symbol på med en kombinasjonsmekanisme. Dette kan gi utfordringer ved
886 søk, hvis en skal søke etter et ord som har ett eller flere symboler
887 som kan skrives på ulikt vis, så er det ikke sikkert at søkesystemet
888 vil finne alle forekomster. For eksempel kan bokstaven U+
00F8 «Latin
889 Small Letter O with Stroke» kodes som den tradisjonelle norske tegnet
890 ø, men også som o kombinert med skråstrek U+
0338. Begge deler er
891 gyldig bruk av Unicode, selv om det er tradisjon for å foretrekke å
892 «normalisere» kombinasjoner som enkelttegn der det er mulig, nettopp
893 for å forenkle søk.
</p
>
895 <p id=
"tegnsett_access_bare_unicode_fremover
"><strong
>Bare Unicode fremover
</strong
></p
>
897 <p
>Forvaltningens bruk av tegnsett er regulert i Forskrift om
898 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
899 utveksling av informasjon mellom forvaltningsorganer og fra
900 forvaltningsorgan til innbyggere og næringsliv skal tegnsettstandarden
901 ISO/IEC
10646 representert ved UTF8 benyttes.» Det er forskjellige
902 bruksområder til UTF-
8, UTF-
16 og UTF-
32, men UTF-
8 er kodingen vi
903 kjenner mest til. Det er flere grunner at UTF-
8 «vant» konkurransen
904 til å bli den utvalgte. Den kanskje viktigste er at UTF-
8 er fullt
905 samvirkende med ASCII-
7, slik at den engelskspråklige delen av verden
906 kunne rulle ut UTF-
8 uten å merke noe forskjell. En tekstfil med kun
907 ASCII-tekst vil være identisk på disken hvis den lagres som UTF-
8 og
908 ASCII. UTF-
16 og UTF-
32 byr på noen optimaliseringer som gjør dem
909 relevant for spesifikke problemområder, men for det meste vil vi aldri
910 oppleve disse standardene på nært hold i hverdagen. Det er uansett kun
911 bruken av UTF-
8 som er lovregulert i Norge.
</p
>
913 <p
>Det er ikke slik at hele verden bruker ISO/IEC
10646 og UTF-
8. Kina
914 har egne standarder for tegnsett, mye brukt er GB
18030, som er
915 Unicode med en annen koding enn UTF-
8, mens Taiwan og andre asiatiske
916 land gjerne bruker Big5 eller andre tegnsett.
</p
>
918 <p
>UTF-
8 er dominerende i Norge, men det er tidsperioder der forskjellige
919 datasystemer utvekslet data i henhold til ISO-
8859-
1, ISO-
8859-
15,
920 Windows-
1252, Codepage
865 og ISO-
646-
60 / Codepage
1016 mens
921 overgangen til UTF-
8 pågikk. Det er ikke slik at et datasystem enkelt
922 kan tvinges til å bruke et tegnsett, da det er flere lag i et
923 datasystem som må settes opp til å bruke riktig tegnsett, og
924 tegnsettproblemet fort oppstår når det er et eller annet i
925 datasystemet som bruker feil tegnsett.
</p
>
927 <p
>Et klassisk eksempel på problemet er en utveksling av tekst mellom to
928 systemer der teksten i utgangspunktet er kodet i UTF-
8, men går
929 gjennom noe som er ISO-
8859-
1 underveis. Dette kan vises med at ordet
930 «på» i et slik scenario ender opp som «pÃ¥». Det er mulig å spore
931 dette tilbake til verdiene symbolene er tilordnet i tegnsettene. «på»
932 blir til «pÃ¥» fordi «å» i UTF-
8 er representert med U+C3AF, og dersom
933 vi ser på hva disse verdiene representerer, ser vi at
934 sekstentallssystemverdien C3 er
1100 0011 i totallssystemet og
935 symbolet med dette tallet i ISO-
8859-
1 er Ã.
</p
>
937 <p
>Vi ser det samme med sekstentallssystemverdien A5, som er
1010 0101 i
938 totallssystemet, og tilsvarende symbol i ISO-
8859-
1 er ¥. Slik
939 mojibake kan lett skje hvis «på» i utgangspunktet var representert med
940 UTF-
8, men ble behandlet med et system som bruker ISO-
8859-
1. Det er
941 ingen automatikk i å fange opp slike ødeleggelser mens tekstlig
942 innhold utveksles mellom datasystemer.
</p
>
944 <p
>En utfordring for depotarkivene er at bruken av tegnsett ikke alltid
945 har vært regulert, og at det kan finnes flere dokumentasjonssamlinger
946 som er opprettet med varierende tegnsett før gjeldende forskrift
947 inntraff – uten at det er mulig å avlede fra filene hvilket tegnsett
948 som ble brukt. Et eksempel på dette er €-symbolet, som kom først etter
949 at ISO-
8859-
1 var tatt i bruk. Det kan bli en utfordring for et
950 depotarkiv, men så lenge det er kjent hvilket tegnsett var i bruk, så
951 bør det gå bra. Riksarkivarens
952 forskrift
<sup
>[
<a id=
"tegnsett_access_footnoteref_4
" href=
"#tegnsett_access_footnotedef_4
" title=
"View footnote.
">4</a
>]
</sup
>
953 formaliserer dette ved å kreve følgende:
</p
>
956 <p
>§
5-
11. Tegnsett i arkivuttrekk
</p
>
959 <li
>Arkivuttrekk og medfølgende struktur- og innholdsbeskrivelser skal
960 overføres som ren tekst i ukryptert form, og benytte godkjent
963 <li
>Godkjente tegnsett er:
965 <li
>Unicode UTF-
8<br
>
966 (ISO/IEC
10646-
1:
2000 Annex D)
</li
>
967 <li
>ISO
8859-
1:
1998, Latin
1</li
>
968 <li
>ISO
8859-
4:
1998, Latin
4 for samiske tegn.
</li
>
969 </ol
></li
>
971 <li
>Andre tegnsett aksepteres bare etter avtale med Arkivverket.
</li
>
975 <p id=
"tegnsett_access_ditt_ansvar
"><strong
>Ditt ansvar
</strong
></p
>
977 <p
>På mange måter burde ikke tegnsett være et problem i
2023, men sånn er
978 det nok ikke. Land som har oppgradert til UTF-
8 som primærtegnsett for
979 utveksling av tekstlig innhold, begrenser problematikken betraktelig,
980 men globalt sett så er tegnsettutfordringen ikke løst fordi ikke alle
981 er enige om å bruke samme tegnsett. Det kan være geopolitiske eller
982 kulturelle hensyn som ligger til grunn for dette.
</p
>
984 <p
>Det er uansett verdt å merke at selv om bruken av UTF-
8 skulle bli
985 100% utbredt, så er det et historisk perspektiv (ASCII-
7,
986 ISO-
8859-variantene, UTF-
8) her som gjør tegnsett til et problemområde
987 arkivarene må forstå og håndtere. Som danningsarkivar har du et
988 ansvar for å vite hvilket tegnsett systemene og databasene dere
989 forvalter, er i samsvar med. Det er noe IT-avdelingen din eller
990 programvareleverandørene enkelt skal kunne svare på, og svaret skal
991 være UTF-
8 for alle nye systemer.
</p
>
995 <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
>
997 <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
>
999 <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
>
1001 <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
>
1005 <p
>For øvrig burde varsleren Edward Snowden få politisk asyl i Norge.
</p
>
1007 <p
>Som vanlig, hvis du bruker Bitcoin og ønsker å vise din støtte til
1008 det jeg driver med, setter jeg pris på om du sender Bitcoin-donasjoner
1010 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>. Merk,
1011 betaling med bitcoin er ikke anonymt. :)
</p
>
1016 <title>New and improved sqlcipher in Debian for accessing Signal database
</title>
1017 <link>https://people.skolelinux.org/pere/blog/New_and_improved_sqlcipher_in_Debian_for_accessing_Signal_database.html
</link>
1018 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/New_and_improved_sqlcipher_in_Debian_for_accessing_Signal_database.html
</guid>
1019 <pubDate>Sun,
12 Nov
2023 12:
00:
00 +
0100</pubDate>
1020 <description><p
>For a while now I wanted to have direct access to the
1021 <a href=
"https://signal.org/
">Signal
</a
> database of messages and
1022 channels of my Desktop edition of Signal. I prefer the enforced end
1023 to end encryption of Signal these days for my communication with
1024 friends and family, to increase the level of safety and privacy as
1025 well as raising the cost of the mass surveillance government and
1026 non-government entities practice these days. In August I came across
1028 <a href=
"https://www.yoranbrondsema.com/post/the-guide-to-extracting-statistics-from-your-signal-conversations/
">recipe
1029 on how to use sqlcipher to extract statistics from the Signal
1030 database
</a
> explaining how to do this. Unfortunately this did not
1031 work with the version of sqlcipher in Debian. The
1032 <a href=
"http://tracker.debian.org/sqlcipher/
">sqlcipher
</a
>
1033 package is a
"fork
" of the sqlite package with added support for
1034 encrypted databases. Sadly the current Debian maintainer
1035 <a href=
"https://bugs.debian.org/
961598">announced more than three
1036 years ago that he did not have time to maintain sqlcipher
</a
>, so it
1037 seemed unlikely to be upgraded by the maintainer. I was reluctant to
1038 take on the job myself, as I have very limited experience maintaining
1039 shared libraries in Debian. After waiting and hoping for a few
1040 months, I gave up the last week, and set out to update the package. In
1041 the process I orphaned it to make it more obvious for the next person
1042 looking at it that the package need proper maintenance.
</p
>
1044 <p
>The version in Debian was around five years old, and quite a lot of
1045 changes had taken place upstream into the Debian maintenance git
1046 repository. After spending a few days importing the new upstream
1047 versions, realising that upstream did not care much for SONAME
1048 versioning as I saw library symbols being both added and removed with
1049 minor version number changes to the project, I concluded that I had to
1050 do a SONAME bump of the library package to avoid surprising the
1051 reverse dependencies. I even added a simple
1052 autopkgtest script to ensure the package work as intended. Dug deep
1053 into the hole of learning shared library maintenance, I set out a few
1054 days ago to upload the new version to Debian experimental to see what
1055 the quality assurance framework in Debian had to say about the result.
1056 The feedback told me the pacakge was not too shabby, and yesterday I
1057 uploaded the latest version to Debian unstable. It should enter
1058 testing today or tomorrow, perhaps delayed by
1059 <a href=
"https://bugs.debian.org/
1055812">a small library
1060 transition
</a
>.
</p
>
1062 <p
>Armed with a new version of sqlcipher, I can now have a look at the
1063 SQL database in ~/.config/Signal/sql/db.sqlite. First, one need to
1064 fetch the encryption key from the Signal configuration using this
1065 simple JSON extraction command:
</p
>
1067 <pre
>/usr/bin/jq -r
'.
"key
"' ~/.config/Signal/config.json
</pre
>
1069 <p
>Assuming the result from that command is
'secretkey
', which is a
1070 hexadecimal number representing the key used to encrypt the database.
1071 Next, one can now connect to the database and inject the encryption
1072 key for access via SQL to fetch information from the database. Here
1073 is an example dumping the database structure:
</p
>
1076 % sqlcipher ~/.config/Signal/sql/db.sqlite
1077 sqlite
> PRAGMA key =
"x
'secretkey
'";
1079 CREATE TABLE sqlite_stat1(tbl,idx,stat);
1080 CREATE TABLE conversations(
1081 id STRING PRIMARY KEY ASC,
1089 , profileFamilyName TEXT, profileFullName TEXT, e164 TEXT, serviceId TEXT, groupId TEXT, profileLastFetchedAt INTEGER);
1090 CREATE TABLE identityKeys(
1091 id STRING PRIMARY KEY ASC,
1095 id STRING PRIMARY KEY ASC,
1098 CREATE TABLE sessions(
1099 id TEXT PRIMARY KEY,
1100 conversationId TEXT,
1102 , ourServiceId STRING, serviceId STRING);
1103 CREATE TABLE attachment_downloads(
1104 id STRING primary key,
1109 CREATE TABLE sticker_packs(
1110 id TEXT PRIMARY KEY,
1114 coverStickerId INTEGER,
1116 downloadAttempts INTEGER,
1117 installedAt INTEGER,
1120 stickerCount INTEGER,
1122 , attemptedStatus STRING, position INTEGER DEFAULT
0 NOT NULL, storageID STRING, storageVersion INTEGER, storageUnknownFields BLOB, storageNeedsSync
1123 INTEGER DEFAULT
0 NOT NULL);
1124 CREATE TABLE stickers(
1125 id INTEGER NOT NULL,
1126 packId TEXT NOT NULL,
1130 isCoverOnly INTEGER,
1135 PRIMARY KEY (id, packId),
1136 CONSTRAINT stickers_fk
1137 FOREIGN KEY (packId)
1138 REFERENCES sticker_packs(id)
1141 CREATE TABLE sticker_references(
1144 CONSTRAINT sticker_references_fk
1146 REFERENCES sticker_packs(id)
1149 CREATE TABLE emojis(
1150 shortName TEXT PRIMARY KEY,
1153 CREATE TABLE messages(
1154 rowid INTEGER PRIMARY KEY ASC,
1160 schemaVersion INTEGER,
1161 conversationId STRING,
1162 received_at INTEGER,
1164 hasAttachments INTEGER,
1165 hasFileAttachments INTEGER,
1166 hasVisualMediaAttachments INTEGER,
1167 expireTimer INTEGER,
1168 expirationStartTimestamp INTEGER,
1171 messageTimer INTEGER,
1172 messageTimerStart INTEGER,
1173 messageTimerExpiresAt INTEGER,
1176 sourceServiceId TEXT, serverGuid STRING NULL, sourceDevice INTEGER, storyId STRING, isStory INTEGER
1177 GENERATED ALWAYS AS (type IS
'story
'), isChangeCreatedByUs INTEGER NOT NULL DEFAULT
0, isTimerChangeFromSync INTEGER
1178 GENERATED ALWAYS AS (
1179 json_extract(json,
'$.expirationTimerUpdate.fromSync
') IS
1
1180 ), seenStatus NUMBER default
0, storyDistributionListId STRING, expiresAt INT
1183 expirationStartTimestamp + (expireTimer *
1000),
1185 )), shouldAffectActivity INTEGER
1186 GENERATED ALWAYS AS (
1190 'change-number-notification
',
1191 'contact-removed-notification
',
1192 'conversation-merge
',
1193 'group-v1-migration
',
1194 'keychange
',
1195 'message-history-unsynced
',
1196 'profile-change
',
1198 'universal-timer-notification
',
1199 'verified-change
'
1201 ), shouldAffectPreview INTEGER
1202 GENERATED ALWAYS AS (
1206 'change-number-notification
',
1207 'contact-removed-notification
',
1208 'conversation-merge
',
1209 'group-v1-migration
',
1210 'keychange
',
1211 'message-history-unsynced
',
1212 'profile-change
',
1214 'universal-timer-notification
',
1215 'verified-change
'
1217 ), isUserInitiatedMessage INTEGER
1218 GENERATED ALWAYS AS (
1222 'change-number-notification
',
1223 'contact-removed-notification
',
1224 'conversation-merge
',
1225 'group-v1-migration
',
1226 'group-v2-change
',
1227 'keychange
',
1228 'message-history-unsynced
',
1229 'profile-change
',
1231 'universal-timer-notification
',
1232 'verified-change
'
1234 ), mentionsMe INTEGER NOT NULL DEFAULT
0, isGroupLeaveEvent INTEGER
1235 GENERATED ALWAYS AS (
1236 type IS
'group-v2-change
' AND
1237 json_array_length(json_extract(json,
'$.groupV2Change.details
')) IS
1 AND
1238 json_extract(json,
'$.groupV2Change.details[
0].type
') IS
'member-remove
' AND
1239 json_extract(json,
'$.groupV2Change.from
') IS NOT NULL AND
1240 json_extract(json,
'$.groupV2Change.from
') IS json_extract(json,
'$.groupV2Change.details[
0].aci
')
1241 ), isGroupLeaveEventFromOther INTEGER
1242 GENERATED ALWAYS AS (
1243 isGroupLeaveEvent IS
1
1245 isChangeCreatedByUs IS
0
1247 GENERATED ALWAYS AS (
1248 json_extract(json,
'$.callId
')
1250 CREATE TABLE sqlite_stat4(tbl,idx,neq,nlt,ndlt,sample);
1252 id TEXT PRIMARY KEY,
1253 queueType TEXT STRING NOT NULL,
1254 timestamp INTEGER NOT NULL,
1257 CREATE TABLE reactions(
1258 conversationId STRING,
1261 messageReceivedAt INTEGER,
1262 targetAuthorAci STRING,
1263 targetTimestamp INTEGER,
1265 , messageId STRING);
1266 CREATE TABLE senderKeys(
1267 id TEXT PRIMARY KEY NOT NULL,
1268 senderId TEXT NOT NULL,
1269 distributionId TEXT NOT NULL,
1271 lastUpdatedDate NUMBER NOT NULL
1273 CREATE TABLE unprocessed(
1274 id STRING PRIMARY KEY ASC,
1281 serverTimestamp INTEGER,
1282 sourceServiceId STRING
1283 , serverGuid STRING NULL, sourceDevice INTEGER, receivedAtCounter INTEGER, urgent INTEGER, story INTEGER);
1284 CREATE TABLE sendLogPayloads(
1285 id INTEGER PRIMARY KEY ASC,
1287 timestamp INTEGER NOT NULL,
1288 contentHint INTEGER NOT NULL,
1290 , urgent INTEGER, hasPniSignatureMessage INTEGER DEFAULT
0 NOT NULL);
1291 CREATE TABLE sendLogRecipients(
1292 payloadId INTEGER NOT NULL,
1294 recipientServiceId STRING NOT NULL,
1295 deviceId INTEGER NOT NULL,
1297 PRIMARY KEY (payloadId, recipientServiceId, deviceId),
1299 CONSTRAINT sendLogRecipientsForeignKey
1300 FOREIGN KEY (payloadId)
1301 REFERENCES sendLogPayloads(id)
1304 CREATE TABLE sendLogMessageIds(
1305 payloadId INTEGER NOT NULL,
1307 messageId STRING NOT NULL,
1309 PRIMARY KEY (payloadId, messageId),
1311 CONSTRAINT sendLogMessageIdsForeignKey
1312 FOREIGN KEY (payloadId)
1313 REFERENCES sendLogPayloads(id)
1316 CREATE TABLE preKeys(
1317 id STRING PRIMARY KEY ASC,
1319 , ourServiceId NUMBER
1320 GENERATED ALWAYS AS (json_extract(json,
'$.ourServiceId
')));
1321 CREATE TABLE signedPreKeys(
1322 id STRING PRIMARY KEY ASC,
1324 , ourServiceId NUMBER
1325 GENERATED ALWAYS AS (json_extract(json,
'$.ourServiceId
')));
1326 CREATE TABLE badges(
1327 id TEXT PRIMARY KEY,
1328 category TEXT NOT NULL,
1330 descriptionTemplate TEXT NOT NULL
1332 CREATE TABLE badgeImageFiles(
1333 badgeId TEXT REFERENCES badges(id)
1336 'order
' INTEGER NOT NULL,
1341 CREATE TABLE storyReads (
1342 authorId STRING NOT NULL,
1343 conversationId STRING NOT NULL,
1344 storyId STRING NOT NULL,
1345 storyReadDate NUMBER NOT NULL,
1347 PRIMARY KEY (authorId, storyId)
1349 CREATE TABLE storyDistributions(
1350 id STRING PRIMARY KEY NOT NULL,
1353 senderKeyInfoJson STRING
1354 , deletedAtTimestamp INTEGER, allowsReplies INTEGER, isBlockList INTEGER, storageID STRING, storageVersion INTEGER, storageUnknownFields BLOB, storageNeedsSync INTEGER);
1355 CREATE TABLE storyDistributionMembers(
1356 listId STRING NOT NULL REFERENCES storyDistributions(id)
1359 serviceId STRING NOT NULL,
1361 PRIMARY KEY (listId, serviceId)
1363 CREATE TABLE uninstalled_sticker_packs (
1364 id STRING NOT NULL PRIMARY KEY,
1365 uninstalledAt NUMBER NOT NULL,
1367 storageVersion NUMBER,
1368 storageUnknownFields BLOB,
1369 storageNeedsSync INTEGER NOT NULL
1371 CREATE TABLE groupCallRingCancellations(
1372 ringId INTEGER PRIMARY KEY,
1373 createdAt INTEGER NOT NULL
1375 CREATE TABLE IF NOT EXISTS
'messages_fts_data
'(id INTEGER PRIMARY KEY, block BLOB);
1376 CREATE TABLE IF NOT EXISTS
'messages_fts_idx
'(segid, term, pgno, PRIMARY KEY(segid, term)) WITHOUT ROWID;
1377 CREATE TABLE IF NOT EXISTS
'messages_fts_content
'(id INTEGER PRIMARY KEY, c0);
1378 CREATE TABLE IF NOT EXISTS
'messages_fts_docsize
'(id INTEGER PRIMARY KEY, sz BLOB);
1379 CREATE TABLE IF NOT EXISTS
'messages_fts_config
'(k PRIMARY KEY, v) WITHOUT ROWID;
1380 CREATE TABLE edited_messages(
1381 messageId STRING REFERENCES messages(id)
1385 , conversationId STRING);
1386 CREATE TABLE mentions (
1387 messageId REFERENCES messages(id) ON DELETE CASCADE,
1392 CREATE TABLE kyberPreKeys(
1393 id STRING PRIMARY KEY NOT NULL,
1394 json TEXT NOT NULL, ourServiceId NUMBER
1395 GENERATED ALWAYS AS (json_extract(json,
'$.ourServiceId
')));
1396 CREATE TABLE callsHistory (
1397 callId TEXT PRIMARY KEY,
1398 peerId TEXT NOT NULL, -- conversation id (legacy) | uuid | groupId | roomId
1399 ringerId TEXT DEFAULT NULL, -- ringer uuid
1400 mode TEXT NOT NULL, -- enum
"Direct
" |
"Group
"
1401 type TEXT NOT NULL, -- enum
"Audio
" |
"Video
" |
"Group
"
1402 direction TEXT NOT NULL, -- enum
"Incoming
" |
"Outgoing
1403 -- Direct: enum
"Pending
" |
"Missed
" |
"Accepted
" |
"Deleted
"
1404 -- Group: enum
"GenericGroupCall
" |
"OutgoingRing
" |
"Ringing
" |
"Joined
" |
"Missed
" |
"Declined
" |
"Accepted
" |
"Deleted
"
1405 status TEXT NOT NULL,
1406 timestamp INTEGER NOT NULL,
1407 UNIQUE (callId, peerId) ON CONFLICT FAIL
1409 [ dropped all indexes to save space in this blog post ]
1410 CREATE TRIGGER messages_on_view_once_update AFTER UPDATE ON messages
1412 new.body IS NOT NULL AND new.isViewOnce =
1
1414 DELETE FROM messages_fts WHERE rowid = old.rowid;
1416 CREATE TRIGGER messages_on_insert AFTER INSERT ON messages
1417 WHEN new.isViewOnce IS NOT
1 AND new.storyId IS NULL
1419 INSERT INTO messages_fts
1422 (new.rowid, new.body);
1424 CREATE TRIGGER messages_on_delete AFTER DELETE ON messages BEGIN
1425 DELETE FROM messages_fts WHERE rowid = old.rowid;
1426 DELETE FROM sendLogPayloads WHERE id IN (
1427 SELECT payloadId FROM sendLogMessageIds
1428 WHERE messageId = old.id
1430 DELETE FROM reactions WHERE rowid IN (
1431 SELECT rowid FROM reactions
1432 WHERE messageId = old.id
1434 DELETE FROM storyReads WHERE storyId = old.storyId;
1436 CREATE VIRTUAL TABLE messages_fts USING fts5(
1438 tokenize =
'signal_tokenizer
'
1440 CREATE TRIGGER messages_on_update AFTER UPDATE ON messages
1442 (new.body IS NULL OR old.body IS NOT new.body) AND
1443 new.isViewOnce IS NOT
1 AND new.storyId IS NULL
1445 DELETE FROM messages_fts WHERE rowid = old.rowid;
1446 INSERT INTO messages_fts
1449 (new.rowid, new.body);
1451 CREATE TRIGGER messages_on_insert_insert_mentions AFTER INSERT ON messages
1453 INSERT INTO mentions (messageId, mentionAci, start, length)
1455 SELECT messages.id, bodyRanges.value -
>> 'mentionAci
' as mentionAci,
1456 bodyRanges.value -
>> 'start
' as start,
1457 bodyRanges.value -
>> 'length
' as length
1458 FROM messages, json_each(messages.json -
>> 'bodyRanges
') as bodyRanges
1459 WHERE bodyRanges.value -
>> 'mentionAci
' IS NOT NULL
1461 AND messages.id = new.id;
1463 CREATE TRIGGER messages_on_update_update_mentions AFTER UPDATE ON messages
1465 DELETE FROM mentions WHERE messageId = new.id;
1466 INSERT INTO mentions (messageId, mentionAci, start, length)
1468 SELECT messages.id, bodyRanges.value -
>> 'mentionAci
' as mentionAci,
1469 bodyRanges.value -
>> 'start
' as start,
1470 bodyRanges.value -
>> 'length
' as length
1471 FROM messages, json_each(messages.json -
>> 'bodyRanges
') as bodyRanges
1472 WHERE bodyRanges.value -
>> 'mentionAci
' IS NOT NULL
1474 AND messages.id = new.id;
1479 <p
>Finally I have the tool needed to inspect and process Signal
1480 messages that I need, without using the vendor provided client. Now
1481 on to transforming it to a more useful format.
</p
>
1483 <p
>As usual, if you use Bitcoin and want to show your support of my
1484 activities, please send Bitcoin donations to my address
1485 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
1490 <title>New chrpath release
0.17</title>
1491 <link>https://people.skolelinux.org/pere/blog/New_chrpath_release_0_17.html
</link>
1492 <guid isPermaLink=
"true">https://people.skolelinux.org/pere/blog/New_chrpath_release_0_17.html
</guid>
1493 <pubDate>Fri,
10 Nov
2023 07:
30:
00 +
0100</pubDate>
1494 <description><p
>The chrpath package provide a simple command line tool to remove or
1495 modify the rpath or runpath of compiled ELF program. It is almost
10
1496 years since I updated the code base, but I stumbled over the tool
1497 today, and decided it was time to move the code base from Subversion
1498 to git and find a new home for it, as the previous one (Debian Alioth)
1499 has been shut down. I decided to go with
1500 <a href=
"https://codeberg.org/
">Codeberg
</a
> this time, as it is my git
1501 service of choice these days, did a quick and dirty migration to git
1502 and updated the code with a few patches I found in the Debian bug
1503 tracker. These are the release notes:
</p
>
1505 <p
>New in
0.17 released
2023-
11-
10:
</p
>
1508 <li
>Moved project to Codeberg, as Alioth is shut down.
</li
>
1509 <li
>Add Solaris support (use
&lt;sys/byteorder.h
> instead of
&lt;byteswap.h
>).
1510 Patch from Rainer Orth.
</li
>
1511 <li
>Added missing newline from printf() line. Patch from Frank Dana.
</li
>
1512 <li
>Corrected handling of multiple ELF sections. Patch from Frank Dana.
</li
>
1513 <li
>Updated build rules for .deb. Partly based on patch from djcj.
</li
>
1516 <p
>The latest edition is tagged and available from
1517 <a href=
"https://codeberg.org/pere/chrpath
">https://codeberg.org/pere/chrpath
</a
>.
1519 <p
>As usual, if you use Bitcoin and want to show your support of my
1520 activities, please send Bitcoin donations to my address
1521 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>