Skip to content

Instantly share code, notes, and snippets.

View futuretea's full-sized avatar
🎯
Focusing

Hang Yu futuretea

🎯
Focusing
View GitHub Profile
@futuretea
futuretea / win-usb.sh
Created August 10, 2019 15:35
make windows usb in linux
#!/bin/bash
set -eux
pacman -Sy woeusb
woeusb --device $1 $2 --target-filesystem NTFS
taskkill /f /im dwm.exe
start dwm
#!/usr/bin/env bash
[[ -n "$DEBUG" ]] && set -x
set -eou pipefail
usage() {
cat <<HELP
USAGE:
export-openstack-volume VOLUME_ID [CLEAN]
HELP
}
@futuretea
futuretea / harvester-debug.md
Last active September 5, 2022 18:05
harvester debug kt-connect
sudo ktctl connect -c ~/.kube/config
ktctl exchange -n harvester-system harvester --expose 6080:8080
ktctl exchange -n harvester-system harvester --expose 6443:8443
ktctl exchange -n harvester-system harvester-webhook --expose 7443:443
@futuretea
futuretea / centos8-static-ip.sh
Created June 11, 2022 14:26
centos8-static-ip
nmcli c modify enp3s0 ipv4.addr 192.168.1.20/24 ipv4.gateway 192.168.1.1 ipv4.method manual
timedatectl set-ntp true
fdisk /dev/sda
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt
pacstrap /mnt base linux linux-firmware
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock --systohc
locale-gen
df -Th | grep -v overlay | grep -v tmpfs
fdisk -l
fdisk /dev/sdb
# n,p,w
mkfs.ext4 /dev/sdb1
mkdir -p /mnt/disk1
mount /dev/sdb1 /mnt/disk1
findmnt
@futuretea
futuretea / harvester-dev.sh
Last active July 11, 2022 09:15
harvester-dev.sh
# mount host E:\\dev to wsl ~/dev
cd ~
ln -s /mnt/e/dev
# mount repo to GOPATH
mkdir -p ~/go/src/github.com/harvester
cd ~/go/src/github.com/harvester
mount --bind /home/go/dev/futuretea/harvester ./harvester
GO111MODULE=off go generate
CGO_ENABLED=0 go build -mod=vendor .
gossh script 192.168.5.[31,61] -e ./hack/host-check.sh
# openstack ussuri ubuntu18.04
sudo apt update -y
sudo apt upgrade -y
git clone https://github.com/openstack/devstack.git
cd devstack
git checkout stable/ussuri
sudo su
./tools/create-stack-user.sh