Posts

Showing posts from 2018

Piece of Miraculous Literature: Modern Story Telling

Image
Introduction For those who study modern literature, there are many known " Literary Elements " (like plot, theme, character, pace and tone, ...) and " Literary Techniques/Devices " ( Flashback , Cliffhanger , Narrative hook , ...) that was developed over time. With regards to story telling, many structural principles of modern storytellers can be explained using analysis based on Aristotle Poetry, where the story is all about a "knot" that get tied or revealed, the play has two parts: complication and unraveling with respect to the "knot". Freytag's Analysis of a store, proposed in 1863 by Gustav Freytag (a German writer) which is a model of an arc of 5 parts: exposition/introduction rising action (rise) climax falling action (return or fall) denouement (catastrophe) Although it's advocated for modern story telling, it's still lakes more advanced structures used by modern story tellers as we are going to see later.

How to make responsive GTK+ applications

Image
Introduction This weekend I've made a GTK+ application, I've done my best to make it responsive by applying my old Android development experience. Android make it clear that you should not block UI thread (main thread) not non-UI tasks like: disk IO (read a file) network IO (request remote API) internal SQLite database intensive computations  Let me quote : "You should not perform the work on the UI thread, but instead create a worker thread and do most of the work there." private class MyTask extends AsyncTask... { protected Long doInBackground(URL... urls) { // worker thread } protected void onProgressUpdate(Integer... progress) { // ui thread } protected void onPostExecute(Long result) { // ui thread } } GTK+ GTK+ is not threadsafe, in the sense all calls to GTK+ should be from a single thread that is the main thread or the UI thread, which seems similar to Android. We have a class that loads the glade XM

DIY Docker using Skopeo+OStree+Runc

Image
Docker is awesome, but what is even more awesome about UNIX philosophy is that you can use combine small tools to create a something that work like docker. Actually Dockerlite used BTRFS and LXC to make a toy version of docker. In this post we are going to discuss show how one can pull a Docker image and run the containers without a docker daemon, of course we do this for fun. We are going the achieve the following: ability to pull docker images space efficient  storage of images and containers even better that docker (not just reuse layers, but even files) run the container We are going to use OSTree : content addressable storage, git-like for OS Images, space efficient and uses hardlinks Skopeo : a way to pull all kinds of images and convert them to all kinds of storage Runc (or any OCI runtime like bubble wraps oci ) In this post we are going to run everything as non-root regular user (to make it even more challenging) let's create a bare OSTr