原创 Linux 字體

文件路徑 字體存放路徑 /usr/share/fonts/ /usr/local/share/fonts/ $XDG_CONFIG_HOME/fonts/ ~/.fonts/ 字體配置文件 /etc/fonts/fonts.con

原创 Thinkpad E430 Broadcom wireless Device Driver

1 Story OK, here's my story.I have a laptop Thinkpad E430, and there's a wireless device on it, but it does not wor

原创 修改你的 Debian 系統語言

怎樣修改你的 Debian 操作系統的語言 首先, 你需要設置環境變量比如 LANG, LANGUAGE, LC_CTYPE, LC_MESSAGES 成你的當地語言。通常設置 LANG (或者 LC_ALL) 就足夠了。使用以下命令

原创 停用 updatedb.mlocate

停用 updatedb.mlocate 今天iotop之後發現 updatedb.mlocate 進程的磁盤讀寫非常頻繁,導致系統速度非常慢。搜索之後發現是 /etc/cron.daily/mlocate 這個計劃任務在運行。 解決方案

原创 BCD碼與十進制轉換

BCD碼轉十進制 #include <stdint.h> /* convert from BCD to dec */ uint8_t dec = (bcd >> 4) * 10 + (bcd & 0x0f); 十進制轉BCD碼 #

原创 測試程序運行時間

1. 使用 clock() 測試運行時間 #include <time.h> int main(int argc, char *argv[]) { clock_t start = clock(); /* your co

原创 獲取/設置 windows 系統時間

#include <windows.h> #include <winbase.h> #include <stdio.h> SYSTEMTIME td; GetLocalTime(&td); printf ("%4d年%02d月%02

原创 產生隨機數

產生隨機數 以下代碼片段可產生 0 ~ RAND_MAX 區間的隨機數,[0 ~ 100) 開區間的隨機數,[a ~ b)開區間,[a ~ b]閉區間的隨機數,[0 ~ 1]閉區間概率值 #include <stdlib.h> int

原创 Disable Touchpad while using trackpoin on Thinkpad E430

Thinkpad E430 has both a trackpoint and a touchpad. The touchpad is disable when typing. However, when I'm using the t