Skip to content

Instantly share code, notes, and snippets.

View bloatfan's full-sized avatar
🤒
Out sick

bloatfan bloatfan

🤒
Out sick
View GitHub Profile

Software Engineering Philosophy & Development Protocol

1. Global Integrity & Topology

  • System Awareness: Before implementation, map the dependency graph and system topology. Ensure local changes preserve global invariants and do not trigger "Shotgun Surgery."
  • Orthogonality: Design for independence. Ensure that changes in one module do not leak side effects into others. Minimize coupling and maximize cohesion.

2. Intent & Abstraction Hierarchy

  • Intent-Revealing Design: Prioritize human readability and intent over machine cleverness. Use naming that explains "Why" rather than "How."
  • Single Level of Abstraction (SLA): Adhere strictly to the Single Responsibility Principle (SRP). Each function must operate at a consistent level of abstraction and have exactly one reason to change.
@bloatfan
bloatfan / yumcentos7.sh
Created October 19, 2024 10:49
yumcentos7
#!/bin/bash
# 检查系统版本
if [ -f /etc/redhat-release ]; then
OS_VERSION=$(grep -oE '[0-9]+\.[0-9]+' /etc/redhat-release)
else
echo "未找到 /etc/redhat-release 文件。请确保您运行的是 CentOS 系统。"
exit 1
fi
@bloatfan
bloatfan / optimize.sh
Last active February 24, 2024 12:38 — forked from taurusxin/optimize.sh
Linux Optimization Script
#!/usr/bin/env bash
echo=echo
for cmd in echo /bin/echo; do
$cmd >/dev/null 2>&1 || continue
if ! $cmd -e "" | grep -qE '^-e'; then
echo=$cmd
break
fi
done
@bloatfan
bloatfan / vagrant-vmware-tech-preview-apple-m1-pro.md
Created March 30, 2022 12:08 — forked from sbailliez/vagrant-vmware-tech-preview-apple-m1-pro.md
Vagrant and VMWare Tech Preview on Apple M1 Pro

Vagrant and VMWare Tech Preview on Apple M1 Pro

This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated from discussions in hashicorp/vagrant-vmware-desktop#22

Installing Rosetta

First install Rosetta if not already done, this is needed to run x86 code:

@bloatfan
bloatfan / vpn-utilities.applescript
Created September 12, 2021 08:52 — forked from iloveitaly/vpn-utilities.applescript
Configure / create VPN connections via applescript
-- Author: Michael Bianco <http://mabblog.com/>
-- Some help from: http://discussions.info.apple.com/message.jspa?messageID=10363317
on create_vpn_service(vpn_name)
tell application "System Preferences"
reveal pane "Network"
activate
tell application "System Events"
tell process "System Preferences"
@bloatfan
bloatfan / ssh-multi.sh
Created October 26, 2020 05:41 — forked from dmytro/ssh-multi.sh
Start multiple synchronized SSH connections with Tmux
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then
@bloatfan
bloatfan / config.json
Created August 21, 2020 23:14
vmess 配置文件
{
"inbounds": [
{
"port": 8888,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "b4b24b02-08a8-4ad5-aff2-1bc10a15315b",
"alterId": 8
@bloatfan
bloatfan / .gdbinit
Created April 13, 2020 15:30
.gdbinit
python
# GDB dashboard - Modular visual interface for GDB in Python.
#
# https://github.com/cyrus-and/gdb-dashboard
# License ----------------------------------------------------------------------
# Copyright (c) 2015-2020 Andrea Cardaci <cyrus.and@gmail.com>
#
@bloatfan
bloatfan / .tmux.conf
Last active November 28, 2025 17:02
.tmux.conf
# 支持鼠标模式
# set -g mouse on
# 设置历史窗口缓冲大小
set -g history-limit 30000
# PREFIX-Q 显示编号的驻留时长,单位 ms
set -g display-panes-time 10000
# 关掉某个窗口后,编号重排
@bloatfan
bloatfan / .vimrc
Last active May 11, 2020 09:25
.vimrc
set nocompatible " be iMproved, required
filetype off " required
" git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
" mkdir -p ~/.vim/.backup/
" mkdir -p ~/.vim/.swp/
" mkdir -p ~/.vim/.undo/
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()