1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries from November
2013</title>
5 <description>Entries from November
2013</description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
10 <title>All drones should be radio marked with what they do and who they belong to
</title>
11 <link>http://people.skolelinux.org/pere/blog/All_drones_should_be_radio_marked_with_what_they_do_and_who_they_belong_to.html
</link>
12 <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>
13 <pubDate>Thu,
21 Nov
2013 15:
40:
00 +
0100</pubDate>
14 <description>Drones, flying robots, are getting more and more popular. The most
15 know ones are the killer drones used by some government to murder
16 people they do not like without giving them the chance of a fair
17 trial, but the technology have many good uses too, from mapping and
18 forest maintenance to photography and search and rescue. I am sure it
19 is just a question of time before
"bad drones
" are in the hands of
20 private enterprises and not only state criminals but petty criminals
21 too. The drone technology is very useful and very dangerous. To have
22 some control over the use of drones, I agree with Daniel Suarez in his
24 "<a href=
"http://www.ted.com/talks/daniel_suarez_the_kill_decision_shouldn_t_belong_to_a_robot.html
">The
25 kill decision shouldn
't belong to a robot
</a
>", where he suggested this
26 little gem to keep the good while limiting the bad use of drones:
</p
>
30 <p
>Each robot and drone should have a cryptographically signed
31 I.D. burned in at the factory that can be used to track its movement
32 through public spaces. We have license plates on cars, tail numbers on
33 aircraft. This is no different. And every citizen should be able to
34 download an app that shows the population of drones and autonomous
35 vehicles moving through public spaces around them, both right now and
36 historically. And civic leaders should deploy sensors and civic drones
37 to detect rogue drones, and instead of sending killer drones of their
38 own up to shoot them down, they should notify humans to their
39 presence. And in certain very high-security areas, perhaps civic
40 drones would snare them and drag them off to a bomb disposal facility.
</p
>
42 <p
>But notice, this is more an immune system than a weapons system. It
43 would allow us to avail ourselves of the use of autonomous vehicles
44 and drones while still preserving our open, civil society.
</p
>
48 <p
>The key is that
<em
>every citizen
</em
> should be able to read the
49 radio beacons sent from the drones in the area, to be able to check
50 both the government and others use of drones. For such control to be
51 effective, everyone must be able to do it. What should such beacon
52 contain? At least formal owner, purpose, contact information and GPS
53 location. Probably also the origin and target position of the current
54 flight. And perhaps some registration number to be able to look up
55 the drone in a central database tracking their movement. Robots
56 should not have privacy. It is people who need privacy.
</p
>
61 <title>Lets make a wireless community network in Oslo!
</title>
62 <link>http://people.skolelinux.org/pere/blog/Lets_make_a_wireless_community_network_in_Oslo_.html
</link>
63 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Lets_make_a_wireless_community_network_in_Oslo_.html
</guid>
64 <pubDate>Wed,
13 Nov
2013 21:
00:
00 +
0100</pubDate>
65 <description><p
>Today NUUG and Hackeriet announced
66 <a href=
"http://www.nuug.no/news/Bli_med___bygge_dugnadsnett_for_alle_i_Oslo.shtml
">our
67 plans to join forces and create a wireless community network in
68 Oslo
</a
>. The workshop to help people get started will take place
69 Thursday
2013-
11-
28, but we already are collecting the geolocation of
70 people joining forces to make this happen. We have
71 <a href=
"https://github.com/petterreinholdtsen/meshfx-node/blob/master/oslo-nodes.geojson
">9
72 locations plotted on the map
</a
>, but we will need more before we have
73 a connected mesh spread across Oslo. If this sound interesting to
74 you, please join us at the workshop. If you are too impatient to wait
75 15 days, please join us on the IRC channel
76 <a href=
"irc://irc.freenode.net/%
23nuug
">#nuug on irc.freenode.net
</a
>
77 right away. :)
</p
>
82 <title>Running TP-Link MR3040 as a batman-adv mesh node using openwrt
</title>
83 <link>http://people.skolelinux.org/pere/blog/Running_TP_Link_MR3040_as_a_batman_adv_mesh_node_using_openwrt.html
</link>
84 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Running_TP_Link_MR3040_as_a_batman_adv_mesh_node_using_openwrt.html
</guid>
85 <pubDate>Sun,
10 Nov
2013 23:
00:
00 +
0100</pubDate>
86 <description><p
>Continuing my research into mesh networking, I was recommended to
87 use TP-Link
3040 and
3600 access points as mesh nodes, and the pair I
88 bought arrived on Friday. Here are my notes on how to set up the
89 MR3040 as a mesh node using
90 <a href=
"http://www.openwrt.org/
">OpenWrt
</a
>.
</p
>
92 <p
>I started by following the instructions on the OpenWRT wiki for
93 <a href=
"http://wiki.openwrt.org/toh/tp-link/tl-mr3040
">TL-MR3040
</a
>,
95 <a href=
"http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin
">the
96 recommended firmware image
</a
>
97 (openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin) and
98 uploaded it into the original web interface. The flashing went fine,
99 and the machine was available via telnet on the ethernet port. After
100 logging in and setting the root password, ssh was available and I
101 could start to set it up as a batman-adv mesh node.
</p
>
103 <p
>I started off by reading the instructions from
104 <a href=
"http://wirelessafrica.meraka.org.za/wiki/index.php?title=Antoine
's_Research
">Wireless
105 Africa
</a
>, which had quite a lot of useful information, but
106 eventually I followed the recipe from the Open Mesh wiki for
107 <a href=
"http://www.open-mesh.org/projects/batman-adv/wiki/Batman-adv-openwrt-config
">using
108 batman-adv on OpenWrt
</a
>. A small snag was the fact that the
109 <tt
>opkg install kmod-batman-adv
</tt
> command did not work as it
110 should. The batman-adv kernel module would fail to load because its
111 dependency crc16 was not already loaded. I
112 <a href=
"https://dev.openwrt.org/ticket/
14452">reported the bug
</a
> to
113 the openwrt project and hope it will be fixed soon. But the problem
114 only seem to affect initial testing of batman-adv, as configuration
115 seem to work when booting from scratch.
</p
>
117 <p
>The setup is done using files in /etc/config/. I did not bridge
118 the Ethernet and mesh interfaces this time, to be able to hook up the
119 box on my local network and log into it for configuration updates.
120 The following files were changed and look like this after modifying
123 <p
><tt
>/etc/config/network
</tt
></p
>
127 config interface
'loopback
'
128 option ifname
'lo
'
129 option proto
'static
'
130 option ipaddr
'127.0.0.1'
131 option netmask
'255.0.0.0'
133 config globals
'globals
'
134 option ula_prefix
'fdbf:
4c12:
3fed::/
48'
136 config interface
'lan
'
137 option ifname
'eth0
'
138 option type
'bridge
'
139 option proto
'dhcp
'
140 option ipaddr
'192.168.1.1'
141 option netmask
'255.255.255.0'
142 option hostname
'tl-mr3040
'
143 option ip6assign
'60'
145 config interface
'mesh
'
146 option ifname
'adhoc0
'
147 option mtu
'1528'
148 option proto
'batadv
'
149 option mesh
'bat0
'
152 <p
><tt
>/etc/config/wireless
</tt
></p
>
155 config wifi-device
'radio0
'
156 option type
'mac80211
'
157 option channel
'11'
158 option hwmode
'11ng
'
159 option path
'platform/ar933x_wmac
'
160 option htmode
'HT20
'
161 list ht_capab
'SHORT-GI-
20'
162 list ht_capab
'SHORT-GI-
40'
163 list ht_capab
'RX-STBC1
'
164 list ht_capab
'DSSS_CCK-
40'
165 option disabled
'0'
167 config wifi-iface
'wmesh
'
168 option device
'radio0
'
169 option ifname
'adhoc0
'
170 option network
'mesh
'
171 option encryption
'none
'
172 option mode
'adhoc
'
173 option bssid
'02:BA:
00:
00:
00:
01'
174 option ssid
'meshfx@hackeriet
'
176 <p
><tt
>/etc/config/batman-adv
</tt
></p
>
179 config
'mesh
' 'bat0
'
180 option interfaces
'adhoc0
'
181 option
'aggregated_ogms
'
182 option
'ap_isolation
'
183 option
'bonding
'
184 option
'fragmentation
'
185 option
'gw_bandwidth
'
186 option
'gw_mode
'
187 option
'gw_sel_class
'
188 option
'log_level
'
189 option
'orig_interval
'
190 option
'vis_mode
'
191 option
'bridge_loop_avoidance
'
192 option
'distributed_arp_table
'
193 option
'network_coding
'
194 option
'hop_penalty
'
196 # yet another batX instance
197 # config
'mesh
' 'bat5
'
198 # option
'interfaces
' 'second_mesh
'
201 <p
>The mesh node is now operational. I have yet to test its range,
202 but I hope it is good. I have not yet tested the TP-Link
3600 box
203 still wrapped up in plastic.
</p
>
208 <title>Debian init.d boot script example for rsyslog
</title>
209 <link>http://people.skolelinux.org/pere/blog/Debian_init_d_boot_script_example_for_rsyslog.html
</link>
210 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Debian_init_d_boot_script_example_for_rsyslog.html
</guid>
211 <pubDate>Sat,
2 Nov
2013 22:
40:
00 +
0100</pubDate>
212 <description><p
>If one of the points of switching to a new init system in Debian is
213 <a href=
"http://thomas.goirand.fr/blog/?p=
147">to get rid of huge
214 init.d scripts
</a
>, I doubt we need to switch away from sysvinit and
215 init.d scripts at all. Here is an example init.d script, ie a rewrite
216 of /etc/init.d/rsyslog:
</p
>
219 #!/lib/init/init-d-script
222 # Required-Start: $remote_fs $time
223 # Required-Stop: umountnfs $time
224 # X-Stop-After: sendsigs
225 # Default-Start:
2 3 4 5
226 # Default-Stop:
0 1 6
227 # Short-Description: enhanced syslogd
228 # Description: Rsyslog is an enhanced multi-threaded syslogd.
229 # It is quite compatible to stock sysklogd and can be
230 # used as a drop-in replacement.
232 DESC=
"enhanced syslogd
"
233 DAEMON=/usr/sbin/rsyslogd
234 </pre
></p
>
236 <p
>Pretty minimalistic to me... For the record, the original sysv-rc
237 script was
137 lines, and the above is just
15 lines, most of it meta
238 info/comments.
</p
>
240 <p
>How to do this, you ask? Well, one create a new script
241 /lib/init/init-d-script looking something like this:
246 # Define LSB log_* functions.
247 # Depend on lsb-base (
>=
3.2-
14) to ensure that this file is present
248 # and status_of_proc is working.
249 . /lib/lsb/init-functions
252 # Function that starts the daemon/service
258 #
0 if daemon has been started
259 #
1 if daemon was already running
260 #
2 if daemon could not be started
261 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test
> /dev/null \
263 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
266 # Add code here, if necessary, that waits for the process to be ready
267 # to handle requests from services started subsequently which depend
268 # on this one. As a last resort, sleep for some time.
272 # Function that stops the daemon/service
277 #
0 if daemon has been stopped
278 #
1 if daemon was already stopped
279 #
2 if daemon could not be stopped
280 # other if a failure occurred
281 start-stop-daemon --stop --quiet --retry=TERM/
30/KILL/
5 --pidfile $PIDFILE --name $NAME
282 RETVAL=
"$?
"
283 [
"$RETVAL
" =
2 ]
&& return
2
284 # Wait for children to finish too if this is a daemon that forks
285 # and if the daemon is only ever run from this initscript.
286 # If the above conditions are not satisfied then add some other code
287 # that waits for the process to drop all resources that could be
288 # needed by services started subsequently. A last resort is to
289 # sleep for some time.
290 start-stop-daemon --stop --quiet --oknodo --retry=
0/
30/KILL/
5 --exec $DAEMON
291 [
"$?
" =
2 ]
&& return
2
292 # Many daemons don
't delete their pidfiles when they exit.
294 return
"$RETVAL
"
298 # Function that sends a SIGHUP to the daemon/service
302 # If the daemon can reload its configuration without
303 # restarting (for example, when it is sent a SIGHUP),
304 # then implement that here.
306 start-stop-daemon --stop --signal
1 --quiet --pidfile $PIDFILE --name $NAME
311 scriptbasename=
"$(basename $
1)
"
312 echo
"SN: $scriptbasename
"
313 if [
"$scriptbasename
" !=
"init-d-library
" ] ; then
314 script=
"$
1"
321 NAME=$(basename $DAEMON)
322 PIDFILE=/var/run/$NAME.pid
324 # Exit if the package is not installed
325 #[ -x
"$DAEMON
" ] || exit
0
327 # Read configuration variable file if it is present
328 [ -r /etc/default/$NAME ]
&& . /etc/default/$NAME
330 # Load the VERBOSE setting and other rcS variables
333 case
"$
1" in
335 [
"$VERBOSE
" != no ]
&& log_daemon_msg
"Starting $DESC
" "$NAME
"
337 case
"$?
" in
338 0|
1) [
"$VERBOSE
" != no ]
&& log_end_msg
0 ;;
339 2) [
"$VERBOSE
" != no ]
&& log_end_msg
1 ;;
343 [
"$VERBOSE
" != no ]
&& log_daemon_msg
"Stopping $DESC
" "$NAME
"
345 case
"$?
" in
346 0|
1) [
"$VERBOSE
" != no ]
&& log_end_msg
0 ;;
347 2) [
"$VERBOSE
" != no ]
&& log_end_msg
1 ;;
351 status_of_proc
"$DAEMON
" "$NAME
" && exit
0 || exit $?
353 #reload|force-reload)
355 # If do_reload() is not implemented then leave this commented out
356 # and leave
'force-reload
' as an alias for
'restart
'.
358 #log_daemon_msg
"Reloading $DESC
" "$NAME
"
362 restart|force-reload)
364 # If the
"reload
" option is implemented then remove the
365 #
'force-reload
' alias
367 log_daemon_msg
"Restarting $DESC
" "$NAME
"
369 case
"$?
" in
372 case
"$?
" in
374 1) log_end_msg
1 ;; # Old process is still running
375 *) log_end_msg
1 ;; # Failed to start
385 echo
"Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}
" >&2
391 </pre
></p
>
393 <p
>It is based on /etc/init.d/skeleton, and could be improved quite a
394 lot. I did not really polish the approach, so it might not always
395 work out of the box, but you get the idea. I did not try very hard to
396 optimize it nor make it more robust either.
</p
>
398 <p
>A better argument for switching init system in Debian than reducing
399 the size of init scripts (which is a good thing to do anyway), is to
400 get boot system that is able to handle the kernel events sensibly and
401 robustly, and do not depend on the boot to run sequentially. The boot
402 and the kernel have not behaved sequentially in years.
</p
>
407 <title>Browser plugin for SPICE (spice-xpi) uploaded to Debian
</title>
408 <link>http://people.skolelinux.org/pere/blog/Browser_plugin_for_SPICE__spice_xpi__uploaded_to_Debian.html
</link>
409 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Browser_plugin_for_SPICE__spice_xpi__uploaded_to_Debian.html
</guid>
410 <pubDate>Fri,
1 Nov
2013 11:
00:
00 +
0100</pubDate>
411 <description><p
><a href=
"http://www.spice-space.org/
">The SPICE protocol
</a
> for
412 remote display access is the preferred solution with oVirt and RedHat
413 Enterprise Virtualization, and I was sad to discover the other day
414 that the browser plugin needed to use these systems seamlessly was
415 missing in Debian. The
<a href=
"http://bugs.debian.org/
668284">request
416 for a package
</a
> was from
2012-
04-
10 with no progress since
417 2013-
04-
01, so I decided to wrap up a package based on the great work
418 from Cajus Pollmeier and put it in a collab-maint maintained git
419 repository to get a package I could use. I would very much like
420 others to help me maintain the package (or just take over, I do not
421 mind), but as no-one had volunteered so far, I just uploaded it to
422 NEW. I hope it will be available in Debian in a few days.
</p
>
424 <p
>The source is now available from
425 <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
>