Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

mofelee

🎯
Focusing
View GitHub Profile
@mofelee
mofelee / Vagrantfile
Created Nov 16, 2017 — forked from anthonysterling/Vagrantfile
Handy Vagrantfile for IE testing with Vagrant.
View Vagrantfile
# Usage: IE={box} vagrant up
#
# Eg. IE=XPIE6 vagrant up
boxes = {
"XPIE6" => "http://aka.ms/vagrant-xp-ie6",
"XPIE8" => "http://aka.ms/vagrant-xp-ie8",
"VistaIE7" => "http://aka.ms/vagrant-vista-ie7",
"Win7IE8" => "http://aka.ms/vagrant-win7-ie8",
"Win7IE9" => "http://aka.ms/vagrant-win7-ie9",
@mofelee
mofelee / k8s-create-deployment.go
Created Nov 9, 2017 — forked from ffledgling/k8s-create-deployment.go
kubernetes client-go example: Create a Deployment based on json
View k8s-create-deployment.go
package main
import (
"encoding/json"
"log"
"os"
// We use pretty instead of the common go-spew or pretty-printing because,
// go-spew is vendored in client-go and causes problems
"github.com/kr/pretty"
@mofelee
mofelee / enable_bbr.sh
Created Sep 25, 2017
Update linux kernel and enable google bbr on ubuntu
View enable_bbr.sh
#!/bin/sh
# update kernel
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10-rc1/linux-image-4.10.0-041000rc1-generic_4.10.0-041000rc1.201612252031_amd64.deb
dpkg -i linux-image-4.10.0*.deb
update-grub
reboot
# check kernel
uname -a
View kube-command.md

映射scope服务到本地

kubectl port-forward -n kube-system "$(kubectl get -n kube-system pod --selector=weave-scope-component=app -o jsonpath='{.items..metadata.name}')" 4040

部署

kubectl run kubernetes-bootcamp --image=docker.io/jocatalin/kubernetes-bootcamp:v1 --port=8080
@mofelee
mofelee / reference.lua
Created Jun 4, 2017 — forked from doches/reference.lua
Lua Cheat Sheet
View reference.lua
-- Lua Cheat Sheet for Programmers, by Al Sweigart http://coffeeghost.net
-- This cheat sheet is an executable Lua program.
--[[ This is
a multline comment]]
---[[ This is a neat trick. The first -- makes -[[ not a multiline comment.
print("This line executes.")
--]] The rest of this line is also a comment.
print("Here is a string" .. ' concatenated with ' .. 2 .. ' other strings.')
@mofelee
mofelee / vim_cheatsheet.txt
Created May 16, 2017 — forked from fernandes/vim_cheatsheet.txt
my vim cheatsheet.txt
View vim_cheatsheet.txt
## Vim
### Basic
enable line numbers :set number | :set nu
disable line numbers :set nonumber | :set nonu | :set nu!
enable relative numbers :set relativenumber
convert entire word to uppercace <leader>u
convert entire word to lowercase <leader>l
convert first char of word to uppercase <leader>U
convert first char of word to lowercase <leader>L
View gist:351cee87cda9d60ce87b26a0df57d41b

via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)

  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zo opens a fold at the cursor.
  • zO opens all folds at the cursor.
  • zm increases the foldlevel by one.
  • zM closes all open folds.
@mofelee
mofelee / varnish
Created Feb 21, 2017 — forked from reifman/varnish
Example Varnish configuration file e.g. /etc/default/varnish
View varnish
# Configuration file for varnish
#
# /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and $MEMLOCK
# to be set from this shell script fragment.
#
# Should we start varnishd at boot? Set to "no" to disable.
START=yes
# Maximum number of open files (for ulimit -n)
@mofelee
mofelee / bash-cheatsheet.sh
Created Feb 21, 2017 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
View bash-cheatsheet.sh
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
View Linux - Systemd cheatsheet.md

Linux - Systemd cheatsheet

systemctl

Activates a service immediately:

systemctl start foo.service

Deactivates a service immediately:

You can’t perform that action at this time.