Instantly share code, notes, and snippets.

View settings.yml
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: myapi-k8s
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["pods"]
verbs: ["get", "watch", "list"]
---
View install.diff
diff --git a/nfs/deploy/kubernetes/class.yaml b/nfs/deploy/kubernetes/class.yaml
index 6ea74350..9aad3ec4 100644
--- a/nfs/deploy/kubernetes/class.yaml
+++ b/nfs/deploy/kubernetes/class.yaml
@@ -1,7 +1,7 @@
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
- name: example-nfs
-provisioner: example.com/nfs
View Dockerfile
FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
MAINTAINER linnil1 <linnil1.886@gmail.com>
ENV LANG en_US.UTF-8
RUN apt update -y && \
apt install -y \
# main thing
vim-gtk \
tmux \
View nnn.py
from kivy.app import App
from kivy.lang.builder import Builder
from kivy.uix.widget import Widget
from kivy.uix.floatlayout import FloatLayout
from kivy.clock import Clock
from kivy.properties import ObjectProperty, NumericProperty, ListProperty
from kivy.core.window import Window
# config Start #
window_size = (800, 600)
View nginx.conf
user nginx;
worker_processes 1;
error_log /etc/nginx/log/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
View commandline
docker run -it --rm -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf:ro -v $(pwd)/certs:/certs:ro -v $(pwd)/log:/var/log/nginx -p 80:80 -p 443:443 nginx
View grafana_synology.json
{
"__inputs": [
{
"name": "DS_PROM",
"label": "prom",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
View PFR.py
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0.01, 1)
vk = np.array([0.1, 1, 10])
xvk_x, xvk_vk = np.meshgrid(x, vk)
y = -xvk_vk * np.log(xvk_x)
plt.plot(xvk_x.T, y.T)
plt.legend(['$V_0 / k = ' + str(i) + '$' for i in vk])
View index.html
<div class="container" id="app">
<div class="input-group-prepend">
<span class="input-group-text">.str file</span>
<input type="file" @change="fileUpload($event, 'strdata')" />
</div>
<div class="input-group">
<textarea v-model="strdata" class="form-control"></textarea>
</div>
<div class="input-group-prepend">
<span class="input-group-text">.pdb file</span>
View index.html
<div class="container" id="app">
<div class="input-group-prepend">
<span class="input-group-text">.str file</span>
</div>
<div class="input-group">
<textarea v-model="strdata" class="form-control"></textarea>
</div>
<div class="btn-group m-4" role="group">
<button type="button" class="btn btn-primary" v-on:click="goClick">.str convert to .tbl</button>
</div>