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 / 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 / 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"

Linux - Systemd cheatsheet

systemctl

Activates a service immediately:

systemctl start foo.service

Deactivates a service immediately: