Skip to content

Instantly share code, notes, and snippets.

View JamesHopbourn's full-sized avatar

James Hopbourn JamesHopbourn

View GitHub Profile
@JamesHopbourn
JamesHopbourn / setup.md
Created August 2, 2025 01:34
小型虚拟网络环境搭建 - Gateway-Server-Client架构
@JamesHopbourn
JamesHopbourn / client-cloud-init.yaml
Created August 2, 2025 01:15
小型互联网实验环境完整文档和配置文件
#cloud-config
package_update: true
package_upgrade: true
packages:
- curl
network:
version: 2
ethernets:
enp0s3:
@JamesHopbourn
JamesHopbourn / setup.md
Created August 2, 2025 01:13
小型互联网实验环境搭建详细步骤 - 三节点虚拟网络实验

小型互联网实验环境搭建详细步骤

前提条件

  • 安装了 Multipass 的主机系统(macOS/Linux/Windows)
  • 确保主机有足够资源:至少 6GB 内存,20GB 磁盘空间
  • 具备 sudo 权限

步骤一:创建虚拟机

@JamesHopbourn
JamesHopbourn / setup.md
Last active August 2, 2025 00:50
小型互联网拓扑实验 - Multipass网络实验环境

小型互联网拓扑实验环境搭建指南

概述

本文档详细描述如何使用 Multipass 搭建一个三台虚拟机的小型局域网环境,模拟现实互联网中的 NAT、内网穿透、网络分段访问控制等场景。

网络拓扑结构

Client (10.0.0.3) ← → Gateway (10.0.0.1) ← → Server (10.0.0.2:8000)
cmake_minimum_required(VERSION 3.10)
project(imgtools)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Windows specific settings
if(WIN32)
# Add Windows libraries
find_library(GDIPLUS_LIB gdiplus)
@JamesHopbourn
JamesHopbourn / download-mavericks.sh
Created March 13, 2025 13:47 — forked from Wowfunhappy/download-mavericks.sh
Download a Mac OS X 10.9 Mavericks installer image Apple
#!/bin/bash
#!/bin/sh
# Download script written by Wowfunhappy. Last updated 2025/03/07.
# Thank you to Krackers, Jazzzny, and others for helping analyze Apple's download process and debug this script.
# Thank you to dosdude1 for donating identifiers from a broken Mac.
# Any mistakes are mine alone.
BOARD_SERIAL_NUMBER="C0243070168G3M91F"
@JamesHopbourn
JamesHopbourn / mavericks-iso.sh
Created March 13, 2025 13:05 — forked from josephabrahams/mavericks-iso.sh
Create a bootable ISO from the OS X Mavericks app
#!/bin/sh
# Create a bootable ISO from the OS X Mavericks app
# http://thezinx.com/misc/trend/create-bootable-dmg-iso-mavericks-app/
if [ ! -f /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg ]; then
echo "Download the OS X Mavericks App and then rerun this script."
open "https://itunes.apple.com/us/app/os-x-mavericks/id675248567"
exit 1
fi
@JamesHopbourn
JamesHopbourn / install-coreutils-from-src-mac
Created February 4, 2025 03:48 — forked from byronmansfield/install-coreutils-from-src-mac
Install coreutils from source Mac OS X
# Install coreutils from source on Mac OS X
# prepare workspace
mkdir -p ~/code/build-from-src/ && cd $_
# download source code
curl -LO https://ftp.gnu.org/gnu/coreutils/coreutils-8.31.tar.xz
# expand
tar -xJvf coreutils-8.31.tar.xz
@JamesHopbourn
JamesHopbourn / git-ssh-error-fix.sh
Created January 22, 2025 03:06 — forked from Tamal/git-ssh-error-fix.sh
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone [email protected]:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T [email protected]
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work