Junichi Uekawa: It's already September.
It's already September. I haven't written much code last month. I wrote a CSV parser and felt a little depressed after reading rfc4180. None of my CSV files were in CRLF.
It's already September. I haven't written much code last month. I wrote a CSV parser and felt a little depressed after reading rfc4180. None of my CSV files were in CRLF.
For a number of years now there has been growing concern that the management technologies in recent Intel CPUs (ME, AMT and vPro) also conceal capabilities for spying, either due to design flaws (no software is perfect) or backdoors deliberately installed for US spy agencies, as revealed by Edward Snowden. In a 2014 interview, Intel's CEO offered to answer any question, except this one.
The LibreBoot project provides a more comprehensive and technical analysis of the issue, summarized in the statement "the libreboot project recommends avoiding all modern Intel hardware. If you have an Intel based system affected by the problems described below, then you should get rid of it as soon as possible" - eerily similar to the official advice German authorities are giving to victims of Cayla the doll.
All those amateur psychiatrists suggesting LibreBoot developers suffer from symptoms of schizophrenia have had to shut their mouths since May when Intel confirmed a design flaw (or NSA backdoor) in every modern CPU had become known to hackers.
Bill Gates famously started out with the mission to put a computer on every desk and in every home. With more than 80% of new laptops based on an Intel CPU with these hidden capabilities, can you imagine the NSA would not have wanted to come along for the ride?
Four questions everybody should be asking

$ rsync -avz mirror.ftp-master.debian.org:/srv/ftp-master.debian.org/buildinfo .
$ python3 index.py
You need at least python3-debian installed $ sqlite3 depends.sqlite "select * from depends where depend='dh-elpa' and depend_version<='0106'"
where 0106 is some adhoc normalization of 1.6
Shockingly enough, my focus started out on Gitano once more. We managed a
1.1 release of Gitano during the Debian conference's "camp" which occurs in the
week before the conference. This was a joint effort of myself, Richard Maw,
and Richard Ipsum. I have to take my hat off to Richard Maw, because without
his dedication to features, 1.1 would lack some stuff which Richard Ipsum
proposed around ruleset support for basic readers/writers and frankly 1.1 would
be a weaker release without it.
Because of the debconf situation, we didn't have a
Gitano developer day which, while sad, didn't slow us down much...
This is an excellent example of where just because one person is too busy doesn't mean that a good idea should be dropped, and I am grateful to Richard Maw for getting this work mergeable and effectively guilt-tripping me into reviewing/merging. This is a learnable moment for me and I hope to do better into the future.
git-multimail.py
in Gitano. This work ranged across hooks and caused me to spend a long time
thinking about the semantics of configuration overriding etc. Fortunately
I got there in the end, and with a massive review effort from Richard Maw,
we got it merged into Gitano.readdir() from
readdir_r() thanks to Richard Ipsum; Gall 1.3 which contained a bunch of
build cleanups, and also a revparse_single() implementation in the C code
to speed things up thanks to Richard Maw; Supple 1.0.8 which improved wrapper
environment cleanups thanks to Richard Ipsum, allowed baking of paths in which
means Nix is easier to support (again thanks to Richard Ipsum), fixed setuid
handling so that Nix is easier to support (guess what? Richard Ipsum again);
Lace 1.4 which now verifies definition names in allow/deny/anyof/allof and
also produces better error messages from nested includes.
And, of course, Gitano 1.1 whose changes were somewhat numerous and so you
are invited to read them in the Gitano NEWS file for the release.
In this, our next exciting installment of STM32 and Rust for USB device
drivers, we're going to look at what the STM32 calls the 'packet memory area'.
If you've been reading along with the course, including reading up on the
datasheet content then you'll be aware that as well as the STM32's normal
SRAM, there's a 512 byte SRAM dedicated to the USB peripheral. This SRAM is
called the 'packet memory area' and is shared between the main bus and the USB
peripheral core. Its purpose is, simply, to store packets in transit. Both
those IN to the host (so stored queued for transmission) or OUT from the host
(so stored, queued for the application to extract and consume).
It's time to actually put hand to keyboard on some Rust code, and the PMA is
the perfect starting point, since it involves two basic structures. Packets
are the obvious first structure, and they are contiguous sets of bytes which
for the purpose of our work we shall assume are one to sixty-four bytes long.
The second is what the STM32 datasheet refers to as the BTABLE or Buffer
Descriptor Table. Let's consider the BTABLE first.
BTABLE is arranged in quads of 16bit words. For "normal" endpoints this
is a pair of descriptors, each consisting of two words, one for transmission,
and one for reception. The STM32 also has a concept of double buffered
endpoints, but we're not going to consider those in our proof-of-concept work.
The STM32 allows for up to eight endpoints (EP0 through EP7) in internal
register naming, though they support endpoints numbered from zero to fifteen in
the sense of the endpoint address numbering. As such there're eight
descriptors each four 16bit words long (eight bytes) making for a buffer
descriptor table which is 64 bytes in size at most.
| Byte offset in PMA | Field name | Description |
|---|---|---|
(EPn * 8) + 0 |
USB_ADDRn_TX |
The address (inside the PMA) of the TX buffer for EPn |
(EPn * 8) + 2 |
USB_COUNTn_TX |
The number of bytes present in the TX buffer for EPn |
(EPn * 8) + 4 |
USB_ADDRn_RX |
The address (inside the PMA) of the RX buffer for EPn |
(EPn * 8) + 6 |
USB_COUNTn_RX |
The number of bytes of space available for the RX buffer for EPn (and once received, the number of bytes received) |
USB_ADDRn_TX entry, and the length into the corresponding
USB_COUNTn_TX entry, before marking the endpoint as ready to transmit.
To receive a packet though is slightly more complex. The application must
allocate some space in the PMA, setting the address into the USB_ADDRn_RX
entry of the BTABLE before filling out the top half of the USB_COUNTn_RX
entry. For ease of bit sizing, the STM32 only supports space allocations of
two to sixty-two bytes in steps of two bytes at a time, or thirty-two to
five-hundred-twelve bytes in steps of thirty-two bytes at a time. Once the
packet is received, the USB peripheral will fill out the lower bits of the
USB_COUNTn_RX entry with the actual number of bytes filled out in the buffer.
BTABLE can be
anywhere within the PMA, as can the packets, the application will have to do
some memory management (either statically, or dynamically) to manage the
packets in the PMA.
0x4000_6000. Secondly we need to know what address in the PMA we
wish to access, so we can determine which 16bit word that is, and thus what the
address is as far as the CPU is concerned. If we assume we only ever want to
access 16bit entries, we can just multiply the PMA offset by two before adding
it to the PMA base address. So, to access the 16bit word at byte-offset 8 in
the PMA, we'd look for the 16bit word at 0x4000_6000 + (0x08 * 2) =>
0x4000_6010.
// Thanks to the work by Jorge Aparicio, we have a convenient wrapper
// for peripherals which means we can declare a PMA peripheral:
pub const PMA: Peripheral<PMA> = unsafe Peripheral::new(0x4000_6000) ;
// The PMA struct type which the peripheral will return a ref to
pub struct PMA
pma_area: PMA_Area,
// And the way we turn that ref into something we can put a useful impl on
impl Deref for PMA
type Target = PMA_Area;
fn deref(&self) -> &PMA_Area
&self.pma_area
// This is the actual representation of the peripheral, we use the C repr
// in order to ensure it ends up packed nicely together
#[repr(C)]
pub struct PMA_Area
// The PMA consists of 256 u16 words separated by u16 gaps, so lets
// represent that as 512 u16 words which we'll only use every other of.
words: [VolatileCell<u16>; 512],
impl PMA_Area
pub fn get_u16(&self, offset: usize) -> u16
assert!((offset & 0x01) == 0);
self.words[offset].get()
pub fn set_u16(&self, offset: usize, val: u16)
assert!((offset & 0x01) == 0);
self.words[offset].set(val);
unsafe stuff for now):
unsafe (&*usb::pma::PMA.get()).set_u16(4, 64);
80001e4: f246 0008 movw r0, #24584 ; 0x6008
80001e8: 2140 movs r1, #64 ; 0x40
80001ea: f2c4 0000 movt r0, #16384 ; 0x4000
80001ee: 8001 strh r1, [r0, #0]
This boils down to a u16 write of 0x0040 (64) to the address 0x4006008
which is the third 32 bit word in the CPU's view of the PMA memory space (where
offset 4 is the third 16bit word) which is exactly what we'd expect to see.
We can, from here, build up some functions for manipulating a BTABLE, though
the most useful ones for us to take a look at are the RX counter functions:
pub fn get_rxcount(&self, ep: usize) -> u16
self.get_u16(BTABLE + (ep * 8) + 6) & 0x3ff
pub fn set_rxcount(&self, ep: usize, val: u16)
assert!(val <= 1024);
let rval: u16 =
if val > 62
assert!((val & 0x1f) == 0);
(((val >> 5) - 1) << 10) 0x8000
else
assert!((val & 1) == 0);
(val >> 1) << 10
;
self.set_u16(BTABLE + (ep * 8) + 6, rval)
BTABLE base in the PMA,
add the address of the USB_COUNTn_RX entry to that, retrieve the u16 and
then mask off the bottom ten bits since that's the size of the relevant field.
The setter is a little more complex, since it has to deal with the two possible
cases, this isn't pretty and we might be able to write some better peripheral
structs in the future, but for now, if the length we're setting is 62 or less,
and is divisible by two, then we put a zero in the top bit, and the number of
2-byte lumps in at bits 14:10, and if it's 64 or more, we mask off the bottom
to check it's divisible by 32, and then put the count (minus one) of those
blocks in, instead, and set the top bit to mark it as such.
Fortunately, when we set constants, Rust's compiler manages to optimise all
this very quickly. For a BTABLE at the bottom of the PMA, and an
initialisation statement of:
unsafe (&*usb::pma::PMA.get()).set_rxcount(1, 64);
80001e4: f246 001c movw r0, #24604 ; 0x601c
80001e8: f44f 4104 mov.w r1, #33792 ; 0x8400
80001ec: f2c4 0000 movt r0, #16384 ; 0x4000
80001f0: 8001 strh r1, [r0, #0]
We can decompose that into a C like *((u16*)0x4000601c) = 0x8400 and from
there we can see that it's writing to the u16 at 0x1c bytes into the CPU's view
of the PMA, which is 14 bytes into the PMA itself. Since we know we set the
BTABLE at the start of the PMA, it's 14 bytes into the BTABLE which is firmly
in the EP1 entries. Specifically it's USB_COUNT1_RX which is what we were
hoping for. To confirm this, check out page 651 of the datasheet. The
value set was 0x8400 which we can decompose into 0x8000 and 0x0400. The
first is the top bit and tells us that BL_SIZE is one, and thus the blocks
are 32 bytes long. Next the 0x4000 if we shift it right ten places, we get
the value 2 for the field NUM_BLOCK and multiplying 2 by 32 we get the 64
bytes we asked it to set as the size of the RX buffer. It has done exactly
what we hoped it would, but the compiler managed to optimise it into a single
16 bit store of a constant value to a constant location. Nice and efficient.
Finally, let's look at what happens if we want to write a packet into the PMA.
For now, let's assume packets come as slices of u16s because that'll make our
life a little simpler:
pub fn write_buffer(&self, base: usize, buf: &[u16])
for (ofs, v) in buf.iter().enumerate()
self.set_u16(base + (ofs * 2), *v);
no_std territory, we can still get an iterator
over the slice, and enumerate it, getting a nice iterator of (index, value)
though in this case, the value is a ref to the content of the slice, so we end
up with *v to deref it. I am sure I could get that automatically happening
but for now it's there.
Amazingly, despite using iterators, enumerators, high level for loops, function
calls, etc, if we pop:
unsafe (&*usb::pma::PMA.get()).write_buffer(0, &[0x1000, 0x2000, 0x3000]);
80001e4: f246 0000 movw r0, #24576 ; 0x6000
80001e8: f44f 5180 mov.w r1, #4096 ; 0x1000
80001ec: f2c4 0000 movt r0, #16384 ; 0x4000
80001f0: 8001 strh r1, [r0, #0]
80001f2: f44f 5100 mov.w r1, #8192 ; 0x2000
80001f6: 8081 strh r1, [r0, #4]
80001f8: f44f 5140 mov.w r1, #12288 ; 0x3000
80001fc: 8101 strh r1, [r0, #8]
which, as you can see, ends up being three sequential halfword stores directly
to the right locations in the CPU's view of the PMA. You have to love
seriously aggressive compile-time optimisation
Hopefully, by next time, we'll have layered some more pleasant routines on our
PMA code, and begun a foray into the setup necessary before we can begin
handling interrupts and start turning up on a USB port.
"Qubes OS from the POV of a Debian developer" and "Qubes OS user meetup at Bornhack"
I wrote the following while on my way home from Bornhack which was an awesome hacking camp on the Danish island of Bornholm, where about 200 people gathered for a week, with a nice beach in walking distance (and a not too cold Baltic Sea) and vegan and not so vegan grills, to give some hints why it was awesome. (Actually it was mostly awesome due to the people there, not the things, but anyway )
And there were of course also talks and workshops, and one was a Qubes OS users meetup, which amazingly was attended by 20 Qubes OS users (and some Qubes OS users present were even missing), so in other words: Qubes OS had a >10% user base at this event! And I even found one heads user!
At DebConf17 I gave a talk titled "Qubes OS from the POV of a Debian developer" and while the video was immediatly available (thanks to the DebConf videoteam!) I've also now put my slides for it online.
Since then, I learned a few things:
/rw/config/suspend-module-blacklist in the NetVM the wireless comes back nicely (on my X230) after Suspend/Resume.
Remember, Mastodon is a new decentralized social network, based on a free software which is rapidly gaining users (already there is more than 1.5 million accounts). As I ve created my account in June, I was a fast addict and I ve already created several tools for this network, Feed2toot, Remindr and Boost (mostly written in Python).
Now, with all this experience I have to stress out the importance of choosing the correct Mastodon instance.
First, let s quickly clarify something about the decentralized part. In Mastodon, decentralization is made through a federation of dedicated servers, called instances , each one with a complete independent administration. Your user account is created on one specific instance. You have two choices:
You can move your user account from one instance to another, but you have to follow a special procedure which can be quite long, considering your own interest for technical manipulation and the total amount of your followers you ll have to warn about your change. As such, you ll have to create another account on a new instance and import three lists: the one with your followers, the one with the accounts you have blocked, and the one with the account you have muted.
From this working process, several technical and human factors will interest us.
As a social network, Mastodon is truly decentralized, with more than 1.5 million users on more than 2350 existing instances. As such, the most common usage is to create an account on an open instance. To create its own instance is way too difficult for the average user. Yet, using an open instance creates a strong dependence on the technical administrator of the chosen instance.
The technical administrator will have to deal with several obligations to ensure its service continuity, with high-quality hardware and regular back-ups. All of these have a price, either in money and in time. Regarding the time factor, it would be better to choose an administration team over an individual, as life events can change quite fast everyone s interests. As such, Framasoft, a French association dedicated to promoting the Free software use, offers its own Mastodon instance named: Framapiaf. The creator of the mastodon project, also offers a quite solid instance, Mastodon.social (see below).
Regarding the money factor, many instance administrators with a large number of users are currently asking for donation via Patreon, as hosting an instance server or renting one cost money.
If anybody could have guessed the previous technical points since the recent registration explosion on the Mastodon social network, the following point took almost everyone by surprise. Little by little, different instances show their culture , their protest action, and their propaganda on this social network.
As the instance administrator has all the powers over its instance, he or she can block the instance of interacting with some other instances, or ban its instance s users from any interaction with other instances users.
With everyone having in mind the main advantages to have federalized instance from, this partial independence of some instances from the federation was a huge surprise. One of the most recent example was when the Unixcorn.xyz instance administrator banned its users from reading Aeris account, which was on its own instance. It was a cataclysm with several consequences, which I ve named the #AerisGate as it shows the different views on moderation and on its reception by various Mastodon users.
If you don t manage your own instance, when you ll have to choose the one where to create your account, make sure that the content you plan to toot is within the rules and compatible with the ideology of said instance s administrator. Yes, I know, it may seem surprising but, as stated above, by entering a public instance you become dependent on someone else s infrastructure, who may have an ideological way to conceive its Mastodon hosting service. As such, if you re a nazi, for example, don t open your Mastodon account on a far-left LGBT instance. Your account wouldn t stay open for long.
The moderation rules are described in the about/more page of the instance, and may contain ideological elements.
To ease the process for newcomers, it is now possible to use a great tool to select what instance should be the best to host your account.
Remember that, as stated above, Mastodon is decentralized, and as such there is no central authority which can be reached in case you have a conflict with your instance administrator. And nobody can force said administrator to follow its own rules, or not to change them on the fly. Think Twice Before Creating Your Account
If you want to create an account on an instance you don t control, you need to check two elements: the availability of the instance hosting service in the long run, often linked to the administrator or the administration group of said instance, and the ideological orientation of your instance. With these two elements checked, you ll be able to let your Mastodon account growth peacefully, without fearing an outage of your instance, or simple your account blocked one morning because it doesn t align with your instance s ideological line.
To help me get involved in free software and writing articles for this blog, please consider a donation through my Liberapay page, even if it s only a few cents per week. My contact Bitcoin and Monero are also available on this page.
Follow me on Mastodon
Translated from French to English by St phanie Chaptal.
It's that time again! Another year,
another OMGWTFBBQ!
We're expecting 50 or so Debian folks at our place in Cambridge this
weekend, ready to natter, geek, socialise and generally have a good
time. Let's hope the weather stays nice, but if not we have gazebo
technology... :-)
Many thanks to a number of awesome companies and people near and
far who are sponsoring the important refreshments for the weekend:
I've even been working on the garden this week to improve it ready
for the event. If you'd like to come and haven't already told us,
please add yourself to the wiki page!
On 5th August I got a chance to attend, speak and experience DebConf 2017 at Montreal, Canada. The conference was stretch ed from 6 August to 12 August .
Seasons of Debian Summer of Code & Winter of Outreachy
Picture of Daniel and me captured by : Dorina Mosku
Picture captured by Aigars Mahinovs
Managing Debian s RTC services Daniel Pocock
with Karen Sandler and Outreachy alumini
I upgraded my last major machine from Jessie to Stretch last week. That machine was the one running the most services, but I d made notes while updating various others to ensure it went smoothly. Below are the things I noted along the way, both for my own reference and in case they are of use to anyone else.
/etc/roundcube/debian-db-roundcube.php and change sqlite3:// to sqlite:// in the $config['db_dsnw'] line.!SSLv2 from the ssl_protocols list in /etc/dovecot/conf.d/10-ssl.confscp:// backend to the sftp:// backend in my backup scripts.needs_root_rights=yes to /etc/X11/Xwrapper.config so Kodi systemd unit could still start it on a new VT. Need to figure out how to get this working without the need for root./etc/fail2ban/jail.d/ rather than the master config. Fixed for next time.pg_upgradecluster 9.4 main chugged away but did exactly what I needed.
Post-Solskogen, there hasn't been all that many commits in the main Nageru
repository, but that doesn't mean the project is standing still. In
particular, I've been working with NVIDIA to shake out a crash bug in their
drivers (which in itself uncovered some interesting debugging techniques,
although in the end, the bug turned out just to be uncovered by the boring
standard technique of analyzing crash dumps and writing a minimal program
to reproduce). But I've also been looking at intraframe codecs; my sort-of
plan was to go to VideoLAN Dev Days
to present my findings, but unfortunately, there seems to be a schedule
conflict, so instead, you can have some scattered random notes:
TL;DR: With its implementation of IPv6 routing tables using radix trees,
Linux offers subpar performance (450 ns for a full view 40,000 routes)
compared to IPv4 (50 ns for a full view 500,000 routes) but fair memory usage
(20 MiB for a full view).
struct fib6_node. When
a node has the RTN_RTINFO flag set, it embeds a pointer to
a struct rt6_info containing information about the
next-hop.
fib6_lookup_1() function walks the radix tree in two
steps:
static struct fib6_node *fib6_lookup_1(struct fib6_node *root, struct in6_addr *addr) struct fib6_node *fn; __be32 dir; /* Step 1: locate potential candidate */ fn = root; for (;;) struct fib6_node *next; dir = addr_bit_set(addr, fn->fn_bit); next = dir ? fn->right : fn->left; if (next) fn = next; continue; break; /* Step 2: check prefix and backtrack if needed */ while (fn) if (fn->fn_flags & RTN_RTINFO) struct rt6key *key; key = fn->leaf->rt6i_dst; if (ipv6_prefix_equal(&key->addr, addr, key->plen)) if (fn->fn_flags & RTN_RTINFO) return fn; if (fn->fn_flags & RTN_ROOT) break; fn = fn->parent; return NULL;
2001:db8:1::1 and 2001:db8:3::1
would get those two cache entries:
$ ip -6 route show cache 2001:db8:1::1 dev r2-r1 metric 0 cache 2001:db8:3::1 via 2001:db8:2::2 dev r2-r3 metric 0 cache
ip6_dst_gc() function
controlled by the following parameters:
$ sysctl -a grep -F net.ipv6.route net.ipv6.route.gc_elasticity = 9 net.ipv6.route.gc_interval = 30 net.ipv6.route.gc_min_interval = 0 net.ipv6.route.gc_min_interval_ms = 500 net.ipv6.route.gc_thresh = 1024 net.ipv6.route.gc_timeout = 60 net.ipv6.route.max_size = 4096 net.ipv6.route.mtu_expires = 600
gc_elasticity) after a 500 ms pause.
Starting from Linux 4.2 (commit 45e4fd26683c), only a PMTU exception would
create a cache entry. A router doesn t have to handle those exceptions, so only
hosts would get cache entries. And they should be pretty rare. Martin KaFai
Lau explains:
Out of all IPv6Here is how a cache entry with a PMTU exception looks like:RTF_CACHEroutes that are created, the percentage that has a different MTU is very small. In one of our end-user facing proxy server, only 1k out of 80kRTF_CACHEroutes have a smaller MTU. For our DC traffic, there is no MTU exception.
$ ip -6 route show cache 2001:db8:1::50 via 2001:db8:1::13 dev out6 metric 0 cache expires 573sec mtu 1400 pref medium
ip6_route_output_flags() function and
correlate the results with the radix tree size:
2400::/16 to 2a06::/16 is scanned (it contains more than half of the
routes). For the /128 scenario, the whole /108 subnet is scanned. For the /48
scenario, the range from the first /48 to the last one is scanned. For each
range, 5000 addresses are picked semi-randomly. This operation is repeated until
we get 5000 hits or until 1 million tests have been executed.
The relation between the maximum depth and the lookup time is incomplete and I
can t explain the difference of performance between the different densities of
the /48 scenario.
We can extract two important performance points:
fib_lookup() and
IPv6 s ip6_route_output_flags() functions have a
fixed cost implied by the evaluation of routing rules, IPv4 has several
optimizations when the rules are left unmodified5. Those optimizations
are removed on the first modification. If we cancel those optimizations, the
lookup time for IPv4 is impacted by about 30 ns. This still leaves a 100 ns
difference with IPv6 to be explained.
Let s compare how time is spent in each lookup function. Here is
a CPU flamegraph for IPv4 s fib_lookup():
fib_table_lookup() function is executed twice: once with the local routing
table and once with the main routing table.
The equivalent flamegraph for
IPv6 s ip6_route_output_flags() is depicted below:
CONFIG_SMP, CONFIG_IPV6,
CONFIG_IPV6_MULTIPLE_TABLES and CONFIG_IPV6_SUBTREES options enabled. Some
other unrelated options are enabled to be able to boot them in a virtual machine
and run the benchmark.
There are three notable performance changes:
struct rt6_info (commit 887c95cc1da5). This should have lead to
a performance increase. The small regression may be due to cache-related
issues.struct fib6_node) and routing information (struct
rt6_info) are allocated with the slab allocator7. It is therefore
possible to extract the information from /proc/slabinfo when the kernel is
booted with the slab_nomerge flag:
# sed -ne 2p -e '/^ip6_dst/p' -e '/^fib6_nodes/p' /proc/slabinfo cut -f1 -d: name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> fib6_nodes 76101 76104 64 63 1 ip6_dst_cache 40090 40090 384 10 1
struct rt6_info matches the number of routes while the
number of nodes is roughly twice the number of routes:
struct rt6_info (336 bytes) compared
to the size of IPv4 s struct fib_alias (48 bytes): IPv4 puts most information
about next-hops in struct fib_info structures that are shared with many
entries.
CONFIG_IPV6_MULTIPLE_TABLES option incurs a fixed penalty of 100 ns by lookup,ip -6 route add 2001:db8:1::/64 \ from 2001:db8:3::/64 \ via fe80::1 \ dev eth0
laser-cutter sprint
So I'm overcoming my jetlag after DebConf17 by helping to make the Alioth sprint
happen, and while it's good to witness work on the upcoming git.debian.org replacement,
I'm rather minding my own business instead of getting involved
And so I got interested in this laser cutter, which since two months has been set up
in the CCCHH hackerspace and which is nicely documentend (and set up),
so I managed to learn how to do my first baby steps with the laser cutter in one evening:
Basically there is a hosted web application named 'LaserWeb4'
for which a pre-configuration exists, so that one only needs to load an image, scale and
position it and tune the laser settings a bit. The laser itself is inside a cage, which
has a physical safety switch which will turn off the laser if the cage is opened.
Obviously the setup is a lot more complex and there are many parameters to tune, and I basically
just learned one thing, which is "printing images on wood", but "printing images on a laptop cover" should
be pretty similar and something to learn in the future
And now I'm even teaching weasel how to use this thing (and he already made interesting
new mistakes) and it looks like Ganneff & formorer are next. Fun fun fun!
Oh, and the Alioth sprint also seems to be quite productive, but I'll leave reporting about this
to others.
I had to write a small Python application to listen for some broadcast message
and process the message. This broadcast messages are actually sort of discovery
messages to find some peers in a network. Writing a simple UDP Server to listen
on a particular port was easy; but while designing an application I was
wondering how can I plugin this server into my main code. There are 2
possibility
from socket import socket, AF_INET, SOCK_DGRAM
class BroadCastReceiver:
def __init__(self, port, msg_len=8192):
self.sock = socket(AF_INET, SOCK_DGRAM)
self.sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
self.sock.bind(('', port))
self.msg_len = msg_len
def __iter__(self):
return self
def __next__(self):
try:
addr, data = self.sock.recvfrom(self.msg_len)
return addr, data
except Exception as e:
print("Got exception trying to recv %s" % e)
raise StopIteration
...
def __init__(self, port, msg_len=8192, timeout=15):
self.sock = socket(AF_INET, SOCK_DGRAM)
self.sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
self.sock.settimeout(timeout)
self.sock.msg_len = msg_len
self.sock.bind(('', port))
...
...
def __del__(self):
self.sock.close()
r = BroadCastReceiver(5000, timeout=10)
count = 0
for (address, data) in r:
print('Got packet from %s: %s' % address, data)
count += 1
# do whatever you want with data
if count > 10:
break
r = BroadCastReceiver(5000, timeout=10)
for i in range(20):
try:
address, data = next(r)
# do whatever you want with data
except:
break
...
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
self.sock.close()
with BroadCastReceiver(2000) as r:
# use server object as you wish
...
def __next__(self):
try:
addr, data = self.sock.recvfrom(self.msg_len)
return addr, data
except Exception as e:
print("Got exception trying to recv %s" % e)
raise StopIteration
finally:
self.sock.close()
| Patch | Status |
|---|---|
| Black box testing sip | Merged |
| New unit test: smartools | Merged |
| New unit test:account_factory | Merged |
| New unit test: util classes | On Review |
| New unit test: archiver, conference, preferences | On Review |
| New unit test: dring, threadloop | On Review |
| Documentation | On Review |
| Refactoring + video_input unit test | Abandoned |
How to use the code?
Follow the instructions to build the daemon and instead of doing make , do make check . You will see something composed of:


Like each month, here comes a report about the work of paid contributors to Debian LTS.
Individual reports
In July, about 181 work hours have been dispatched among 11 paid contributors. Their reports are available:
No comment Liked this article? Click here. My blog is Flattr-enabled.
Next.