Finding out What’s Next at BarCampMel 2012 with Drizzle, SQL, JavaScript and a web browser

Just for the pure insane fun of it, I accepted the challenge of “what can you do with the text format of the schedule?” for BarCampMel. I’m a database guy, so I wanted to load it into a database (which would be Drizzle), and I wanted it to be easy to keep it up to date (this is an unconference after all).

So… the text file itself isn’t in any standard format, so I’d have to parse it. I’m lazy and didn’t want to leave the comfort of the database. Luckily, inside Drizzle, we have a js plugin that lets you execute arbitrary JavaScript. Parsing solved. I needed to get the program and luckily we have the http_functions plugin that uses libcurl to allow us to perform HTTP GET requests. I also wanted it in a table so I could query it when not online, so I needed to load the data. Luckily, in Drizzle we have the built in EXECUTE functionality, so I could just use the JavaScript to parse the response from the HTTP GET request and construct SQL to load the data into a table to then query.

So, grab your Drizzle server with “plugin-add=js” and “plugin-add=http_functions” in the config file or as options to drizzled (prefixed with –) and….

This simple one liner pulls the current schedule and puts it into a table called ‘schedule’:

SELECT EXECUTE(JS("function sql_quote(s) {return s ? '\"'+ s.replace('\"', '\\\"') + '\"' : 'NULL'} function DrizzleDateString(d) { function pad(n) { return n<10 ? '0'+n : n } return d.getFullYear()+'-'+pad(d.getMonth()+1)+'-'+pad(d.getDate())+' '+pad(d.getHours())+':'+pad(d.getMinutes())+':'+pad(d.getSeconds()) } var sql = 'COMMIT;CREATE TABLE IF NOT EXISTS schedule (start_time datetime, stage varchar(1000), mr2 varchar(1000), mr1 varchar(1000), duration int); begin; delete from schedule;' ; var time= new Date;var input= arguments[0].split(\"\\n\"); var entry = new Array(); var stage, mr2, mr1; for(var i=0; i < input.length; i++) { var p= input[i].match('^(.*?) (.*)$'); if(p) {if(p[1]=='Time') { time=new Date(Date.parse(p[2]));} if(p[1]=='Duration') { sql+='INSERT INTO schedule (start_time,stage,mr2,mr1,duration) VALUES (\"' + DrizzleDateString(time) + '\", ' + sql_quote(stage) + ', ' + sql_quote(mr2) + ',' + sql_quote(mr1) + ',' + p[2] + '); '; time= new Date(time.getTime()+p[2]*60*1000); stage= mr2= mr1= ''; } if(p[1]=='stage') {stage=p[2]} if (p[1]=='mr2') {mr2=p[2]} if (p[1]=='mr1') {mr1=p[2]} }}; sql+='COMMIT;'; sql", (select http_get('https://dl.dropbox.com/s/01yh7ji7pswjwwk/live-schedule.txt?dl=1'))));

Which you can then find out “what’s on now and coming up” with this query:

select * from schedule where start_time > DATE_ADD(now(), INTERVAL 9 HOUR) ORDER BY start_time limit 2\G
But it’s totally not fun having to jump to the command line all the time, and you may want it in JSON format for consuming with some web thing…. so you can load the json_server plugin and browse to the port that it’s running on (default 8086) and type the SQL in there and get a JSON response, or just look at the pretty table there.

Photos from BarCampMel 2012

Just thought I’d post a couple of photos I took today at BarCampMel. Actually, this is technically 4 photos as I’ve used a Fuji Instax shot in each one. The first is Ben making coffee: in the morning and the afternoon. The second shot is awesome partially automated brewing setup.

image

image

Samuel Smith’s Nut Brown Ale

More Vegan beer from Samuel Smith’s! I can heartily recommend their Nut Brown Ale to anyone who’s ever had a Newcastle Brown and wanted a bit more. This isn’t overwhelming and thoroughly enjoyable. I’m finding that this seems to be a good pattern in their beers – flavourful, drinkable and not overwhelming. You could easily pair this with food too… and I’m either craving lentils or they’d go well with it. The back of bottle suggests Thai, Malaysian and Chinese food, which would also go pretty well. There is a societal bias towards matching wine with food, and beer is often supremely overlooked. This is rather sad as the range and depths of flavours of bere is wide and varied, and pretty much always supremely more affordable. You can probably easily name several wines that cost hundreds or thousands of dollars; try naming a single beer that costs more than $100 for a six pack.

Edit: it’s not this beer that costs a lot, this one is quite reasonable. The expensive one is of you can’t easily get to a Belgian monastery.

Samuel Smith’s Oatmeal Stout

Another Vegan beer from Samuel Smith with the nice Vegan symbol on the back and everything. This isn’t a heavy stout, it’s quite lite and consuming more than one pint wouldn’t be taxing at all. The oatmeal part is not overwhelming, providing a subtle flavour more than overpowering the rest of the beer. A quite nice midweek beer.

image

Vegan Lentil and Kidney Bean Shepherd’s Pie

This started with Michelle Bridges’ Lentil Shepherd’s Pie recipe: http://www.dailylife.com.au/health-and-fitness/dl-nutrition/michelle-bridges-lentil-shepherds-pie-20120704-21g7d.html and ended up with this. I’ve made some modifications, e.g. making it Vegan.

The biggest modification is in the cauliflower topping. Like the original I avoided putting mashed potato on the top. This greatly reduces the calorie content, dose low-GI something and a million other things that people try and sell you in food bar form. Basically: cauliflower is awesome, let’s see what we can do with it.

This should be gluten free too…

This serves about 4 people.

Ingredients for the filling:

  • 1/4 cup dried green lentils
  • 1/4 cup dried red kidney beans
  • 1 whole onion (small, peeled)
  • 1 chopped onion
  • 1 bay leaf (or 2, depending on size and your addiction to the awesomeness that is bay leaves)
  • 1 large carrot, diced (I used a purple carrot, because, well, how awesome looking are they?)
  • 1 zucchini, diced
  • 1 capsicum, diced
  • 1 garlic clove, crushed (I ended up using probably closer to 2.. but I like garlic)
  • 400g can diced tomatoes
  • 1tbsp oil (olive works, but Canola or similar should work fine too)

Ingredients: topping

  • 1/2 head of cauliflower chopped/broken into florets (you can double this part of the recipe to have a nice side of the topping too.. which is rather yummy)
  • 400g can of Butter beans, drained and rinsed
  • Up to 1/4 cup nutritional yeast.
Serve with: steamed broccoli and green beans

The original recipe also used mushrooms and didn’t have the zucchini or capsicum. I didn’t have mushrooms (I’d eaten them all) but I did have zucchini and capsicum, and they’re yummy. So feel free to vary.

Method

You’re going to need a saucepan. Put the dried lentlis and dried kidney beans in it with 2-3 cups of water. Add the whole onion and bay leaf, bring to the boil and simmer for 40+ minutes, until the lentils and kidney beans are tender. When done, if there is an excess of water, drain it. You’ll want to have about 1/4 cup of liquid left in there. Remove the onion and bay leaf from the pot.

Pro tip: sprinkle a small amount of salt on the onion and eat it. Deny that it ever existed and enjoy your mid-cooking snack.

The original recipe used all lentils instead of half with kidney beans. I like red kidney beans. If you don’t use red kidney beans and just use lentils, the simmering time is probably the original 40mins, while it took a bit longer for mine – maybe 50 (it’s easy to tell. attempt to eat one of the kidney beans :)

At the same time, you want to grab the cauliflower and steam it for about 15 minutes. You want it to be very soft, you’re going to be mashing it (so if it’s not done at 15, wait a little longer).

Get a bowl that’s good for mashing and put the cauliflower in it. Add the butter beans (you may want to zap them in a microwave for up to 1 minute to get them warmer and easier to mash). Mash the two together, adding the nutritional yeast and perhaps a small amount of salt. The nutritional yeast will give a cheese-like flavour without, well, being cheese. I added the nutritional yeast a bit gradually and tasted along the way to get it right. You’ll know when you start to get close, as you’ll start getting this kind of creamy cheesey cauliflower taste.

In a large frying pan, add some oil (about 1tbsp is fine) and cook the onion, carrot, zucchini and capsicum until they start to soften, stirring regularly (this could be ~10mins). Add the tomatoes, lentils and kidney beans, season with salt and black pepper to taste. Depending on how much liquid was left in your lentil and kidney bean pot, you may need to add a little. Transfer to an oven proof dish, topping with the cauliflower+butter bean mash.

If you like, sprinkle some bread crumbs (or those gluten free quinoa crumbs that Ogram sells) on the top, and bung it in a 180C oven for anywhere from 15-30 minutes to get things all warm, a bit golden and depending on how hungry you are :)

Plate it all up and you can end up with something like this (cell phone pic, with awful white balance, lighting and generally the worst photo I’ve ever taken):

We really enjoyed this, and if you’re looking for a good sized plate of food that checks in at (i think) around 400calories, there you go.

Samuel Smith’s Old Brewery Tadcaster Taddy Porter

I had this one a few days ago. When I was last in Acland Cellars I saw a bunch of Samuel Smith’s beer, and I noticed the small Vegan symbol on the back. Not one to shy away from vegan beer, I bought one of each I could see.

Beer doesn’t have to be explicitly labelled to be vegan, basically what you’re wanting to avoid is isinglass (obtained from dried swim bladders from fish) that is used as a fining agent.

Pro tip: if your beer has a bit of sediment in it (like Coopers does), it’s near 100% likely to be vegan (barring honey or somebody inventing a way to put bacon in beer).

A fining agent will accelerate the settling (clarification) of beer. If you’ve ever bottled your own homebrew, you’ll have noticed that the first 90% of bottles look a lot clearer than the last 10% (here you’re starting to stir up the sediment at the bottom of the brewing vessel). This then settles in the bottle and isn’t a problem – just don’t drink the last half mouthful. This is natural beer – “bottle conditioned”. Mass produced beers (think VB/Carlton/XXXX, not Coopers) are likely to use a fining agent such as isinglass as this enables them to pump out the beer quicker and not have to produce bottles that can withstand the pressure of secondary fermentation.

Pro tip: “bottle conditioned” likely means vegan too.

Basically, being vegan is a great excuse to not drink lots of shit beer.

Anyway, this is the beer I had the other night, and it was quite a pleasant porter. yay!

The Age (Fairfax) picks up on Telstra NextG ‘stalking’

http://www.theage.com.au/technology/technology-news/telstra-accused-of-next-g-web-stalking-20120705-21ivs.html

It took a while, but it’s there. There is a mention of Netsweeper and that they provide products and services to Yemen, Qatar and the United Arab Emirates but it misses what these products are really for.

Jenkins Bazaar plugin 1.19

I recently released a new version of the Bazaar plugin for Jenkins. This release was inspired by a problem we noticed at Percona. It is:

  • run “bzr revert” after a pull, as if you have a directory that is removed and re-added while having unknown files in said directory (e.g. build artifacts), you would end up in a very bad place (this is a BZR bug, so we work-around it with a “bzr revert”).

The update has already appeared in the Jenkins update centre, so you should already be able to upgrade to it.

New libeatmydata release!

I updated the web site for libeatmydata (woah!): http://flamingspork.com/projects/libeatmydata/ and the launchpad page: https://launchpad.net/libeatmydata to reflect this too.

New exciting things in the land of libeatmydata:

  • sync_file_range is now wrapped (thanks to Phillip Susi)
  • I now bundle the eatmydata helper script originally included in the debian packages
  • the autotools foo builds on MacOS X
  • I modified the eatmydata helper script to also do the right DYLD environment variables if it’s running on Darwin. i.e. the eatmydata helper script now runs on MacOS X too (well, it should – please test)
  • libeatmydata should now work just about everywhere that can LD_PRELOAD. Patches welcome.

If anyone knows how to build a non-versioned shared libray using autotools… I’d love to hear it. libeatmydata is totally not something that needs soname versioning. I guess it’s harmless though.

New York Times Curried Cauliflower Soup

I made the Curried Cauliflower Soup I found on the New York Times website: http://www.nytimes.com/2011/12/13/health/nutrition/curried-cauliflower-soup-recipes-for-health.html

Rather delicious I have to say. In the future, I aim to try adding some peas, maybe some parsnip or even carrot.

Damn delicious though.

Chickpea and green bean curry

Ingredients

oil (olive, canola, whatever you like)
2 tsp mustard seeds
1 onion (chopped)
2 cloves garlic
1 dried chilli (crushed/chopped) – or more, depending on heat preference and heat of chilli
2 teaspoon chopped ginger
2 tsp ground coriander
2 tsp ground cumin
2 good handfulls of green beans, chopped into inch long pieces
1 can chickpeas (drained, washed)
1 can diced tomatoes

Method

Put oil in saucepan, add the mustard seeds
As the mustard seeds start to pop, add the chopped onion
Cook until onion is soft, then add all the spices
Stir and cook for ~30 seconds, until aromatic
Add can tomatoes, chickpeas and beans.
stir and cook until chickpeas are done and beans are a little softer, but still nice and crunchy (you can cook for longer if you like your green beans more well done, but I like a bit of crunch)

This took not much time, and was invented this evening purely because earlier in the day I had felt the need for green beans.

Nutrition

This serves about 2-3 people (depending on how much you eat). For 3ppl, it’s about 215 calories and 9g of protein per serve.