Skip to content

Instantly share code, notes, and snippets.

@kerma
kerma / provider.terraform-provider-google_v4.12.0_x5-google_container_cluster.network_policy.provider.log
Last active March 10, 2023 07:13
BUG in terraform-provider-google_v4.12.0_x5 - PROVIDER_UNSPECIFIED - INVALID_ARGUMENT
---[ REQUEST ]---------------------------------------
POST /v1/projects/REDACTED/locations/europe-west3-a/clusters/REDACTED:setNetworkPolicy?alt=json&prettyPrint=false HTTP/1.1
Host: container.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/1.1.6 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/dev
Content-Length: 69
Content-Type: application/json
X-Goog-Api-Client: gl-go/1.16.14 gdcl/20220122
Accept-Encoding: gzip
{
@kerma
kerma / ASS.md
Created March 16, 2021 20:57 — forked from anonymous/ASS.md
Acronyms Seriously Suck - Elon Musk

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

@kerma
kerma / json_test.go
Last active December 5, 2020 13:57
Some tests for checking encoding/json behaviour
// https://kerma.codes/posts/go-json/
package main
import (
"encoding/json"
"reflect"
"testing"
"time"
)
@kerma
kerma / newuser.zshrc.recommended
Last active April 26, 2020 12:19
newuser.zshrc.recommended
@kerma
kerma / sorted_wishlist.py
Created June 12, 2017 11:59
Audible sorted wishlist
#!/usr/bin/env python3
# Sort Audible wishlist by ranking into txt file
# Save As http://www.audible.com/wl/ref=a_wl_c1_pg?sortType=rank&sortOrder=dsc&totalAsinsPerPage=100&page=1 for input
import re
import requests
def get_rating(wishlist, url_part):
url = 'https://www.audible.com' + url_part
@kerma
kerma / psql_manage_users.sql
Created March 30, 2017 12:06
PostgreSQL user management
-- Add a user with readonly privileges to db
CREATE USER username WITH PASSWORD '<password>';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO username;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO username;
-- Delete a user
revoke all privileges on all tables in schema public from username;
drop user username;
-- Add a "root" user to database
@kerma
kerma / example.py
Created August 3, 2016 09:01
Tornado access log split to STDOUT
import sys
import logging
import tornado.httpserver
import tornado.log
import tornado.options
import tornado.web
logger = logging.getLogger(__name__)
tornado.options.define("access_to_stdout", default=False, help="Log tornado.access to stdout")
@kerma
kerma / convert_flac_to_aac.sh
Last active April 20, 2024 07:00
Convert all flac files in folder to m4a using ffmpeg and libfdk_aac
# on os x use brew to get ffmpeg with libfdk_aac
brew install ffmpeg --with-fdk-aac
# convert and use m4a as file extension
find . -name '*.flac' -exec sh -c 'ffmpeg -i "$1" -c:a libfdk_aac -b:a 320k "${1%.flac}.m4a"' _ {} \;