Skip to content

Instantly share code, notes, and snippets.

View kube-flannel.yaml
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: flannel
rules:
- apiGroups:
- ""
resources:
- pods
@li-wu
li-wu / handle_file.js
Created Dec 24, 2018
Using koa to handle file upload
View handle_file.js
const fs = require('fs')
const app = new Koa()
const router = new Router()
const serve = require('koa-static')
const koaBody = require('koa-body')
app
.use(serve(__dirname + '/files')) // files文件夹用于保存上传的文件,也是静态资源地址
.use(router.routes())
View namespace-prod.yaml
apiVersion: v1
kind: Namespace
metadata:
name: production
View namespace-dev.yaml
apiVersion: v1
kind: Namespace
metadata:
name: development
View install_cygwin_sshd.ps1
Write-Host "Creating necessary user account"
$pw = ConvertTo-SecureString -String "sshd_password" -AsPlainText -Force
New-LocalUser -Name sshd -Password $pw -PasswordNeverExpires -AccountNeverExpires
Add-LocalGroupMember -Group Administrators -Member sshd
Write-Host "Installing Cygwin"
Invoke-WebRequest https://cygwin.com/setup-x86_64.exe -OutFile C:\setup-x86_64.exe
Start-Process C:\setup-x86_64.exe -Wait -NoNewWindow -ArgumentList "-q -n -l C:\cygwin64\packages -s http://mirrors.kernel.org/sourceware/cygwin/ -R C:\cygwin64 -P python-devel,openssh,cygrunsrv,wget,tar,qawk,bzip2,subversion,vim,make,gcc-fortran,gcc-g++,gcc-core,make,openssl,openssl-devel,libffi-devel,libyaml-devel,git,zip,unzip,gdb,libsasl2,gettext"
Remove-Item C:\setup-x86_64.exe