About a year and a half after I started writing the openstack-debian-images package, I m very happy to announce to everyone that, thanks to Steve McIntyre s help, the official OpenStack Debian image is now generated at the same time as the official Debian CD ISO images. If you are a cloud user, if you use OpenStack on a private cloud, or if you are a public cloud operator, then you may want to download the weekly build of the OpenStack image from here:
http://cdimage.debian.org/cdimage/openstack/testing/
Note that for the moment, there s only the amd64 arch available, but I don t think this is a problem: so far, I haven t found any public cloud provider offering anything else than Intel 64 bits arch. Maybe this will change over the course of this year, and we will need arm64, but this can be added later on.
Now, for later plans: I still have 2 bugs to fix on the openstack-debian-images package (the default 1GB size is now just a bit too small for Jessie, and the script exits with zero in case of error), but nothing that prevents its use right now. I don t think it will be a problem for the release team to accept these small changes before Jessie is out.
When generating the image, Steve also wants to generate a sources.tar.gz containing all the source packages that we include on the image. He already has the script (which is used as a hook script when running the build-openstack-debian-image script), and I am planning to add it as a documentation in /usr/share/doc/openstack-debian-images.
Last, probably it would be a good idea to install grub-xen, just as Ian Campbell suggested to make it possible for this image to run in AWS or other Xen based clouds. I would need to be able to test this though. If you can contribute with this kind of test, please get in touch.
Feel free to play with all of this, and customize your Jessie images if you need to. The script is (on purpose) very small (around 400 lines of shell script) and easy to understand (no function, it s mostly linear from top to bottom of the file), so it is also very easy to hack, plus it has a convenient hook script facility where you can do all sorts of things (copying files, apt-get install stuff, running things in the chroot, etc.).
Again, thanks so much to Steve for working on using the script during the CD builds. This feels me with joy that Debian finally has official images for OpenStack.
I install the
unattended-upgrades
package on almost all of my Debian and Ubuntu servers in order to ensure
that security updates are automatically applied. It works quite well except
that I still need to login manually to upgrade my
Rackspace servers whenever a new
rackspace-monitoring-agent is released because it comes from a separate
repository
that's not covered by unattended-upgrades.
It turns out that unattended-upgrades can be configured to automatically
upgrade packages outside of the standard security repositories but it's not
very well documented and the few relevant
answers
you can find online are still using the old whitelist syntax.
apt-get install unattended-upgrades
and to answer yes to the automatic stable update question.
If you don't see the question (because your debconf threshold is too low --
change it with dpkg-reconfigure debconf), you can always trigger the
question manually:
dpkg-reconfigure -plow unattended-upgrades
Once you've got that installed, the configuration file you need to look at is
/etc/apt/apt.conf.d/50unattended-upgrades.
origin (shortcut: o)label (shortcut: l)archive (shortcut: a)suite (which is the same as archive)component (shortcut: c)site (no shortcut)_Release file under /var/lib/apt/lists/.
Note that the value of site is the hostname of the package repository,
also present in the first part these *_Release filenames
(stable.packages.cloudmonitoring.rackspace.com in the example below).
In my case, I was looking at the following inside
/var/lib/apt/lists/stable.packages.cloudmonitoring.rackspace.com_debian-wheezy-x86%5f64_dists_cloudmonitoring_Release:
Origin: Rackspace
Codename: cloudmonitoring
Date: Fri, 23 Jan 2015 18:58:49 UTC
Architectures: i386 amd64
Components: main
...
which means that, in addition to site, the only things I could match on
were origin and component since there are no Suite or Label fields
in the Release file.
This is the line I ended up adding to my
/etc/apt/apt.conf.d/50unattended-upgrades:
Unattended-Upgrade::Origins-Pattern
// Archive or Suite based matching:
// Note that this will silently match a different release after
// migration to the specified archive (e.g. testing becomes the
// new stable).
// "o=Debian,a=stable";
// "o=Debian,a=stable-updates";
// "o=Debian,a=proposed-updates";
"origin=Debian,archive=stable,label=Debian-Security";
"origin=Debian,archive=oldstable,label=Debian-Security";
+ "origin=Rackspace,component=main";
;
unattended-upgrades will pick
up rackspace-monitoring-agent the next time it runs, I used:
unattended-upgrade --dry-run --debug
which should output something like this:
Initial blacklisted packages:
Starting unattended upgrades script
Allowed origins are: ['origin=Debian,archive=stable,label=Debian-Security', 'origin=Debian,archive=oldstable,label=Debian-Security', 'origin=Rackspace,component=main']
Checking: rackspace-monitoring-agent (["<Origin component:'main' archive:'' origin:'Rackspace' label:'' site:'stable.packages.cloudmonitoring.rackspace.com' isTrusted:True>"])
pkgs that look like they should be upgraded: rackspace-monitoring-agent
...
Option --dry-run given, *not* performing real actions
Packages that are upgraded: rackspace-monitoring-agent
/var/run/reboot-required file whenever a kernel update has been installed,
all you need to do is create a cronjob like this in
/etc/cron.daily/reboot-required:
#!/bin/sh
cat /var/run/reboot-required 2> /dev/null true
assuming of course that you are already receiving emails sent to the root
user (if not, add the appropriate alias in /etc/aliases and run
newaliases).
I've done a bunch of hacking on the Redis key/value database server recently:
Lua-based maxmemory eviction scripts. (#2319) (This changeset was sponsored by an anonymous client.) Redis typically stores the entire data set in memory, using the operating system's virtual memory facilities if required. However, one can use Redis more like a cache or ring buffer by enabling a "maxmemory policy" where a RAM limit is set and then data is evicted when required based on a predefined algorithm. This change enables entirely custom control over exactly what data to remove from RAM when this maxmemory limit is reached. This is an advantage over the existing policies of, say, removing entire keys based on the existing TTL, Least Recently Used (LRU) or random eviction strategies as it permits bespoke behaviours based on application-specific requirements, crucially without maintaining a private fork of Redis. As an example behaviour of what is possible with this change, to remove the lowest ranked member of an arbitrary sorted set, you could load the following eviction policy script:
local bestkey = nil local bestval = 0 for s = 1, 5 do local key = redis.call("RANDOMKEY") local type_ = redis.call("TYPE", key) if type_.ok == "zset" then local tail = redis.call("ZRANGE", key, "0", "0", "WITHSCORES") local val = tonumber(tail[2]) if not bestkey or val < bestval then bestkey = key bestval = val end end end if not bestkey then -- We couldn't find anything to remove, so return an error return false end redis.call("ZREMRANGEBYRANK", bestkey, "0", "0") return true
TCP_FASTOPEN support. (#2307) The aim of TCP_FASTOPEN is to eliminate one roundtrip from a TCP conversation by allowing data to be included as part of the SYN segment that initiates the connection. (More info.)
Support infinitely repeating commands in redis-cli. (#2297)
Add --failfast option to testsuite runner. (#2290)
Add a -q (quiet) argument to redis-cli. (#2305)
Making some Redis Sentinel defaults a little saner. (#2292)
Add run-parts(8) directories to be executed at various points in the daemon's lifecycle. (e427f8) This is especially useful for loading Lua scripts as they are not persisted across restarts.
Split out Redis Sentinel into its own package. (#775414, 39f642) This makes it possible to run Sentinel sanely on Debian systems without bespoke scripts, etc.
Ensure /etc/init.d/redis-server start idempotency with --oknodo (60b7dd) Idempotency in initscripts is especially important given the rise of configuration managment systems.
Uploaded 3.0.0 RC2 to Debian experimental. (37ac55)
Re-enabled the testsuite. (7b9ed1)
Since July, I have been aware of an ugly problem with
propellor. Certain
propellor configurations could have a bug. I've tried to solve the problem at
least a half-dozen times without success; it's eaten several weekends.
Today I finally managed to fix propellor so it's impossible to write code that
has the bug, bending the Haskell type checker to my will with the power of
GADTs and type-level functions.
the bug
Code with the bug looked innocuous enough. Something like this:
foo :: Property
foo = property "foo" $
unlessM (liftIO $ doesFileExist "/etc/foo") $ do
bar <- liftIO $ readFile "/etc/foo.template"
ensureProperty $ setupFoo bar
ensureProperty
line, and the setupFoo Property is run only sometimes, and is
passed data that is read from the filesystem.
This makes it very hard, indeed probably impossible for Propellor to
look inside the monad, realize that setupFoo is being used, and add
its Info to the host.
Probably, setupFoo doesn't have Info associated with it -- most
properties do not. But, it's hard to tell, when writing such a Property
if it's safe to use ensureProperty. And worse, setupFoo could later
be changed to have Info.
Now, in most languages, once this problem was noticed, the solution would
probably be to make ensureProperty notice when it's called on a Property
that has Info, and print a warning message. That's Good Enough in a sense.
But it also really stinks as a solution. It means that building propellor
isn't good enough to know you have a working system; you have to let it
run on each host, and watch out for warnings. Ugh, no!
the solution
This screams for GADTs. (Well, it did once I learned how what GADTs are
and what they can do.)
With GADTs, Property NoInfo and Property HasInfo can be separate data
types. Most functions will work on either type (Property i) but
ensureProperty can be limited to only accept a Property NoInfo.
data Property i where
IProperty :: Desc -> ... -> Info -> Property HasInfo
SProperty :: Desc -> ... -> Property NoInfo
data HasInfo
data NoInfo
ensureProperty :: Property NoInfo -> Propellor Result
requires,
which only runs the first Property after the second one has successfully
been met.
So, what's it's type when used with GADT Property?
requires :: Property i1 -> Property i2 -> Property ???
class Combine x y r where
requires :: x -> y -> r
Combines, for each combination
of 2 Properties with HasInfo or NoInfo.
It type checked. But, type inference was busted. A simple expression
like
foo requires bar
blew up:
No instance for (Requires (Property HasInfo) (Property HasInfo) r0)
arising from a use of requires'
The type variable r0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Note: there is a potential instance available:
instance Requires
(Property HasInfo) (Property HasInfo) (Property HasInfo)
-- Defined at Propellor/Types.hs:167:10
To avoid that, it needed ":: Property HasInfo" appended --
I didn't want the user to need to write that.
I got stuck here for an long time, well over a month.
type level programming
Finally today I realized that I could fix this with a little type-level
programming.
class Combine x y where
requires :: x -> y -> CombinedType x y
CombinedType is a type-level function, that calculates the type that
should be used for a combination of types x and y. This turns out to be really
easy to do, once you get your head around type level functions.
type family CInfo x y
type instance CInfo HasInfo HasInfo = HasInfo
type instance CInfo HasInfo NoInfo = HasInfo
type instance CInfo NoInfo HasInfo = HasInfo
type instance CInfo NoInfo NoInfo = NoInfo
type family CombinedType x y
type instance CombinedType (Property x) (Property y) = Property (CInfo x y)
before :: (IsProp x, Combines y x, IsProp (CombinedType y x)) => x -> y -> CombinedType y x
before x y = (y requires x) describe (propertyDesc x)
onChange
:: (Combines (Property x) (Property y))
=> Property x
=> Property y
=> CombinedType (Property x) (Property y)
onChange = -- 6 lines of code omitted
fallback :: (Combines (Property p1) (Property p2)) => Property p1 -> Property p2 -> Property (CInfo p1 p2)
fallback = -- 4 lines of code omitted
[Property], and since a haskell list can only contain a
single type, while Property Info and Property NoInfo are two different
types, that needed to be dealt with. Happily, I was able to extend
propellor's existing (&) and (!) operators to work in this situation,
so a list can be constructed of properties of several different types:
propertyList "foos" $ props
& foo
& foobar
! oldfoo
A new release 0.11.4 of Rcpp is now on the CRAN network for GNU R, and an updated Debian package will be uploaded in due course.
Rcpp has become the most popular way of enhancing GNU R with C++ code. As of today, 323 packages on CRAN depend on Rcpp for making analyses go faster and further; BioConductor adds another 41 packages, and casual searches on GitHub suggests dozens mores.
This release once again adds a large number of small bug fixes, polishes and enhancements. And like the last time, these changes were made by a group of seven different contributors (counting code commits) plus three more providing concrete suggestions. This shows that the Rcpp development and maintenance rests a large number of (broad) shoulders.
See below for a detailed list of changes extracted from the NEWS file.
Changes in Rcpp version 0.11.4 (2015-01-20)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 API:
- The
ListOf<T>class gains the.attrand.namesmethods common to other Rcpp vectors.- The
[dpq]nbinom_mu()scalar functions are now available via theR::namespace when R 3.1.2 or newer is used.- Add an additional test for AIX before attempting to include
execinfo.h.Rcpp::stopnow supports improvedprintf-like syntax using the small tinyformat header-only library (following a similar implementation in Rcpp11)- Pairlist objects are now protected via an additional
Shield<>as suggested by Martin Morgan on the rcpp-devel list.- Sorting is now prohibited at compile time for objects of type
List,RawVectorandExpressionVector.- Vectors now have a
Vector::const_iteratorthat is 'const correct' thanks to fix by Romain following a bug report in rcpp-devel by Martyn Plummer.- The
mean()sugar function now uses a more robust two-pass method, and new unit tests formean()were added at the same time.- The
mean()andvar()functions now support all core vector types.- The
setequal()sugar function has been corrected via suggestion by Qiang Kou following a bug report by S ren H jsgaard.- The macros
major,minor, andmakedevno longer leak in from the (Linux) system headersys/sysmacros.h.- The
push_front()string function was corrected.- Changes in Rcpp Attributes:
- Only look for plugins in the package's namespace (rather than entire search path).
- Also scan header files for definitions of functions to be considerd by Attributes.
- Correct the regular expression for source files which are scanned.
- Changes in Rcpp unit tests
- Added a new binary test which will load a pre-built package to ensure that the Application Binary Interface (ABI) did not change; this test will (mostly or) only run at Travis where we have reasonable control over the platform running the test and can provide a binary.
- New unit tests for sugar functions
mean,setequalandvarwere added as noted above.- Changes in Rcpp Examples:
- For the (old) examples
ConvolveBenchmarksandOpenMP, the respectiveMakefilewas renamed toGNUmakefileto pleaseR CMD checkas well as the CRAN Maintainers.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A new version of RcppAnnoy is now on CRAN. RcppAnnoy wraps the small, fast, and lightweight C++ template header library Annoy written by Erik Bernhardsson for use at Spotify. RcppAnnoy uses Rcpp Modules to offer the exact same functionality as the Python module wrapped around Annoy.
This version contains a trivial one-character change requested by CRAN to cleanse the Makevars file of possible GNU Make-isms. Oh well. This release also overcomes an undefined behaviour sanitizer bug noticed by CRAN that took somewhat more effort to deal with. As mentioned recently in another blog post, it took some work to create a proper Docker container with the required compiler and subsequent R setup, but we have one now, and the aforementioned blog post has details on how we replicated the CRAN finding of an UBSAN issue. It also took Erik some extra efforts to set something up for his C++/Python side, but eventually an EC2 instance with Ubuntu 14.10 did the task as my Docker sales skills are seemingly not convincing enough. In any event, he very quickly added the right fix, and I synced RcppAnnoy with his Annoy code.
Courtesy of CRANberries, there is also a diffstat report for this release. More detailed information is on the RcppAnnoy page page.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Lever Rukhin Photographs Los Angeles From His CarPhoblographer: It looks like many of these images have artificial lighting in them. What s your gear setup, and how do you introduce so much light into the scene from your car? Lever: About 9 months ago, I affixed a Mola beauty dish onto the roof rack of my 75 Volvo and juice it with a profoto bi-tube. This takes a bit of practice, as making a turn changes the light completely, which I always try to keep balanced. The Canon 5D3 with a 24mm f1.4 is set up on a tripod. The strobe has allowed me to capture more detail as well as creating a somewhat surreal feel to the sets.
Lev Rukhin http://www.levrukhin.com/Pitchfork: The world has a difficult time with the female auteur. B: I have nothing against Kanye West. Help me with this I m not dissing him this is about how people talk about him. With the last album he did, he got all the best beatmakers on the planet at the time to make beats for him. A lot of the time, he wasn t even there. Yet no one would question his authorship for a second. If whatever I m saying to you now helps women, I m up for saying it. For example, I did 80% of the beats on Vespertine and it took me three years to work on that album, because it was all microbeats it was like doing a huge embroidery piece. Matmos came in the last two weeks and added percussion on top of the songs, but they didn t do any of the main parts, and they are credited everywhere as having done the whole album. [Matmos ] Drew [Daniel] is a close friend of mine, and in every single interview he did, he corrected it. And they don t even listen to him. It really is strange.In Defense of the Selfie Stick
When you ask someone to take a picture of you, technically, they are the photographer, and they own the copyright of your picture. ( ) All of a sudden, your backpacking adventure in Europe requires you to pack a stack of legal contracts. Now your exchange goes from Can you take a picture of us? to Can you take a picture of us, making sure that the church is on the top right corner, and also, I am going to need you to sign this paper .I don t know what s with the selfie stick hate. Let people have fun, it doesn t hurt. If anything, it prevents them from asking you to take their photo, and if we already established you are the kind of people not a big fan of strangers, all the better, right? Why Top Tech CEOs Want Employees With Liberal Arts Degrees
Both Yi and Sheer recognize that the scientific method is valuable, with its emphasis on logic and reason, especially when dealing with data or engineering problems. But they believe this approach can sometimes be limiting. When I collaborate with people who have a strictly technical background, says Yi, the perspective I find most lacking is an understanding of what motivates people and how to balance multiple factors that are at work outside the realm of technology.Interesting food for thought, specially if you know an engineer that ditches the arts as of little value for personal growth in their careers/life.
| Week | Squeeze | Wheezy | Jessie |
|---|---|---|---|
| 43 | 284 (213+71) | 468 (332+136) | 319 (240+79) |
| 44 | 261 (201+60) | 408 (265+143) | 274 (224+50) |
| 45 | 261 (205+56) | 425 (291+134) | 295 (229+66) |
| 46 | 271 (200+71) | 401 (258+143) | 427 (313+114) |
| 47 | 283 (209+74) | 366 (221+145) | 342 (260+82) |
| 48 | 256 (177+79) | 378 (230+148) | 274 (189+85) |
| 49 | 256 (180+76) | 360 (216+155) | 226 (147+79) |
| 50 | 204 (148+56) | 339 (195+144) | ??? |
| 51 | 178 (124+54) | 323 (190+133) | 189 (134+55) |
| 52 | 115 (78+37) | 289 (190+99) | 147 (112+35) |
| 1 | 93 (60+33) | 287 (171+116) | 140 (104+36) |
| 1 | 93 (60+33) | 287 (171+116) | 140 (104+36) |
| 2 | 82 (46+36) | 271 (162+109) | 157 (124+33) |
| 3 | 25 (15+10) | 249 (165+84) | 172 (128+44) |
| 4 | 14 (8+6) | 244 (176+68) | 187 (132+55) |
| 5 | 2 (0+2) | 224 (132+92) | |
| 6 | release! | 212 (129+83) | |
| 7 | release+1 | 194 (128+66) | |
| 8 | release+2 | 206 (144+62) | |
| 9 | release+3 | 174 (105+69) | |
| 10 | release+4 | 120 (72+48) | |
| 11 | release+5 | 115 (74+41) | |
| 12 | release+6 | 93 (47+46) | |
| 13 | release+7 | 50 (24+26) | |
| 14 | release+8 | 51 (32+19) | |
| 15 | release+9 | 39 (32+7) | |
| 16 | release+10 | 20 (12+8) | |
| 17 | release+11 | 24 (19+5) | |
| 18 | release+12 | 2 (2+0) |
Last weekend I went to Mumbai to attend the Mini-Debconf held at IIT-Bombay. These are my impressions of the trip.
Arrival and Impressions of Mumbai
Getting there was a quite an adventure in itself. Unlike during my ill-fated attempt to visit a Debian event in Kerala last year when a bureaucratic snafu left me unable to get a visa, the organizers started the process much earlier at their end this time and with proper permissions. Yet in India, the wheels only turn as fast as they want to turn so despite their efforts, it was only literally at the last minute that I actually managed to secure my visa. I should note however that Indian government has done a lot to improve the process compared to the hell I remember from, say, a decade ago. It's fairly straightforward for tourist visas now and I trust they will get around to doing the same for conference visas in the fullness of time. I didn't want to commit to buying a plane ticket until I had the visa so I became concerned that the only flights left would be either really expensive or on the type of airline that flies you over Syria or under the Indian Ocean. I lucked out and got a good price on a Swiss Air flight, not non-stop but you can't have everything.
So Thursday afternoon I set off for JFK. With only one small suitcase getting there by subway was no problem and I arrived and checked in with plenty of time. Even TSA passed me through with only a minimal amount of indignity. The first leg of my journey took me to Zurich in about eight hours. We were only in Zurich for an hour and then (by now Friday) it was another 9 hours to Mumbai. Friday was Safala Ekadashi but owing to the necessity of staying hydrated on a long flight I drank a lot of water and ate some fruit which I don't normally do on a fasting day. It was tolerable but not too pleasant; I definitely want to try and make travel plans to avoid such situations in the future.
Friday evening local time I got to Mumbai. Chhattrapati Shivaji airport has improved a lot since I saw t last and now has all the amenities an international traveller needs including unrestricted free wifi (Zurich airport are you taking notes?) But here my first ominous piece of bad luck began. No sign of my suitcase. Happily some asking around revealed that it had somehow gotten on some earlier Swiss Air flight instead of the one I was on and was actually waiting for me. I got outside and Debian Developer Praveen Arimbrathodiyil was waiting to pick me up.
Normally I don't lke staying in Mumbai very much even though I have relatives there but that's because we usually went during July-August the monsoon season when Mumbai reverts back to the swampy archipelago it was originally built on. This time the weather was nice, cold by local standards, but lovely and spring-like to someone from snowy New Jersey. There have been a lot of improvements to the road infrastructure and people are actually obeying the traffic laws. (Within reason of course. Whether or not a family of six can arrange themselves on one Bajaj scooter is no business of the cops.)
The Hotel Tuliip (yes, two i's. Manager didn't know why.) Residency where I was to stay while not quite a five star establishment was adequate for my needs with a bed, hot water shower, and air conditioning. And a TV which to the bellhops great confusion I did not want turned on. (He asked about five times.) There was no Internet access per se but the manager offered to hook up a wireless router to a cable. Which on closer inspection turned out to have been severed at the base. He assured me it would be fixed tomorrow so I didn't complain and decided to do something more productive thank checking my email like sleeping.
The next day I woke up in total darkness. Apparently there had been some kind of power problem during the night which tripped a fuse or something. A call to the front desk got them to fix that and then the second piece of bad luck happened. I plugged my Thinkpad in and woke it up from hibernation and a minute later there was a loud pop from the power adapter. Note I have a travel international plug adapter with surge protector so nothing bad ought to have happened but the laptop would on turning on display the message "critical low battery error" and immediately power off. I was unable to google what that meant without Internet access but I decided not to panic and continue getting ready. I would have plenty of opportunity to troubleshoot at the conference venue. Or so I thought...
I took an autorickshaw to IIT. There also there have been positive improvements. Being quite obviously a foreigner I was fully prepared to be taken along the "scenic route." But now there are fair zones and the rickshaws all have (tamperproof!) digital fare meters so I was deposited at the main gate without fuss. After reading a board with a scary list of dos and don'ts I presented myself at security only to be inexplicably waved through without a second glance. Later I found out they've abandoned all the security theatre but not got around to updating the signs yet. Mumbai is one of the biggest, densely populated cities in the world but the IIT campus is an oasis of tranquility on the shores of Lake Powai. It's a lot bigger than it looked on the map so I had to wander around a bit before I reached the conference venue but I did make for the official registration time.
Registration
I was happy to meet several old friends (Such as Kartik Mistry and Kumar Appiah who along with Praveen and myself were the other DDs there,) people who I've corresponded with but never met, and many new people. I'm told 200+ people registered altogether. Most seemed to be students from IIT and elsewhere in Mumbai but there were also some Debian enthusiasts from further afield and most hearteningly some "civilians" who wanted to know what this was all about.
With the help of a borrowed Thinkpad adapter I got my laptop running again. (Thankfully, despite the error message, the battery itself was unharmed.) However, my streak of bad luck was not yet over. It was that very weekend that IIT had a freak campus-wide network outage something that had never happened before. And as the presentation for the talk I was to give had apparently been open when I hibernated my laptop the night before, the sudden forced shutdown had trashed the file. (ls showed it as 0 length. An fsck didn't help.) I possibly had a backup on my server but with no Internet access I had no way to retrieve it. I still remained cool. The talk was scheduled for the second day so I could recover it at the hotel.
Keynotes
Professor Kannan Maudgalya of the FOSSEE (Free and Open Source Software for Education) Project which is part of the central government Ministry for Human Resource Development spoke about various activities of his project. Of particular interest to us are:
For one of our customers we are using the Open Monitoring Distribution which includes Check_MK as monitoring system. We re monitoring the switches (Cisco) via SNMP. The switches as well as all the servers support GBit connections, though there are some systems in the wild which are still operating at 100MBit (or even worse on 10MBit). Recently there have been some performance issues related to network access. To make sure it s not the fault of a server or a service we decided to monitor the switch ports for their network speed. By default we assume all ports to be running at GBit speed. This can be configured either manually via:
cat etc/check_mk/conf.d/wato/rules.mk
[...]
checkgroup_parameters.setdefault('if', [])
checkgroup_parameters['if'] = [
( 'speed': 1000000000 , [], ['switch1', 'switch2', 'switch3', 'switch4'], ALL_SERVICES, 'comment': u'GBit links should be used as default on all switches' ),
] + checkgroup_parameters['if']
or by visting Check_MK s admin web-interface at WATO Configuration -> Host & Service Parameters -> Parameters for Inventorized Checks -> Networking -> Network interfaces and switch ports and creating a rule for the Explicit hosts switch1, switch2, etc and setting Operating speed to 1 GBit/s there.
So far so straight forward and this works fine. Thanks to this setup we could identify several systems which used 100Mbit and 10MBit links. Definitely something to investigate on the according systems with their auto-negotiation configuration. But to avoid flooding the monitoring system and its notifications we want to explicitly ignore those systems in the monitoring setup until those issues have been resolved.
First step: identify the checks and their format by either invoking cmk -D switch2 or looking at var/check_mk/autochecks/switch2.mk:
OMD[synpros]:~$ cat var/check_mk/autochecks/switch2.mk
[
("switch2", "cisco_cpu", None, cisco_cpu_default_levels),
("switch2", "cisco_fan", 'Switch#1, Fan#1', None),
("switch2", "cisco_mem", 'Driver text', cisco_mem_default_levels),
("switch2", "cisco_mem", 'I/O', cisco_mem_default_levels),
("switch2", "cisco_mem", 'Processor', cisco_mem_default_levels),
("switch2", "cisco_temp_perf", 'SW#1, Sensor#1, GREEN', None),
("switch2", "if64", '10101', 'state': ['1'], 'speed': 1000000000 ),
("switch2", "if64", '10102', 'state': ['1'], 'speed': 1000000000 ),
("switch2", "if64", '10103', 'state': ['1'], 'speed': 1000000000 ),
[...]
("switch2", "snmp_info", None, None),
("switch2", "snmp_uptime", None, ),
]
OMD[synpros]:~$
Second step: translate this into the according format for usage in etc/check_mk/main.mk:
checks = [ ( 'switch2', 'if64', '10105', 'state': ['1'], 'errors': (0.01, 0.1), 'speed': None ), # MAC: 00:42:de:ad:be:af, 10MBit ( 'switch2', 'if64', '10107', 'state': ['1'], 'errors': (0.01, 0.1), 'speed': None ), # MAC: 00:23:de:ad:be:af, 100MBit ( 'switch2', 'if64', '10139', 'state': ['1'], 'errors': (0.01, 0.1), 'speed': None ), # MAC: 00:42:de:ad:be:af, 100MBit [...] ]Using this configuration we ignore the operation speed on ports 10105, 10107 and 10139 of switch2 using the the if64 check. We kept the state setting untouched where sensible ( 1 means that the expected operational status of the interface is to be up ). The errors settings specifies the error rates in percent for warnings (0.01%) and critical (0.1%). For further details refer to the online documentation or invoke cmk -M if64 . Final step: after modifying the checks configuration make sure to run cmk -IIu switch2 ; cmk -R to renew the inventory for switch2 and apply the changes. Do not forget to verify the running configuration by invoking cmk -D switch2 :
I expect this is obvious to many people but bahumbug To Phish, or Not to Phish? just woke me up to the fact that if Google hosts your company email then its Sender Policy Framework might make other Google-sent emails look legitimate for your domain. When combined with the unsupportive support of the big free webmail hosts, is this another black mark against SPF?
Writing Your Way to Happiness (nytimes.com)The concept is based on the idea that we all have a personal narrative that shapes our view of the world and ourselves. But sometimes our inner voice doesn t get it completely right. Some researchers believe that by writing and then editing our own stories, we can change our perceptions of ourselves and identify obstacles that stand in the way of better health. It may sound like self-help nonsense, but research suggests the effects are real. Students who had been prompted to change their personal stories improved their grade-point averages and were less likely to drop out over the next year than the students who received no information. In the control group, which had received no advice about grades, 20 percent of the students had dropped out within a year. But in the intervention group, only 1 student or just 5 percent dropped out.Old Masters at the Top of Their Game (nytimes.com)
Now I am 79. I ve written many hundreds of essays, 10 times that number of misbegotten drafts both early and late, and I begin to understand that failure is its own reward. It is in the effort to close the distance between the work imagined and the work achieved wherein it is to be found that the ceaseless labor is the freedom of play, that what s at stake isn t a reflection in the mirror of fame but the escape from the prison of the self. T. H. White, the British naturalist turned novelist to write The Once and Future King, calls upon the druid Merlyn to teach the lesson to the young prince Arthur: You may grow old and trembling in your anatomies, you may lie awake at night listening to the disorder of your veins, you may miss your only love, you may see the world about you devastated by evil lunatics, or know your honour trampled in the sewers of baser minds. There is only one thing for it then to learn. Learn why the world wags and what wags it. That is the only thing which the mind can never exhaust, never alienate, never be tortured by, never fear or distrust, and never dream of regretting.A Life with a View (ribbonfarm.com)
The arrival fallacy is about seeking a life from which one can look with a complacent equanimity upon the rest of reality, without yearning. It is an ideal of a life that is defined primarily by blindness to itself. You yearn while you see your life as others see it, until you arrive at a situation where you can disappear into the broader background, and see comfortably without being seen discomfittingly, especially by yourself. Once you re there, the yearning stops, so the theory goes. Of course it is a laughably bad theory.How To Escape From A Moving Car (mrporter.com)
Everyone s first instinct is to put their hands or legs down first. That s the worst thing you can do: you will break something. The pointy parts of your body hurt elbows, knees, hips, ankles. Put your fists under your chin, and bring your elbows together. Keep your chin tucked in to your chest to protect your head. The best point of impact is the back of the shoulder and your back. If you dive out directly onto your shoulder you ll break it.What the World Looks Like with Social Anxiety (collegehumor.com)
Shea Strauss.Georges Braque has said that out of limited means, new forms emerge. I say, we find out what we will do by knowing what we will not do. And so, if your heart is set on 8 10 platinum landscapes in misty southern terrains, work your way through those who inspire you, ride their bus route and damn those who would say you are merely repeating what has been done before. Wait for the months and years to pass and soon your differences will begin to appear with clarity and intelligence, when your originality will become visible, even the works from those very first years of trepidation when everything you did seemed so done before.At 90, She s Designing Tech For Aging Boomers (npr.org)
And for the bulging demographic of baby boomers growing old, Beskind has this advice: Embrace change and design for it.
#!/usr/bin/env python3
#coding: utf-8
# Copyright 2015 Enrico Zini <enrico@enricozini.org>. Licensed under the terms
# of the GNU General Public License, version 2 or any later version.
import argparse
import fcntl
import select
import curses
import contextlib
import subprocess
import os
import sys
import collections
import shlex
import shutil
import logging
def stream_output(proc):
"""
Take a subprocess.Popen object and generate its output, line by line,
annotated with "stdout" or "stderr". At process termination it generates
one last element: ("result", return_code) with the return code of the
process.
"""
fds = [proc.stdout, proc.stderr]
bufs = [b"", b""]
types = ["stdout", "stderr"]
# Set both pipes as non-blocking
for fd in fds:
fcntl.fcntl(fd, fcntl.F_SETFL, os.O_NONBLOCK)
# Multiplex stdout and stderr with different prefixes
while len(fds) > 0:
s = select.select(fds, (), ())
for fd in s[0]:
idx = fds.index(fd)
buf = fd.read()
if len(buf) == 0:
fds.pop(idx)
if len(bufs[idx]) != 0:
yield types[idx], bufs.pop(idx)
types.pop(idx)
else:
bufs[idx] += buf
lines = bufs[idx].split(b"\n")
bufs[idx] = lines.pop()
for l in lines:
yield types[idx], l
res = proc.wait()
yield "result", res
@contextlib.contextmanager
def miniscreen(has_fancyterm, name, maxlines=3, silent=False):
"""
Show the output of a process scrolling in a portion of the screen.
has_fancyterm: true if the terminal supports fancy features; if false, just
write lines to standard output
name: name of the process being run, to use as a header
maxlines: maximum height of the miniscreen
silent: do nothing whatsoever, used to disable this without needing to
change the code structure
Usage:
with miniscreen(True, "my process", 5) as print_line:
for i in range(10):
print_line(("stdout", "stderr")[i % 2], "Line # ".format(i))
"""
if not silent and has_fancyterm:
# Discover all the terminal control sequences that we need
output_normal = str(curses.tigetstr("sgr0"), "ascii")
output_up = str(curses.tigetstr("cuu1"), "ascii")
output_clreol = str(curses.tigetstr("el"), "ascii")
cols, lines = shutil.get_terminal_size()
output_width = cols
fg_color = (curses.tigetstr("setaf") or
curses.tigetstr("setf") or "")
sys.stdout.write(str(curses.tparm(fg_color, 6), "ascii"))
output_lines = collections.deque(maxlen=maxlines)
def print_lines():
"""
Print the lines in our buffer, then move back to the beginning
"""
sys.stdout.write(" progress:".format(name))
sys.stdout.write(output_clreol)
for msg in output_lines:
sys.stdout.write("\n")
sys.stdout.write(msg)
sys.stdout.write(output_clreol)
sys.stdout.write(output_up * len(output_lines))
sys.stdout.write("\r")
try:
print_lines()
def _progress_line(type, line):
"""
Print a new line to the miniscreen
"""
# Add the new line to our output buffer
msg = " ".format("." if type == "stdout" else "!", line)
if len(msg) > output_width - 4:
msg = msg[:output_width - 4] + "..."
output_lines.append(msg)
# Update the miniscreen
print_lines()
yield _progress_line
# Clear the miniscreen by filling our ring buffer with empty lines
# then printing them out
for i in range(maxlines):
output_lines.append("")
print_lines()
finally:
sys.stdout.write(output_normal)
elif not silent:
def _progress_line(type, line):
print(" : ".format(type, line))
yield _progress_line
else:
def _progress_line(type, line):
pass
yield _progress_line
def run_command_fancy(name, cmd, env=None, logfd=None, fancy=True, debug=False):
quoted_cmd = " ".join(shlex.quote(x) for x in cmd)
log.info("%s running command %s", name, quoted_cmd)
if logfd: print("runcmd:", quoted_cmd, file=logfd)
# Run the script itself on an empty environment, so that what was
# documented is exactly what was run
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
with miniscreen(fancy, name, silent=debug) as progress:
stderr = []
for type, val in stream_output(proc):
if type == "stdout":
val = val.decode("utf-8")
if logfd: print("stdout:", val, file=logfd)
log.debug("%s stdout: %s", name, val)
progress(type, val)
elif type == "stderr":
val = val.decode("utf-8")
if logfd: print("stderr:", val, file=logfd)
stderr.append(val)
log.debug("%s stderr: %s", name, val)
progress(type, val)
elif type == "result":
if logfd: print("retval:", val, file=logfd)
log.debug("%s retval: %d", name, val)
retval = val
if retval != 0:
lastlines = min(len(stderr), 5)
log.error("%s exited with code %s", name, retval)
log.error("Last %d lines of standard error:", lastlines)
for line in stderr[-lastlines:]:
log.error("%s: %s", name, line)
return retval
parser = argparse.ArgumentParser(description="run a command showing only a portion of its output")
parser.add_argument("--logfile", action="store", help="specify a file where the full execution log will be written")
parser.add_argument("--debug", action="store_true", help="debugging output on the terminal")
parser.add_argument("--verbose", action="store_true", help="verbose output on the terminal")
parser.add_argument("command", nargs="*", help="command to run")
args = parser.parse_args()
if args.debug:
loglevel = logging.DEBUG
elif args.verbose:
loglevel = logging.INFO
else:
loglevel = logging.WARN
logging.basicConfig(level=loglevel, stream=sys.stderr)
log = logging.getLogger()
fancy = False
if not args.debug and sys.stdout.isatty():
curses.setupterm()
if curses.tigetnum("colors") > 0:
fancy = True
if args.logfile:
logfd = open("output.log", "wt")
else:
logfd = None
retval = run_command_fancy("miniscreen example", args.command, logfd=logfd)
sys.exit(retval)
I ve been meaning to move away from Movable Type for a while; they no longer provide the Open Source variant, I ve had some issues with the commenting side of things (more the fault of spammers than Movable Type itself) and there are a few minor niggles that I wanted to resolve. Nothing has been particularly pressing me to move and I haven t been blogging as much so while I ve been keeping an eye open for a replacement I haven t exerted a lot of energy into the process. I have a little bit of time at present so I asked around on IRC for suggestions. One was ikiwiki, which I use as part of helping maintain the SPI website (and think is fantastic for that), the other was Jekyll. Both are available as part of Debian Jessie.
Jekyll looked a bit fancier out of the box (I m no web designer so pre-canned themes help me a lot), so I decided to spend some time investigating it a bit more. I d found a Movable Type to ikiwiki converter which provided a starting point for exporting from the SQLite3 DB I was using for MT. Most of my posts are in markdown, the rest (mostly from my Blosxom days) are plain HTML, so there wasn t any need to do any conversion on the actual content. A minor amount of poking convinced Jekyll to use the same URL format (permalink: /:year/:month/:title.html in the _config.yml did what I wanted) and I had to do a few bits of fix up for some images that had been uploaded into MT, but overall fairly simple stuff.
Next I had to think about comments. My initial thought was to just ignore them for the moment; they weren t really working on the MT install that well so it s not a huge loss. I then decided I should at least see what the options were. Google+ has the ability to embed in your site, so I had a play with that. It worked well enough but I didn t really want to force commenters into the Google ecosystem. Next up was Disqus, which I ve seen used in various places. It seems to allow logins via various 3rd parties, can cope with threading and deals with the despamming. It was easy enough to integrate to play with, and while I was doing so I discovered that it could cope with importing comments. So I tweaked my conversion script to generate a WXR based file of the comments. This then imported easily into Disqus (and also I double checked that the export system worked).
I m sure the use of a third party to handle comments will put some people off, but given the ability to export I m confident if I really feel like dealing with despamming comments again at some point I can switch to something locally hosted. I do wish it didn t require Javascript, but again it s a trade off I m willing to make at present.
Anyway. Thanks to Tollef for the pointer (and others who made various suggestions). Hopefully I haven t broken (or produced a slew of new posts for) any of the feed readers pointed at my site (but you should update to use feed.xml rather than any of the others - I may remove them in the future once I see usage has died down).
(On the off chance it s useful to someone else the conversion script I ended up with is available. There s a built in Jekyll importer that may be a better move, but I liked ending up with a git repository containing a commit for each post.)
The latest version of Mono has released (actually, it happened a week ago, but it took me a while to get all sorts of exciting new features bug-checked and shipshape).
Stable packages
This release covers Mono 3.12, and MonoDevelop 5.7. These are built for all the same targets as last time, with a few caveats (MonoDevelop does not include F# or ASP.NET MVC 4 support). ARM packages will be added in a few weeks time, when I get the new ARM build farm working at Xamarin s Boston office.
Ahead-of-time support
This probably seems silly since upstream Mono has included it for years, but Mono on Debian has never shipped with AOT d mscorlib.dll or mcs.exe, for awkward package-management reasons. Mono 3.12 fixes this, and will AOT these assemblies optimized for your computer on installation. If you can suggest any other assemblies to add to the list, we now support a simple manifest structure so any assembly can be arbitrarily AOT d on installation.
Goodbye Mozroots!
I am very pleased to announce that as of this release, Mono users on Linux no longer need to run mozroots to get SSL working. A new command, cert-sync , has been added to this release, which synchronizes the Mono SSL certificate store against your OS certificate store and this tool has been integrated into the packaging system for all mono-project.com packages, so it is automatically used. Just make sure the ca-certificates-mono package is installed on Debian/Ubuntu (it s always bundled on RPM-based) to take advantage! It should be installed on fresh installs by default. If you want to invoke the tool manually (e.g. you installed via make install, not packages) use
cert-sync /path/to/ca-bundle.crtOn Debian systems, that s
cert-sync /etc/ssl/certs/ca-certificates.crtand on Red Hat derivatives it s
cert-sync /etc/pki/tls/certs/ca-bundle.crtYour distribution might use a different path, if it s not derived from one of those. Windows installer back from the dead Thanks to help from Alex Koeplinger, I ve brought the Windows installer back from the dead. The last release on the website was for 3.2.3 (it s actually not this version at all it s complicated ), so now the Windows installer has parity with the Linux and OSX versions. The Windows installer (should!) bundles everything the Mac version does F#, PCL facades, IronWhatever, etc, along with Boehm and SGen builds of the Mono runtime done with Visual Studio 2013. An EXPERIMENTAL OH MY GOD DON T USE THIS IN PRODUCTION 64-bit installer is in the works, when I have the time to try and make a 64-build of Gtk#.
Next.