Skip to content

Instantly share code, notes, and snippets.

View wongsyrone's full-sized avatar
😂
Babysitting

Syrone Wong wongsyrone

😂
Babysitting
View GitHub Profile
#!/usr/bin/env bash
export GOPATH=$PWD/transsocks
GOOS=linux GOARCH=amd64 go build -a -ldflags="-s -w" github.com/cybozu-go/transocks/...
GOOS=linux GOARCH=amd64 go install -a -ldflags="-s -w" github.com/cybozu-go/transocks/...
两台电脑均从救援/备用系统启动,并挂掉原/新根目录到 /mnt。联网并在旧系统启动 sshd,然后:
```
rsync -aviHAXKh --partial --delete old_computer:/mnt /mnt
```
然后装引导、写引导配置,改 /etc/fstab,重启。
@wongsyrone
wongsyrone / gist:db4f32dfb711819407b9f4ebed289735
Created August 6, 2018 08:39
UD+EFI+DATA三分区PE制作
http://zds1210.blog.163.com/
@wongsyrone
wongsyrone / gist:aca57ed19fa0f7afef172dbfea3c9cd2
Last active September 20, 2023 03:12
upgrade Ubuntu mainline kernel
apt-get update && apt-get dist-upgrade -y
apt autoremove -y
rm linux*.deb
# removed due to libc6 unmet dependency
# curl -O https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.15.67/amd64/linux-headers-5.15.67-051567-generic_5.15.67-051567.202209080732_amd64.deb
# removed due to libssl3 unmet dependency
# curl -O https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.15.67/amd64/linux-headers-5.15.67-051567_5.15.67-051567.202209080732_all.deb
curl -O https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.15.67/amd64/linux-image-unsigned-5.15.67-051567-generic_5.15.67-051567.202209080732_amd64.deb
@wongsyrone
wongsyrone / ps6.py
Created June 19, 2018 12:13
6.00.1x problem set 5
import string
### DO NOT MODIFY THIS FUNCTION ###
def load_words(file_name):
'''
file_name (string): the name of the file containing
the list of words to load
Returns: a list of valid words. Words are strings of lowercase letters.
@wongsyrone
wongsyrone / ps4a.py
Created June 17, 2018 09:42
6.00.1x problem set 4
# The 6.00 Word Game
import random
import string
VOWELS = 'aeiou'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'
HAND_SIZE = 7
SCRABBLE_LETTER_VALUES = {
@wongsyrone
wongsyrone / ps3_hangman.py
Created May 24, 2018 03:09
hangman game py3
# Hangman game
#
# -----------------------------------
# Helper code
# You don't need to understand this helper code,
# but you will have to know how to use the functions
# (so be sure to read the docstrings!)
import random
@wongsyrone
wongsyrone / week1-1.md
Last active November 26, 2023 14:12
Interview Questions: Union–Find (ungraded)

Interview Questions: Analysis of Algorithms

3-SUM in quadratic time. Design an algorithm for the 3-SUM problem that takes time proportional to n2 in the worst case. You may assume that you can sort the n integers in time proportional to n2 or better.

Note: these interview questions are ungraded and purely for your own enrichment. To get a hint, submit a solution.

Hint: given an integer x and a sorted array a[] of n distinct integers, design a linear-time algorithm to determine if there exists two distinct indices i and j such that a[i]+a[j]==x.

@wongsyrone
wongsyrone / gist:2d10580b7dcfa7c15044ea5b8feed0da
Created March 13, 2018 00:57
Golang的包管理、项目管理
Golang的包管理有两个特点,一个是去中心化,也就是说,不像Node.js有一个npm,包的仓库可以是任意的代码仓库。一个是代码仓库跟代码本身耦合在一起(比如导入一个包是 "github.com/langresser/websocket"),这个是Golang推荐的工作方式。
好处是go get命令可以轻易的安装好一个项目的依赖(自动从github上面clone,并放在GOPATH的第一个路径中),坏处是不能进行版本控制,一旦情况复杂起来就力不从心(比如某个第三方库的接口有修改,可能导致A的电脑上能正常运行的,B使用go get执行完反而不能正常运行)。
下面是我总结的一些工程管理经验。
1、建立一个golang文件夹,里面包含两个会加入到GOPATH中的文件夹:

KVM OSX Guest 10.11 (El Capitan) with Clover

  • Some notes about this approach:
    • An OSX Installer USB drive for Install OS X El Capitan is created
    • Clover is then installed on the USB drive
    • Clover Configurator is then run on the USB drive
    • The USB drive contents are copied to the VM host
    • VNC is used to connect to the guest UI
  • The qxl virtual video device is used (part of the standard kvm qemu install)