News aggregator

Andrew Savory: If you want a $200 discount for #AdobeSummit, use….

Planet ALUG - Sun, 10/02/2013 - 13:30

If you want a $200 discount for #AdobeSummit, use… wp.me/p2vuKe-KZ

Categories: LUG Community Blogs

Andrew Savory: upstart config is fragile, nasty hack to exhaust…..

Planet ALUG - Sun, 10/02/2013 - 13:29

upstart config is fragile, nasty hack to exhaust… wp.me/p2vuKe-KW

Categories: LUG Community Blogs

Andrew Savory: “because we’ve chosen up to this point not to inno…

Planet ALUG - Sun, 10/02/2013 - 13:29

“because we’ve chosen up to this point not to inno… wp.me/p2vuKe-KU

Categories: LUG Community Blogs

Will Jessop: willjessop4

Planet GLLUG - Sun, 10/02/2013 - 03:09
Creating BERT dicts in Go

I’ve been learning Go recently and have written a program to connect to an existing service (written in Ruby) that sends and receives messages serialised as BERT terms.

I’m posting this partly because I had quite a lot of fun figuring it out and partly to document creating BERT dicts in Go should anyone else need to do this in the future and hit the same issues I did.

Why BERT?

I’m a big fan of BERT. It’s compact, flexible, and there are good libs available for serialisation/de-serialisation. So far I’ve exclusively been using the bert gem (written by Tom Preston-Werner, author of the BERT spec).

Creating BERT dicts

One of the great features of BERT is the complex types it supports, including dicts. The equivalent to a dict in Ruby would be a hash, in Go a map. They are really simple to create in Ruby:

require 'bert' BERT.encode({"key" => "val"}) => "\x83h\x03d\x00\x04bertd\x00\x04dictl\x00\x00\x00\x01h\x02m\x00\x00\x00\x03keym\x00\x00\x00\x03valj"

We can pull this apart and see exactly what the bert gem did to our data. Let’s dump the string to an array of 8-bit unsigned integers:

BERT.encode({"key" => "val"}).unpack("C*") => [131, 104, 3, 100, 0, 4, 98, 101, 114, 116, 100, 0, 4, 100, 105, 99, 116, 108, 0, 0, 0, 1, 104, 2, 109, 0, 0, 0, 3, 107, 101, 121, 109, 0, 0, 0, 3, 118, 97, 108, 106]

It’s hard to see exactly what happened, but with the BERT docs and the erlang External Term Format docs we can see how the hash got encoded.

magic| tuple | atom | bert | | dict | list 1 elem | list | atom | key | atom | | val | nil | nil 131, 104, 3, 100, 0, 4, 98, 101, 114, 116, 100, 0, 4, 100, 105, 99, 116, 108, 0, 0, 0, 1, 108, 0, 0, 0, 2, 100, 0, 3, 107, 101, 121, 100, 0, 3, 118, 97, 108, 106, 106

If the formatting of that breakdown is messed up here’s a raw gist that may be clearer.

What you can see here are what the bytes represent (you can see the breakdown of each data type on the External Term Format docs). This is great, but why write a blog post just about dicts? Well, they’re easy to create in Ruby:

BERT.encode(:complex => {"key" => [:data, {:structures => "are easy to serialise"}]}) => "\x83h\x03d\x00\x04bertd\x00\x04dictl\x00\x00\x00\x01h\x02d\x00\acomplexh\x03d\x00\x04bertd\x00\x04dictl\x00\x00\x00\x01h\x02m\x00\x00\x00\x03keyl\x00\x00\x00\x02d\x00\x04datah\x03d\x00\x04bertd\x00\x04dictl\x00\x00\x00\x01h\x02d\x00\nstructuresm\x00\x00\x00\x15are easy to serialisejjjj"

but it’s not so obvious in Go, and I hit some issues when trying to create them.

Serialising to BERT in Golang

Serialising data to BERT/BERP in Go is pretty easy for simple cases using the gobert lib:

package main import ( "fmt" "bytes" "github.com/sethwklein/gobert" ) func main() { var buf = new(bytes.Buffer) bert.MarshalResponse(buf, bert.Atom("foo")) for _, b := range(buf.Bytes()) { fmt.Printf("%d ", b) } fmt.Println() }

This gives us:

0 0 0 7 131 100 0 3 102 111 111

If we run that through the Ruby lib decoder we get:

> BERT.decode([131, 100, 0, 3, 102, 111, 111].pack("C*")) => :foo

(The Ruby bert lib decodes atoms to symbols).

Serialising to BERT dicts in Golang

However, there is a little more effort involved serialising more complex data structures, in particular dicts, as I found out.

You might have thought that you could just pass in a map:

package main import ( "fmt" "bytes" "github.com/sethwklein/gobert" ) func main() { message := map[string]string{"key1": "val1", "key2": "val2"} var buf = new(bytes.Buffer) bert.MarshalResponse(buf, message) for _, b := range(buf.Bytes()) { fmt.Printf("%d ", b) } fmt.Println() }

We get the output:

0 0 0 1 131

Well, that doesn’t work. What you end up with is a one byte long BERP. It seems that gobert doesn’t automatically serialise maps. No problem, we’ll build one up manually. A quick look at the BERT documentation shows the format of a dict:

“Dictionaries (hash tables) are expressed via an array of 2-tuples representing the key/value pairs. The KeysAndValues array is mandatory, such that an empty dict is expressed as {bert, dict, []}. Keys and values may be any term. For example, {bert, dict, [{name, <<“Tom”>>}, {age, 30}]}.”

So let’s create this special structure manually.

package main import ( "fmt" "bytes" "github.com/sethwklein/gobert" ) func main() { message1 := []bert.Term{bert.Atom("key1"), bert.Atom("val1")} message2 := []bert.Term{bert.Atom("key2"), bert.Atom("val3")} keys_and_values := []bert.Term{message1, message2} dict := []bert.Term{bert.BertAtom, bert.Atom("dict"), keys_and_values} var buf = new(bytes.Buffer) bert.MarshalResponse(buf, dict) for _, b := range(buf.Bytes()) { fmt.Printf("%d ", b) } fmt.Println() }

The result:

0 0 0 51 131 104 3 100 0 4 98 101 114 116 100 0 4 100 105 99 116 104 2 104 2 100 0 4 107 101 121 49 100 0 4 118 97 108 49 104 2 100 0 4 107 101 121 50 100 0 4 118 97 108 51

It looks better, but it doesn’t decode, using Ruby:

> BERT.decode([131, 104, 3, 100, 0, 4, 98, 101, 114, 116, 100, 0, 4, 100, 105, 99, 116, 104, 2, 104, 2, 100, 0, 4, 107, 101, 121, 49, 100, 0, 4, 118, 97, 108, 49, 104, 2, 100, 0, 4, 107, 101, 121, 50, 100, 0, 4, 118, 97, 108, 51].pack("C*")) TypeError: Invalid dict spec, not an erlang list

We’re still missing something. Let’s compare the output of the Ruby bert lib to the output of gobert for the same data structure:

> BERT.encode({:key1 => :val1, :key2 => :val2}).unpack("C*") => [131, 104, 3, 100, 0, 4, 98, 101, 114, 116, 100, 0, 4, 100, 105, 99, 116, 108, 0, 0, 0, 2, 104, 2, 100, 0, 4, 107, 101, 121, 49, 100, 0, 4, 118, 97, 108, 49, 104, 2, 100, 0, 4, 107, 101, 121, 50, 100, 0, 4, 118, 97, 108, 50, 106]

We’re definitely missing some data in the gobert output.

If you follow along the byte sequences you can see that they start off the same until the 18th byte. In the Ruby output this is ‘108’, or LIST_EXT. In the gobert output it’s 104, a SMALL_TUPLE_EXT. We can see where this difference happens in encode.go in the gobert lib (in the writeTag func):

case reflect.Slice: writeSmallTuple(w, v) case reflect.Array: writeList(w, v)

Let’s decode the BERT data to see where the diversion happens in the underlying data structures:

magic| tuple | atom | bert | atom | dict 131, 104, 3, 100, 0, 4, 98, 101, 114, 116, 100, 0, 4, 100, 105, 99, 116

We can see that the “bert” and “dict” atoms are encoded the same, but the keys_and_values array is getting encoded as a SMALL_TUPLE_EXT by gobert when we wanted a LIST_EXT. If we look back at the gobert code we can see that the decision to use SMALL_TUPLE_EXT over LIST_EXT is dependent on a slice or array being present. We can use the go “reflect” package to look at the arrays/slices we are creating and see what they are:

package main import ( "fmt" "reflect" "github.com/sethwklein/gobert" ) func main() { array := [2]bert.Term{} slice := []bert.Term{} array_val := reflect.ValueOf(array) slice_val := reflect.ValueOf(slice) fmt.Printf("array is a: %v\n", array_val.Kind()) fmt.Printf("slice is a: %v\n", slice_val.Kind()) } array is a: array slice is a: slice The fix

So, in order to fix our data structure to get gobert to correctly encode the dict we need to change the keys_and_values slice to an array:

package main import ( "fmt" "bytes" "github.com/sethwklein/gobert" ) func main() { message1 := []bert.Term{bert.Atom("key1"), bert.Atom("val1")} message2 := []bert.Term{bert.Atom("key2"), bert.Atom("val3")} keys_and_values := [2]bert.Term{message1, message2} // Now an array dict := []bert.Term{bert.BertAtom, bert.Atom("dict"), keys_and_values} var buf = new(bytes.Buffer) bert.MarshalResponse(buf, dict) for _, b := range(buf.Bytes()) { fmt.Printf("%d ", b) } fmt.Println() }

The result:

0 0 0 55 131 104 3 100 0 4 98 101 114 116 100 0 4 100 105 99 116 108 0 0 0 2 104 2 100 0 4 107 101 121 49 100 0 4 118 97 108 49 104 2 100 0 4 107 101 121 50 100 0 4 118 97 108 51 106

But more importantly, can we decode the data we encoded?

> BERT.decode([131, 104, 3, 100, 0, 4, 98, 101, 114, 116, 100, 0, 4, 100, 105, 99, 116, 108, 0, 0, 0, 2, 104, 2, 100, 0, 4, 107, 101, 121, 49, 100, 0, 4, 118, 97, 108, 49, 104, 2, 100, 0, 4, 107, 101, 121, 50, 100, 0, 4, 118, 97, 108, 51, 106].pack("C*")) => {:key1=>:val1, :key2=>:val3}

Yes!


Categories: LUG Community Blogs

Andrew Savory: Also http://t.co/3pz0kE7j “up to this point”: the…

Planet ALUG - Sat, 09/02/2013 - 19:45

Also j.mp/Y1sK6D “up to this point”: the point is when android stops selling or bada/tizen actually gets good. Neither very likely.

Categories: LUG Community Blogs

Andrew Savory: To be fair, Samsung suck less at ecosystems than m…

Planet ALUG - Sat, 09/02/2013 - 19:41

To be fair, Samsung suck less at ecosystems than most. They suck more than Apple, Google, Amazon (all better at code & licensing content).

Categories: LUG Community Blogs

Andrew Savory: “because we’ve chosen up to this point not to inno…

Planet ALUG - Sat, 09/02/2013 - 19:36

“because we’ve chosen up to this point not to innovate in that direction” = “cos we suck at platforms & ecosystems” j.mp/Y1sK6D

Categories: LUG Community Blogs

Surrey LUG Bring-A-Box 9th February 2013

Surrey LUG - Sat, 09/02/2013 - 18:37
Start: 2013-02-09 11:00 End: 2013-02-09 17:00

We have regular sessions on the second Saturday of each month. Bring a 'box', bring a notebook, bring anything that might run Linux, or just bring yourself and enjoy socialising/learning/teaching or simply chilling out!

This month's meeting is at the Red Hat offices in Farnborough, Hampshire. Our thanks to Dominic Cleal for hosting us.

Categories: LUG Community Blogs

Aq: The ongoing story

Planet WolvesLUG - Fri, 08/02/2013 - 23:07

I had this idea for a little fun literary project.

Tweet the first line of a story. Anyone can reply with what they want the second line to be. You choose the best one of those lines — the one which best fits your desire for how the story should go; this is what stops it descending into a big game of Consequences — and retweet it. It’s a collaborative literary thing. Then people reply with their choice of a third line; repeat until the story reaches a satisfactory conclusion.

Anyone can read the whole story by just reading the tweet stream of the story account. The first couple of tweets should explain the game.

I think this’d actually work, apart from a technical flaw: when the story account retweets a second line from someone, an @-reply to that goes to the someone, not the story account. (Well, it’ll probably go to both, but that’s still annoying and shortens the tweet too much. )

Nevertheless, if someone does this, I’d enjoy contributing a line now and then.

Categories: LUG Community Blogs

Karanbir Singh: Introducing Raindrops

Planet GLLUG - Fri, 08/02/2013 - 17:57

Introducing ProjectRaindrops, a service that will build disk images for you ready to be used in your favourite cloud or virtualised environment.

One of the key barriers to entry into a cloud or virtualised environment : setting up and maintaining a piece of infrastructure that builds disk images. Its also a colossal waste of time and involves needing a complete instance of the environment one is going to deploy the image in. Wouldn't it be nice if there was a service that allowed you to drop in a kickstart file, write up a config to go with that kickstart and just build the image for you ?

Now there is. Its called ProjectRaindrops and its live, in beta mode, at http://projectraindrops.net/ ; As an initial kick off we are doing builds for HVM ( ie. any fully virtualised environment, be it KVM, Xen, VirtualBox or VMware ); With more HyperVisors and more disk formats coming soon.

Getting started is easy, goto the Raindrops website; sign in using either github or twitter credentials ( we don't store any personal details, but if your account does not have an email address, we won't be able to send out email notifications ). There are two key components:

  • A config file: that contains metadata about what you want the build to do
  • A kickstart file: that has the actual details on what the build should contain

Example pre-populated templates are available, just click on the new button and the template will be injected in. And there is some validation rules that track the config and kickstart file, so if you make mistakes or lose format validation, you will find out right away. And we have versioning for each file built in too. Finally, there is no real correlation between a config file and a kickstart file, when you create a new job you can pick an arbitrary kickstart and any config file in your account to match it with.

So, now that you have a config and a kickstart file, click on new job, give it a name, select which config you want to use and what kickstart file, click on 'Submit' and in a few minutes your build should be done. You can even track the job as it works its way through various stages.

Lots of interesting things in planning and development stages, stay tuned for more news in the coming weeks. For now, go ahead and drop in on http://projectraindrops.net/ and give it a shot. Just consider it to be a Beta release, so send us lots of feedback.

- KB

Categories: LUG Community Blogs

MJ Ray: Clevo 7872-9040/A built Jan 13 with Debian 6

Planet ALUG - Fri, 08/02/2013 - 05:45

My trusty Asus seems to have succumbed to graphic fault. I got an OS-free Zoostorm as its replacement, to avoid paying the MS tax. Zoostorm is one brand that Clevo laptops are sold under.

It was actually a Clevo 7872-9040/A built Jan 13. I installed Debian 6 on it. The download button was easy to spot on the front page, but I actually used mini.iso so I could use a smaller usb stick. The first larger stick I tried was a dud and I’m not sure where other sticks went in the move.

The base installation went fine and most things went well, but the wireless networking and sound required an upgrade, but more on that next tech post.

Categories: LUG Community Blogs

Steve Kemp: Let there be slaughter-documentation, and cake.

Planet HantsLUG - Thu, 07/02/2013 - 20:16

Tonight I've made a new release of my slaughter automation tool.

Recent emails lead me to believe I've now got two more users, so I hope they appreciate this:

That covers installation, setup, usage, and more. Took a while to write, but I actually enjoyed it. I'm sure further additions will be made going forward. Until them I'm going to call it a night and enjoy some delicious cake.

Categories: LUG Community Blogs

Richard WM Jones: rich

Planet GLLUG - Thu, 07/02/2013 - 19:20

Life on Earth is being repeated on iPlayer. It’s an incredible series.


Categories: LUG Community Blogs

Richard WM Jones: rich

Planet GLLUG - Thu, 07/02/2013 - 19:18

Years ago I played around with CIL to analyze libvirt. More recently Dan used CIL to analyze libvirt’s locking code.

We didn’t get so far either time, but I’ve been taking a deeper look at CIL in an attempt to verify error handling in libguestfs.

Here is my partly working code so far.

(* * Analyse libguestfs APIs to find error overwriting. * Copyright (C) 2008-2013 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see * <http://www.gnu.org/licenses/>. * * Author: Daniel P. Berrange <berrange@redhat.com> * Author: Richard W.M. Jones <rjones@redhat.com> *) open Unix open Printf open Cil let debug = ref false (* Set of ints. *) module IntSet = Set.Make (struct type t = int let compare = compare end) (* A module for storing any set (unordered list) of functions. *) module FunctionSet = Set.Make ( struct type t = varinfo let compare v1 v2 = compare v1.vid v2.vid end ) (* Directed graph of functions. * * Function = a node in the graph * FunctionDigraph = the directed graph * FunctionPathChecker = path checker module using Dijkstra's algorithm *) module Function = struct type t = varinfo let compare f1 f2 = compare f1.vid f2.vid let hash f = Hashtbl.hash f.vid let equal f1 f2 = f1.vid = f2.vid end module FunctionDigraph = Graph.Imperative.Digraph.Concrete (Function) module FunctionPathChecker = Graph.Path.Check (FunctionDigraph) (* Module used to analyze the paths through each function. *) module ErrorCounter = struct let name = "ErrorCounter" let debug = debug (* Our current state is very simple, just the number of error * function calls did encountered up to this statement. *) type t = int let copy errcalls = errcalls (* Start data for each statement. *) let stmtStartData = Inthash.create 97 let printable errcalls = sprintf "(errcalls=%d)" errcalls let pretty () t = Pretty.text (printable t) let computeFirstPredecessor stmt x = x (* XXX??? *) let combinePredecessors stmt ~old:old_t new_t = if old_t = new_t then None else Some new_t (* This will be initialized after we have calculated the set of all * functions which can call an error function, in main() below. *) let error_functions_set = ref FunctionSet.empty (* Handle a Cil.Instr. *) let doInstr instr _ = match instr with (* A call to an error function. *) | Call (_, Lval (Var callee, _), _, _) when FunctionSet.mem callee !error_functions_set -> Dataflow.Post (fun errcalls -> errcalls+1) | _ -> Dataflow.Default (* Handle a Cil.Stmt. *) let doStmt _ _ = Dataflow.SDefault (* Handle a Cil.Guard. *) let doGuard _ _ = Dataflow.GDefault (* Filter statements we've seen already to prevent loops. *) let filter_set = ref IntSet.empty let filterStmt { sid = sid } = if IntSet.mem sid !filter_set then false else ( filter_set := IntSet.add sid !filter_set; true ) (* Initialize the module before each function that we examine. *) let init stmts = filter_set := IntSet.empty; Inthash.clear stmtStartData; (* Add the initial statement(s) to the hash. *) List.iter (fun stmt -> Inthash.add stmtStartData stmt.sid 0) stmts end module ForwardsErrorCounter = Dataflow.ForwardsDataFlow (ErrorCounter) (* The always useful filter + map function. *) let rec filter_map f = function | [] -> [] | x :: xs -> match f x with | Some y -> y :: filter_map f xs | None -> filter_map f xs let rec main () = (* Read the list of input C files. *) let files = let chan = open_process_in "find src -name '*.i' | sort" in let files = input_chan chan in if close_process_in chan <> WEXITED 0 then failwith "failed to read input list of files"; if files = [] then failwith "no input files; is the program running from the top directory? did you compile with make -C src CFLAGS=\"-save-temps\"?"; files in (* Load and parse each input file. *) let files = List.map ( fun filename -> printf "loading %s\n%!" filename; Frontc.parse filename () ) files in (* Merge the files. *) printf "merging files\n%!"; let sourcecode = Mergecil.merge files "libguestfs" in (* CFG analysis. *) printf "computing control flow\n%!"; Cfg.computeFileCFG sourcecode; let functions = filter_map (function GFun (f, loc) -> Some (f, loc) | _ -> None) sourcecode.globals in (* Examine which functions directly call which other functions. *) printf "computing call graph\n%!"; let call_graph = make_call_graph functions in (* FunctionDigraph.iter_edges ( fun caller callee -> printf "%s calls %s\n" caller.vname callee.vname ) call_graph; *) (* The libguestfs error functions. These are global function names, * but to be any use to us we have to look these up in the list of * all global functions (ie. 'functions') and turn them into the * corresponding varinfo structures. *) let error_function_names = [ "guestfs_error_errno"; "guestfs_perrorf" ] in let find_function name = try List.find (fun ({ svar = { vname = n }}, _) -> n = name) functions with Not_found -> failwith ("function '" ^ name ^ "' does not exist") in let error_function_names = List.map ( fun f -> (fst (find_function f)).svar ) error_function_names in (* Get a list of functions that might (directly or indirectly) call * one of the error functions. *) let error_functions, non_error_functions = functions_which_call call_graph error_function_names functions in (* List.iter ( fun f -> printf "%s can call an error function\n" f.vname ) error_functions; List.iter ( fun f -> printf "%s can NOT call an error function\n" f.vname ) non_error_functions; *) (* Save the list of error functions in a global set for fast lookups. *) let set = List.fold_left ( fun set elt -> FunctionSet.add elt set ) FunctionSet.empty error_functions in ErrorCounter.error_functions_set := set; (* Analyze each top-level function to ensure it calls an error * function exactly once on error paths, and never on normal return * paths. *) printf "analyzing correctness of error paths\n%!"; List.iter compute_error_paths functions; () (* Make a directed graph of which functions directly call which other * functions. *) and make_call_graph functions = let graph = FunctionDigraph.create () in List.iter ( fun ({ svar = caller; sallstmts = sallstmts }, _) -> (* Evaluate which other functions 'caller' calls. First pull * out every 'Call' instruction anywhere in the function. *) let insns = List.concat ( filter_map ( function | { skind = Instr insns } -> Some insns | _ -> None ) sallstmts ) in let calls = List.filter (function Call _ -> true | _ -> false) insns in (* Then examine what function is being called at each place. *) let callees = filter_map ( function | Call (_, Lval (Var callee, _), _, _) -> Some callee | _ -> None ) calls in List.iter ( fun callee -> FunctionDigraph.add_edge graph caller callee ) callees ) functions; graph (* [functions_which_call g endpoints functions] partitions the * [functions] list, returning those functions that call directly or * indirectly one of the functions in [endpoints], and a separate list * of functions which do not. [g] is the direct call graph. *) and functions_which_call g endpoints functions = let functions = List.map (fun ({ svar = svar }, _) -> svar) functions in let checker = FunctionPathChecker.create g in List.partition ( fun f -> (* Does a path exist from f to any of the endpoints? *) List.exists ( fun endpoint -> try FunctionPathChecker.check_path checker f endpoint with (* It appears safe to ignore this exception. It seems to * mean that this function is in a part of the graph which * is completely disconnected from the other part of the graph * that contains the endpoint. *) | Invalid_argument "[ocamlgraph] iter_succ" -> false ) endpoints ) functions and compute_error_paths ({ svar = svar } as f, loc) = (*ErrorCounter.debug := true;*) (* Find the initial statement in this function (assumes that the * function can only be entered in one place, which is normal for C * functions). *) let initial_stmts = match f.sbody.bstmts with | [] -> [] | first::_ -> [first] in (* Initialize ErrorCounter. *) ErrorCounter.init initial_stmts; (* Compute the error counters along paths through the function. *) ForwardsErrorCounter.compute initial_stmts; (* Process all Return statements in this function. *) List.iter ( fun stmt -> try let errcalls = Inthash.find ErrorCounter.stmtStartData stmt.sid in match stmt with (* return -1; *) | { skind = Return (Some i, loc) } when is_literal_minus_one i -> if errcalls = 0 then printf "%s:%d: %s: may return an error code without calling error/perrorf\n" loc.file loc.line svar.vname else if errcalls > 1 then printf "%s:%d: %s: may call error/perrorf %d times (more than once) along an error path\n" loc.file loc.line svar.vname errcalls (* return 0; *) | { skind = Return (Some i, loc) } when is_literal_zero i -> if errcalls >= 1 then printf "%s:%d: %s: may call error/perrorf along a non-error return path\n" loc.file loc.line svar.vname (* return; (void return) *) | { skind = Return (None, loc) } -> if errcalls >= 1 then printf "%s:%d: %s: may call error/perrorf and return void\n" loc.file loc.line svar.vname | _ -> () with Not_found -> printf "%s:%d: %s: may contain unreachable code\n" loc.file loc.line svar.vname ) f.sallstmts (* Some convenience CIL matching functions. *) and is_literal_minus_one = function | Const (CInt64 (-1L, _, _)) -> true | _ -> false and is_literal_zero = function | Const (CInt64 (0L, _, _)) -> true | _ -> false (* Convenient routine to load the contents of a channel into a list of * strings. *) and input_chan chan = let lines = ref [] in try while true; do lines := input_line chan :: !lines done; [] with End_of_file -> List.rev !lines and input_file filename = let chan = open_in filename in let r = input_chan chan in close_in chan; r let () = try main () with exn -> prerr_endline (Printexc.to_string exn); Printexc.print_backtrace Pervasives.stderr; exit 1
Categories: LUG Community Blogs

Andrew Savory: upstart config is fragile, nasty hack to exhaust…

Planet ALUG - Thu, 07/02/2013 - 16:11

upstart config is fragile, nasty hack to exhaust pids to recover from errors. Issue spotted 2009; 2.5years ago. #urgh
bugs.launchpad.net/upstart/+bug/4…

Categories: LUG Community Blogs

MJ Ray: One of them, one of us

Planet ALUG - Thu, 07/02/2013 - 05:35

Interesting stuff is happening again and I’m doing a bit of travelling where I’m not driving much, so I can write some blog posts. If this train stops bouncing quite so much!

I think most readers are interested in technology and collaborative work, so it makes sense to alternate those two themes most of the time. So that’s what I’ll aim for, probably a few posts each week for the next few weeks.

Let me know in the comments or our co-op’s contract form if there’s anything in particular you’d like us to cover, else I’ll start with my recent experiences installing Debian 6 on a new laptop and the fun of running a business at tax return time.

Categories: LUG Community Blogs
Syndicate content