<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blogs on Carlos León</title><link>//carlosleon.info/blog/</link><description>Recent content in Blogs on Carlos León</description><generator>Hugo -- gohugo.io</generator><lastBuildDate>Sun, 23 Feb 2020 13:53:05 +0000</lastBuildDate><atom:link href="//carlosleon.info/blog/index.xml" rel="self" type="application/rss+xml"/><item><title>Fixing data corruption problems in Ceph</title><link>//carlosleon.info/blog/ceph-data-corruption/</link><pubDate>Sun, 23 Feb 2020 13:53:05 +0000</pubDate><guid>//carlosleon.info/blog/ceph-data-corruption/</guid><description>The first thing I want to say is: I&amp;rsquo;m really sorry that you have arrived to this post. Most likely you are facing data corruption problems in Ceph and are looking for an answer than can help you recover your precious data. I have some news for you: this post might or might not help you. I&amp;rsquo;m sorry.
May the force be with you.
Data corruption in Ceph: how come?</description></item><item><title>Introduction to Qemu</title><link>//carlosleon.info/blog/intro-to-qemu/</link><pubDate>Mon, 03 Feb 2020 00:23:05 +0000</pubDate><guid>//carlosleon.info/blog/intro-to-qemu/</guid><description>Through my whole career and also during my studies I have always resorted to VirtualBox for my personal virtualization needs and VMWare for my customers&amp;rsquo;.
Qemu has been under my peripheral vision for a few years now but since I was always happy with VirtualBox I hadn&amp;rsquo;t really had a need to look somewhere else.
So, I&amp;rsquo;m still happy with VirtualBox but I now want to give Qemu a try, so here are my findings.</description></item><item><title>Scaleway Storage Solutions</title><link>//carlosleon.info/blog/scaleway-storage-solutions/</link><pubDate>Wed, 15 Jan 2020 00:20:58 +0000</pubDate><guid>//carlosleon.info/blog/scaleway-storage-solutions/</guid><description>I&amp;rsquo;m currently evaluating the different storage solutions that Scaleway has to offer since I want to setup a Nomad setup for running several of the services listed on awesome-selfhosted.
Specs The machine that I&amp;rsquo;m going to be working with has the following characteristics:
|--------|--------------------| | Image | Debian Buster | | Region | AMS1 | | Cores | 4 x86_64 | | RAM | 12GB | | Disk 1 | 25GB NVMe | | Disk 2 | 25GB Block Storage | |--------|--------------------| The file system on the disks is ext4.</description></item><item><title>Register a new device in Homeassistant via MQTT</title><link>//carlosleon.info/blog/homeassistant-mqtt-register-device/</link><pubDate>Thu, 09 Jan 2020 00:00:00 +0000</pubDate><guid>//carlosleon.info/blog/homeassistant-mqtt-register-device/</guid><description>The example that we are going to be looking at is a light hooked up to an ESP8266 module (which comes with native support for mqtt) and turn that light on &amp;amp; off via Homeassistant.
I make heavy use of Docker since it&amp;rsquo;s the easiest way I know to get started with running Homeassistant and mqtt locally.
This is how you do it!
Getting Started Folder structure We are going to store the Homeassistant configuration in the following directory:</description></item><item><title>Portable Pipelines</title><link>//carlosleon.info/blog/portable-pipelines/</link><pubDate>Thu, 21 Mar 2019 00:00:00 +0000</pubDate><guid>//carlosleon.info/blog/portable-pipelines/</guid><description>Portable Pipelines Let&amp;rsquo;s begin by making sure we are all on the same page:
One day a developer starts working on a project that will transform business requirements into working features written in code. This code will eventually be backed up in a source control management system. These days git seems to be the contendant that won the race. Once that code has been pushed (speaking in git terms here) all you should want to do is to sit back and see that code be: 1.</description></item><item><title>Calling a method defined in another file in Go</title><link>//carlosleon.info/blog/calling-a-method-defined-in-another-file-in-go/</link><pubDate>Thu, 03 Sep 2015 00:00:00 +0000</pubDate><guid>//carlosleon.info/blog/calling-a-method-defined-in-another-file-in-go/</guid><description>If you have two files in Go that look like this:
a.go
package main func main() { println(foo()) } b.go
func foo() string { return &amp;#34;Hello, foo!&amp;#34; } If you go build . the project, it completes without errors and the binary file is generated:
$ ls -l a.go b.go foo And it works:
$ ./foo Hello, foo! But when you&amp;rsquo;re developing you want to run the project right from Go instead of compiling and then running the binary.</description></item><item><title>AngularJS, Sinatra and HTML5Mode</title><link>//carlosleon.info/blog/angular-sinatra-html5mode/</link><pubDate>Fri, 13 Sep 2013 00:00:00 +0000</pubDate><guid>//carlosleon.info/blog/angular-sinatra-html5mode/</guid><description>Sinatra, AngularJS and HTML5Mode The Sinatra Part get &amp;#34;/*&amp;#34; do File.read(File.join(&amp;#34;public&amp;#34;, &amp;#34;index.html&amp;#34;)) end Put this at the bottom of your application file and this will serve your AngularJS application at any endpoint. This, of course, will read the public/index.html file every time that you head that endpoint. Better if you memoize it.
get &amp;#34;/*&amp;#34; do render_index end def render_index @index ||= File.read(File.join(&amp;#34;public&amp;#34;, &amp;#34;index.html&amp;#34;)) end Important note Any other route that you register after this snippet won&amp;rsquo;t be triggered as &amp;quot;/*&amp;quot; matches everything.</description></item><item><title>Cookies with cURL</title><link>//carlosleon.info/blog/cookies-with-curl/</link><pubDate>Fri, 13 Sep 2013 00:00:00 +0000</pubDate><guid>//carlosleon.info/blog/cookies-with-curl/</guid><description>If want to consume an API that uses sessions using cURL, then probably you will need to make use of cookies. Using cookies with cURL is pretty simple.
I&amp;rsquo;m going to create a simple web application using [Sinatra] for the example&amp;rsquo;s sake:
require &amp;#34;rubygems&amp;#34; require &amp;#34;sinatra&amp;#34; enable :sessions get &amp;#34;/&amp;#34; do session[:user] # Return whatever stored in session[:user]. end post &amp;#34;/&amp;#34; do session[:user] = params[:user] # Set session[:user] to whatever sent on param.</description></item><item><title>Generating JSON in Go</title><link>//carlosleon.info/blog/generating-json-in-go/</link><pubDate>Fri, 13 Sep 2013 00:00:00 +0000</pubDate><guid>//carlosleon.info/blog/generating-json-in-go/</guid><description>Say you have a custom type defined like this:
type User struct { id int email string age int married bool } Using the encoding/json package from the standard library to serialise an instance of a User would look something like this:
package main import ( &amp;#34;encoding/json&amp;#34; &amp;#34;fmt&amp;#34; ) func main() { u := User{1, &amp;#34;john@doe.com&amp;#34;, 33, true} uJSON, err := json.Marshal(u) if err != nil { fmt.Printf(&amp;#34;Something went wrong: %s\n&amp;#34;, err) } else { fmt.</description></item><item><title>Javascript events pool</title><link>//carlosleon.info/blog/js-events-pool/</link><pubDate>Thu, 22 Aug 2013 00:00:00 +0000</pubDate><guid>//carlosleon.info/blog/js-events-pool/</guid><description>If you&amp;rsquo;ve lately worked with mainstream SPA frameworks (Angularjs, Emberjs, Backbonejs) and related, you should know by now that things are kept in sync thanks to data binding.
It&amp;rsquo;s a pleasure because (with some luck) you just need to setup your bindings and views and data models would automatically be kept in sync.
Now, if you are working with a simpler application (that may not require any framework) but you would like to have some binding still you don&amp;rsquo;t want to load any framework to your project just because you want some binding here and maybe there.</description></item><item><title>Improving (?) my site&#39;s performance: Part II</title><link>//carlosleon.info/blog/improving-my-sites-performance-part-2/</link><pubDate>Mon, 01 Jul 2013 00:00:00 +0000</pubDate><guid>//carlosleon.info/blog/improving-my-sites-performance-part-2/</guid><description>A couple of weeks ago I decided to internally improve my website. Here I explain exactly what is it that I did to do so. Some of these changes include ruby memoize/memoization and Sinatra Caching.
As I previously mentioned, my blog&amp;rsquo;s architechture is inspired in [@cyx]&amp;rsquo;s personal website. However, I was not totally comfortable with the fact that everytime that a page was requested (a blog post in this case), the application had to go to disk, bring the blgo post, parse the markdown and then render the view.</description></item><item><title>Improving (?) my site&#39;s performance: Part I</title><link>//carlosleon.info/blog/improving-my-sites-performance/</link><pubDate>Sun, 24 Mar 2013 00:00:00 +0000</pubDate><guid>//carlosleon.info/blog/improving-my-sites-performance/</guid><description>When I decided to finally come up with a blog, I gave Jekyll and Octopress a try. Nice plugins, &amp;ldquo;easy&amp;rdquo; deployment strategies and what not, but somehow I could not cope with them. That&amp;rsquo;s why I decided to write my own. At last I am a software developer and building a semi-static website shouldn&amp;rsquo;t be that complicated.
The solution I came up with is inspired by @cyx&amp;rsquo;s personal website, although now I seriously am thinking about refactoring a couple stuff here and there.</description></item><item><title>Backbone.js best practices for n00bs</title><link>//carlosleon.info/blog/backbone-js-best-practices-for-n00bs/</link><pubDate>Thu, 31 May 2012 00:00:00 +0000</pubDate><guid>//carlosleon.info/blog/backbone-js-best-practices-for-n00bs/</guid><description>The other day I was looking for some Backbone.js tutorials on the internetz, something that could give me some clue about how to properly structure a web application using this framework and I found a not that old (one year and a half now) blog post talking about how to do a trivial Backbone.js application. A professor at college told me once that the best way to learn to write good code is reading good code.</description></item><item><title>Method stub with MiniTest</title><link>//carlosleon.info/blog/method-stub-with-minitest/</link><pubDate>Thu, 24 May 2012 00:00:00 +0000</pubDate><guid>//carlosleon.info/blog/method-stub-with-minitest/</guid><description>MiniTest is a testing tool that provides the necessary resources to make your test suite a complete stack, supporting TDD, BDD, mocking and benchmarking. It comes by default with Ruby 1.9.x and is also available for Ruby 1.8.7.
It provides two styles of testing: Unit tests and Specs. I personally prefer Specs since they are easier to read. Find out more about this on the documentation site. If you&amp;rsquo;re not yet using it, I suggest you to give it a try.</description></item></channel></rss>