Skip to content

Instantly share code, notes, and snippets.

View tai271828's full-sized avatar

Taihsiang Ho tai271828

View GitHub Profile
@tai271828
tai271828 / README.md
Created October 12, 2020 17:14 — forked from smoser/README.md
ubuntu-auto-install: install a ubuntu image with kvm

Ubuntu Auto Install

This allows user to do automated installation of ubuntu. Provided here a a few different files/scripts for making this easier.

I've used this to verify that d-i kernel and initramfs from -proposed work as shown in bug 1511497.

The provided 'preseed' below can be used as a fully automated installation of ubuntu. Boot with qemu like:

note python web server is useful for this (python -m SimpleHTTPServer 9999)

@tai271828
tai271828 / README.md
Last active September 30, 2020 17:10
local-lab-tool-box - local scalebot development tool box

Local Scalebot Development Tool Box

Usage: build from sctrach including its host

./init-host.sh ./init-development-env.sh

Usage: build from scratch if the host is ready

./init-development-env.sh

clean way to rebuild on the same local host includes charm rebuild

./clean-development-env.sh

@tai271828
tai271828 / README.md
Last active August 12, 2020 05:19
SHWE Toolbox - Setup net-boot server of Ubuntu server/cloud images automatically

SHWE Tool-box

Setup net-boot server of Ubuntu server/cloud images automatically

Usage

./setup-netboot.sh

@tai271828
tai271828 / 00-run-all.sh
Last active July 6, 2020 07:14
Re-deploy the whole openstack model with juju tool chain (openstack-base-testing-toolbox)
#!/bin/bash
# remember to activate your python openstack venv first
echo "============= START: Begin to deploy the whole stack... ==============="
time ./01-re-deploy.sh
echo "============= DONE: Deployed the whole stack. ========================="
echo "============= START: Begin to test the whole stack... ================="
time ./02-basic-test-just-deployed.sh
echo "============= DONE: Tested the whole stack. ========================="
@tai271828
tai271828 / grub.cfg
Created April 9, 2020 18:52
A grub menu to boot Ubuntu Focal arm server version beta image via netboot
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30,0; then
clear
fi
insmod gzio
set timeout=5
menuentry "Install Ubuntu Server (Focal Beta) (Pull the iso from web)" {
@tai271828
tai271828 / syscall.c
Created January 29, 2020 16:48
System calls
/*
* Description: output/input strings from stdout/stdin over Lunux system call
*
* Author: Taihsiang Ho (tai271828)
*
* Usage: gcc -g --static syscall.c
*
* Original source: shiwulo's os hw 3
*
* Also refer to the system call summary of Linux:
@tai271828
tai271828 / min_avg_subarray_v1.py
Last active July 9, 2019 13:51
Demo code to find the min average value from the subset of a positive integer set.
#!/usr/bin/env python3
#
# Author: Taihsiang Ho (tai271828) tai271828@gmail.com
#
# Given an positive integer set Xi. The length of the set is n.
# Given arbitrary a and b, and 1 <= a < b <= n.
# Find the minimum average number, which is
# sigma(i=a to b) Xi / (b - a + 1)
#
#
@tai271828
tai271828 / reactor.py
Created March 30, 2019 03:12 — forked from jpanganiban/reactor.py
A Very Simple Reactor Pattern Implementation in Python (with Gevent)
#!/usr/bin/env python
from gevent import monkey
monkey.patch_all() # Patch everything
import gevent
import time
class Hub(object):
"""A simple reactor hub... In async!"""
@tai271828
tai271828 / bootstrap.sh
Last active February 7, 2019 14:40
Bootstrap charm-tools development environment with SGE-cluster charms as an example
#!/bin/bash
#
# Author: Taihsiang Ho (tai271828) <tai271828@gmail.com>
#
# You could build the development env for charm-tools
# Usage example:
# $ lxc launch ubuntu:16.04 charm-tool-dev-16-04
# $ lxc exec charm-tool-dev-16-04 bash
# $ ./bootstrap.sh
# # in charm-tools folder
@tai271828
tai271828 / Vagrantfile
Created December 19, 2018 06:46
A Vagrantfile to build images in a Ubuntu Xenial box
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at