Extract SSH public key from private key

Submitted by luxian on Thu, 03/09/2017 - 11:03

In the last couple of days I spent a lot of time debugging the deployment script called via GitLab CI. The script worked well on one server (dev), but failed on the second one (prod).

GitLab CI was using a docker container with an injected SSH private key to connect to server and run some scripts. The whole setup was exactly as described in the official tutorial. From the beginning I was surprised to see that public key was never added to the container. But since it did the job well  I didn't spend too much time to see how it actually works.

When I tried to make deployment work for a second server, things didn't work so smoothly. It refused to connect over SSH. After some digging and with ssh debugging enabled it was clear that the public key used by CI container was missing from the authorized_keys file on that server. The authorized_keys file was big on the first server, the one that work, and I had no idea which key was the one I needed to copy over. So I tried to see if I can extract the public key from the private key. To my delight, this seems to be a very easy task. You just need to run the following command:

ssh-keygen -y -f ~/.ssh/id_rsa

Where ~/.ssh/id_rsa is the file with your private key. This command will print the associated public key. With this key in place, the deployment script worked without issues.

Lessons learned:

  • private keys contain the public key so in case you lose it you can re-create it
  • I need a better systems for deploying and managing authorized_keys across all the servers

Tags

Deep learning gallery: Quadcopter trail navigation

Submitted by luxian on Tue, 02/28/2017 - 18:57

Deep Learning Gallery

I have deeplearninggallery.com in my bookmarks for quite some time but I didn't have time to check until today. As you probably guessed by the domain name itself, it's a gallery with a lot of cool deep learning projects. It's worth checking it out.

To stir your curiosity is a cool project I saw today:

Quadcopter trail navigation in forest

Project goal was to make a drone that can follow a trail through the forest using only one camera (no 3D images). You can see the results in the video. They pretty much did it. If you want to read more, you will find more links in the video description.

 

 

 

Google's AI becomes aggresive in stressful situation

Submitted by luxian on Mon, 02/13/2017 - 21:07

Actually this is not something very new if you have read all the previously recommended links in the article that started this serie "Artificial Inteligence". This new article is proving that depending on environment (how abundant resources are, goal definition and the connections between AI agents) the behavior of AI can be either aggressive or highly cooperative.

The full story can be found in the article Google's New AI Has Learned to Become "Highly Aggressive" in Stressful Situations. Following quotes are from it:

(...) the message is clear - put different AI systems in charge of competing interests in real-life situations, and it could be an all-out war if their objectives are not balanced against the overall goal of benefitting us humans above all else.

(...) the initial results show that, just because we build them, it doesn't mean robots and AI systems will automatically have our interests at heart.

 

Bye bye Nylas! Hello again Thunderbird!

Submitted by luxian on Wed, 02/08/2017 - 20:51

I'm not sure when I started using Nylas N1, but I think it was almost a year ago. It started as a very promising project. It has all the features I need:

  • multi platform (Windows, OS X, Linux)
  • snooze function (as a free service)
  • nice interface

I switched to it immediately after Mailbox was shut down by Dropbox. The snooze functionality was - and still is - a very cool and useful feature. But until now - no one figured it out how can this be implemented as a free service/mail client. Keeping servers up and running to move emails around is apparently very expensive. Dropbox couldn't afford it and Nylas either. 

The latest changes from Nylas started to remind me about Mailbox. The hype passed and now to company behind it works hard to come up with a business model around it. They switched to a subscription model, which in my opinion is a good decision, but I think the prices are too big. 

$9 per month is too much for a good looking mail client. It doesn't bring much more than the web interface. It doesn't have a mobile app (I hope they don't try to port the Electron app) and doesn't sync your accounts around devices like Mailbox had. I appreciate them for keeping it open source (in theory you can still run it for free if you compile it yourself and run it on your own server).

Maybe we are not ready yet for good email clients if we still need to run them in the cloud. Maybe we have to wait until mail servers like Google Mail/Inbox or Outlook 365 come up with an API that support Snooze/Delay functionality.

My 2017 gaming goals

Submitted by luxian on Tue, 01/10/2017 - 22:01

Now that my old PS3 is retired, I plan to play more games on my new PS4. I just finished the Uncharted 4 and want to play more.

Currently, I'm playing Battlefield Hardline but I'm trying to see what would be my next one. The list of options I come up with contains:

And maybe Grand Turismo Sport.

Super intelligence might be further away than we think

Submitted by luxian on Thu, 12/29/2016 - 22:28

If you watched and read the links I posted in the Artificial Intelligence article you probably believe that Super Intelligence might become reality rather sooner than later. Today I found an article trying to provide arguments against this: The Singularity is Further Than it Appears.

A short list of arguments:

  • Super Intelligence will not create the next level of Super Intelligence very fast, because this is not a linear problem.
  • There is no incentive for companies to create human level intelligence at the moment.
  • There are some ethical reasons we have to face when we build a truly sentient AI: Can we turn it off? Would that be murder? Can we experiment on it? Does it deserve privacy? What if it starts asking for privacy? Or freedom? Or the right to vote?
  • Uploading our brains to a computer is still a far away dream. At the moment we are able to "simulate" a cat brain but it runs 600 times slower than the real one and it's missing a lot of features the real brain has - so the simulation is far for being complete. Even with this incomplete simulation, we have to wait until 2035 or 2040 to have the hardware we need to simulate a brain similar to human brain in size.

via HN

The reason behind this

Submitted by luxian on Thu, 12/15/2016 - 23:21

I created this blog for two reasons:

  • Practice and improve my writing skills, especially in English since it's not my native language
  • Share things that I find interesting, mostly stuff that's not part of the general hype

This is a challenge and my content is not even close to what I want it to be. I guess practice it's the only thing that helps you closing the gap between expectations and result. And nobody tells this to beginners...

/via @MKBHD

What is HDR for TV?

Submitted by luxian on Wed, 12/14/2016 - 11:50

I asked myself the same question recently and started searching around for it. I was happy to find that Trusted Reviews has an in-detail article about it: HDR TV: What is it and should you care?

In an nutshell:

  • There is a new standard for HRD TV standard/certification you should look for called: UHD Premium
  • UHD Premium certification requires a great brightness range and better color reproduction (10 bit colors)
  • UHD Premium come is two flavors in order to allow both LED LCD and OLED displays to get the certification:
    • Standard 1: requires more maximum brightness (> 1,000 nits) but has demands are more relaxed for black (<0.05 nits) - targeting LCD panels
    • Standard 2: maximum brightness requirements are lowered (>540 nits), but demands more from black colors (0.0005 nits) - targeting OLED panels
  • You will need a compatible video source to enjoy this
  • There are greater chances to get HDR content faster than 4K because it much easier to produce and distribute

 

Next thing will see are the HDR monitors.