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'
#!/usr/bin/python
#rt[100].get('lat')
#rt[100].get('lon')
#rt[100][0].text
#
#
#for child_of_root in rt:
# if child_of_root.tag == '{http://www.topografix.com/GPX/1/0}wpt':
# for cc in child_of_root:
@tai271828
tai271828 / dump-module-dep.py
Last active August 15, 2017 09:35
Dump dot file by using modulegraph. It trims unwanted modules in the graph.
#!/usr/bin/env python3
#
# Author: Taihsiang Ho (tai271828)
# License: BSD 3-clause
#
# This script uses modulegraph to prepare a Graphviz dot file.
#
# The first positional argument is the target python script to be scanned. The
# result of the optional arguments could refer to the --help.
#
@tai271828
tai271828 / campsaver.py
Last active October 9, 2018 08:33
A campsaver crawler to watch the price of the commodity you want to have
#!/usr/bin/env python3
#
# Copyright 2017, Taihsiang Ho <[email protected]>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
@tai271828
tai271828 / .gitignore
Last active October 12, 2018 18:25
Create Curtin development environment in a quick way
serial.log
@tai271828
tai271828 / txt2sql.py
Created November 3, 2017 12:04
Convert my libreoffice dumped csv to another csv ready to be imported by mysql
#!/usr/bin/python3
import csv
import pprint
import sys
def fill_null_value(input, filler="\\N"):
"""
Replace empty elements of input by a filler.
@tai271828
tai271828 / virsh-batch-start-vm.py
Created November 24, 2017 06:48
Batch start vm by virsh
#!/usr/bin/env python
#
# Batch start vm by virsh
#
# usage:
# ./virsh-batch-start-vm.py <domain1> [<domain2> ... <domainN>]
#
#
import sys
@tai271828
tai271828 / rtc.c
Last active January 31, 2018 13:43
Simplified MC146818 RTC Linux driver
/*
* RTC class driver for "CMOS RTC": PCs, ACPI, etc
*
* Copyright (C) 1996 Paul Gortmaker (drivers/char/rtc.c)
* Copyright (C) 2006 David Brownell (convert to new framework)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
#!/bin/bash
#
# A simple script tool to change the deb of kernel images.
#
#
function usage() {
local usage="Usage: `basename $0` [-t target_kernel_version] [-i increment] [-d decrement] [--dry --dryrun]"
echo $usage
exit
}