Skip to content

Instantly share code, notes, and snippets.

View mofelee's full-sized avatar
🎯
Focusing

mofelee

🎯
Focusing
View GitHub Profile
@mofelee
mofelee / vim_cheatsheet.txt
Created May 16, 2017 08:28 — forked from fernandes/vim_cheatsheet.txt
my 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
@mofelee
mofelee / reference.lua
Created June 4, 2017 17:20 — forked from doches/reference.lua
Lua Cheat Sheet
-- 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.')

映射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 / enable_bbr.sh
Created September 25, 2017 10:45
Update linux kernel and enable google bbr on ubuntu
#!/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
@mofelee
mofelee / Vagrantfile
Created November 16, 2017 02:38 — forked from anthonysterling/Vagrantfile
Handy Vagrantfile for IE testing with Vagrant.
# 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",

Linux - Systemd cheatsheet

systemctl

Activates a service immediately:

systemctl start foo.service

Deactivates a service immediately:

@mofelee
mofelee / k8s-create-deployment.go
Created November 9, 2017 06:31 — forked from ffledgling/k8s-create-deployment.go
kubernetes client-go example: Create a Deployment based on json
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 / offlineInstallMeteor.sh
Last active November 10, 2021 21:26
离线安装meteor--使用前先把安装包放在同一个文件夹里
#!/bin/sh
# This is the Meteor install script!
#
# Are you looking at this in your web browser, and would like to install Meteor?
# Just open up your terminal and type:
#
# curl https://install.meteor.com/ | sh
#
# Meteor currently supports:
@mofelee
mofelee / alfred.json
Created June 13, 2022 03:44 — forked from nmhnmh/alfred.json
Template for Alfred App Script Filter JSON output
{
"variables": {
"fruit": "banana",
"vegetable": "carrot"
},
"rerun" : 1,
"items": [
{
"uid": "desktop",
"type": "file",