Skip to content

Instantly share code, notes, and snippets.

@mcastelino
mcastelino / Kube-dns.md
Last active June 20, 2022 08:48
kubernetes kube-dns components, debugging

Summary

  • dnsmasq front ends the requests and sends them on to kube-dns

    dnsmasq
      --cache-size=1000
      --no-resolv
      --server=127.0.0.1#10053
    

--log-facility=-

@terlar
terlar / kubectl.fish
Last active January 31, 2021 04:11
Kubernetes fish completions
# kubernetes - is an open source system for managing containerized
# applications across multiple hosts, providing basic mechanisms for
# deployment, maintenance, and scaling of applications.
# See: https://kubernetes.io
function __kubectl_no_command
set -l cmd (commandline -poc)
if not set -q cmd[2]
return 0
end
@mgoodness
mgoodness / k8s-svc-annotations.md
Last active March 11, 2024 16:24
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@organizm
organizm / start_chrome_desctop.sh
Last active January 9, 2022 11:33
How to install end start chrome remote desctop #ubuntu
Mostly from https://aur.archlinux.org/packages/chrome-remote-desktop/?comments=all but with some of my changes.
1. I manually created the chrome-remote-desktop group, and added myself to it.
2. I manually created the ~/.chrome-remote-desktop-session file with "exec startxfce4" in it.
3. I manually created the ~/.config/chrome-remote-desktop directory.
4. mkdir /etc/chromium-browser/native-messaging-hosts
4. ln -s /etc/opt/chrome/native-messaging-hosts/* /etc/chromium-browser/native-messaging-hosts/
You should now have a 'Enable Remote Connection' button on the CRD extension page.
@edwthomas
edwthomas / charts-reframe.cljs
Created June 8, 2016 00:13
Example of using Chart.js with Clojurescript
(:require [re-frame.core :as re-frame]
[reagent.core :as reagent]
[cljsjs.chartjs])
(defn show-revenue-chart
[]
(let [context (.getContext (.getElementById js/document "rev-chartjs") "2d")
chart-data {:type "bar"
:data {:labels ["2012" "2013" "2014" "2015" "2016"]
:datasets [{:data [5 10 15 20 25]
@vasanthk
vasanthk / System Design.md
Last active May 16, 2024 20:21
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@baraldilorenzo
baraldilorenzo / readme.md
Created January 16, 2016 12:57
VGG-19 pre-trained model for Keras

##VGG19 model for Keras

This is the Keras model of the 19-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@gavinandresen
gavinandresen / sigop_sighash_count.md
Last active January 28, 2021 09:13
sigop/sighash counting

The consensus protocol limits on blocks are:

1 million or fewer bytes canonically-serialized size. 20,000 or fewer "sigops"

Unfortunately, Satoshi implemented those as quick fixes with zero code review and little testing (Bitcoin was not a Big Deal back then, it was the right decision at the time), and the way sigop counting is done is... well, just wrong.

Here's how Satoshi did it, as pseudo-code (see GetLegacySigOpCount in main.cpp for actual code):

For all the transactions in a block:

@wavded
wavded / go-ci-build.sh
Last active March 1, 2023 23:30
Go Jenkins CI Script - golang
#!/bin/bash
# Go build script that runs cloc, cpd, lint, vet, test and coverage for Jenkins
#
# Outside tools include:
# gocov: go get github.com/axw/gocov
# gocov-xml: go get github.com/t-yuki/gocov-xml
# go2xunit: go get bitbucket.org/tebeka/go2xunit
# jscpd: npm i jscpd -g
# cloc: npm i cloc -g
@julz
julz / main.go
Created November 20, 2015 12:39
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {