Skip to content

Instantly share code, notes, and snippets.

View chenhan1218's full-sized avatar

Chen-Han (Stanley) Hsiao chenhan1218

View GitHub Profile
@chenhan1218
chenhan1218 / WebRTC-on-LAN.md
Last active September 23, 2022 07:43
WebRTC on LAN

WebRTC on LAN

剛嘗試了怎麼樣在區域網路中使用 WebRTC 來進行 VOIP,意外發現其實滿簡單的。分享一下我的步驟

P.S 這是提供給外部網路不通的環境下,如果外部網路通暢,那麼可以直接用現有服務,如 https://talky.io/ 即可

架起 WebRTC Signal Server

git clone https://github.com/andyet/signalmaster
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import mechanize
from colorama import init
from colorama import Fore, Back, Style
init()
def main():
@chenhan1218
chenhan1218 / grub.cfg
Last active August 29, 2015 14:17 — forked from fourdollars/grub.cfg
function load_efi_video {
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
}
function load_video {
set gfxmode=auto
@chenhan1218
chenhan1218 / develop-in-lxc.py
Created March 18, 2016 03:09 — forked from Roadmaster/develop-in-lxc.py
develop-in-lxc.py
#!/usr/bin/env python3
#
# Copyright 2015 Canonical Ltd.
#
# Authors:
# Daniel Manrique <[email protected]>
#
# develop-in-lxc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
@chenhan1218
chenhan1218 / README.md
Created June 4, 2018 09:51 — 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'.

@chenhan1218
chenhan1218 / gist:f2fbd2a732dbfef989d6462dcd30e584
Last active October 7, 2019 04:38
Memo for customize maas (curtin) image

Memo Date: 2018-07-18 MAAS version: 2.3

Curtin’s assumption is that a fairly rich Linux (Ubuntu) environment is booted.

But if your image is not Linux (Ubuntu) based, you could customize the image via:

  1. Understand curtin stages
    http://curtin.readthedocs.io/en/latest/topics/config.html
    Stages:

Keybase proof

I hereby claim:

  • I am chenhan1218 on github.
  • I am chenhan1218 (https://keybase.io/chenhan1218) on keybase.
  • I have a public key ASBy0BGC2ENHA6kPE6jV--miOu1xNSEvmrJ0ZY6btiC4yQo

To claim this, I am signing this object:

@chenhan1218
chenhan1218 / timezone.py
Created October 21, 2019 10:37
Airflow subdag
# Failed trial of airflow subdag with timezone aware
from datetime import datetime, timedelta
import pendulum
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.operators.subdag_operator import SubDagOperator
@chenhan1218
chenhan1218 / timezone.py
Last active October 22, 2019 08:14
airflow dag with timezone aware
from datetime import datetime, timedelta
import pendulum
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
default_args = {"owner": "airflow"}