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>http://people.skolelinux.org/pere/blog/
</link>
7 <atom:link href=
"http://people.skolelinux.org/pere/blog/index.rss" rel=
"self" type=
"application/rss+xml" />
10 <title>RSS-kilde for fritekstsøk i offentlige anbud hos Doffin
</title>
11 <link>http://people.skolelinux.org/pere/blog/RSS_kilde_for_friteksts_k_i_offentlige_anbud_hos_Doffin.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/RSS_kilde_for_friteksts_k_i_offentlige_anbud_hos_Doffin.html
</guid>
13 <pubDate>Fri,
22 Nov
2013 13:
40:
00 +
0100</pubDate>
14 <description><p
>I fjor sommer lagde jeg en
15 <a href=
"http://people.skolelinux.org/pere/blog/SQL_database_med_anbud_publisert_p__Doffin.html
">offentlig
16 tilgjengelig SQL-database over offentlig anbud
</a
> basert på skraping
17 av HTML-data fra Doffin. Den har stått og gått siden da, og har nå
18 ca.
28000 oppføringer. Jeg oppdaget da jeg tittet innom at noen
19 oppføringer var ikke blitt med, antagelig på grunn av at de fikk
20 tildelt sekvensnummer i Doffin en godt stund før de ble publisert,
21 slik at min nettsideskraper som fortsatte skrapingen der den slapp
22 sist ikke fikk dem med seg. Jeg har fikset litt slik at skraperen nå
23 ser litt tilbake i tid for å se om den har gått glipp av noen
24 oppføringer, og har skrapet på nytt fra midten av september
2013 og
25 fremover. Det bør dermed bli en mer komplett database for kommende
26 måneder. Hvis jeg får tid skal jeg forsøke å skrape
"glemte
" data fra
27 før midten av september
2013, men tør ikke garantere at det blir
28 prioritert med det første.
</p
>
30 <p
>Men målet med denne bloggposten er å vise hvordan denne
31 Doffin-databasen kan brukes og integreres med en RSS-leser, slik at en
32 kan la datamaskinen holde et øye med Doffin-annonseringer etter
33 nøkkelord. En kan lage sitt eget søk ved å besøke
34 <ahref=
"https://classic.scraperwiki.com/docs/api?name=norwegian-doffin#sqlite
">API-et
35 hos Scraperwiki
</a
>, velge format rss2 og så legge inn noe ala dette i
36 "query in SQL
":
</p
>
39 select title, scrapedurl as link, abstract as description,
40 publishdate as pubDate from
'swdata
'
41 where abstract like
'%linux%
' or title like
'%linux%
'
42 order by seq desc limit
20
43 </pre
></p
>
45 <p
>Dette vil søke opp alle anbud med ordet linux i oppsummering eller
46 tittel. En kan lage mer avanserte søk hvis en ønsker det. URL-en som
47 dukker opp nederst på siden kan en så gi til sin RSS-leser (jeg bruker
48 akregator selv), og så automatisk få beskjed hvis det dukker opp anbud
49 med det aktuelle nøkkelordet i teksten. Merk at kapasiteten hos
50 Scraperwiki er begrenset, så be RSS-leseren kun hente ned en gang hver
51 dag eller noe slikt.
</p
>
53 <p
>Du lurer kanskje på hva slags informasjon en kan få ut fra denne
54 databasen. Her er to RSS-kilder, med søkeordet
55 "<a href=
"https://api.scraperwiki.com/api/
1.0/datastore/sqlite?format=rss2
&name=norwegian-doffin
&query=select%
20title%
2C%
20scrapedurl%
20as%
20link%
2C%
20abstract%
20as%
20description%
2C%
0A%
20%
20%
20%
20%
20%
20%
20publishdate%
20as%
20pubDate%
20from%
20'swdata
'%
0A%
20%
20%
20where%
20abstract%
20like%
20'%
25linux%
25'%
20or%
20title%
20like%
20'%
25linux%
25'%
0A%
20%
20%
20order%
20by%
20seq%
20desc%
20limit%
2020">linux
</a
>",
57 "<a href=
"https://api.scraperwiki.com/api/
1.0/datastore/sqlite?format=rss2
&name=norwegian-doffin
&query=select%
20title%
2C%
20scrapedurl%
20as%
20link%
2C%
20abstract%
20as%
20description%
2C%
0A%
20%
20%
20%
20%
20%
20%
20publishdate%
20as%
20pubDate%
20from%
20'swdata
'%
0A%
20%
20%
20where%
20abstract%
20like%
20'%
25fri%
20programvare%
25'%
20or%
20title%
20like%
20'%
25fri%
20programvare%
25'%
0A%
20%
20%
20order%
20by%
20seq%
20desc%
20limit%
2020">fri
58 programvare
</a
>"
60 "<a href=
"https://api.scraperwiki.com/api/
1.0/datastore/sqlite?format=rss2
&name=norwegian-doffin
&query=select%
20title%
2C%
20scrapedurl%
20as%
20link%
2C%
20abstract%
20as%
20description%
2C%
0A%
20%
20%
20%
20%
20%
20%
20publishdate%
20as%
20pubDate%
20from%
20'swdata
'%
0A%
20%
20%
20where%
20abstract%
20like%
20'%
25odf%
25'%
20or%
20title%
20like%
20'%
25odf%
25'%
0A%
20%
20%
20order%
20by%
20seq%
20desc%
20limit%
2020">odf
</a
>".
61 Det er bare å søke på det en er interessert i. Kopier gjerne
62 datasettet og sett opp din egen tjeneste hvis du vil gjøre mer
63 avanserte søk. SQLite-filen med Doffin-oppføringer kan lastes med fra
64 Scraperwiki for de som vil grave dypere.
</p
>
65 <!-- nov
625, okt
1080, sep
1120 --
>
70 <title>All drones should be radio marked with what they do and who they belong to
</title>
71 <link>http://people.skolelinux.org/pere/blog/All_drones_should_be_radio_marked_with_what_they_do_and_who_they_belong_to.html
</link>
72 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/All_drones_should_be_radio_marked_with_what_they_do_and_who_they_belong_to.html
</guid>
73 <pubDate>Thu,
21 Nov
2013 15:
40:
00 +
0100</pubDate>
74 <description>Drones, flying robots, are getting more and more popular. The most
75 know ones are the killer drones used by some government to murder
76 people they do not like without giving them the chance of a fair
77 trial, but the technology have many good uses too, from mapping and
78 forest maintenance to photography and search and rescue. I am sure it
79 is just a question of time before
"bad drones
" are in the hands of
80 private enterprises and not only state criminals but petty criminals
81 too. The drone technology is very useful and very dangerous. To have
82 some control over the use of drones, I agree with Daniel Suarez in his
84 "<a href=
"https://archive.org/details/DanielSuarez_2013G
">The kill
85 decision shouldn
't belong to a robot
</a
>", where he suggested this
86 little gem to keep the good while limiting the bad use of drones:
</p
>
90 <p
>Each robot and drone should have a cryptographically signed
91 I.D. burned in at the factory that can be used to track its movement
92 through public spaces. We have license plates on cars, tail numbers on
93 aircraft. This is no different. And every citizen should be able to
94 download an app that shows the population of drones and autonomous
95 vehicles moving through public spaces around them, both right now and
96 historically. And civic leaders should deploy sensors and civic drones
97 to detect rogue drones, and instead of sending killer drones of their
98 own up to shoot them down, they should notify humans to their
99 presence. And in certain very high-security areas, perhaps civic
100 drones would snare them and drag them off to a bomb disposal facility.
</p
>
102 <p
>But notice, this is more an immune system than a weapons system. It
103 would allow us to avail ourselves of the use of autonomous vehicles
104 and drones while still preserving our open, civil society.
</p
>
108 <p
>The key is that
<em
>every citizen
</em
> should be able to read the
109 radio beacons sent from the drones in the area, to be able to check
110 both the government and others use of drones. For such control to be
111 effective, everyone must be able to do it. What should such beacon
112 contain? At least formal owner, purpose, contact information and GPS
113 location. Probably also the origin and target position of the current
114 flight. And perhaps some registration number to be able to look up
115 the drone in a central database tracking their movement. Robots
116 should not have privacy. It is people who need privacy.
</p
>
121 <title>Lets make a wireless community network in Oslo!
</title>
122 <link>http://people.skolelinux.org/pere/blog/Lets_make_a_wireless_community_network_in_Oslo_.html
</link>
123 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Lets_make_a_wireless_community_network_in_Oslo_.html
</guid>
124 <pubDate>Wed,
13 Nov
2013 21:
00:
00 +
0100</pubDate>
125 <description><p
>Today NUUG and Hackeriet announced
126 <a href=
"http://www.nuug.no/news/Bli_med___bygge_dugnadsnett_for_alle_i_Oslo.shtml
">our
127 plans to join forces and create a wireless community network in
128 Oslo
</a
>. The workshop to help people get started will take place
129 Thursday
2013-
11-
28, but we already are collecting the geolocation of
130 people joining forces to make this happen. We have
131 <a href=
"https://github.com/petterreinholdtsen/meshfx-node/blob/master/oslo-nodes.geojson
">9
132 locations plotted on the map
</a
>, but we will need more before we have
133 a connected mesh spread across Oslo. If this sound interesting to
134 you, please join us at the workshop. If you are too impatient to wait
135 15 days, please join us on the IRC channel
136 <a href=
"irc://irc.freenode.net/%
23nuug
">#nuug on irc.freenode.net
</a
>
137 right away. :)
</p
>
142 <title>Running TP-Link MR3040 as a batman-adv mesh node using openwrt
</title>
143 <link>http://people.skolelinux.org/pere/blog/Running_TP_Link_MR3040_as_a_batman_adv_mesh_node_using_openwrt.html
</link>
144 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Running_TP_Link_MR3040_as_a_batman_adv_mesh_node_using_openwrt.html
</guid>
145 <pubDate>Sun,
10 Nov
2013 23:
00:
00 +
0100</pubDate>
146 <description><p
>Continuing my research into mesh networking, I was recommended to
147 use TP-Link
3040 and
3600 access points as mesh nodes, and the pair I
148 bought arrived on Friday. Here are my notes on how to set up the
149 MR3040 as a mesh node using
150 <a href=
"http://www.openwrt.org/
">OpenWrt
</a
>.
</p
>
152 <p
>I started by following the instructions on the OpenWRT wiki for
153 <a href=
"http://wiki.openwrt.org/toh/tp-link/tl-mr3040
">TL-MR3040
</a
>,
155 <a href=
"http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin
">the
156 recommended firmware image
</a
>
157 (openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin) and
158 uploaded it into the original web interface. The flashing went fine,
159 and the machine was available via telnet on the ethernet port. After
160 logging in and setting the root password, ssh was available and I
161 could start to set it up as a batman-adv mesh node.
</p
>
163 <p
>I started off by reading the instructions from
164 <a href=
"http://wirelessafrica.meraka.org.za/wiki/index.php?title=Antoine
's_Research
">Wireless
165 Africa
</a
>, which had quite a lot of useful information, but
166 eventually I followed the recipe from the Open Mesh wiki for
167 <a href=
"http://www.open-mesh.org/projects/batman-adv/wiki/Batman-adv-openwrt-config
">using
168 batman-adv on OpenWrt
</a
>. A small snag was the fact that the
169 <tt
>opkg install kmod-batman-adv
</tt
> command did not work as it
170 should. The batman-adv kernel module would fail to load because its
171 dependency crc16 was not already loaded. I
172 <a href=
"https://dev.openwrt.org/ticket/
14452">reported the bug
</a
> to
173 the openwrt project and hope it will be fixed soon. But the problem
174 only seem to affect initial testing of batman-adv, as configuration
175 seem to work when booting from scratch.
</p
>
177 <p
>The setup is done using files in /etc/config/. I did not bridge
178 the Ethernet and mesh interfaces this time, to be able to hook up the
179 box on my local network and log into it for configuration updates.
180 The following files were changed and look like this after modifying
183 <p
><tt
>/etc/config/network
</tt
></p
>
187 config interface
'loopback
'
188 option ifname
'lo
'
189 option proto
'static
'
190 option ipaddr
'127.0.0.1'
191 option netmask
'255.0.0.0'
193 config globals
'globals
'
194 option ula_prefix
'fdbf:
4c12:
3fed::/
48'
196 config interface
'lan
'
197 option ifname
'eth0
'
198 option type
'bridge
'
199 option proto
'dhcp
'
200 option ipaddr
'192.168.1.1'
201 option netmask
'255.255.255.0'
202 option hostname
'tl-mr3040
'
203 option ip6assign
'60'
205 config interface
'mesh
'
206 option ifname
'adhoc0
'
207 option mtu
'1528'
208 option proto
'batadv
'
209 option mesh
'bat0
'
212 <p
><tt
>/etc/config/wireless
</tt
></p
>
215 config wifi-device
'radio0
'
216 option type
'mac80211
'
217 option channel
'11'
218 option hwmode
'11ng
'
219 option path
'platform/ar933x_wmac
'
220 option htmode
'HT20
'
221 list ht_capab
'SHORT-GI-
20'
222 list ht_capab
'SHORT-GI-
40'
223 list ht_capab
'RX-STBC1
'
224 list ht_capab
'DSSS_CCK-
40'
225 option disabled
'0'
227 config wifi-iface
'wmesh
'
228 option device
'radio0
'
229 option ifname
'adhoc0
'
230 option network
'mesh
'
231 option encryption
'none
'
232 option mode
'adhoc
'
233 option bssid
'02:BA:
00:
00:
00:
01'
234 option ssid
'meshfx@hackeriet
'
236 <p
><tt
>/etc/config/batman-adv
</tt
></p
>
239 config
'mesh
' 'bat0
'
240 option interfaces
'adhoc0
'
241 option
'aggregated_ogms
'
242 option
'ap_isolation
'
243 option
'bonding
'
244 option
'fragmentation
'
245 option
'gw_bandwidth
'
246 option
'gw_mode
'
247 option
'gw_sel_class
'
248 option
'log_level
'
249 option
'orig_interval
'
250 option
'vis_mode
'
251 option
'bridge_loop_avoidance
'
252 option
'distributed_arp_table
'
253 option
'network_coding
'
254 option
'hop_penalty
'
256 # yet another batX instance
257 # config
'mesh
' 'bat5
'
258 # option
'interfaces
' 'second_mesh
'
261 <p
>The mesh node is now operational. I have yet to test its range,
262 but I hope it is good. I have not yet tested the TP-Link
3600 box
263 still wrapped up in plastic.
</p
>
268 <title>Debian init.d boot script example for rsyslog
</title>
269 <link>http://people.skolelinux.org/pere/blog/Debian_init_d_boot_script_example_for_rsyslog.html
</link>
270 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Debian_init_d_boot_script_example_for_rsyslog.html
</guid>
271 <pubDate>Sat,
2 Nov
2013 22:
40:
00 +
0100</pubDate>
272 <description><p
>If one of the points of switching to a new init system in Debian is
273 <a href=
"http://thomas.goirand.fr/blog/?p=
147">to get rid of huge
274 init.d scripts
</a
>, I doubt we need to switch away from sysvinit and
275 init.d scripts at all. Here is an example init.d script, ie a rewrite
276 of /etc/init.d/rsyslog:
</p
>
279 #!/lib/init/init-d-script
282 # Required-Start: $remote_fs $time
283 # Required-Stop: umountnfs $time
284 # X-Stop-After: sendsigs
285 # Default-Start:
2 3 4 5
286 # Default-Stop:
0 1 6
287 # Short-Description: enhanced syslogd
288 # Description: Rsyslog is an enhanced multi-threaded syslogd.
289 # It is quite compatible to stock sysklogd and can be
290 # used as a drop-in replacement.
292 DESC=
"enhanced syslogd
"
293 DAEMON=/usr/sbin/rsyslogd
294 </pre
></p
>
296 <p
>Pretty minimalistic to me... For the record, the original sysv-rc
297 script was
137 lines, and the above is just
15 lines, most of it meta
298 info/comments.
</p
>
300 <p
>How to do this, you ask? Well, one create a new script
301 /lib/init/init-d-script looking something like this:
306 # Define LSB log_* functions.
307 # Depend on lsb-base (
>=
3.2-
14) to ensure that this file is present
308 # and status_of_proc is working.
309 . /lib/lsb/init-functions
312 # Function that starts the daemon/service
318 #
0 if daemon has been started
319 #
1 if daemon was already running
320 #
2 if daemon could not be started
321 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test
> /dev/null \
323 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
326 # Add code here, if necessary, that waits for the process to be ready
327 # to handle requests from services started subsequently which depend
328 # on this one. As a last resort, sleep for some time.
332 # Function that stops the daemon/service
337 #
0 if daemon has been stopped
338 #
1 if daemon was already stopped
339 #
2 if daemon could not be stopped
340 # other if a failure occurred
341 start-stop-daemon --stop --quiet --retry=TERM/
30/KILL/
5 --pidfile $PIDFILE --name $NAME
342 RETVAL=
"$?
"
343 [
"$RETVAL
" =
2 ]
&& return
2
344 # Wait for children to finish too if this is a daemon that forks
345 # and if the daemon is only ever run from this initscript.
346 # If the above conditions are not satisfied then add some other code
347 # that waits for the process to drop all resources that could be
348 # needed by services started subsequently. A last resort is to
349 # sleep for some time.
350 start-stop-daemon --stop --quiet --oknodo --retry=
0/
30/KILL/
5 --exec $DAEMON
351 [
"$?
" =
2 ]
&& return
2
352 # Many daemons don
't delete their pidfiles when they exit.
354 return
"$RETVAL
"
358 # Function that sends a SIGHUP to the daemon/service
362 # If the daemon can reload its configuration without
363 # restarting (for example, when it is sent a SIGHUP),
364 # then implement that here.
366 start-stop-daemon --stop --signal
1 --quiet --pidfile $PIDFILE --name $NAME
371 scriptbasename=
"$(basename $
1)
"
372 echo
"SN: $scriptbasename
"
373 if [
"$scriptbasename
" !=
"init-d-library
" ] ; then
374 script=
"$
1"
381 NAME=$(basename $DAEMON)
382 PIDFILE=/var/run/$NAME.pid
384 # Exit if the package is not installed
385 #[ -x
"$DAEMON
" ] || exit
0
387 # Read configuration variable file if it is present
388 [ -r /etc/default/$NAME ]
&& . /etc/default/$NAME
390 # Load the VERBOSE setting and other rcS variables
393 case
"$
1" in
395 [
"$VERBOSE
" != no ]
&& log_daemon_msg
"Starting $DESC
" "$NAME
"
397 case
"$?
" in
398 0|
1) [
"$VERBOSE
" != no ]
&& log_end_msg
0 ;;
399 2) [
"$VERBOSE
" != no ]
&& log_end_msg
1 ;;
403 [
"$VERBOSE
" != no ]
&& log_daemon_msg
"Stopping $DESC
" "$NAME
"
405 case
"$?
" in
406 0|
1) [
"$VERBOSE
" != no ]
&& log_end_msg
0 ;;
407 2) [
"$VERBOSE
" != no ]
&& log_end_msg
1 ;;
411 status_of_proc
"$DAEMON
" "$NAME
" && exit
0 || exit $?
413 #reload|force-reload)
415 # If do_reload() is not implemented then leave this commented out
416 # and leave
'force-reload
' as an alias for
'restart
'.
418 #log_daemon_msg
"Reloading $DESC
" "$NAME
"
422 restart|force-reload)
424 # If the
"reload
" option is implemented then remove the
425 #
'force-reload
' alias
427 log_daemon_msg
"Restarting $DESC
" "$NAME
"
429 case
"$?
" in
432 case
"$?
" in
434 1) log_end_msg
1 ;; # Old process is still running
435 *) log_end_msg
1 ;; # Failed to start
445 echo
"Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}
" >&2
451 </pre
></p
>
453 <p
>It is based on /etc/init.d/skeleton, and could be improved quite a
454 lot. I did not really polish the approach, so it might not always
455 work out of the box, but you get the idea. I did not try very hard to
456 optimize it nor make it more robust either.
</p
>
458 <p
>A better argument for switching init system in Debian than reducing
459 the size of init scripts (which is a good thing to do anyway), is to
460 get boot system that is able to handle the kernel events sensibly and
461 robustly, and do not depend on the boot to run sequentially. The boot
462 and the kernel have not behaved sequentially in years.
</p
>
467 <title>Browser plugin for SPICE (spice-xpi) uploaded to Debian
</title>
468 <link>http://people.skolelinux.org/pere/blog/Browser_plugin_for_SPICE__spice_xpi__uploaded_to_Debian.html
</link>
469 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Browser_plugin_for_SPICE__spice_xpi__uploaded_to_Debian.html
</guid>
470 <pubDate>Fri,
1 Nov
2013 11:
00:
00 +
0100</pubDate>
471 <description><p
><a href=
"http://www.spice-space.org/
">The SPICE protocol
</a
> for
472 remote display access is the preferred solution with oVirt and RedHat
473 Enterprise Virtualization, and I was sad to discover the other day
474 that the browser plugin needed to use these systems seamlessly was
475 missing in Debian. The
<a href=
"http://bugs.debian.org/
668284">request
476 for a package
</a
> was from
2012-
04-
10 with no progress since
477 2013-
04-
01, so I decided to wrap up a package based on the great work
478 from Cajus Pollmeier and put it in a collab-maint maintained git
479 repository to get a package I could use. I would very much like
480 others to help me maintain the package (or just take over, I do not
481 mind), but as no-one had volunteered so far, I just uploaded it to
482 NEW. I hope it will be available in Debian in a few days.
</p
>
484 <p
>The source is now available from
485 <a href=
"http://anonscm.debian.org/gitweb/?p=collab-maint/spice-xpi.git;a=summary
">http://anonscm.debian.org/gitweb/?p=collab-maint/spice-xpi.git;a=summary
</a
>.
</p
>
490 <title>Teaching vmdebootstrap to create Raspberry Pi SD card images
</title>
491 <link>http://people.skolelinux.org/pere/blog/Teaching_vmdebootstrap_to_create_Raspberry_Pi_SD_card_images.html
</link>
492 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Teaching_vmdebootstrap_to_create_Raspberry_Pi_SD_card_images.html
</guid>
493 <pubDate>Sun,
27 Oct
2013 17:
00:
00 +
0100</pubDate>
494 <description><p
>The
495 <a href=
"http://packages.qa.debian.org/v/vmdebootstrap.html
">vmdebootstrap
</a
>
496 program is a a very nice system to create virtual machine images. It
497 create a image file, add a partition table, mount it and run
498 debootstrap in the mounted directory to create a Debian system on a
499 stick. Yesterday, I decided to try to teach it how to make images for
500 <a href=
"https://wiki.debian.org/RaspberryPi
">Raspberry Pi
</a
>, as part
501 of a plan to simplify the build system for
502 <a href=
"https://wiki.debian.org/FreedomBox
">the FreedomBox
503 project
</a
>. The FreedomBox project already uses vmdebootstrap for
504 the virtualbox images, but its current build system made multistrap
505 based system for Dreamplug images, and it is lacking support for
506 Raspberry Pi.
</p
>
508 <p
>Armed with the knowledge on how to build
"foreign
" (aka non-native
509 architecture) chroots for Raspberry Pi, I dived into the vmdebootstrap
510 code and adjusted it to be able to build armel images on my amd64
511 Debian laptop. I ended up giving vmdebootstrap five new options,
512 allowing me to replicate the image creation process I use to make
513 <a href=
"http://people.skolelinux.org/pere/blog/A_Raspberry_Pi_based_batman_adv_Mesh_network_node.html
">Debian
514 Jessie based mesh node images for the Raspberry Pi
</a
>. First, the
515 <tt
>--foreign /path/to/binfm_handler
</tt
> option tell vmdebootstrap to
516 call debootstrap with --foreign and to copy the handler into the
517 generated chroot before running the second stage. This allow
518 vmdebootstrap to create armel images on an amd64 host. Next I added
519 two new options
<tt
>--bootsize size
</tt
> and
<tt
>--boottype
520 fstype
</tt
> to teach it to create a separate /boot/ partition with the
521 given file system type, allowing me to create an image with a vfat
522 partition for the /boot/ stuff. I also added a
<tt
>--variant
523 variant
</tt
> option to allow me to create smaller images without the
524 Debian base system packages installed. Finally, I added an option
525 <tt
>--no-extlinux
</tt
> to tell vmdebootstrap to not install extlinux
526 as a boot loader. It is not needed on the Raspberry Pi and probably
527 most other non-x86 architectures. The changes were accepted by the
528 upstream author of vmdebootstrap yesterday and today, and is now
530 <a href=
"http://git.liw.fi/cgi-bin/cgit/cgit.cgi/vmdebootstrap/
">the
531 upstream project page
</a
>.
</p
>
533 <p
>To use it to build a Raspberry Pi image using Debian Jessie, first
534 create a small script (the customize script) to add the non-free
535 binary blob needed to boot the Raspberry Pi and the APT source
540 set -e # Exit on first error
541 rootdir=
"$
1"
542 cd
"$rootdir
"
543 cat
&lt;
&lt;EOF
> etc/apt/sources.list
544 deb http://http.debian.net/debian/ jessie main contrib non-free
546 # Install non-free binary blob needed to boot Raspberry Pi. This
547 # install a kernel somewhere too.
548 wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update \
549 -O $rootdir/usr/bin/rpi-update
550 chmod a+x $rootdir/usr/bin/rpi-update
551 mkdir -p $rootdir/lib/modules
552 touch $rootdir/boot/start.elf
553 chroot $rootdir rpi-update
554 </pre
></p
>
556 <p
>Next, fetch the latest vmdebootstrap script and call it like this
557 to build the image:
</p
>
560 sudo ./vmdebootstrap \
563 --distribution jessie \
564 --mirror http://http.debian.net/debian \
573 --root-password raspberry \
574 --hostname raspberrypi \
575 --foreign /usr/bin/qemu-arm-static \
576 --customize `pwd`/customize \
580 --package ca-certificates \
583 </pre
></p
>
585 <p
>The list of packages being installed are the ones needed by
586 rpi-update to make the image bootable on the Raspberry Pi, with the
587 exception of netbase, which is needed by debootstrap to find
588 /etc/hosts with the minbase variant. I really wish there was a way to
589 set up an Raspberry Pi using only packages in the Debian archive, but
590 that is not possible as far as I know, because it boots from the GPU
591 using a non-free binary blob.
</p
>
593 <p
>The build host need debootstrap, kpartx and qemu-user-static and
594 probably a few others installed. I have not checked the complete
595 build dependency list.
</p
>
597 <p
>The resulting image will not use the hardware floating point unit
598 on the Raspberry PI, because the armel architecture in Debian is not
599 optimized for that use. So the images created will be a bit slower
600 than
<a href=
"http://www.raspbian.org/
">Raspbian
</a
> based images.
</p
>
605 <title>Det er jo makta som er mest sårbar ved massiv overvåkning av Internett
</title>
606 <link>http://people.skolelinux.org/pere/blog/Det_er_jo_makta_som_er_mest_s_rbar_ved_massiv_overv_kning_av_Internett.html
</link>
607 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Det_er_jo_makta_som_er_mest_s_rbar_ved_massiv_overv_kning_av_Internett.html
</guid>
608 <pubDate>Sat,
26 Oct
2013 20:
30:
00 +
0200</pubDate>
609 <description><p
>De siste måneders eksponering av
610 <a href=
"http://www.aftenposten.no/nyheter/uriks/Her-er-Edvard-Snowdens-mest-omtalte-avsloringer-
7351734.html
">den
611 totale overvåkningen som foregår i den vestlige verden dokumenterer
612 hvor sårbare vi er
</a
>. Men det slår meg at de som er mest sårbare
613 for dette, myndighetspersoner på alle nivåer, neppe har innsett at de
614 selv er de mest interessante personene å lage profiler på, for å kunne
615 påvirke dem.
</p
>
617 <p
>For å ta et lite eksempel: Stortingets nettsted,
618 <a href=
"http://www.stortinget.no/
">www.stortinget.no
</a
> (og
620 <a href=
"http://data.stortinget.no/
">data.stortinget.no
</a
>),
621 inneholder informasjon om det som foregår på Stortinget, og jeg antar
622 de største brukerne av informasjonen der er representanter og
623 rådgivere på Stortinget. Intet overraskende med det. Det som derimot
624 er mer skjult er at Stortingets nettsted bruker
625 <a href=
"http://en.wikipedia.org/wiki/Google_Analytics
">Google
626 Analytics
</a
>, hvilket gjør at enhver som besøker nettsidene der også
627 rapporterer om besøket via Internett-linjer som passerer Sverige,
628 England og videre til USA. Det betyr at informasjon om ethvert besøk
629 på stortingets nettsider kan snappes opp av svensk, britisk og USAs
630 etterretningsvesen. De kan dermed holde et øye med hvilke
631 Stortingssaker stortingsrepresentantene synes er interessante å sjekke
632 ut, og hvilke sider rådgivere og andre på stortinget synes er
633 interessant å besøke, når de gjør det og hvilke andre representanter
634 som sjekker de samme sidene omtrent samtidig. Stortingets bruk av
635 Google Analytics gjør det dermed enkelt for utenlands etteretning å
636 spore representantenes aktivitet og interesse. Hvis noen av
637 representantene bruker Google Mail eller noen andre tjenestene som
638 krever innlogging, så vil det være enda enklere å finne ut nøyaktig
639 hvilke personer som bruker hvilke nettlesere og dermed knytte
640 informasjonen opp til enkeltpersoner på Stortinget.
</p
>
642 <p
>Og jo flere nettsteder som bruker Google Analytics, jo bedre
643 oversikt over stortingsrepresentantenes lesevaner og interesse blir
644 tilgjengelig for svensk, britisk og USAs etterretning. Hva de kan
645 bruke den informasjonen til overlater jeg til leseren å undres
651 <title>A Raspberry Pi based batman-adv Mesh network node
</title>
652 <link>http://people.skolelinux.org/pere/blog/A_Raspberry_Pi_based_batman_adv_Mesh_network_node.html
</link>
653 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/A_Raspberry_Pi_based_batman_adv_Mesh_network_node.html
</guid>
654 <pubDate>Mon,
21 Oct
2013 11:
40:
00 +
0200</pubDate>
655 <description><p
>The last few days I have been experimenting with
656 <a href=
"http://www.open-mesh.org/projects/batman-adv/wiki
">the
657 batman-adv mesh technology
</a
>. I want to gain some experience to see
658 if it will fit
<a href=
"https://wiki.debian.org/FreedomBox
">the
659 Freedombox project
</a
>, and together with my neighbors try to build a
660 mesh network around the park where I live. Batman-adv is a layer
2
661 mesh system (
"ethernet
" in other words), where the mesh network appear
662 as if all the mesh clients are connected to the same switch.
</p
>
664 <p
>My hardware of choice was the Linksys WRT54GL routers I had lying
665 around, but I
've been unable to get them working with batman-adv. So
666 instead, I started playing with a
667 <a href=
"http://www.raspberrypi.org/
">Raspberry Pi
</a
>, and tried to
668 get it working as a mesh node. My idea is to use it to create a mesh
669 node which function as a switch port, where everything connected to
670 the Raspberry Pi ethernet plug is connected (bridged) to the mesh
671 network. This allow me to hook a wifi base station like the Linksys
672 WRT54GL to the mesh by plugging it into a Raspberry Pi, and allow
673 non-mesh clients to hook up to the mesh. This in turn is useful for
674 Android phones using
<a href=
"http://servalproject.org/
">the Serval
675 Project
</a
> voip client, allowing every one around the playground to
676 phone and message each other for free. The reason is that Android
677 phones do not see ad-hoc wifi networks (they are filtered away from
678 the GUI view), and can not join the mesh without being rooted. But if
679 they are connected using a normal wifi base station, they can talk to
680 every client on the local network.
</p
>
682 <p
>To get this working, I
've created a debian package
683 <a href=
"https://github.com/petterreinholdtsen/meshfx-node
">meshfx-node
</a
>
685 <a href=
"https://github.com/petterreinholdtsen/meshfx-node/blob/master/build-rpi-mesh-node
">build-rpi-mesh-node
</a
>
686 to create the Raspberry Pi boot image. I
'm using Debian Jessie (and
687 not Raspbian), to get more control over the packages available.
688 Unfortunately a huge binary blob need to be inserted into the boot
689 image to get it booting, but I
'll ignore that for now. Also, as
690 Debian lack support for the CPU features available in the Raspberry
691 Pi, the system do not use the hardware floating point unit. I hope
692 the routing performance isn
't affected by the lack of hardware FPU
695 <p
>To create an image, run the following with a sudo enabled user
696 after inserting the target SD card into the build machine:
</p
>
699 % wget -O build-rpi-mesh-node \
700 https://raw.github.com/petterreinholdtsen/meshfx-node/master/build-rpi-mesh-node
701 % sudo bash -x ./build-rpi-mesh-node
> build.log
2>&1
702 % dd if=/root/rpi/rpi_basic_jessie_$(date +%Y%m%d).img of=/dev/mmcblk0 bs=
1M
704 </pre
></p
>
706 <p
>Booting with the resulting SD card on a Raspberry PI with a USB
707 wifi card inserted should give you a mesh node. At least it does for
708 me with a the wifi card I am using. The default mesh settings are the
709 ones used by the Oslo mesh project at Hackeriet, as I mentioned in
710 <a href=
"http://people.skolelinux.org/pere/blog/Oslo_community_mesh_network___with_NUUG_and_Hackeriet_at_Hausmania.html
">an
711 earlier blog post about this mesh testing
</a
>.
</p
>
713 <p
>The mesh node was not horribly expensive either. I bought
714 everything over the counter in shops nearby. If I had ordered online
715 from the lowest bidder, the price should be significantly lower:
</p
>
717 <p
><table
>
719 <tr
><th
>Supplier
</th
><th
>Model
</th
><th
>NOK
</th
></tr
>
720 <tr
><td
>Teknikkmagasinet
</td
><td
>Raspberry Pi model B
</td
><td
>349.90</td
></tr
>
721 <tr
><td
>Teknikkmagasinet
</td
><td
>Raspberry Pi type B case
</td
><td
>99.90</td
></tr
>
722 <tr
><td
>Lefdal
</td
><td
>Jensen Air:Link
25150</td
><td
>295.-
</td
></tr
>
723 <tr
><td
>Clas Ohlson
</td
><td
>Kingston
16 GB SD card
</td
><td
>199.-
</td
></tr
>
724 <tr
><td
>Total cost
</td
><td
></td
><td
>943.80</td
></tr
>
726 </table
></p
>
728 <p
>Now my mesh network at home consist of one laptop in the basement
729 connected to my production network, one Raspberry Pi node on the
1th
730 floor that can be seen by my neighbor across the park, and one
731 play-node I use to develop the image building script. And some times
732 I hook up my work horse laptop to the mesh to test it. I look forward
733 to figuring out what kind of latency the batman-adv setup will give,
734 and how much packet loss we will experience around the park. :)
</p
>
739 <title>Perl library to control the Spykee robot moved to github
</title>
740 <link>http://people.skolelinux.org/pere/blog/Perl_library_to_control_the_Spykee_robot_moved_to_github.html
</link>
741 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Perl_library_to_control_the_Spykee_robot_moved_to_github.html
</guid>
742 <pubDate>Sat,
19 Oct
2013 10:
20:
00 +
0200</pubDate>
743 <description><p
>Back in
2010, I created a Perl library to talk to
744 <a href=
"http://en.wikipedia.org/wiki/Spykee
">the Spykee robot
</a
>
745 (with two belts, wifi, USB and Linux) and made it available from my
746 web page. Today I concluded that it should move to a site that is
747 easier to use to cooperate with others, and moved it to github. If
748 you got a Spykee robot, you might want to check out
749 <a href=
"https://github.com/petterreinholdtsen/libspykee-perl
">the
750 libspykee-perl github repository
</a
>.
</p
>