Skip to content

Instantly share code, notes, and snippets.

View mofelee's full-sized avatar
🎯
Focusing

mofelee

🎯
Focusing
View GitHub Profile
#!/bin/bash
export SRC_IMG="https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2"
export IMG_NAME="debian-12-generic-amd64.qcow2"
export TEMPL_NAME="debian12-generic"
export VMID="9001"
export MEM="1024"
export DISK_SIZE="8G"
export DISK_STOR="local-lvm"
@mofelee
mofelee / README.md
Created February 7, 2023 11:31 — forked from craig-m-unsw/README.md
Parallels (MacOS M1 host) Packer + Vagrant of Ubuntu 20.04 arm64. Installed with cloud-init and configured with Ansible.

parallels Packer (arm64)

A simple Packer + Vagrant install of Ubuntu 20.04 (Focal Fossa) LTS server for arm64, to run from my M1 Mac on Parallels Pro (17.1). Currently on MacOS Monterey.

Packer will run the ansible playbook.yml before the machine is shutdown and exported.

The installation is automated by cloud-init (which reads user-data). The file meta-data just needs to be an empty text file (you need to create this - no blank files or folders allowed in gists).

ubuntu2004/
@mofelee
mofelee / cheat_sheet.txt
Created August 8, 2022 13:17
GDB cheat sheet
GDB commands by function - simple guide
---------------------------------------
More important commands have a (*) by them.
Startup
% gdb -help print startup help, show switches
*% gdb object normal debug
*% gdb object core core debug (must specify core file)
%% gdb object pid attach to running process
% gdb use file command to load object
@mofelee
mofelee / conventional-commits.md
Created August 3, 2022 05:22 — forked from Zekfad/conventional-commits.md
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@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",
@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",
@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 / 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

映射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