Skip to content

Instantly share code, notes, and snippets.

@gibiansky
gibiansky / doctl-snap-docker-registry-login-experience.md
Last active April 28, 2020 17:51
Issues with Snap doctl and Docker registry login

I am trying to connect to a DigitalOcean container registry which I created using the web UI. I am following the QuickStart guide here:

https://www.digitalocean.com/docs/images/container-registry/quickstart/

I skipped the "Create a Registry" step because I think I have already created a registry. Also, I have been using doctl with Kubernetes and Terraform, so I'm pretty sure I'm already authenticated with an API token as needed.

I had trouble getting doctl to log in to the registry:

{
"sentences": [
"There was exactly one a-piece all round.",
"Alice looked all round the table, but there was nothing on it but tea.",
"He had been looking at Alice for some time with great curiosity, and this was his first speech.",
"The Knave did so, very carefully, with one foot.",
"So they had to fall a LONG way.",
"The Knight looked very much surprised, and a little offended at the remark.",
"It was a golden crown.",
"The Queen gasped and shut her eyes.",
{
"sentences": [
"And she went on planning to herself how she would manage it.",
"The Caterpillar was the first to speak.",
"This time Alice waited patiently until it chose to speak again.",
"There was certainly too much of it in the air.",
"The Cat only grinned WHEN it saw Alice.",
"Alice was not much surprised at this, she was getting so used to queer things happening.",
"While she was looking at the place where it had been, it suddenly appeared again.",
"The Hatter was the first to break the silence.",
@gibiansky
gibiansky / baidu-t7.html
Last active October 16, 2017 20:55
Baidu Technical Ladder T7 Summary
<i>An excerpt from the Baidu Technical Ladder guidelines.</i>
<br/>
<b>Senior Research Scientist (T7, T8, T9)</b>
<p>Being appointed as a senior research scientist/engineer requires either significant technical depth or significant leadership. He/she is able to provide overall leadership for independent work within a significant technical area. He/she should be able to lead a small team tackling a complex problem. He/she should be able to set technical direction, select the overall approach to a problem, make resource and prioritization decisions within the context of that project, provide high-level context to others, and communicate effectively and cross-functionally about their project or area.</p>
<p>For example, if Baidu decides to develop AI technology for a specific product, a Senior Research Scientist should be able to independently investigate that technology area, select approaches to try, liaise with the appropriate Baidu engineering groups, lead a small team (in a tech lead role) of 2-10 enginee
@gibiansky
gibiansky / wrap_tensorflop_ops_with_timing.py
Created September 1, 2016 17:49
Demo of wrapping Tensorflow ops with some timing info
import time
import tensorflow as tf
def print_time(name):
"""This creates a new function that prints out the time annotated with a
marker.
>>> print_time("Name")(1, 2, 3)
@gibiansky
gibiansky / morgan_qp.py
Last active September 2, 2016 14:33
Quadratic Programming for Morgan
# Let's us use print() as a function later.
from __future__ import print_function
# Load the file into a list of (H, L, y) tuples
with open("luckeyfxnsample_g.csv", "r") as handle:
data = [tuple(float(x) for x in line.split(",")) for line in handle]
def transform(H, L, y):
"""Transform (H, L, y) tuples into (y, HL, L, L^2, L^3) tuples."""
return y, H * L, L, L * L, L * L * L
@gibiansky
gibiansky / parse.py
Last active January 31, 2016 17:57
Fancy parsing
# If you use triple quotes, the strings can span multiple lines...
# Let's define our test data...
my_test_data = """
<strong>LHD Contact Information:</strong>
</div>
<div class="right">
<strong>Alameda County Public Health Department</strong> <strong>(NACCHO Member)</strong><br />
1000 Broadway Ste 500<br />
Oakland, CA 94607-4033<br />
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 1.5.2">
<title>Hacking on GHC</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400">
<style>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.