Language Selection

English French German Italian Portuguese Spanish

Programming/Development: Minicoin, GNU Gengetop and Python

Filed under
Advertisement
  • Building and testing on multiple platforms – introducing minicoin

    While working with large-scale (thousands of hosts), distributed (globally) systems, one of my favourite, albeit somewhat gruesome, metaphors was that of “servers as cattle” vs “servers as pets”. Pet-servers are those we groom manually, we keep them alive, and we give them nice names by which to remember and call (ie ssh into) them. However, once you are dealing with hundreds of machines, manually managing their configuration is no longer an option. And once you have thousands of machines, something will break all the time, and you need to be able to provision new machines quickly, and automatically, without having to manually follow a list of complicated instructions.

    When working with such systems, we use configuration management systems such as CFEngine, Chef, Puppet, or Ansible, to automate the provisioning and configuration of machines. When working in the cloud, the entire machine definition becomes “infrastructure as code”. With these tools, servers become cattle which – so the rather unvegetarian idea – is simply “taken behind the barn and shot” when it doesn’t behave like it should. We can simply bring a new machine, or an entire environment, up by running the code that defines it. We can use the same code to bring production, development, and testing environments up, and we can look at the code to see exactly what the differences between those environments are. The tooling in this space is fairly complex, but even so there is little focus on developers writing native code targeting multiple platforms.

    For us as developers, the machine we write our code on is most likely a pet. Our primary workstation dying is the stuff for nightmares, and setting up a new machine will probably keep us busy for many days. But this amount of love and care is perhaps not required for those machines that we only need for checking whether our code builds and runs correctly. We don’t need our test machines to be around for a long time, and we want to know exactly how they are set up so that we can compare things. Applying the concepts from cloud computing and systems engineering to this problem lead me (back) to Vagrant, which is a popular tool to manage virtual machines locally and to share development environments.

  • GNU Gengetopt - News: 2.23 released

    New version (2.23) was released. Main changes were in build system, so please report any issues you notice.

  • Abolishing SyntaxError: invalid syntax ...

    Do you remember when you first started programming (possibly with Python) and encountered an error message that completely baffled you? For some reason, perhaps because you were required to complete a formal course or because you were naturally persistent, you didn't let such messages discourage you entirely and you persevered. And now, whenever you see such cryptic error messages, you can almost immediately decipher them and figure out what causes them and fix the problem.

  • Sending email with EZGmail and Python
  • Creating and Importing Modules in Python

More in Tux Machines

today's howtos

  • How To Install Flatpak on Ubuntu 20.04 LTS - idroot

    In this tutorial, we will show you how to install Flatpak on Ubuntu 20.04 LTS. For those of you who didn’t know, Flatpak is a package management and software deployment tool created to make the distribution of desktop applications on Linux easier. Flatpak is similar to Ubuntu’s Snapcraft. However, the snap technology is proprietary to Ubuntu. This is why many Linux distribution does not have support for a Snap but they have for Flatpak. This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation of Flatpak on an Ubuntu 20.04 (Focal Fossa) server. You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.

  • NO_ZERO_IN_DATE with MySQL 5.7

    I’m going through some old notes and found this little gem that really confused me last time I was migrating MySQL databases.

  • How to turn off login banner in Linux/Unix with .hushlogin - nixCraft

    Here is a quick tip that explains how to hide and turn off annoying banner in Linux or Unix by creating .hushlogin file.

  • curl -G vs curl -X GET

    You normally use curl without explicitly saying which request method to use. If you just pass in a HTTP URL like curl http://example.com, curl will use GET. If you use -d or -F curl will use POST, -I will cause a HEAD and -T will make it a PUT. If for whatever reason you’re not happy with these default choices that curl does for you, you can override those request methods by specifying -X [WHATEVER]. This way you can for example send a DELETE by doing curl -X DELETE [URL]. It is thus pointless to do curl -X GET [URL] as GET would be used anyway. In the same vein it is pointless to do curl -X POST -d data [URL]... But you can make a fun and somewhat rare request that sends a request-body in a GET request with something like curl -X GET -d data [URL].

Ramblings about GNOME development

I still like the "C + GLib + GTK-Doc + Devhelp" combination for software development. But it's maybe because that's what I've practiced the most during the 2010's, and it's hard to change habits. What I don't really like, though, is creating lots of GObject subclasses, and writing GObject Introspection-friendly APIs (to take care of language bindings). It's a burden that GNOME library developers need to carry. I said in the previous section that I like a verbose syntax, but here when subclassing a GObject in C, it's a little too verbose (boilerplate code). It needs to be generated with a tool (here is the one that I wrote: gobject-boilerplate scripts). And it's not really malleable code. In the small glib-gtk-book that I wrote several years ago, I described in a chapter the "semi-OOP" C style used by GLib core (not GIO). So, having a kind of simple Object-Oriented style in C, without using GObject. It doesn't require a lot of code to write your own semi-OOP class in C. But then in later chapters I recommended to create GObject subclasses. Time to revisit my copy :-) ? [...] When we know well something, we also know well what are its benefits and drawbacks. We sometimes question ourself: is the grass greener elsewhere? It's nice to explore other worlds, see how things can be done differently. And then coming back to where we were, but with a changed look, new ideas, and, most importantly, a renewed motivation! Read more

Pinebook Pro

I recently bought a Pinebook Pro. This was mainly out of general interest, but also because I wanted to have a spare portable computer. When I was recently having some difficulty with my laptop not charging, I realised that I am dependent on having access to Emacs, notmuch.el and my usual git repositories in the way that most people are dependent on their smartphones – all the info I need to get things done is in there, and it’s very disabling not to have it. So, good to have a spare. I decided to get the machine running the hard way, and have been working to add a facility to install the device-specific bootloader to Consfigurator. It has been good to learn about how ARM machines boot. The only really hard part turned out to be coming up with the right abstractions within Consfigurator, thanks to the hard work of the Debian U-Boot maintainers. This left me with a chroot and a corresponding disk image, properly partitioned and with the bootloader installed. It was only then that the difficulties began: getting a kernel and initrd combination which can output to the Pinebook Pro’s screen and take input from its keyboard is not really straightforward yet, but that’s required for inputting disk encryption passwords, which are required on portable devices. I don’t have the right hardware to make a serial connection to the machine, so all this took a lot of trial and error. I’ve ended up using Manjaro’s patched upstream kernel build for now, because that compiles in the right drivers, and debugging an initrd without a serial connection is far too inefficient. Read more

Elive 3.8.20 beta released

The Elive Team is proud to announce the release of the beta version 3.8.20 Read more