2013年11月10日 星期日

HDMI轉VGA 影像轉換線-開箱測試和惡劣賣家買賣心得文



整理家中發現了一台螢幕,就想說,我可以拿來做什麼呢? 突然意識到,最近想要使用雙螢幕,覺得這樣做事情,比較有效率。
我在家裡,還是用一台24吋DVI的螢幕,在做事情,而剛好我也有一台閒置的19吋螢幕,放著有一段時間了。

因為在上班的地方,我也一直使用雙螢幕,已經有好幾年了。

因此我想了,好幾種方式,可以達到.

第一種: HDMI轉VGA
第二種: Displayport轉VGA
第三種: USB轉VGA

考量之後,覺得以下.

第一種: HDMI轉VGA  
 (推出時間很久了,這應該是很成熟的東西了,價格也還好,重點是現在有很多HDMI的產品,考量未來的通用性,這比較會是好選擇。)

第二種: Displayport轉VGA   
(覺得有點怕怕的,Displayport,雖然這很有前景,但我沒有任何相關的產品。)

第三種: USBVGA  
(費用頗高,且要考量主機效能的問題,Displayport,雖然大部分的主機,都有USB,但考量價格,我放棄了。)

我的主機配置:

Benq G2410HD (使用原廠附的正常長度的VGA線,使用FullHD test: 1920x1080)
CPU: Intel Xeon E3-1230 V2
Display card: 微星 R7770-2PMD1GD5/OC (因此輸出是 DPx2 , HDMIx1, VGAx1)
MB: H77 Pro4/MVP - ASRock


結論是: 我買了HDMI轉VGA .

---------------------但我遇到惡劣賣家,索性將我遇到的痛苦,利用測試來客觀發表使用經驗文,分享給需要用此產品的人,不要跟我一樣買到如此地雷的商品-------------------------
透過比較測試法,來比較以下兩個商品.
1. 露天買的無良,HDMI轉VGA 影像轉換線:
2. i-gota HDMI轉VGA 影像轉換線

惡劣賣家商品:





結果:
我們來看圖說故事.



靠~,這是什麼爛東西,一開始使用幾個小時,使用是不會有問題的,但持續開機到隔天早上,我就發現,螢幕有變偏綠的情形,我心知不妙了,這產品有問題

開著主機,放到隔天早上,你就可以看到這種偏綠色的畫面,顯然這是耐久性,穩定性不良的產品。

但因為我有接Aten KVM,我擔心賣家,會推卸責任,為了要釐清問題,因此我從顯示卡到螢幕之間不要任何的轉接線之類的。
單純化,我才能大膽的說,這是產品的問題,結果: 果不其然,狀況又發生了,只要時間放久一點,這個轉換線,就開始運作不穩定了。


我開始向露天的一個賣場" lizun7776的賣場"  http://class.ruten.com.tw/user/index00.php?s=lizun7776,說明產品有問題,我說妳們有沒有別牌比較好的轉換線,我要換,或者退貨一途。


結果賣家開始如預期的 推卸責任"(原型畢露?)"。
-----------------------
回我: "偏綠色畫面通常為vga線線材不良或過長所致(因本品無訊號放大功能,前述線材狀況會導致訊號減弱

露天會員lizun7776"
----------------------

我反應  長時間(指數年,線材老化)使用才會有訊號減弱 的問題,明顯就是不穩定導致畫面不良。
若是線材狀況不良,一開始就會有會有問題。

---
我請賣家,只要測試24小時,就能看到結果了。(實際上根本不需要24小時,很快就能遇到,說24小時只是籠統的講法,因為我也不可能,都在電腦面前呀,我根本不知道,何時故障的,因此我只能說24小時內,一定會發生偏綠色和畫面不良的問題)。

這位賣家最後還跟我講,哪有人主機開那麼久,看螢幕四小時就脫窗了,( 內心OS: 她是笨蛋嗎?) 我說Server是不關機的,總之她又開始亂扯了,說沒人一直看螢幕的。....Orz

我跟這位專業度不足的惡劣賣家,細節我們後面再說。 因為氣到去PCHOME 24小時購買另一個。

我要用同樣的硬體,同樣的線材,同樣的環境去做一樣的測試。


----------------------
接著賣家"露天會員lizun7776",像是鬼打牆般的, 一再的跟我扯線材問題,若是線材有問題,一開始就會有問題。因為線材內阻是固定的,不會忽大忽小,造成訊號衰減。(PS.我確定我的線材沒有問題。但我口說無憑,下面我利用測試使用另一個產品提出證據。)

以下是這個爛商品的構造,和使用的晶片。 小心不要買到。


這個東西結構簡單,只要解開螺絲,就能無損拆開來。
查看晶片是  Lontium LT8511A



接著介紹另一個主角
用同樣的硬體,同樣的線材,同樣的環境去做一樣的測試。


 i-gota HDMI轉VGA 影像轉換線



結果: 

畫面是好的。ok ,我知道這樣還不夠,我又另外放置到隔天早上,甚至超過24小時,都沒有變成偏綠色的情形。
拆開後,很奇怪,同樣的晶片,不同的結果,不知道是不是山寨?



媽的~  無良賣家,你在繼續扯呀。
同樣的東西,同樣的測試,就只有你的會變成偏綠色。




--------退貨-------------痛苦的來了-------------------------
露天的一個賣場" lizun7776的賣場"  http://class.ruten.com.tw/user/index00.php?s=lizun7776
HDMI轉VGA,收到時間是2013/10/15 。

我開始向賣家"lizun7776的賣場",說明產品有問題,我說妳們有沒有品質比較好轉換線,我要換,或者退貨一途。

當一說退貨,就開始酸言酸語起來了,然後東扯西扯的,然後又說我"鑑賞非等於試用"退貨乙節歉難辦理.

還說我使用超過七日

收到時間是2013/10/15
表達退貨時間是2013/10/19
郵局寄回2013/10/21
賣家已領貨2013/10/22
扣掉禮拜六日,這兩天郵局休息不能退。

我實際使用只有四天(15~19)


這惡劣賣家竟然說我使用七天,怎麼會有這麼離譜的賣家,惡劣到極點。

最後她終於退錢了,但我也元氣大傷,花這麼多時間,只是希望,其他買家不要步入我的後塵,對我是小錢,賠時間才是大事,最虧的就是時間。

以上所言,句句事實,若有不實,我願意受法律制裁。(我都賭這麼大了)



附上 露天悄悄話,完整細節。除了敏感資訊,無任何刪除修改。(我有抓圖,不過我還是用文字的方式,做複製貼上。)

==============================================================
對象時間內容
買家2013/10/19 00:02品質不良-HDMI轉VGA 影像轉換線
在特定情況,會出現偏綠色畫面,已經發生數次。

請問你還有別牌,品質比較好的"HDMI轉VGA 影像轉換線"嗎?

若沒有,我要退貨。露天會員tavimi2
惡劣賣家 2013-10-19 00:05:55偏綠色畫面通常為vga線線材不良或過長所致(因本品無訊號放大功能,前述線材狀況會導致訊號減弱

露天會員lizun7776
買家2013/10/19 10:13不是這樣,我另一個HDMI轉VGA 影像轉換線,不會有這樣的問題。

長時間使用才會有訊號減弱 的問題,明顯就是不穩定倒置畫面不良。
若是線材狀況不良,一開始就會有會有問題。

露天會員tavimi2
惡劣賣家 2013-10-19 10:23:42很遺憾您的見解如此,請換一條vga線應即可改善,如未能確認非自已本身配件(包含 vga線、訊源、螢幕)無誤,如發回時經賣場檢測(以ps3配合 full hd螢幕檢測)無誤賣場將原物寄還。

露天會員lizun7776
買家2013/10/19 11:54我的電腦是不關機的,長時間使用問題就會發生。

這是產品不穩定導致,我們用LINE來聊可以嗎? 避免浪費時間在這裡用"悄悄話"

露天會員tavimi2
惡劣賣家 2013-10-19 17:10:05您的電腦?本品為標準hdmi訊號轉換,大大如堅稱為本品之問題非自身設備的問題,可附回郵40元寄回賣場檢測,如確認為大大所稱之問題,賣場會換新予您,但如無大大所稱情形,原物將寄回予您,希望您已用其他設備測試過(如標準hdmi訊號與fullhd螢幕),寄回時務請保持配件外觀無損以便判別
姓名:胡X君
住址:403台中大全街郵局(台中xxx支)(存局侯領)
tel:09762x13xx
務寫存局侯領

露天會員lizun7776
買家2013/10/21 10:29我已經另外買一個"HDMI轉VGA 影像轉換線",經過長時間測試(使用原來的螢幕和線材),已經證實你的商品不穩定了,我將會寄回給你,請你辦理退貨事宜。

露天會員tavimi2
惡劣賣家2013/10/21 11:32「鑑賞非等於試用,如有試用需求者,請移駕他賣家購買。如有不明者請先由問與答確認後再下標」為商品首頁言明。商品如確實有問題可換貨,如係因買家個人之因素確定商品無誤則退回,退貨乙節歉難辦理。

露天會員lizun7776
買家2013/10/21 12:15東西確認有問題,我會寄還給你確認,我並非試用,是確定要買,但是你的東西品質不良,和不良的態度,我是完全不能接受的 若我所說並非事實,我願意接受一切法律責任。賣家在搞不清楚狀況下,就開始推諉,浪費我太多時間,我是學電子的,也是學過測試的,從一開始,我就可以從經驗判斷,這東西穩定性是有問題的,影像轉換線可以顯示畫面,不代表東西,就是好的,當這東西經過長時間測試,就可以知道它的耐久性有問題。 為了證實這點,(急用因此我轉往PCHOME 24小時購買)我還另外買了另一家品牌,比較測試,在同樣的條件下,同樣的FullHD螢幕、訊源和線材,就沒有變成偏綠色的情形。 我有絕對的信心,因此我會要求退貨,(從你一開始的消極推諉的態度,我就知道)我沒有時間慢慢的等你換貨,,不但如此,我會要求全額退費,並且要求補貼郵資。若你不退,這東西沒多少錢,我虧得起,我會不計任何代價積極處理。

露天會員tavimi2
惡劣賣家2013/10/21 13:01這東西沒多少錢,我虧得起,退吧。「謝謝您的檢驥」

露天會員lizun7776
買家2013/10/22 01:46已寄回,請查收。
永豐銀行代號:807
帳號: *****************

郵費: $40
總共是$258+$40=$298

露天會員tavimi2
惡劣賣家2013/10/22 08:18幸虧您搭計程車的費用沒算!請給予寄件號碼以便領件。

露天會員lizun7776
買家 2013-10-22 13:36:02不用客氣,怕你虧不起。
掛號函件執據 第949130 400043 10 40300 1 號

露天會員tavimi2
惡劣賣家2013/10/22 14:00已領,目前已測試至2小時,尚無任何異常!

露天會員lizun7776
買家2013/10/22 20:10短時間是不會有問題的,你只要放24小時,不關機,就知道了。

露天會員tavimi2
惡劣賣家2013/10/22 20:02整整4小時完測,無任何畫面不良問題,退款10/28退還,如未收到請以悄悄話告知。

露天會員lizun7776
買家2013/10/24 01:40才測4小時,這樣也敢叫做測試。這麼對你的商品沒信心,是不敢看到這個事實嗎?品質不好就不要害別人好嗎?
跟錢無關,就算是你只賣100元,這麼沒穩定性,也只是垃圾。 東西收到了,就該轉帳給我,這沒甚麼好拖時間的吧。 不過就是網路轉帳而已,何必等10/28。

露天會員tavimi2
惡劣賣家2013/10/22 20:17這樣還短哦,眼睛都快脫窗了,218元還要測24小時哦!無能作您的生恴。

露天會員lizun7776
買家2013/10/24 17:59沒有人會24小時看的畫面,但有時電腦會需要放到隔天的時候,如下載檔案或是server(伺服器是不關機的)使用。 你的螢幕若有省電功能,他自己可以進入省電模式,若沒有省電功能,你可以自己關掉螢幕,來達到省電的目的。 但是你的連接線,因為接著電腦,所以呈現通電的狀態,也就是說,連接線仍然持續的運作,你只要睡覺前放著到隔天,這時你動個滑鼠或開螢幕看畫面,你就會看到問題,實際上我的測試,不用到24小時,此商品就開始變綠色,或畫質抖動。
這不是雞蛋專挑骨頭,在正常使用電腦下,這個情形是非常常見的。 我們無冤無仇,也不認識,更不是找碴,從一開始也沒有對你戴著惡意,但是你一開始,態度惡劣,回覆上盡是酸言酸語。

你說的 "您將賣家的東西玩了近七日"你去查回覆時間吧,不到七日,就跟你回覆東西耐久性有問題。 品質不好的東西,有啥好玩的。

你說的"挑盡毛病,又拒絕換貨",我沒有挑,第一天,我就發現問題了,超容易就發現了,我根本就不需要挑。
我傳Line給你,也在悄悄話,告訴你想跟你直接溝通說明,讓你了解,避免使用悄悄話浪費時間,你也不回。
拒絕換貨是你根本不知道問題出在哪裡,一再的跟我講線材,若是線材有問題,一開始就會有問題。因為線材內阻是固定的,不會忽大忽小,造成訊號衰減。就像現在,你還是找不出問題,你就算換了一百條,也還是一樣的結果。那不是更加耗時嗎? 還記得嗎? 我買了另一條,跟你一樣的東西,他就不會有這樣的狀況。

露天會員tavimi2
惡劣賣家2013/10/24 07:00不是不測24 小時,只是就算測了,怕賣家也無法24 小時時時緊釘畫面( 怕睡著), 賣家不是專挑骨頭的人,近百人買家也不是,您將賣家的東西玩了近七日,挑盡毛病,又拒絕換貨,賣場還願退您,28日退款相對應不致太久,還請見察。

露天會員lizun7776
惡劣賣家2013-10-24 17:13:33既急則退。
298已退
未五碼:xx507

露天會員lizun7776

2013年10月14日 星期一

基礎英文文法-《動詞時態--現在簡單式》

現在簡單式現在簡單式,又稱現在式
通常用於下列狀況

1. 表示現在的事實或狀態
example: I live in Taiwan.
                She is a high school student.

2. 表示現在的習慣或固定會做的事情example: They go to school everyday.
                I brush my teeth in the morning.

3. 表示事實、格言或不變的真理
example: It is hot in summer.
                 Time is money.
                 

動詞變化在現在簡單式中
動詞的使用上有些許的變化
Be動詞就是跟著人稱加上am, are, is
而一般動詞則是在主詞是第一人稱、第二人稱、及複數的時候加上原形動詞
但若遇上第三人稱單數現在式同時出現(俗稱三單現)
就必須要把動詞作一些修改 
(與名詞單數變複數的規則大致相同)

一般直接字尾加srun -- runs
jump -- jumps
hope -- hopes

o,x,s,ch,sh,z結尾的字加esdo -- does
fix -- fixes
watch -- watches
wash -- washes
buzz -- buzzes
pass -- passes

子音+y結尾的字去y加iesstudy -- studies
fly -- flies


三單現在使用上很容易被忽略
所以要特別小心!
example: He runs very fast. (他跑步很快) 主詞(he)符合第三人稱單數、跑步很快是事實,所以又符合現在式的條件, 所以動詞需改成三單現的型態。                 My sister visits my grandparents in summer.(我妹妹在夏天拜訪我的祖父母) 主詞(my sister) 符合第三人稱單數、在夏天拜訪我的祖父母是固定的習慣,所以又符合現在式的條件, 所以動詞需改成三單現的型態。
                 Mom washes my clothes everyday. (媽媽每天都洗我的衣服) 主詞(mom)符合第三人稱單數、每天都洗我的衣服是固定的習慣,所以又符合現在式的條件, 所以動詞需改成三單現的型態。                 Tim does his homework in the evening. (提姆在傍晚做作業)主詞(Tim)符合第三人稱單數、在傍晚做作業是固定的習慣,所以又符合現在式的條件, 所以動詞需改成三單現的型態。

2013年7月18日 星期四

Linux系統下超級終端Minicom的使用方法

Linux下的Minicom的功能與Windows下的超級終端功能相似,適於在linux通過超級終端對嵌入式設備的管理以及對嵌入操作系統的升級,現寫出Minicom的使用手冊

Linux下的超級終端Minicom的使用手冊

  Linux下的Minicom的功能與Windows下的超級終端功能相似,適於在Linux通過超級終端對嵌入式設備的管理以及對嵌入操作系統的升級,現寫出Minicom的使用手冊

  配置Minicom和使用Minicom

  1.啟動Minicom

  以root權限登錄系統

  使用命令

  root –s則Minicom啟動,屏幕出現如下的界面|:

  ……………[configuration]……………………………………

  …… Filename and paths ………………………

  …… File transfer and protocols ………………

  …… Serial port setup …………………

  …… Modem and dialing …………………………

  …… Screen and keyboard …………

  …… Save setup as df1 …………………

  …… Save setup as…… …………………………

  …… Exit …………………………

  …… Exit from Minicom …………………………

  ………………………………

  2.設置serial port setup

  使用down箭頭選擇serial port setup,出現具體各選項的配置:

  A — Serial Device : /dev/ttyS0

  B — lockfile Location : /var/lock

  C — Calling Program :

  D — Callout Program:

  E — Bps/par/Bits : 9600 8N1

  F — Hardware Flow Control : YES

  G — Software Flow Control : NO

  Change with setting?

  將選項A的值設置為/dev/ttyS0 表示是串口1。

  將選項E的值設置為9600。

  設置過程中命令的使用,例如需要修改選項A的值,在Change with setting?選項後輸入A則光標轉移到A選項後,可以對A選項的值進行修改。

  3.設置Modem and dialing

  使用方向箭頭選中modem and dialing 項,則修改modem and dialing 選項中的配置項。

  需要修改的是去掉

   A — initing string ……:

   B — Reset string ……:

  K — Hang-up string ……三個配置項。

  4.選擇Save as df1

  選擇Save as df1選項將修改後的配置信息進行保存為默認的配置選項。

  5.Exit from Minicom

  選擇Exit from Minicom選項從配置菜單返回到命令行。

  6.重新啟動Minicom

  使用Minicom啟動Minicom在Linux下通過串口連接路由器,實現超級終端的功能。

2013年6月18日 星期二

Mounting a hard disk image including partitions using Linux


Mounting a hard disk image including partitions using Linux


A while ago I thought it would be a good idea to make a backup of my Linux server by just dumping the complete disk to a file. In retrospect, it would have been much easier had I just dumped the individual filesystems.
When I finally got around to using this backup, long after the 10GB disk had perished I realized that to use the loopback device to mount a filesystem it actually needs a filesystem to mount. What I had was a disk image, including partition table and individual partitions. To further complicate matters the data partition was also not the first partition inside this image.
For reference, I created this image using the Unix ‘dd’ tool:
# dd if=/dev/hda of=hda.img
30544113+0 records in
30544113+0 records out
# ls -lh
-rw-r--r-- 1 root    root  9.6G 2008-01-22 14:12 hda.img
I followed the instructions on http://www.trekweb.com/~jasonb/articles/linux_loopback.html to try and mount the partitions inside the disk image, but ran into two problems.
To mount a partition inside the disk image you need to calculate the offset of where the partition starts. You can use fdisk to show this information to you, but you need to specify the number of cylinders if you are using a disk image.
You then also need to multiply the start and end numbers with the calculated sectors to get a byte offset.
I found another tool more useful for this task, called parted. If you are using Ubuntu, you can install it with ‘apt-get install parted’
# parted hda.img
GNU Parted 1.7.1
Using /data/rabbit/disk_image/test2
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit
Unit?  [compact]? B
(parted) print
Disk /data/rabbit/disk_image/test2: 10262568959B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number  Start        End           Size         Type     File system  Flags
1      32256B       106928639B    106896384B   primary  ext3         boot
2      106928640B   1184440319B   1077511680B  primary  linux-swap
3      1184440320B  10256924159B  9072483840B  primary  ext3
(parted) quit
Now we have the offsets and we can use those to mount the filesystems using the loopback device:
#mount -o loop,ro,offset=32256 hda.img /mnt/rabbit
That mounted the first partition, the ‘boot’ partition, but this didn’t have the data on it that I was looking for. Lets try to mount partition number 3.
#umount /mnt/rabbit
#mount -o loop,ro,offset=1184440320 test2 /mnt/rabbit
#mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail  or so
Oops, that doesn’t look right. According the article referred to above if you are using a util-linux below v2.12b then you cannot specify an offset higher than 32bits. I’m using util-inux 2.13 which shouldn’t have that problem, and besides, my offset is well below the 32bit limit.
The article also offers an alternative loopback implementation that supports mounting partitions within an image, but that requires patching and recompiling your kernel which I would rather not do.
Instead I decided to extra ct the filesystem from the image which would then allow me to mount it without specifying an offset.
Doing this is quite straightforward with ‘dd’. You need to give ‘dd’ a skip count, or, how far into the source to start copying, and a count, how much to copy.
Here you can either use the single byte offsets retrieved with parted or divide them by 512 and let ‘dd’ use 512 byte blocks. Copying just one byte at a time takes a very long time, so I suggest using a larger block size.
Here is the command I used to extract my filesystem. Skip is 2313360 (1184440320/512) and Count is 17719695 (9072483840/4)
#dd if=hda.img of=hda3.img bs=512 skip=2313360 count=17719695
17719695+0 records in
17719695+0 records out
9072483840 bytes (9.1 GB) copied, 485.679 seconds, 18.7 MB/s
After extracting the filesystem I was able to mount it without any problems.
# mount -o loop hda3.img /mnt/rabbit/
# df -h /mnt/rabbit
Filesystem            Size  Used Avail Use% Mounted on
/data/rabbit/image/hda3.img
8.4G  6.3G  1.7G  80% /mnt/rabbit

Loop-mounting partitions from a disk image

Loop-mounting partitions from a disk image
Update: it seems that kpartx pretty much does all of the below. Thanks to Faidon Liambotis for the pointer.
Every now and then, I have a disk image (as produced by catpv, or dd) and I need to access separate partitions. Unfortunately, the patch allowing partitions on loop devices to be accessed via their own device nodes does not appear to be in the latest (Debian) 2.6.18 kernels — the loop module does not have a max_part parameter, according to modinfo.
So this time I sat down to come up with a recipe on how to access the partitions, and after some arithmetic and much swearing at disk manufacturers, and especially the designers of the msdos partition table type, I think I have found the solution, and the urge to document it for posterity.
It's all about the -o parameter to losetup, which specifies how many bytes into the disk a given partition starts. Getting this number isn't straight forward. Well, it is, if you know how, which is why I am writing this.
Let's take a look at a partition table, with sectors as units:
$ /sbin/fdisk -lu disk.img
You must set cylinders.
You can do this from the extra functions menu.

Disk disk.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes

      Device Boot      Start         End      Blocks   Id  System
disk.imgp1   *          63       96389       48163+  83  Linux
disk.imgp2           96390     2056319      979965   82  Linux swap / Solaris
disk.imgp3         2056320    78140159    38041920    5  Extended
disk.imgp5         2056383     3052349      497983+  83  Linux
disk.imgp6         3052413    10859939     3903763+  83  Linux
disk.imgp7        10860003    68372639    28756318+  83  Linux
disk.imgp8        68372703    76180229     3903763+  83  Linux
disk.imgp9        76180293    78140159      979933+  83  Linux

The first few lines is fdisk complaining not being able to extract the number of cylinders, since it has to operate on a file which does not provide an ioctl interface.
The first important data are the units, which are stated to be 512 bytes per sector. We take note of this value as the factor for use in the next operation.
Let's say we want to access the 7th partition, which is 10860003 sectors into the disk, according to the fdisk output. We know that each sector is 512 bytes, so:
10860003 * 512 = 5560321536

Passing this number to losetup produces the desired result:
# losetup /dev/loop0 disk.img -o $((10860003 * 512))
# file -s /dev/loop0
/dev/loop0: Linux rev 1.0 ext3 filesystem data
# mount /dev/loop0 /mnt
[...]
# umount /mnt
# losetup -d /dev/loop0

If the partition really holds a normal filesystem, you can also let mount set up the loop device, and manage it automatically:
# mount -o loop,offset=$((10860003 * 512)) disk.img /mnt
[...]
# umount /mnt

And since there's aparently no means to automate the whole process for an entire disk, I hacked up plosetup. Enjoy:
# plosetup lapse.hda .
I: partition 1 of lapse.hda will become ./lapse.hda_p1 (/dev/loop0)...
I: plosetup: skipping partition 2 of type 82...
I: plosetup: skipping partition 3 of type 5...
I: partition 5 of lapse.hda will become ./lapse.hda_p5 (/dev/loop1)...
I: partition 6 of lapse.hda will become ./lapse.hda_p6 (/dev/loop2)...
I: partition 7 of lapse.hda will become ./lapse.hda_p7 (/dev/loop3)...
I: partition 8 of lapse.hda will become ./lapse.hda_p8 (/dev/loop4)...
I: partition 9 of lapse.hda will become ./lapse.hda_p9 (/dev/loop5)...
# ls -l
total 0
lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p1 -> /dev/loop0
lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p5 -> /dev/loop1
lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p6 -> /dev/loop2
lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p7 -> /dev/loop3
lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p8 -> /dev/loop4
lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p9 -> /dev/loop5
# plosetup -c .
# ls -l
total 0

(this post is dedicated to Penny for no other reason than the tunes I am listening to right now)
NP: Fly My Pretties / The Return of Fly My Pretties
Update: Be careful about the $((...)) style arithmetic. dash manages to overflow at 32bit. zsh and bash seem to get it right. If in doubt, use perl or a calculator.

2013年5月17日 星期五

系統與VIM語系 切換英文/中文顯示



文字終端機改以UTF-8顯示。

[root@www ~]# LANG=zh_TW.big5 ---> zh_TW.UTF-8



------------------------------------------------------
文字終端機亂碼問題:
 #vi /etc/sysconfig/i18n裡的 LC_TIME 改成 LC_TIME=en


-------------------------------------------------------
或者直接切換英文進入VIM
[root@wcentos64 ~]# LANGUAGE=en vim
-------------------------------------------------------


改變redhat語系 
修改 /etc/sysconfig/i18n 文件,如 
LANG="en_US"xwindow會顯示英文界面, 
LANG="zh_CN.GB18030"xwindow會顯示中文界面。 
另一種方法 
cp /etc/sysconfig/i18n $HOME/.i18n
修改 $HOME/.i18n 文件,如 
LANG="en_US"xwindow會顯示英文界面, 
LANG="zh_CN.GB18030"xwindow會顯示中文界面。 
這樣就可以改個人介面,不會影響到其他人。 

-------------------------------------------------------------------
Vim有無顯示顏色 
首先確保安装了vim-enhanced,然後 vi ~/.vimrc; 如果有syntax on,則顯示 
颜色,syntax off,不顯示颜色 

語系檔案的變數 (locale)
locale 的定義:
LANG 主語言的環境
LCALL 指定所有的 Locale
LCCTYPE 字元定義 (包含字元分類與轉換規則)
LCMESSAGES 訊息顯示
LCTIME 時間格式
LCNUMERIC 數字格式
LCMONETARY 貨幣格式
LCCOLLATE 字母順序與特殊字元比較



系統語系設定:/etc/sysconfig/i18n 
國際化(Internationalization)被縮寫為 i18n,即只取首尾兩個字母,中間字母為18個。

-----------------------------
Linux distributions 可支援的語系,可以指令 locale 查詢: 
[root@dywOffice ~]# locale -a
en_AU
en_AU.ISO-8859-1
en_AU.UTF-8
en_GB
en_GB.ISO-8859-1
en_GB.UTF-8
en_US
en_US.ISO-8859-1
en_US.UTF-8
ISO-8859-1
ISO-8859-10
zh_CN.GB18030
zh_CN.GB2312
zh_CN.GBK
zh_CN.UTF-8
zh_HK.GB18030
zh_HK.UTF-8
zh_TW
zh_TW.Big5
zh_TW.UTF-8



Centos 最小化安裝後安裝GNOME桌面環境


默認最小化安裝,或者因爲需要,在安裝系統的時候沒有安裝桌面組建,現在開始安裝桌面環境
以centos6爲例,有點小差別,其他系統請參照yum grouplist查找相關組建
1.顯示系統已經安裝的組件和可以安裝的組件: 
#yum grouplist 
2.如果系統安裝之初採用最小化安裝沒有安裝xwindow
#yum groupinstall "X Window System" 
3.安裝GNOME桌面環境 yum groupinstall "GNOME Desktop Environment"  
4.安裝KDE桌面環境 yum groupinstall "KDE (K Desktop Environment)" 
5.卸載GNOME桌面環境 yum groupremove "GNOME Desktop Environment" 
6.卸載KDE桌面環境 yum groupremove "KDE (K Desktop Environment)" 
kde安裝 1 2 4  
Centos 6.3 安裝GNOME桌面環境 yum groupinstall "Desktop"  (在yum grouplist查找相關組建)
開機爲文本界面,由文本界面切換到圖形界面
方法1:運行命令 
 #startx  需要先配置圖形界面信息     
方法2:修改/etc/inittab文件中的
  id:3:initdefault  將3改爲5  重新啓動系統
 方法3:進入圖形界面  init 5  從圖形界面進入文本界面 init 3  重啓 init 6 

------------------------or-------------------
Command代碼  收藏代碼
  1. # yum groupinstall  "X Window System"  "GNOME Desktop Environment"  

由於初始化安裝用的最小化安裝包,沒有桌面環境。但是又急切需要一些桌面的工具,第一次用yum install gnome-session,安裝好之後,竟然不能初始化桌面環境。

無奈搜索搜索,找到了這個方法,記錄一下!

安裝完成之後,
Command代碼  收藏代碼
  1. #init  5  
 就可以初始化桌面了





2013年4月30日 星期二

How do I check and configure serial ports under Linux?



How do I check and configure serial ports under Linux for various purposes such as modem, connecting null modems or connect a dumb terminal?

Linux offers various tools. Linux uses ttySx for a serial port device name. For example, COM1 (DOS/Windows name) is ttyS0, COM2 is ttyS1 and so on.

Task: Display Detected System's Serial Support

Simple run dmesg command
$ dmesg | grep tty
Output:
[   37.531286] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[   37.531841] 00:0b: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[   37.532138] 0000:04:00.3: ttyS1 at I/O 0x1020 (irq = 18) is a 16550A

setserial command

setserial is a program designed to set and/or report the configuration information associated with a serial port. This information includes what I/O port and IRQ a particular serial port is using, and whether or not the break key should be interpreted as the Secure Attention Key, and so on. Just type the following command:
$ setserial -g /dev/ttyS[0123]
Output:
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x1020, IRQ: 18
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
setserial with -g option help to find out what physical serial ports your Linux box has.

Linux serial console programs

Once serial ports identified you can configure Linux box using various utilities:
  1. minicom- The best friendly serial communication program for controlling modems and connecting to dump devices
  2. wvidial or other GUI dial up networking program - a PPP dialer with built-in intelligence.
  3. getty / agetty - agetty opens a tty port, prompts for a login name and invokes the /bin/login command.
  4. grub / lilo configuration - To configure serial port as the system console

[GPO] 在Microsoft Active Directory (AD) 網域環境,新增Microsoft Edge群組原則管理

[GPO]  在 Microsoft Active Directory (AD) 網域環境, 新增Microsoft Edge群組原則管理 在還沒有被微軟強迫使用Edge前,對於一些老舊的網站,還可以使用IE。 因此在公司環境,之前有為IE和google chrome,寫入配合的...