Skip to content

Instantly share code, notes, and snippets.

View tai271828's full-sized avatar

Taihsiang Ho tai271828

View GitHub Profile
@tai271828
tai271828 / grub.cfg
Last active April 9, 2020 18:52 — forked from fourdollars/grub.cfg
The grub.cfg could be used to make a multiboot live USB.
function load_efi_video {
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
}
function load_video {
set gfxmode=auto
#!/bin/bash
# Plant rope vim's plugin
# This is a script to install or update 'ropevim'
# Copyright Alexander Artemenko, 2008
# Contact me at svetlyak.40wt at gmail com
release_ubuntu=`lsb_release -r | awk {'print $2'}`
#url_rope='http://bitbucket.org/agr/rope'
#url_ropevim='http://bitbucket.org/agr/ropevim'
@tai271828
tai271828 / cmd
Created April 21, 2018 23:35 — forked from eldondev/cmd
Because everyone needs a good preseed
wget -nc http://ftp.debian.org/debian/dists/jessie/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux
wget -nc http://ftp.debian.org/debian/dists/jessie/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz
cp -nv ~/.ssh/id_rsa.pub .
qemu-system-x86_64 -machine accel=kvm -kernel linux -initrd initrd.gz -m 1G -smp 2 -append "blacklist=vga16fb fb=false video=false vga=normal auto=true url=http://10.0.2.10:8080/debian-preseed.txt hostname=otto domain=" -net user,guestfwd=:10.0.2.10:8080-cmd:"/bin/busybox httpd -i" -hda /dev/shm/deb.img -net nic -display none
@tai271828
tai271828 / split_ttc_font_to_ttf.py
Created August 4, 2018 08:06 — forked from yrcjaya/split_ttc_font_to_ttf.py
Convert font TTC to TTF
"""Convert TTC font to TTF using fontforge with python extension.
**Warning** The scripts saves splitted fonts in the current working directory.
Usage:
split_ttc_font_to_ttf.py Droid.ttc
Preinstallation: apt-get install python-fontforge
"""
import sys
@tai271828
tai271828 / README.md
Created September 20, 2018 15:38 — forked from smoser/README.md
MAAS and curtin debug

Debugging curtin from within MAAS

Deploying a node with MAAS cli

You can deploy a node with the maas cli which is often preferable to clicking a button on a web UI.

$ SYSTEM_ID=node-787b19d8-d25c-11e4-9f9e-00163eca91de
$ NAME="random-nodename"
$ MAASNAME="maaslocal"

$ maas $MAASNAME machine allocate "name=$NAME"

@tai271828
tai271828 / README.md
Created October 13, 2018 02:25 — forked from smoser/README.md
Curtin install in a vm with tools/launch

curtin install with launch

Curtin has a test suite named vmtest. It has loads of configs for installation that put curtin through a battery. As of this writing it runs 192 installations on amd64 covering all supported ubuntu releases. It runs nightly under jenkins. See example results in the curtin-vmtest-devel-amd64 job.

If you're interested just a general use of curtin without starting a VM, see another article 'Curtin Development on uvt-kvm'.

@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 / 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
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
Created October 22, 2020 13:31 — forked from smoser/README.md
update or add to an initramfs or initrd with contents of a directory

Update an initramfs with contents of a directory without root

This tool allows you to take a initramfs and add contents of a directory to it. This is very useful if you need to test initramfs, you can simply take the original and add your files "over".

Also, because it does not extract the original cpio archive, it works without root.

Usage:

Usage: overlay-initramfs [ options ] source-initramfs directory [output]