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