- Here are some default vars for the process
ISO_DIR=~/fedora;
ROOTFS_MOUNT_DIR=/mnt/contents
DISTRO_LOCATION=| 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]" | |
| ) |
| #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 |
| all: final.osc | |
| clean: | |
| rm *.list *.osm *.osc | |
| # P31=屬於 Q7930614=中華民國村里 P5020=中華民國戶政資料代碼 | |
| define quest | |
| SELECT DISTINCT ?village ?ref | |
| WHERE { | |
| ?village wdt:P31 wd:Q7930614. |
| 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') |
| import os | |
| import random | |
| import subprocess | |
| def ps_exec(cmd, adminPriv=False): | |
| """ 使用 Windows PowerShell Start-Process 執行程式, 回傳 STDOUT, 並且支援以系統管理員身分執行 """ | |
| # 產生隨機檔名, 用來儲存 stdout | |
| existed = True | |
| while existed: |
| /// 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 |
| """ | |
| Classify photos by EXIF attributes. | |
| Before classified: | |
| DCIM | |
| ├── 100ANDRO | |
| │ ├── DSC_2828.JPG | |
| │ └── DSC_2830.JPG | |
| ├── 99ANDRO |
| git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }' | |
| # 退出桌面模式,以節省記憶體,不然編譯到一半會有記憶體不足的狀況,造成失敗 | |
| # 你的畫面會進入Console 模式,是正常的 | |
| sudo systemctl isolate multi-user | |
| # 準備建置原始碼 | |
| yarn | |
| # 建置原始碼,這個會要花一些時間,約15~20分鐘 | |
| yarn run gulp vscode-linux-arm64-min | |
| yarn run gulp vscode-linux-arm64-build-deb |