You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setting up repos of .deb packages for Ubuntu may not be something people need to do often on their own laptops. But I was recently doing something where it made sense. I was setting up a kubernetes cluster and wanted to automate the whole process using vagrant and ansible. This meant that each time a VM would be spun up, I would add apt repositories to it and then install docker.io, kubeadm, kubectl, kubelet, and kubernetes-cni packages. All of these VMs were to be on my laptop, and each time they'd reach out to google's or docker's repos to pull these packages in. A sum total of around 70 MB isn't big but I could be spinning up tens of VMs over the course of my experiments and a fresh download off the web is a terribly inefficient use of bandwidth (certainly here in India). So I wanted to setup an apt repository locally on the host laptop which runs Ubuntu 16.04 (xenial).
The plan
On the host: What we need to do is to run a web server (Apache2 works fine) that serves a directory with the packages tha
The callback-resume pattern is used to leverage Ruby fibers for async-IO tasks. You can avoid callback nesting a la Node, and having to manually manage all the context and state from one callback to another.
You can get the key concepts about Ruby fibers from here:
[The best description of Ruby fiber] (lee.hambley.name/2012/06/19/the-best-description-of-a-ruby-fiber.html)
$ git clone https://github.com/scylladb/seastar.git
$ cd seastar
$ vi doc/building-ubuntu.md # or the appropriate file
$ # install all pre-requisites, not boost if you already have
$ ./configure.py --cflags "-I /opt/boost/include" --ldflags "-L /opt/boost/lib" # etc.
$ vi build.ninja # and then :s^-Werror ^^g and save
This is a short tutorial on converting JSON to objects of Java classes (deserialization) and back (serialization), using Java. The Jackson library, one of the more popular JSON libraries used in Java, provides a very elegant way to do this using annotations and reflection.
Basic deserialization and serialization
Imagine you have some JSON describing a book in your library. How would you write a Book class that can be deserialized from this JSON?
{
"title": "The Linux Programming Interface",
"author": "Michael Kerrisk",
"publisher": "No Starch Press",