- Here are some default vars for the process
ISO_DIR=~/fedora;
ROOTFS_MOUNT_DIR=/mnt/contents
DISTRO_LOCATION=
/// Make CPUs usage as a sin wave | |
#include <math.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/time.h> | |
#include <unistd.h> | |
const float PI = 3.1415926; | |
const int TIME_SLICE = 40000; // 40 ms |
import os | |
import random | |
import subprocess | |
def ps_exec(cmd, adminPriv=False): | |
""" 使用 Windows PowerShell Start-Process 執行程式, 回傳 STDOUT, 並且支援以系統管理員身分執行 """ | |
# 產生隨機檔名, 用來儲存 stdout | |
existed = True | |
while existed: |
def get_aid_from_url(url: str) -> (str, str): | |
# from get_aid_from_url in PyPtt | |
# 檢查是否符合 PTT BBS 文章網址格式 | |
pattern = re.compile('https://www.ptt.cc/bbs/[-.\w]+/M.[\d]+.A[.\w]*.html') | |
r = pattern.search(url) | |
if r is None: | |
raise ValueError('url must be www.ptt.cc article url') |
all: final.osc | |
clean: | |
rm *.list *.osm *.osc | |
# P31=屬於 Q7930614=中華民國村里 P5020=中華民國戶政資料代碼 | |
define quest | |
SELECT DISTINCT ?village ?ref | |
WHERE { | |
?village wdt:P31 wd:Q7930614. |
#main: ~/.mlterm/main | |
bg_color = black | |
fg_color = grey75 | |
geometry = 86x24 | |
fontsize = 32 | |
scrollbar_mode = autohide | |
scrollbar_view_name = next | |
use_bold_font = false | |
use_anti_alias = true | |
letter_space = 0 |
function git_user_switcher() { | |
# Define an associative array to store the user settings | |
typeset -A -g git_users | |
# Add the users to the dictionary | |
# Format: username "name email gpg_key" | |
git_users=( | |
adam "adam [email protected]" | |
) |