Linux的電腦名稱也就是hostname
取得太長會讓Console的畫面空間變少
1. 暫時性的修改:
$ hostname NEW_HOSTNAME
或者
$ sysctl kernel.hostname=NEW_HOSTNAME
2. 永久修改
$ vi /etc/hostname
$ /etc/init.d/hostname.sh start
2016年5月18日 星期三
2016年5月17日 星期二
Ubuntu 16.04禁用UTC
$ sudo timedatectl set-local-rtc 1
禁用UTC讓Ubuntu與Windows時間同步
$ timedatectl
Local time: 二 2016-05-17 16:05:12 CST
Universal time: 二 2016-05-17 08:05:12 UTC
RTC time: 二 2016-05-17 16:05:12
Time zone: Asia/Taipei (CST, +0800)
Network time on: yes
NTP synchronized: no
RTC in local TZ: yes
Warning: The system is configured to read the RTC time in the local time zone.
This mode can not be fully supported. It will create various problems
with time zone changes and daylight saving time adjustments. The RTC
time is never updated, it relies on external facilities to maintain it.
If at all possible, use RTC in UTC by calling
'timedatectl set-local-rtc 0'.
禁用UTC讓Ubuntu與Windows時間同步
$ timedatectl
Local time: 二 2016-05-17 16:05:12 CST
Universal time: 二 2016-05-17 08:05:12 UTC
RTC time: 二 2016-05-17 16:05:12
Time zone: Asia/Taipei (CST, +0800)
Network time on: yes
NTP synchronized: no
RTC in local TZ: yes
Warning: The system is configured to read the RTC time in the local time zone.
This mode can not be fully supported. It will create various problems
with time zone changes and daylight saving time adjustments. The RTC
time is never updated, it relies on external facilities to maintain it.
If at all possible, use RTC in UTC by calling
'timedatectl set-local-rtc 0'.
2016年5月9日 星期一
dmesg使用方法
dmesg是用來讀取開機時Kernel顯示的硬體資訊,紀錄一下常用的使用方式。
(開機訊息亦保存在/var/log目錄中,名稱為dmesg的文件)
# dmesg | more
分頁顯示所有資訊
# dmesg -c
清除 dmesg buffer
# dmesg | grep -i usb
# dmesg | grep -i tty
# dmesg | grep -i memory
# dmesg | grep -i dma
(開機訊息亦保存在/var/log目錄中,名稱為dmesg的文件)
# dmesg | more
分頁顯示所有資訊
# dmesg -c
清除 dmesg buffer
# dmesg | grep -i usb
# dmesg | grep -i tty
# dmesg | grep -i memory
# dmesg | grep -i dma
Linux下查詢serial console指令
$ dmesg | grep tty
[ 0.000000] console [tty0] enabled
[ 12.903931] 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 12.924451] 00:06: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
$ ls -l /dev/ttyS0
crw-rw---- 1 root dialout 188, 0 5月 10 11:55 /dev/ttyS0
要加入 dialout group (修改 /etc/group)。然後就可正常使用tty。
***
查詢USB裝置:lsusb 或 lsusb -v
查詢裝置插入Log:tail /var/log/syslog
[ 0.000000] console [tty0] enabled
[ 12.903931] 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 12.924451] 00:06: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
$ ls -l /dev/ttyS0
crw-rw---- 1 root dialout 188, 0 5月 10 11:55 /dev/ttyS0
要加入 dialout group (修改 /etc/group)。然後就可正常使用tty。
***
查詢USB裝置:lsusb 或 lsusb -v
查詢裝置插入Log:tail /var/log/syslog
訂閱:
文章 (Atom)
Uninstalling HEVC Video Extensions from Windows
Microsoft store packages are usually APPX format installations (HEVC Video Extensions is installed as APPX package) You will need to use Pow...
-
C(和C++)中的巨集(Macro)屬於編譯器預處理的範疇。 下面對常遇到的巨集的使用問題做了簡單總結。 單井號(#)和雙井號(##) (#)的功能是將其後面的巨集引數進行字串化操作(Stringfication): #define WARN_IF(EXP) / ...
-
$ dmesg | grep tty [ 0.000000] console [tty0] enabled [ 12.903931] 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550...
-
dmesg是用來讀取開機時Kernel顯示的硬體資訊,紀錄一下常用的使用方式。 (開機訊息亦保存在/var/log目錄中,名稱為dmesg的文件) # dmesg | more 分頁顯示所有資訊 # dmesg -c 清除 dmesg buffer # dmes...