In order to access some embedded system, network equipments, wifi routers, I usually need to use serial communication programs like kermit, minicom.

However, I usually need to access to different devices with different baud rate. So, I wrote some scripts for helping me.

The first one is kermit.sh, which get the options from environment variable. It’s using /dev/ttyUSB0 by default, and 9600 as baud rate. If you want to use differnt device name, just type

$ kermit.sh # using default
$ DEVICE=/dev/ttyUSB1 SPEED=115200 kermit.sh

The script will also save a session log in /tmp, it will show you the filename after you exit from the terminal. However, since kermit is not free. (because it ask developers who make modifications send back the chages). I also wrote another script for minicom.

This is a tip for Debian GNU/Linux.

Many times, you would like to record every work and commands in the terminal session. In the situations like checking the server’s status, testing new softwares, changing the configurations, fighting with crackers.. things like that.

In that moment, you don’t have time to take notes on every commands, but trying to get the system running. However, you will also want to check the log of the commands and outputs.

There is a very useful command named script (1) in the bsdutils packages. The software will help you make typescript of everything printed in the terminal, including your input. So, you can use this software to record your works, and review it later.

No only the things printed in your terminal, you can also save the timing data with ‘-t‘ option. The timing data will be outputted to standard error, you can save it by redirect the standard error to a file. Then you can play back the typescripts by scriptreplay (1).

Therefore, you could show how you get thing down to your friends/colleague by playing the typescript. Just like watch a movie.

For a easier usage, I wrote a small script. The script will help me save the typescript in the filename I assigned or time stamp.

Usage is very simple

$ ./script.sh # save the typescript as time stamp filename
$ ./script.sh mission-critical.log # save the typescript as mission-critical.log

This is a tip for Debian GNU/Linux.

說真的 reportbug-ng 實在遠比 reportbug 的純 CLI 介面好用太多了啊。

特別是這些特色

  • BTS 查詢功能
  • 關鍵字過濾介面
  • 網頁瀏覽介面
  • 整合郵件軟體!

最後一個功能最方便,終於可以使用 Icedove/Thunderbird 方便的撰寫問題回報了,可超方便的使用 Enigmail 與拼字檢查功能了!

備註: reportbug 與 reportbug-ng 都是 Debian GNU/Linux 的軟體瑕疵回報工具。與 Ubuntu Launchpad 的簡易回報方式有相當大的差異,詳情請參閱 Debian bug tracking system

稍早曾經介紹過 Debian 無人值守安裝程式,也就是 pre-seeding

最近看到熱血的 Daniel Bo 做了數個針對不同的桌面環境所設定的幾個預先安裝檔,如果你注意到他的網站名稱叫做 I’Been to Ubuntu,大概就不會意外他為了 Debian 做了這些桌面安裝環境的用意了。這個計畫可以協助你先排除一些需要先調整、設定才能開始使用系統的難題,於是你可以先透過 preseeds 光碟安裝一個馬上可用的系統作入門,但也保有 Debian 原有的特色。

目前支援的桌面環境有 Gnome, KDE, XFCEFVWM 等,你可以從網站上直接下載安裝光碟。對了,Daniel BoGames That Work 網站也相當精彩。

你若使用 ifupdown 於不同的網路環境間切來換去,特別是固定 IP 、PPP/PPPoE 撥接、DHCP 等不同的設定。你可能會被不同服務間使用的 Domain Name Server 設定困擾,尤其是連接某些無線網路的被配到 NAT 內的 DNS,再改回 Static IP 時,/etc/resolv.conf / resolv.conf(5) 沒有被更新,於是還必須手動更改成 NAT 外可用的 DNS 位址。

此時可以利用 resolvconf (8) 來代勞,基本概念是 resolvconf 做了一些基本的設定架構與指令,你可以透過指令或設定檔預先設定想使用的 DNS 位址。若搭配 ifupdwon 使用,只需更改 /etc/network/interfaces 如

# The primary network interface
allow-hotplug eth1
iface eth1 inet dhcp
dns-nameservers 168.95.1.1 168.192.1.1
dns-search google.com debian.org

這是一篇 Tip.

某些原因你可能會想更改你的 MAC Address,像是你的 ISP/宿網只允許你使用註冊的 MAC Address 上網時。

若你使用 Debian GNU/Linux ,可以修改 /etc/network/interfaces 中的設定,在你的網路卡設定中加入如下參數

# The primary network interface
allow-hotplug eth1
iface eth1 inet dhcp
    hwaddress ether 00:05:9b:c5:5b:68

如此 ifupdown 便會在帶起網路時,一併更改地址為上述指定之 00:05:9b:c5:5b:68. 若你純粹想幹壞事,可以安裝 macchanger 來臨時亂數更改 MAC Address,改法如下

# The primary network interface
allow-hotplug eth1
auto eth1
iface eth1 inet dhcp
    pre-up macchanger -A eth1

文件請參考 interface(5). 對了,若你想更改是 madwifi 驅動之無線網路卡介面,請記得在開啟 VAP 前對 master device 進行 MAC Address 更改

這是一篇 Tip.