Clint Adams: Not the Grace Hopper Conference
Do you love porting? For ideas on how to make GHC suck less on your favorite architecture, see this not-at-all ugly table.
Posted on 2016-11-28
This should ask d-i to install the package inside the d-i environment early in the installation sequence. Having it installed in d-i in turn will make sure the relevant scripts are called just after debootstrap filled /target/ with the freshly installed Debian system to configure apt to run dpkg with eatmydata. This is enough to speed up the installation process. There is a proposal to extend the idea a bit further by using /etc/ld.so.preload instead of apt.conf, but I have not tested its impact.preseed/early_command="anna-install eatmydata-udeb"
When I was first introduced to Debian packaging, people recommended I use
pbuilder. Given how complex the toolchain is in the pbuilder case,
I don t understand why that is (was?) a common recommendation.
Back in August 2015, so well over a year ago, I switched to
sbuild, motivated by how much simpler it was to implement ratt
(rebuilds reverse build dependencies) using sbuild, and I have not looked
back.
Are there people who do not use sbuild for reasons other than familiarity? If
so, please let me know, I d like to understand.
I also made a version of the diagram above, colored by the programming
languages in which the tools are implemented. The chosen colors are heavily
biased :-).
To me, the diagram above means: if you want to make substantial changes to the
Debian build tool infrastructure, you need to become an expert in all of
Python, Perl, Bash, C and Make. I know that this is not true for every change,
but it still irks me that there might be changes for which it is required.
I propose to eliminate complexity in Debian by deprecating the pbuilder
toolchain in favor of sbuild.
A new version of the RcppExamples package is now on CRAN.
The RcppExamples package provides a handful of short examples detailing by concrete working examples how to set up basic R data structures in C++. This version takes advantage of the updated date and datetime classes in Rcpp 0.12.8 (which are optional for now and being phased in while we deprecate the old ones).
A NEWS extract follows:
Courtesy of CRANberries, there is also a diffstat report for the most recent release.Changes in RcppExamples version 0.1.8 (2016-11-24)
- Updated DateExample to show vector addition available under Rcpp 0.12.8 when the (currently still phased in and optional) new Date(time) classes are used via the define in src/Makevars,.win; with fallback code for older versions
- Other minor edits to DESCRIPTION and README.md
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
/dev/sdb) and copy the image onto it:
$ wget https://people.debian.org/~stapelberg/raspberrypi3/2016-11-24-raspberry-pi-3-stretch-PREVIEW.img $ sudo dd if=2016-11-24-raspberry-pi-3-stretch-PREVIEW.img of=/dev/sdb bs=5MI hope this initial work on getting Debian booted will motivate other people to contribute little improvements here and there. A list of current limitations and potential improvements can be found on the RaspberryPi3 Debian wiki page.
I am a incorrigibly in picking non-mainstream, open smartphones, and then struggling hard. Back then in 2008, I tried to use the OpenMoko FreeRunner, but eventually gave up because of hardware glitches and reverted to my good old Siemens S35. It was not that I would not be willing to put up with inconveniences, but as soon as it makes live more difficult for the people I communicate with, it becomes hard to sustain.
Two years ago I tried again, and got myself a Jolla phone, running Sailfish OS. Things are much nicer now: The hardware is mature, battery live is good, and the Android compatibility layer enables me to run many important apps that are hard to replace, especially the Deutsche Bahn Navigator and various messengers, namely Telegram, Facebook Messenger, Threema and GroupMe.
Some apps that require Google Play Services, which provides a bunch of common tasks and usually comes with the Google Play store would not run on my phone, as Google Play is not supported on Sailfish OS. So far, the most annoying ones of that sort were Uber and Lyft, making me pay for expensive taxis when others would ride cheaper, but I can live with that. I tried to install Google Play Services from shady sources, but it would regularly crash.
/system/framework/framework.jar file, put it into the input folder of this project, run python main.py, select 2, and copy the framework.jar from output/ back. Great.
foo.odex in the Android system folder, runs some tool on them to create a classes.dex file, and adds that to the corresponding foo.jar or foo.apk file, copies this back to the phone and deletes the foo.odex file.
The annoying this is that one does not only have to do it for framework.jar in order to please tingle, because if one does it to one odex file, one has to do to all! It seems that for people using Windows, the Universal Deodexer V5 seems to be a convenient tool, but I had to go more manually.
So I first fetched smali , compiled it using ./gradlew build. Then I fetched the folders /opt/alien/system/framework and /opt/alien/system/app from the phone (e.g. using scp). Keep a backup of these in case something breaks. Then I ran these commands (disclaimer: I fetched these from my bash history and slightly cleaned them up. This is not a fire-and-forget script! Use it when you know what it and you are doing):
cd framework
for file in *.odex
do
java -jar ~/build/smali/baksmali/build/libs/baksmali.jar deodex $file -o out
java -jar ~/build/smali/smali/build/libs/smali.jar a out -o classes.dex
zip -u $(basename $file .odex).jar classes.dex
rm -rf out classes.dex $file
done
cd ..
cd app
for file in *.odex
do
java -jar ~/build/smali/baksmali/build/libs/baksmali.jar deodex -d ../framework $file -o out
java -jar ~/build/smali/smali/build/libs/smali.jar a out -o classes.dex
zip -u $(basename $file .odex).apk classes.dex
rm -rf out classes.dex $file
done
cd ..
The resulting framework.jar can now be patched with tingle:
mv framework/framework.jar ~/build/tingle/input
cd ~/build/tingle
./main.py
# select 2
cd -
mv ~/build/tingle/output/framework.jar framework/framework.jar
Now I copy these framework and app folders back on my phone, and restart Dalvik:
devel-su systemctl restart aliendalvik.service
It might start a bit slower than usually, but eventually, all the Android apps should work as before.
The final bit that was missing in my case was that I had to reinstall Signal: If it is installed before microG is installed, it does not get permission to use GCM, and when it tries (while registering: After generating the keys) it just crashes. I copied /data/data/org.thoughtcrime.secretsms/ before removing Signal and moved it back after (with cp -a to preserve permissions) so that I could keep my history.
And now, it seems, vanilla Signal is working just fine on my Jolla phone!
I spent a few days in Cambridge for a minidebconf. This is a tiny
version of the full annual Debconf. We had a couple of days for
hacking, and another two days for talks.
I spent my hacking time on thinking about vmdebootstrap (my tool for
generating disk images with an installed Debian), and came to the
conclusion I need to atone my sins for writing such crappy code by
rewriting it from scratch to be nicer to use. I gave a talk about
this, too. The
mailing list post
has the important parts, and
meetings-archive
has a video.
I haven't started the rewrite, and it's not going to make it for
stretch.
I also gave two other talks, on the early days of Linux, and
Qvarn, the latter being what I do at work.
Thank you to ARM, for sponsoring the location, and the other sponsors
for sponsoring food. These in-real-life meetings between developers
are important for the productivity and social cohesion of Debian.
I don't often write on this blog, and when I do, it's either tech related,
or light life stuff.
Over the next few weeks, it's going to get a lot more political. If you
currently follow this blog for its technical content, you may be tempted to
tune out. I would encourage you to stay and listen. I'm passionate about
the technology that I work on; but the greatest problems facing our world
today are not ones that will be solved with software.
American democracy is in bad shape, and it's because of what we're doing to
it. This is not a problem of the Right or of the Left; it is not a problem
that began with the election of Donald Trump, and it's not a problem that
will go away at the end of his term. It is partly a structural problem with
the way our elections work, but more than that it's a problem of how we're
splitting into separate tribes, isolating ourselves from those who don't
agree with us.
As Russ Allbery
wrote the morning after the election, everything about how we organize
ourselves online today - and how we let Facebook and Twitter organize us -
leads us to surround ourselves with people who already think the same way we
do. That leaves all of us with huge blind spots for other people in our
country, and it stifles the free exchange of ideas that is so essential for
a healthy democracy. We need leaders who will work to make America a better
and more just place for all our neighbors, not just a two-party system
that plays tug-of-war using two different sets of voters that feel shut out.
And the way we organize ourselves today (online and off) does not let us
recognize those leaders.
There's a lot of talk now about Facebook changing how it decides what to
show people; and maybe they can manage to help everyone's online experience
be a little less of a bubble. But part of the change needs to come from us.
We need to be willing to engage, civilly, with people whose perspective is
different from ours, and make the effort to understand where the other is
coming from.
So for the next few weeks, I'm going to talk. And I'm going to listen.
I have no unique qualifications to speak about the country's issues. But I
do have a perspective of my own, which might be different enough from yours
to be useful. I was born and raised in Iowa, and graduated from college
there. This election cycle, I learned that Iowa holds the distinction of
being the state with the lowest percentage of college-educated whites. I'm
part of that statistic, because a few years after graduating I moved to
Portland, Oregon - a place that's notoriously so far to the left of what we
think of as the middle, that it actually has anarchists who would
shamefully use a peaceful protest as cover to commit property
crime.
So I know a few things about the people in each state, that I think the
other should hear.
I'm also that rarest of creatures, a Portlander who goes to church
(Catholic). But I still choose as my neighbors the weird, wonderful, and
welcoming community that we have here, whatever Glenn
Beck might think.
I have a son, and I worry about what kind of world he'll grow up to live in.
I work in software, which means I'm doing a lot better than a lot of people
in the country right now; it also means that from where I sit, I see trends
already in progress that will have an effect on the working class and the
middle class that makes NAFTA look like a gnat's fart in comparison. And so
I worry for what kind of world we will all live in, if we don't make some
changes fast.
Let's have a conversation. No comments enabled on this blog, but you can
find me on G+ or on
Facebook.
Like I wrote before, we at Collabora have been working on improving WebKitGTK+ performance for customer projects, such as Apertis. We took the opportunity brought by recent improvements to WebKitGTK+ and GTK+ itself to make the final leg of drawing contents to screen as efficient as possible. And then we went on investigating why so much CPU was still being used in some of our test cases.
The first weird thing we noticed is performance was actually degraded on Wayland compared to running under X11. After some investigation we found a lot of time was being spent inside GTK+, painting the window s background.
Here s the thing: the problem only showed under Wayland because in that case GTK+ is responsible for painting the window decorations, whereas in the X11 case the window manager does it. That means all of that expensive blurring and rendering of shadows fell on GTK+ s lap.
During the web engines hackfest, a couple of months ago, I delved deeper into the problem and noticed, with Carlos Garcia s help, that it was even worse when HiDPI displays were thrown into the mix. The scaling made things unbearably slower.
You might also be wondering why would painting of window decorations be such a problem, anyway? They should only be repainted when a window changes size or state anyway, which should be pretty rare, right? Right, that is one of the reasons why we had to make it fast, though: the resizing experience was pretty terrible. But we ll get back to that later.
So I dug into that, made a few tries at understanding the issue and came up with a patch showing how applying the blur was being way too expensive. After a bit of discussion with our own Pekka Paalanen and Benjamin Otte we found the root cause: a fast path was not being hit by pixman due to the difference in scale factors on the shadow mask and the target surface. We made the shadow mask scale the same as the surface s and voil , sane performance.
I keep talking about this being a performance problem, but how bad was it? In the following video you can see how huge the impact in performance of this problem was on my very recent laptop with a HiDPI display. The video starts with an Epiphany window running with a patched GTK+ showing a nice demo the WebKit folks cooked for CSS animations and 3D transforms.
After a few seconds I quickly alt-tab to the version running with unpatched GTK+ I made the window the exact size and position of the other one, so that it is under the same conditions and the difference can be seen more easily. It is massive.
Yes, all of that slow down was caused by repainting window shadows! OK, so that solved the problem for HiDPI displays, made resizing saner, great! But why is GTK+ repainting the window even if only the contents are changing, anyway? Well, that turned out to be an off-by-one bug in the code that checks whether the invalidated area includes part of the window decorations.
If the area being changed spanned the whole window width, say, it would always cause the shadows to be repainted. By fixing that, we now avoid all of the shadow drawing code when we are running full-window animations such as the CSS poster circle or gtk3-demo s pixbufs demo.
As you can see in the video below, the gtk3-demo running with the patched GTK+ (the one on the right) is using a lot less CPU and has smoother animation than the one running with the unpatched GTK+ (left).
Pretty much all of the overhead caused by window decorations is gone in the patched version. It is still using quite a bit of CPU to animate those pixbufs, though, so some work still remains. Also, the overhead added to integrate cairo and GL rendering in GTK+ is pretty significant in the WebKitGTK+ CSS animation case. Hopefully that ll get much better from GTK+ 4 onwards.
dpkg 1.18.14 has migrated to stretch.debdiff(1) what patch(1) is to diff(1). It is a
general tool that is not specific to Reproducible Builds. This week, Ximin Luo
worked on making it more "production-ready" and will soon submit it for
inclusion in devscripts.
reprotest development
Ximin Luo significantly improved reprotest, adding presets and auto-detection
of which preset to use. One can now run e.g. reprotest auto . or reprotest
auto $pkg_$ver.dsc instead of the long command lines that were needed before.
He also made it easier to set up build dependencies inside the virtual server
and made it possible to specify pre-build dependencies that reprotest itself
needs to set up the variations. Previously one had to manually edit the virtual
server to do that, which was not very usable to humans without an in-depth
knowledge of the building process.
These changes will be tested some more and then released in the near future as
reprotest 0.4.
I run a couple of different sites that allow users to sign-up and use various
services. In each of these sites I have some minimal rules in place to detect bad signups, but these are a little ad hoc, because the nature of "badness" varies on a per-site basis.
I've worked in a couple of places where there are in-house tests of bad signups, and these usually boil down to some naive, and overly-broad, rules:
200 OK" or "403 Forbidden" based on some very very simple critereon. This is modeled on the spam detection service for blog-comments server I use - something that is itself becoming less useful over time. (Perhaps time to kill that? A decision for another day.)
Unfortunately this whole approach is very reactive, as it takes human eyeballs to detect new classes of problems. Code can't guess in advance that it should block usernames which could collide with official ones, for example allowing a username of "admin", "help", or "support".
I'm certain that these systems have been written a thousand times, as I've seen at least five such systems, and they're all very similar. The biggest flaw in all these systems is that they try to classify users in advance of them doing anything. We're trying to say "Block users who will use stolen credit cards", or "Block users who'll submit spam", by correlating that behaviour with other things. In an ideal world you'd judge users only by the actions they take, not how they signed up. And yet .. it is better than nothing.
For the moment I'm continuing to try to make the best of things, at least by centralising the rules for myself I cut down on duplicate code. I'll pretend I'm being cool, modern, and sexy, and call this a micro-service! (Ignore the lack of containers for the moment!)
Updates to Altos Lisp
I wrote a few days ago about a tiny lisp
interpreter I wrote for AltOS
Really, it's almost "done" now, I just wanted to make a few improvements
Incremental Collection
I was on a walk on Wednesday when I figured out that I didn't need to
do a full collection every time; a partial collection that only
scanned the upper portion of memory would often find plenty of free
space to keep working for a while.
To recap, the heap is in two pieces; the ROM piece and the RAM
piece. The ROM piece is generated during the build process and never
changes afterwards (hence the name), so the only piece which is
collected is the RAM piece. Collection works like:
chunk_low = heap base
new_top = heap base
For all of the heap
Find the first 64 live objects above chunk_low
Compact them all to new_top
Rewrite references in the whole heap for them
Set new_top above the new locations
Set chunk_low above the old locations
top = new_top
The trick is to realize that there's really no need to start at the
bottom of the heap; you can start anywhere you like and compact stuff,
possibly leaving holes below that location in the heap. As the heap
tends to have long-lived objects slowly sift down to the beginning,
it's useful to compact objects higher than that, skipping the
compaction process for the more stable area in memory.
Each time the whole heap is scanned, the top location is
recorded. After that, incremental collects happen starting at that
location, and when that doesn't produce enough free space, a full
collect is done.
The collector now runs a bunch faster on average now.
Binary Searches
I stuck some linear searches in a few places in the code, the first
was in the collector when looking to see where an object had moved
to. As there are 64 entries, the search is reduced from 32
to 6 compares on average. The second place was in the frame objects,
which hold the list of atom/value bindings for each lexical scope
(including the global scope). These aren't terribly large, but a
binary search is still a fine plan. I wanted to write down here the
basic pattern I'm using for binary searches these days, which avoids
some of the boundary conditions I've managed to generate in the past:
int find (needle)
int l = 0;
int r = count - 1;
while (l <= r)
int m = (l + r) >> 1;
if (haystack[m] < needle)
l = m + 1;
else
r = m - 1;
return l;
With this version, the caller can then check to see if there's an
exact match, and if not, then the returned value is the location in
the array where the value should be inserted. If the needle is known to
not be in the haystack, and if the haystack is large enough to accept
the new value:
void insert(needle)
int l = find(needle);
memmove(&haystack[l+1],
&haystack[l],
(num - l) * sizeof (haystack[0]));
haystack[l] = needle;
Similarly, if the caller just wants to know if the value is in the
array:
bool exists(needle)
int l = find(needle);
return (l < count && haystack[l] == needle);
Call with Current Continuation
Because the execution stack is managed on the heap, it's completely
trivial to provide the scheme-like call with current continuation,
which constructs an object which can be 'called' to transfer control
to a saved location:
> (+ "hello " (call/cc (lambda (return) (setq boo return) (return "foo "))) "world")
"hello foo world"
> (boo "bar ")
"hello bar world"
> (boo "yikes ")
"hello yikes world"
One thing I'd done previously is dump the entire state of the
interpreter on any error, and that included a full stack trace. I
adopted that code for printing of these continuation objects:
boo
[
expr: (call/cc (lambda (return) (set (quote boo) return) (return "foo ")))
state: val
values: (call/cc
[recurse...]
)
sexprs: ()
frame:
]
[
expr: (+ "hello " (call/cc (lambda (return) (set (quote boo) return) (return "foo "))) "world")
state: formal
values: (+
"hello "
)
sexprs: ((call/cc (lambda (return) (set (quote boo) return) (return "foo ")))
"world"
)
frame:
]
The top stack frame is about to return from the call/cc spot with a
value; supply a value to 'boo' and that's where you start. The next
frame is in the middle of computing formals for the +
s-expression. It's found the + function, and the "hello " string and
has yet to get the value from call/cc or the value of the "world"
string. Once the call/cc "returns", that value will get moved to the
values list and the sexpr list will move forward one spot to compute
the "world" value.
Implementing this whole mechanism took only a few dozen lines of code
as the existing stack contexts were already a continuation in effect.
The hardest piece was figuring out that I needed to copy the entire
stack each time the continuation was created or executed as it is
effectively destroyed in the process of evaluation.
I haven't implemented dynamic-wind yet; when I did that for nickle, it
was a bit of a pain threading execution through the unwind paths.
Re-using Frames
I decided to try and re-use frames (those objects which hold
atom/value bindings for each lexical scope). It wasn't that hard; the
only trick was to mark frames which have been referenced from
elsewhere as not-for-reuse and then avoid sticking those in the re-use
queue. This reduced allocations even further so that for simple
looping or tail-calling code, the allocator may never end up being
called.
How Big Is It?
I've managed to squeeze the interpreter and all of the rest of the
AltOS system into 25kB of Cortex-M0 code. That leaves space for the
4kB boot loader and 3kB of flash to save/restore the 3kB heap across
resets.
Adding builtins to control timers and GPIOs would make this a
reasonable software load for an Arduino; offering a rather different
programming model for those with a taste for adventure. Modern
ARM-based Arduino boards have plenty of flash and ram for this. It
might be interesting to get this running on the Arduino Zero; there's
no real reason to replace the OS either; porting the lisp
interpreter into the bare Arduino environment wouldn't take long.
Yesterday the eighth update in the 0.12.* series of Rcpp made it to the CRAN network for GNU R where the Windows binary has by now been generated too; the Debian package is on its way as well. This 0.12.8 release follows the 0.12.0 release from late July, the 0.12.1 release in September, the 0.12.2 release in November, the 0.12.3 release in January, the 0.12.4 release in March, the 0.12.5 release in May, the 0.12.6 release in July, and the 0.12.7 release in September --- making it the twelveth release at the steady bi-montly release frequency. While we are keeping with the pattern, we have managed to include quite a lot of nice stuff in this release. None of it is a major feauture, though, and so we have not increased the middle number.
Among the changes this release are (once again) much improved exception handling (thanks chiefly to Jim Hester), better large vector support (by Qiang), a number of Sugar extensions (mostly Nathan, Qiang and Dan) and beginnings of new DateVector and DatetimeVectors classes, and other changes detailed below. We plan to properly phase in the new date(time) classes. For now, you have to use a #define such as this one in Rcpp.h which remains commented-out for now. We plan to switch this on as the new default no earlier than twelve months from now.
Rcpp has become the most popular way of enhancing GNU R with C or C++ code. As of today, 843 packages on CRAN depend on Rcpp for making analytical code go faster and further. That is up by eightyfour packages, or a full ten percent, just since the last release in early September!
Again, we are lucky to have such a large group of contributors. Among them, we have invited Nathan Russell to the Rcpp Core team given his consistently excellent pull requests (as well as many outstanding Stackoverflow answers for Rcpp). More details on changes are below.
Thanks to CRANberries, you can also look at a diff to the previous release. As always, even fuller details are on the Rcpp Changelog page and the Rcpp page which also leads to the downloads page, the browseable doxygen docs and zip files of doxygen output for the standard formats. A local directory has source and documentation too. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.Changes in Rcpp version 0.12.8 (2016-11-16)
- Changes in Rcpp API:
- String and vector elements now use extended
R_xlen_tindices (Qiang in PR #560)- Hashing functions now return unsigned int (Qiang in PR #561)
- Added static methods
eye(),ones(), andzeros()for select matrix types (Nathan Russell in PR #569)- The exception call stack is again correctly reported; print methods and tests added too (Jim Hester in PR #582 fixing #579)
- Variatic macros no longer use a GNU extensions (Nathan in PR #575)
- Hash index functions were standardized on returning unsigned integers (Also PR #575)
- Changes in Rcpp Sugar:
- Changes in Rcpp unit tests
- A test for expression vectors was corrected.
- The constructor test for datetime vectors reflects the new classes which treats Inf correctly (and still as a non-finite value)
- Changes in Rcpp Attributes
- Updated Date and Datetime vector classes:
- The
DateVectorandDatetimeVectorclasses were renamed with a prefixold; they are currentlytypedef'ed to the existing name (#557)- New variants
newDateVectorandnewDatetimeVectorwere added based onNumericVector(also #557, #577, #581, #587)- By defining
RCPP_NEW_DATE_DATETIME_VECTORSthe new classes can activated. We intend to make the new classes the default no sooner than twelve months from this release.- The
capabilities()function can also be used for presence of this feature
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
For over a year now, I have been using CyanogenMod in my Nexus phone. At first I just installed some bundle that brought all the proprietary Google applications and libraries, but later I decided that I wanted more control over it, so I did a clean install with no proprietary stuff.
This was not so great at the beginning, because the base system lacks the geolocation helpers that allow you to get a position in seconds (using GSM antennas and Wifi APs). And so, every time I opened OsmAnd (a great maps application, free software and free maps), I would have to wait minutes for the GPS radio to locate enough satellites.
Shortly after, I found about the UnifiedNLP project that provided a drop-in replacement for the location services, using pluggable location providers. This worked great, and you could choose to use the Apple or Mozilla on-line providers, or off-line databases that you could download or build yourself.
This worked well for most of my needs, and I was happy about it. I also had F-droid for installing free software applications, DAVdroid for contacts and calendar synchronisation, K9 for reading email, etc. I still needed some proprietary apps, but most of the stuff in my phone was Free Software.
But sadly, more and more application developers are buying into the vendor lock-in that is Google Play Services, which is a set of APIs that offer some useful functionality (including the location services), but that require non-free software that is not part of the AOSP (Android Open-Source Project). Mostly, this is because they make push notifications a requirement, or because they want you to be able to buy stuff from the application.
This is not limited to proprietary software. Most notably, the Signal project refuses to work without these libraries, or even to distribute the pre-compiled binaries on any platform that is not Google Play! (This is one of many reason why I don't recommend Signal to anybody).
And of course, many very useful services that people use every day require you to install proprietary applications, which care much less about your choices of non-standard platforms.
For the most part, I had been able to just get the package files for these applications1 from somewhere, and have the functionality I wanted.
Some apps would just work perfectly, others would complain about the lack of Play Services, but offer a degraded experience. You would not get notifications unless you re-opened the application, stuff like that. But they worked. Lately, some of the closed-source apps I sometimes use stopped working altogether.
So, tired of all this, I decided to give the MicroG project a try.
maguro (the codename for my phone) directory:
$ ./pull-fileset maguro
Now you need to apply some patches with the patch-fileset script. The patches are located in the patches directory:
$ ls patches
sigspoof-core
sigspoof-hook-1.5-2.3
sigspoof-hook-4.0
sigspoof-hook-4.1-6.0
sigspoof-hook-7.0
sigspoof-ui-global-4.1-6.0
sigspoof-ui-global-7.0
The patch-fileset script takes these parameters:
patch-fileset <patch-dir> <api-level> <input-dir> [ <output-dir> ]
Note that this requires knowing your Android version, and the API level. If you don't specify an output directory, it will append the patch name to the input directory name. Note that you should also check the output of the script for any warnings or errors!
First, you need to apply the patch that hooks into your specific version of Android (6.0, API level 23 in my case):
$ ./patch-fileset patches/sigspoof-hook-4.1-6.0 23 maguro
>>> target directory: maguro__sigspoof-hook-4.1-6.0
[...]
*** patch-fileset: success
Now, you need to add the core spoofing module:
$ ./patch-fileset patches/sigspoof-core 23 maguro__sigspoof-hook-4.1-6.0
>>> target directory: maguro__sigspoof-hook-4.1-6.0__sigspoof-core
[...]
*** patch-fileset: success
And finally, add the UI elements that let you enable or disable the signature spoofing:
$ ./patch-fileset patches/sigspoof-ui-global-4.1-6.0 23 maguro__sigspoof-hook-4.1-6.0__sigspoof-core
>>> target directory: maguro__sigspoof-hook-4.1-6.0__sigspoof-core__sigspoof-ui-global-4.1-6.0
[...]
*** patch-fileset: success
Now, you have a bundle ready to upload to your phone, and you do that with the push-fileset script:
$ ./push-fileset maguro__sigspoof-hook-4.1-6.0__sigspoof-core__sigspoof-ui-global-4.1-6.0
After this, reboot your phone, go to settings / developer settings, and at the end you should find a checkbx for "Allow signature spoofing" which you should now enable.
This is an extension of part 1 which I shared few days ago. This would be a longish one so please bear.
First of all somebody emailed me this link so in the future a layover at Doha Airport will be a bit expensive from before, approx INR 700/- added to the ticket costs
Moving on, Let me share an experience I shared one of the last few days I had while I was in Cape Town

Singer singing some great oldies from 60 s , 70 s till 90 s.
[shirish@debian] - [/run/user/1000/gvfs/mtp:host=%5Busb%3A001%2C006%5D/Card/DCIM/Camera] - [4621]
[$] feh -g 1350x1000 .
This actually makes it far far easier to traverse through the 1000 odd photos of the trip that I have in my personal archive without doing any sort of conversion methodology. Btw, it took me time but finally was able to create an album at gallery.debconf.org . Haven t been able to upload photos as came across an error which I have shared at https://lists.debconf.org/lurker/message/20161113.215659.fce58823.en.html
Moving on, here s the funny story/experience I wanted to share
What happened was this. This is from the Doha Airport. I had seen big buggies (ones similar to golf carts) which was ferrying people from end of the concourse to the other. I had been walking the whole day and even with the horizontal escalators and everything, it takes a toll. I was half-tired, half-sleepy and saw a buggy stationed. From behind it looked like the buggies I had seen. As there was no place to park my behind there, I entered into the buggy and sat there. Around 15-20 minutes later a Doha cop in another buggy came to me and asked me if something had happened ?
I had no clue what he was talking about. He told/shared/asked me in friendly tone whether I had committed a crime or wanted to report a crime. When I replied in negative to both, he asked then why I was sitting there. I replied it was for stretching my legs and it was the buggy which was being used to transport people from A. to B. He gently told me I had entered into the wrong one and it was actually a cop buggy. I couldn t believe it. He did go his own way as he saw I was dead-tired. After 10-15 minutes, half-believingly I came out of the buggy and to my shock the gentleman was right. There was nothing to do but solder on to find a spot in this big airport. I shared this with few friends and family and managed to elicit few laughs hence sharing.
The somewhat sad one was I had met a couple with a baby. Now as shared before, Most Airports including the Doha Airport is Air-Conditioned/Climate-Controlled and is probably in mid-20 s so it was more than cold for me. The couples with the baby were from Asian sub-continent. From their clothes and the way they were, they were not very well off. I do remember them sharing that they had a death in the family and hence were going. I didn t know at that point in time that there was something called bereavement fares and if they were able to take opportunity of those tickets. But this is besides the point . The issue was that their baby had been running a high-fever and the A/C was making matters worse. I had seen a pharmacy but no clinic in the airport. It was much later I came across http://dohahamadairport.com/airport-guide/facilities-services/medical-emergencies but as can be seen on the web-page it doesn t tell whether the services are chargeable or not. I assume it would be paid, although in some of the developed/industrialized countries it is rumoured not to be for simple ailments such as the baby was going through. Have no idea if that s true or not. I also don t know how it equates with travel insurance as well as most travel insurance is also supposed to help you in situations like these. I was concerned as it was a baby and babies as all know are very very fragile. If anybody has an idea or had similar experience would like to know specifically related to International Airport environment as it has transit issues unlike in domestic airports where I don t think it would be a bit more easy.
Now coming to my own inadequacies/lack of foresight which I had mentioned I will share, I had asked/queried and got to lead a Debian-installation workshop on the Open Debian Day. I had done a few earlier and had installed it a few times on my system and for my friends, relatives and some clients. The only bad experiences I had were to do with UEFI but even those in the jessie releases had got resolved quite a bit, so was pretty confident. The day before the Installfest was to happen, Mensah Nyarko Yaa Dufie (one full name) of Ghana approached me to install Debian on her system. I had some older version of the Debian DVD either 8.1 or 8.3 and had known that 8.5 had been released just a few days back. Had seen pretty fast internet (as far as downloading Debian DVD) is concerned hence asked her to wait a bit while I downloaded the newest image. I sha256summed it to make sure that the image was bit-to-bit perfect.
Now I hadn t bought a pen drive/disk from India as I was under the impression that in such conferences, pen drives should not be an issue. I had asked Bernelle privately before via e-mail as well and she had assured me that some pen-drives would be available. She gave me a handful of HP pen drives. The pen drives as we came know during our usage were somewhat flaky. It would pop out/lose connection even with the slightest nudge to the lappy.
Somehow I was able to transfer the image to the usb disk. As people say hindsight is 50:50 maybe it was not such a smart move on my part to download the big DVD image and maybe I should have got the netinstall iso . Be careful, the link I have just shared is of the old version, if you have good web link and want to try the newest stable netinstall head to cdimage.debian.org . Apart from that goof-up I dunno (still) of anyway to know if a copy from an .iso image to usb was successful or not and did it do correctly
I did the following command
sudo dd if=/path_to/debian-dvd.iso of=/dev/usb-mount-point
which is usually /dev/sdb on all of my systems . Her system was a brand new HP (don t remember the model details) which she had bought just a few weeks/months before debconf. We tried a few times but it failed at installing the boot-loader stage. I asked Ritesh Raj Saraff (a friend and DD) and while he had some ideas, none of them worked. Ritesh later pointed out Steve McIntyre and shared he is part of the Debian-Installer team. At that point in time, I had no clue who Steve McIntyre was otherwise I probably would not have approached him. He quickly acquiesced to my request and shared that he would be there for the workshop. With load of my mind little bit, I apologized to mensah and asked her to be at the workshop the following day. I had no clue what was wrong at this point in time, whether it was the iso image in the usb disk or a UEFI issue. This also wasn t good for my confidence but as somebody from the Debian-Installer team was there, I was somewhat relaxed.
Next day, some more people came for the Installfest. While I had made 2-3 copies, clearly it was not enough as more people came. I was in a frenzy and asked Deven Bansod, Keerthana Krishnan, Prabaharan Jaminy (the whole GSOC and Outreachy attendees) to volunteer to help out in making more iso images on usb disks. I introduced mensah to Steve McIntyre and we tried 2-3 times to get debian installed on the system but it didn t move from the same place. Ritesh shared that dd had a memory leak and hence cat was a better way to do it. So we did
$ cat debian.iso > /dev/sdb and soon other machines had debian sporting on their desktops.
But mensa s lappy wouldn t get move from the boot-loader stage. Suddenly Steve had the bright idea (light bulb moment) that maybe the .iso is corrupted/usb disk is bad or something is incomplete. We started on another usb disk.
Now this is where I have a query While I don t want to compare, in Ubuntu there was an image self-checking mechanism where probably behind the scenes (backend) the checksums published in a file are compared with checksums generated by apps. which are on the .iso image. While it does extend your time, the end result is you know if there is some issue on the decompressed image on the usb disk. AFAIK we don t have anything similar. The only two things I know is the wiki page and of course the various checksums of the image as shared at http://cdimage.debian.org/debian-cd/8.6.0/amd64/iso-cd/ or http://cdimage.debian.org/debian-cd/8.6.0/amd64/iso-dvd/
If anybody knows of any movement or a bug in the BTS which I can follow for the above issue please let me know.
This time Steve was able to install it without any issues. I asked him whether he had to make some specific FAT/Ex-FAT/NTFS partitions as some new UEFI-based lappies need one or more but he replied in the negative. While mensa did get her debian install, the GUI didn t come while command-prompt was available. Then Steve added backports to the sources.list, got the new kernel, new Intel/Nvidia drivers (think it was one of those hybrid models IIRC) and she was able to boot into GNOME-Debian.
I didn t saw any bug-reports about checksumming state of the applications before installation but did couple of reports about badblocks support and memory checking and from action on both bug-reports it is also need of the hour (although the earlier one has been marked as won t fix :().
In this whole thing, I liked/appreciated the way Steve handled things, I intuitively understood/knew that he wasn t just part of the Debian-installer team but someone better. I can t explain it but it was there. A little investigation in the evening and it turned out that he had been Debian Project Leader for two consecutive years (2008 and 2009) . In hindsight it probably was a good thing I didn t know that before otherwise I probably wouldn t have interacted with him and it would have been my loss. To have been the DPL and still being so humble while technically being so proficient, I was amazed and didn t know what to make of it.
Here i.e. in India, if somebody wins even the mohalla elections (neighbourhood elections) the person carries a big chip on her/is shoulder not just till he is on the seat but even beyond, and here was an example of a previous DPL asking time from one of the developers in a video if it s possible in the next couple of days.
Lastly,last week have able to report 2 bugs upstream. The first one is of youtube-dl . It s somewhat complicated hence will not go there atm. The second and more surprising one was from nano our esteemed text-editor- Hopefully the bug will be fixed once a new version comes.
The Omnia router is a followup project on CZ.NIC's original
research project, the Turris. The goal of the project was to
identify hostile traffic on end-user networks and develop global
responses to those attacks across every monitored device. The Omnia is
an extension of the original project: more features were added and
data collection is now opt-in. Whereas the original Turris was simply
a home router, the new Omnia router includes:
uname -a). It is unclear why those patches are necessary since the
ARMv7 Armada 385 CPU has been
supported in Linux since at least 4.2-rc1, but it is common for
OpenWRT ports to ship patches to the kernel, either to backport
missing functionality or perform some optimization.
There has been some pressure from backers to petition Turris to
"speedup the process of upstreaming Omnia support to OpenWrt". It
could be that the team is too busy with delivering the devices already
ordered to complete that process at this point. The software is
available on the CZ-NIC GitHub repository and the actual Linux
patches can be found here and here. CZ.NIC also operates a
private GitLab instance where more software is available. There is
technically no reason why you wouldn't be able to run your own
distribution on the Omnia router: OpenWRT development snapshots should
be able to run on the Omnia hardware and some people have
installed Debian on Omnia. It may require some customization
(e.g. the kernel) to make sure the Omnia hardware is correctly
supported. Most people seem to prefer to run TurrisOS because of
the extra features.
The hardware itself is also free and open for the most part. There is
a binary blob needed for the 5GHz wireless card, which seems to be the
only proprietary component on the board. The schematics of the device
are available through the Omnia wiki, but oddly not in the GitHub
repository like the rest of the software.
For example, the wizard, once connected to the network, goes through a
full system upgrade and will, by default, automatically upgrade itself
(including reboots) when new updates become available. Users have to
opt-in to the automatic updates, and can chose to automate only the
downloading and installation of the updates without having the device
reboot on its own. Reboots are also performed during user-specified time
frames (by default, Omnia applies kernel updates during the night). I
also liked the "skip" button that allowed me to completely bypass the
wizard and configure the device myself, through the regular OpenWRT
systems (like LuCI or SSH) if I needed to.
Notwithstanding the antenna connectors themselves, the hardware is
nice. I ordered the black metal case, and I must admit I love the
many LED lights in the front. It is especially useful to have color
changes in the reset procedure: no more guessing what state the
device is in or if I pressed the reset button long enough. The LEDs
can also be dimmed to reduce the glare that our electronic devices
produce.
All this comes at a price, however: at \$250 USD, it is a much higher
price tag than common home routers, which typically go for around
\$50. Furthermore, it may be difficult to actually get the device,
because no orders are being accepted on the Indiegogo site after
October 31. The Turris team doesn't actually want to deal with retail
sales and has now delegated retail sales to other stores, which
are currently limited to European deliveries.
Note: this article first appeared in the Linux Weekly News.
stderr of failed commands, is JSON
encoded, which makes reading Jenkins' output hard.
Ansible however has Callback plugins that could be used. In that page it says:
Ansible comes with a number of callback plugins that you can look at for examples. These can be found in lib/ansible/plugins/callback.That is a link to a git repo with just a pile of Python sources and no, say
README.md index to what they do. Hopefully they have some docstring with a short description of what they do?
no.
Actually,
some
do,
but just because someone copypasted
the default one
and didn't even bother removing its docstring.
A Tiny Lisp for AltOS
I took a bit of a diversion over the last week or so when I wondered
how small a lisp interpreter I could write, and whether I could fit
that into one of the processors that AltOS runs on. It turns out, you
can write a tiny lisp interpreter that fits in about 25kB of ram with
a 3kB heap for dynamic data.
I decided to target our ChaosKey boards; they're tiny, and I've got a
lot of them. That processor offers 28kB of usable flash space (after
the 4kB boot loader) and 6kB of ram with the processor running at a
steaming 48MHz.
I'm not at all sure this is useful, but I always enjoy doing language
implementations, and this one presented some 'interesting' challenges:
| Value | Type |
|---|---|
| 0 | Cons cell |
| 1 | 14-bit int |
| 2 | String |
| 3 | Other |
val eval(val exprs)
val vals;
while (exprs)
vals = append(vals, eval(car(exprs)));
exprs = exprs->cdr;
return execute (car(vals), cdr(vals));
This makes things really simple and provides for a clean framework for
implementing various bits of lisp, including control flow and
macros. However, it rapidly consumes all of the available memory for a
stack, while also requiring separate bookkeeping for the in-use memory
in each frame.
I replaced this design with one which keeps the lisp stack on the
heap, and then performs eval with a state machine with all state
stored in global variables so that the memory manager can reference
them directly.
Each eval operation is performed in a separate 'stack' context, which
holds the entire eval state except for the current value, which lives
in a separate global variable and is used to pass values out of one
stack frame and into another. When the last stack context is finished,
the evaluation terminates and the value is returned to the caller.
There are nine states in the state machine, each of which is
implemented in a separate function, making the state machine a simple
matter of pulling the current state from the top of the stack and
invoking the associated function:
while (ao_lisp_stack)
if (!(*evals[ao_lisp_stack->state])() ao_lisp_exception)
ao_lisp_stack_clear();
return AO_LISP_NIL;
return ao_lisp_v;
Because there's no C recursion involved, catching exceptions is a
simple matter of one test at this level.
Primitives like progn, while, cond and eval all take special magic in
the state machine to handle; getting all of that working took several
attempts before I found the simple loop shown above.
Lexical Scoping
The last time I did a lisp interpreter, I implemented dynamic
scoping. Atoms were all global and had values associated directly with
them. Evaluating a lambda started by saving all of the existing global
values for the parameter atoms and then binding the new values. When
finished, the previous values would be restored. This is almost
correct, but provides surprising results for things like:
> (setq baz 1)
> (def foo (lambda (bar) (+ baz bar)))
> (def bletch (lambda (baz) (foo baz)))
> (bletch 2)
4
The value that foo gets for 'baz' is 2 instead of 1 under dynamic
scoping, which most people find surprising. This time, I was
determined to use lexical scoping, and it turned out to be
surprisingly easy.
The first trick was to separate the atoms from their 'value'; each
atom can have a different value in different lexical scopes. So, each
lexical scope gets a 'frame' object, those contain the value for each
atom defined in that scope. There's a global scope which holds all of
the globally defined values (like baz, foo and bletch above). Each
frame points to its enclosing scope, so you can search upwards to find
the right value.
The second trick was to realize that the lexical scope of a lambda is
the scope in which the lambda itself is evaluated, and that the
evaluation of a lambda expression results in a 'function' object,
which contains the lambda and its enclosing scope:
> (def foo (lambda (bar bletch)
((lambda (baz)
(+ baz bar))
bletch)))
> (foo 2 3)
5
In this case, the inner lambda in foo can 'see' the value of bar from
the enclosing lambda. More subtly, even if the inner lambda were
executed multiple times, it would see the same baz, and could even
change it. This can be used to implement all kinds of craziness,
including generators:
> (defun make-inc (add)
((lambda (base)
(lambda ()
(progn
(setq base (+ base add))
base)))
0)
)
> (setq plus2 (make-inc 2))
> (plus2)
2
> (plus2)
4
The current implementation of each frame is a simple array of
atom/value pairs, with a reference to the parent frame to form the
full scope. There are dramatically faster implementations of this same
concept, but the goal here was small and simple.
A Tiny Allocator Optimization
With eval consuming heap space for stacks, frames and argument lists,
the interpreter was spending a lot of time in the collector. As a
simple optimization, I added some free lists for stack frames and cons
cells.
Stack frames are never referenced when they're finished, so they can
always go on the free list. Cons cells used to construct argument
lists for functions are usually free.
Builtin functions have a bit which indicates whether they might hold
on to a reference to the argument list. Interpreted lambdas can't get
the list while nlambdas, lexprs and macros do.
Each lambda execution creates a new frame, and while it would be
possible to discover if that frame 'escapes' the lambda, I decided to
not attempt to cache free ones yet.
Save and Restore
To make the lisp interpreter more useful in tiny computers, I added
the ability to save and restore the entire heap to flash. This
requires leaving enough space in the flash to preserve the heap,
further constraining the amount of flash available for the application.
Code
All of this code is in the 'lisp' branch of my AltOS repository:
AltOS
The lisp interpreter is independent from the rest of AltOS and could
be re-purposed for another embedded operating system. It runs fine on
ChaosKey hardware, and also on the
STM32F042 Nucleo-32 board
There's also a test framework which runs on Linux, and is how I
developed almost all of the code. That's in the src/test directory in
the above repository, and is called 'ao_lisp_test'.
Towers of Hanoi
Here's an implementation of the classic recursive Towers of Hanoi
game; it shows most of the current features of the language.
;
; Towers of Hanoi
;
; Copyright 2016 Keith Packard <keithp@keithp.com>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful, but
; WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; General Public License for more details.
;
; ANSI control sequences
(defun move-to (col row)
(patom "\033[" row ";" col "H" nil)
)
(defun clear ()
(patom "\033[2J" nil)
)
(defun display-string (x y str)
(move-to x y)
(patom str)
)
; Here's the pieces to display
(setq stack '("*" "**" "***" "****" "*****" "******" "*******"))
(setq top (+ (length stack) 3))
;
; Here's all of the stacks of pieces
; This is generated when the program is run
;
(setq stacks nil)
; Display one stack, clearing any
; space above it
(defun display-stack (x y clear stack)
(cond ((= 0 clear)
(cond (stack (progn
(display-string x y (car stack))
(display-stack x (1+ y) 0 (cdr stack))
)
)
)
)
(t (progn
(display-string x y " ")
(display-stack x (1+ y) (1- clear) stack)
)
)
)
)
; This should probably be included in the rom image...
(defun length (list)
(cond (list (1+ (length (cdr list))))
(0)
)
)
; Position of the top of the stack on the screen
; Shorter stacks start further down the screen
(defun stack-pos (y stack)
(- y (length stack))
)
; Display all of the stacks, spaced 20 columns apart
(defun display-stacks (x y stacks)
(cond (stacks (progn
(display-stack x 0 (stack-pos y (car stacks)) (car stacks))
(display-stacks (+ x 20) y (cdr stacks)))
)
)
)
; Display all of the stacks, then move the cursor
; out of the way and flush the output
(defun display ()
(display-stacks 0 top stacks)
(move-to 1 21)
(flush)
)
; Reset stacks to the starting state, with
; all of the pieces in the first stack and the
; other two empty
(defun reset-stacks ()
(setq stacks (list stack nil nil))
(length stack)
)
; more functions which could usefully
; be in the rom image
(defun min (a b)
(cond ((< a b) a)
(b)
)
)
(defun nth (list n)
(cond ((= n 0) (car list))
((nth (cdr list) (1- n)))
)
)
; Replace a stack in the list of stacks
; with a new value
(defun replace (list pos member)
(cond ((= pos 0) (cons member (cdr list)))
((cons (car list) (replace (cdr list) (1- pos) member)))
)
)
; Move a piece from the top of one stack
; to the top of another
(defun move-piece (from to)
(let ((from-stack (nth stacks from))
(to-stack (nth stacks to))
(piece (car from-stack)))
(setq from-stack (cdr from-stack))
(setq to-stack (cons piece to-stack))
(setq stacks (replace stacks from from-stack))
(setq stacks (replace stacks to to-stack))
(display)
(delay 100)
)
)
; The implementation of the game
(defun _hanoi (n from to use)
(cond ((= 1 n)
(progn
(move-piece from to)
nil)
)
(t
(progn
(_hanoi (1- n) from use to)
(_hanoi 1 from to use)
(_hanoi (1- n) use to from)
)
)
)
)
; A pretty interface which
; resets the state of the game,
; clears the screen and runs
; the program
(defun hanoi ()
(setq len (reset-stacks))
(clear)
(_hanoi len 0 1 2)
)
| Series: | Inheritance #2 |
| Publisher: | Orbit |
| Copyright: | November 2010 |
| Printing: | September 2011 |
| ISBN: | 0-316-04395-8 |
| Format: | Mass market |
| Pages: | 395 |
Next.