Skip to content

Instantly share code, notes, and snippets.

@kozikow
kozikow / cool.js
Created April 18, 2017 22:36
Cool effect js
(function() {
function l(a, d) {
this.i = (this.g = "PUBLIC" !== a) ? a : "*";
this.j = d
}
l.prototype.init = function(a) {
window.addEventListener("message", function(d) {
d = d.data;
d.isCanvaApi && (a[d.type] || $.noop)(d)
}, !1);
@kozikow
kozikow / job_submit.py
Created January 31, 2017 08:17
Submiting job to kubernetes
import os
import re
import kubernetes
import logging
import math
from kubernetes.client import V1Container
from kubernetes.client import V1EnvVar
from kubernetes.client import V1Job
@kozikow
kozikow / lspci.txt
Created January 5, 2017 15:53
lspci-vv of my workstation
00:00.0 Host bridge: Intel Corporation Skylake Host Bridge/DRAM Registers (rev 07)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7998
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
Latency: 0
Capabilities: [e0] Vendor Specific Information: Len=10 <?>
Kernel driver in use: skl_uncore
00:01.0 PCI bridge: Intel Corporation Skylake PCIe Controller (x16) (rev 07) (prog-if 00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
@kozikow
kozikow / Xorg.conf
Created January 3, 2017 06:39
My xorg.conf
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 375.26 (buildmeister@swio-display-x86-rhel47-01) Thu Dec 8 19:06:44 PST 2016
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 1920 0
Screen 1 "Screen1" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
@kozikow
kozikow / Xorg.0.log
Created January 3, 2017 06:38
My xorg logs
[ 104.499]
X.Org X Server 1.18.4
Release Date: 2016-07-19
[ 104.500] X Protocol Version 11, Revision 0
[ 104.500] Build Operating System: Linux 4.5.4-1-ARCH x86_64
[ 104.501] Current Operating System: Linux kozikow-pc 4.8.13-1-ARCH #1 SMP PREEMPT Fri Dec 9 07:24:34 CET 2016 x86_64
[ 104.501] Kernel command line: initrd=\initramfs-linux.img root=PARTUUID=7ced5832-ec56-453b-b4a0-94df77cb38a7 rw
[ 104.502] Build Date: 19 July 2016 05:54:24PM
[ 104.502]
[ 104.502] Current version of pixman: 0.34.0
@kozikow
kozikow / org-html.el
Created December 30, 2016 18:43
Html settings of org
;; Awesome https://github.com/fniessen/org-html-themes
;; #+ATTR_HTML: :border 2 :rules groups :frame all
(setq org-html-table-default-attributes
'(:border "2" :cellspacing "0" :cellpadding "6" :rules "all" :frame
"all"))
;; Style from http://gongzhitaao.org/orgcss/
(setq org-html-style-default "<style type=\"text/css\">html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}[hidden],template{display:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit;font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background-color:#ff0;colo
@kozikow
kozikow / org-babel-history.el
Created December 27, 2016 21:41
Auto complete recent comint messages.
(defmacro my-save-excursion (&rest forms)
`(let* ((oldp (point))
(oldbuff (current-buffer))
(retval (progn ,@forms)))
(unless (eq (current-buffer) oldbuff) (switch-to-buffer oldbuff))
(goto-char oldp)
etval))
(defun my-helm-comint-input-ring-action (candidate)
@kozikow
kozikow / deployment.yaml
Created November 2, 2016 23:25
Deployment config
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: caffe
namespace: echoserver
spec:
replicas: 3
template:
metadata:
labels:
@kozikow
kozikow / autoscaler.yaml
Created November 2, 2016 23:25
Autoscaler
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: caffe
namespace: echoserver
spec:
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Deployment
name: caffe
// Generate airflow config to stdout.
// To start service the from scratch, put this in src/airflow_config/airflow_config.go and run:
// export GOPATH=$(pwd)
// export PATH=$PATH:$GOPATH/bin
// go get k8s.io/client-go/1.4/kubernetes
// go install airflow_config
// airflow_config prod > airflow-prod.yaml
// airflow_config dev > airflow-dev.yaml
// In dev: