Blockchain is an over hyped technology solution looking for a problem

The article makes a very simple argument for something that I have felt for a while, block chain is a cool technology but the majority of the use cases people talk about are just bull shit.

http://www.coindesk.com/blockchain-intermediaries-hype/

Troubleshooting OpenStack gate issues with logstash

From time to time, I have to figure out why the Trove CI failed some job. By “from to time”, I really mean “constantly”, “all the time”, and “everyday”.

Very often the issue is some broken change that someone pushed up, easy ones are pep8 or pylint failures, slightly harder are the py27/py35 failures. The really hard ones are failures in the Trove scenario tests.

Very often the failures are transient and a recheck fixes them (which is annoying in itself) but sometimes the failure is repeatable.

In the past week, I’ve had to deal with one such issue; I first realized that it was a repeated failure after about a dozen rechecks of various changes.

I realized that the change had a telltale signature that looked like this:

Test Replication Instance Multi-Promote functionality.
Test promoting a replica to replica source (master).        SKIP: Failure in <function wait_for_delete_non_affinity_master at 0x7f1aafd53320>
Verify data is still on new master.                         SKIP: Failure in <function wait_for_delete_non_affinity_master at 0x7f1aafd53320>
Add data to new master to verify replication.               SKIP: Failure in <function wait_for_delete_non_affinity_master at 0x7f1aafd53320>
Verify data exists on new master.                           SKIP: Failure in <function wait_for_delete_non_affinity_master at 0x7f1aafd53320>

The important part of the message (I realized later) was the part that read:

Failure in <function wait_for_delete_non_affinity_master ...

Looking a bit above this, I found the test that had in fact failed

Wait for the non-affinity master to delete.                 FAIL

One thing important in this kind of debugging is to try and figure out when this failure really started to happen, and that’s one of the places where logstash comes in really handy.

For every single CI job run by the OpenStack integrated gate, the result artifacts are parsed and some of them are indexed in an elasticsearch database.

It is trivial now to pick up the string that I felt was the ‘signature’ and search for it in logstash. Within seconds I can tell that this error began to occur on 4/11.

This, by itself was not sufficient to figure out what the problem was, but once Matt Riedemann identified a probable cause, I was able to confirm that the problem started occurring shortly after that change merged.

Logstash is a really really powerful tool, give it a shot, you’ll find it very useful.

Raspberry Pi networking projects

The Raspberry Pi 3 that I have comes standard with two network interfaces; a wired interface that can do 100mbps and a WiFi interface. Older Raspberry Pi’s required that you use a USB dongle for WiFi, I don’t use those units any longer.

So for the purposes of all that follows, I assume Raspberry Pi 3, onboard WiFi and wired ethernet.

By default, these two interfaces are active and software that you run on the Raspberry Pi can connect to the outside world using one, or both.

I’ve found several interesting use-cases for the Raspberry Pi by changing the way these interfaces are configured.

  1. A WiFi satellite location

    piwifi1In this image, three devices (device 1, 2 and 3) are not WiFi enabled and are internet connected using the Raspberry Pi as effectively a wireless network extender.

    This setup is relatively straightforward on a Raspberry Pi.

  • Configure the wireless interface on the Raspberry Pi to connect to the wireless access point.
  • Enable ip forwarding
  • Configure dnsmasq
  • Enable packet forwarding from the wlan0 and eth0 interfaces

    With this setup, the three devices connected to the wired interface will get their DHCP leases from the Raspberry Pi. Packets will get forwarded by the Raspberry Pi between the wired and wireless interfaces.

  1. A WiFi satellite location without DHCP

    piwifi2The above configuration is very useful for some things but not always. I have a printer (quite old) which I have connected to a single parallel port ethernet print server (TP-Link TL-PS110P). I need to be able to access this printer from other wirelessly connected devices and so I need it to have its DHCP lease coming from the WiFi Access Point!

    This setup is similar to (1) above, but no dnsmasq, no NAT, enable proxy ARP.

  1. The Raspberry Pi as a WiFi access point

    piwifi3This is something I’ve just been playing with recently and it appears to work quite well. The Raspberry Pi 3’s WiFi interface can be configured to act as an access point using the hostapd package. The way I have this setup, dnsmasq is enabled and the wirelessly connected devices receive DHCP leases from the Raspberry Pi. Traffic is routed to the internet over the wired interface.

  2. The Raspberry Pi as a secure WiFi access point

    Eventually, this is what I want to get, a Raspberry Pi as a secure WiFi access point; the WiFi interface running in access point mode but all traffic going out of the wired interface is tunneled to a VPN.

    I use OpenVPN, and that works fine on the Raspberry Pi already. Have to put the pieces together and make it a bit more robust; right now, not quite there.

    Equally interesting would be the other configuration like (1) above but where all traffic out of the WiFi interface is tunneled. In that setup, I could, for example connect my laptop to the wired interface and connect to any WiFi access point on the Raspberry Pi. Traffic over the WiFi interface would be tunneled by the Raspberry Pi and this would be an ideal travel setup as the Raspberry Pi would just be powered off the USB port on the laptop 🙂

Raspberry Pi basics

I have been using a Raspberry Pi (I’ve bought a few of these on Amazon, at $50 each, they are a bargain) for some time now and have found them to be excellent for a number of things.

A recent project to set one up as a WiFi access point got me thinking that I should, maybe, share some of these use-cases.

So, here’s a primer on how I setup the Raspberry Pi. I have a new one on order right now so this is an actual first-time setup.

If you have never done this before, don’t worry, it is very simple.

Assembling your Raspberry Pi

New and out of the box, the only things that you have to do are

  • Figure out how to affix the heat-sink on the processor; I always use the largest one that they provide. Do this once, do it carefully and you will have no issues later
  • Figure out how to get the board neatly into the nice clear plastic case.

Formatting your SD card

I don’t purchase the “complete kit” which comes with a Micro-SD card. I usually have a card or three hanging around and set it up using NOOBS (That’s Raspberry Pi’s New Out Of Box Software).

Since I setup the card on a Windows machine, there is one thing I’d like to highlight. The documentation makes it sound hard, they have you download some special format utility and all that stuff. Don’t bother.

Just follow the easy instructions found here.

  1. Launch the disk management utility.

My new 16GB disk drive is the one that shows up as Disk 1.

This was a brand new SD card, if you are reusing an SD card, you may see multiple partitions, delete them all.

If you find that the “Delete Volume” options are greyed out, you will have to use the Windows Command Line. Use the diskpart utility, select the disk, then select each partition in turn and delete it. You will be left with a disk that looks like this.

Observe that now Disk 1 is shown as “Unallocated”. I always make sure I get here and format the disk.

  1. Format the disk
    You do this by simply right clicking on the “Unallocated” disk and choosing “Format”. Be careful to choose FAT32.
  1. Copy NOOBS onto the new SD card
    Download the latest NOOBS zip file and unzip it. Then just drag and drop the whole thing onto your new SD card. Safely eject the SD card, make sure the power is disconnected from the Raspberry Pi and plug the card into the slot. Then … the moment of truth.
  2. Power up the Raspberry Pi for the first time
    If you did everything correctly, you should see a NOOBS screen that comes up and allows you to choose the operating system. I usually enable WiFi at this point (or if the wired network is connected, that works too) , and then I follow the standard NOOBS documentation, setup Raspbian with PIXEL, and then reboot.
  3. On first boot, I enable the SSH server, set the locale, timezone and things like that and from that point the rest of the setup is done from command line.

That’s really all there is to your first time Raspberry Pi setup!

 

How to Understand the Curves Tool in Photoshop

Two of the most important things I’ve learned to work with in the past couple of weeks are the Curves Tool in Photoshop (for post processing) and the Histogram tool (either in Photoshop or on your camera itself, for use either while taking pictures, or in post processing).

This article is about the curves tool, well worth the read.

-amrith

After you’ve mastered Levels , it’s time to take a step up to the tool that is probably the most useful for color and contrast control in Photoshop: Curves. As with levels, you should play around with the basic Curves command to get a feel for it.

Source: How to Understand the Curves Tool in Photoshop

Primes Versus Zoom Lenses: Which Lens to Use and Why?

Which type of lens is better, a prime lens or a zoom lens? This is one of the most debatable topics in photography. Some of you might choose a zoom lens and others may choose a prime lens, it all depends on what and where you are going to shoot.

Source: Primes Versus Zoom Lenses: Which Lens to Use and Why?