Skip to content

Instantly share code, notes, and snippets.

import numpy as np
earnings = [
[
[500,505,490],
[810,450,678],
[234,897,430],
[560,1023,640]
],
[
hands = [
['J', 'Q', 'K'],
['2', '2', '2'],
['6', 'A', 'K'],
]
my_slice = hands[1][1:]
my_slice[1] = 2
print(my_slice[0] * my_slice[1])
spam_amount = 0
print(spam_amount)
# Ordering Spam, egg, Spam, Spam, bacon and Spam (4 more servings of Spam)
spam_amount = spam_amount + 4
if spam_amount > 0:
print("But I don't want ANY spam!")
viking_song = "Spam " * spam_amount
@levlas
levlas / gke-iam-roles.md
Created December 18, 2018 12:35 — forked from robscott/gke-iam-roles.md
GKE IAM Roles Compared

GKE IAM Roles

On GKE, there's an interesting overlap between what the IAM roles grant you for Kubernetes clusters. In general, the roles in the tables below line up with each other, but there are some strange exceptions. In each of the tables below are the results of a diff between related IAM roles (only the container.* permissions are included in these results).

Project Owner GKE Admin
container.hostServiceAgent.use
Project Editor GKE Developer

Keybase proof

I hereby claim:

  • I am levlas on github.
  • I am leventel (https://keybase.io/leventel) on keybase.
  • I have a public key ASA4hi1cUGL743CJ4LsoIZ1DH9CSjS6QQX0G0l9A0YdShgo

To claim this, I am signing this object:

@levlas
levlas / fluentbit_pod.log
Created March 12, 2018 17:03
Log of fluentbit DS pods
...
[2018/03/12 09:48:07] [error] [io] TCP connection failed: 54.93.252.107:9200
[2018/03/12 09:48:07] [error] [io] TCP connection failed: 54.93.252.107:9200
Fluent-Bit v0.12.15
Copyright (C) Treasure Data
"took""errors""took""errors""took""errors""took""errors""took""errors""took""errors"
"took""errors""took""errors""took""errors""took""errors""took""errors""took""errors"
"took""errors""took""errors""took""errors""took""errors""took""errors""took""errors"
"took""errors""took""errors""took""errors""took""errors""took""errors""took""errors"
@levlas
levlas / fluent-bit-read-role-error.json
Created March 11, 2018 13:04
Error was returned by GKE when I tried to create a new role for fluentbit
Error from server (Forbidden):
error when creating "https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/fluent-bit-role.yaml":
clusterroles.rbac.authorization.k8s.io "fluent-bit-read" is forbidden:
attempt to grant extra privileges:
[PolicyRule{Resources:["namespaces"], APIGroups:[""], Verbs:["get"]}
PolicyRule{Resources:["namespaces"], APIGroups:[""], Verbs:["list"]}
PolicyRule{Resources:["namespaces"], APIGroups:[""], Verbs:["watch"]}
PolicyRule{Resources:["pods"], APIGroups:[""], Verbs:["get"]}
PolicyRule{Resources:["pods"], APIGroups:[""], Verbs:["list"]}
PolicyRule{Resources:["pods"], APIGroups:[""], Verbs:["watch"]}]
@levlas
levlas / output of configure
Last active October 11, 2017 14:23
nmap static build
checking whether NLS is requested... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
@levlas
levlas / vim.rc
Created October 4, 2017 16:09
simple vim.rc
syntax on
set number
set bg=dark
autocmd Filetype c setlocal ts=2 sw=2 expandtab
autocmd Filetype yaml setlocal ts=2 sw=2 expandtab
@levlas
levlas / inventory
Created October 1, 2017 18:05
Ansible templating with variables from inventory
[aws]
aws_u ansible_host=5.5.1.1
[k8s]
[arub]
flok ansible_host=8.2.2.5
[py3-hosts]
aws_u