Skip to content

Instantly share code, notes, and snippets.

@foo0x29a
foo0x29a / gist:f78d7d68042edba6bfb661fa707eca2a
Created June 14, 2018 14:49
Print pods memory usage of a given namespace
( NAMESPACE="staging"; for i in $(kubectl top pods -n $NAMESPACE | awk 'NR>1{split($3,a,"Mi"); print a[1];}'); do total=$(( $total + $i )); done; echo $total; )
@foo0x29a
foo0x29a / src
Last active June 16, 2018 21:32
#! /usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
from itertools import cycle
from sklearn import tree
from sklearn import svm, datasets
from sklearn.metrics import roc_curve, auc
Idade, H, J, R, B, C, Classe
20,0,0,1,1,0,1
22,0,1,0,1,0,0
30,0,1,0,0,1,0
31,0,0,1,0,1,1
29,1,0,0,0,1,1
k = 1
predicted: [1 1 0 0 0]
true: [1 0 0 1 1]
confusion matrix:
[[1 1]
[2 1]]
k = 2
predicted: [1 1 0 0 0]
true: [1 0 0 1 1]
digraph Tree {
node [shape=box] ;
0 [label="H <= 0.5\nentropy = 0.996\nsamples = 13\nvalue = [6, 7]\nclass = 1"] ;
1 [label="Idade <= 28.5\nentropy = 0.971\nsamples = 10\nvalue = [6, 4]\nclass = 0"] ;
0 -> 1 [labeldistance=2.5, labelangle=45, headlabel="True"] ;
2 [label="B <= 0.5\nentropy = 0.918\nsamples = 6\nvalue = [2, 4]\nclass = 1"] ;
1 -> 2 ;
3 [label="Idade <= 26.0\nentropy = 0.918\nsamples = 3\nvalue = [2, 1]\nclass = 0"] ;
2 -> 3 ;
4 [label="entropy = 0.0\nsamples = 2\nvalue = [2, 0]\nclass = 0"] ;
predicted: [1 1 0 0 1]
true: [1 0 0 1 1]
confusion matrix:
[[1 1]
[1 2]]
@foo0x29a
foo0x29a / named.conf.options
Created February 24, 2019 13:05
/etc/bind/named.conf.options
options {
directory "/var/cache/bind";
recursion yes;
listen-on { any; };
forwarders {
8.8.8.8;
8.8.4.4;
};
@foo0x29a
foo0x29a / named.conf.local
Last active February 24, 2019 13:08
/etc/bind/named.conf.local
zone "nagoya-foundation.com" {
type master;
file "/etc/bind/zones/db.nagoya-foundation.com";
};
@foo0x29a
foo0x29a / db.nagoya-foundation.com
Created February 24, 2019 13:37
/etc/bind/zones/db.nagoya-foundation.com
$TTL 604800
@ IN SOA ns1.nagoya-foundation.com. root.nagoya-foundation.com. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
; name servers - NS records
IN NS ns1.nagoya-foundation.com.
@foo0x29a
foo0x29a / Dockerfile
Created February 24, 2019 14:00
BIND9
FROM ubuntu:bionic
RUN apt-get update \
&& apt-get install -y \
bind9 \
bind9utils \
bind9-doc
# Enable IPv4
RUN sed -i 's/OPTIONS=.*/OPTIONS="-4 -u bind"/' /etc/default/bind9