Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, February 11, 2015

Linux I2C Driver

 

linux-source/Documentation/i2c/ has lot of the information you'd need. .../writing-clients.txt is a good place to start.

Have a look at the online version:

https://www.kernel.org/doc/Documentation/i2c/writing-clients

There is an okay sort of a tutorial at:

http://renjucnair.blogspot.ca/2012/01/writing-i2c-client-driver.html

Here is a good commentary on someone writing an i2c driver and has a tutorial feel to it:

http://www.embedded-bits.co.uk/2009/i2c-in-the-2632-linux-kernel/

Here is some sample code:

http://code.google.com/p/ldd-templates/source/browse/drivers/i2c/sample-i2c-client.c

Reference

http://stackoverflow.com/questions/16728587/i2c-driver-in-linux

Friday, December 19, 2014

linux command – grep

 

 

dmesg | grep -i usb

[option]

“-i” ignore the case.

cat /var/log/dmesg | less

 

 

Reference

http://manpages.ubuntu.com/manpages/utopic/man1/dmesg.1.html

Friday, November 7, 2014

Saturday, November 5, 2011

problem of apt-get install


E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

rm /var/lib/dpkg/lock
rm /var/cache/apt/archives/lock
sudo dpkg --configure -a


Reference
http://www.linuxquestions.org/questions/linux-newbie-8/e-could-not-get-lock-var-lib-dpkg-lock-open-11-resource-temporarily-unavailable-360554/

Apache in linux Ubuntu(2)

403 Forbidden
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>



權限問題
drwx------

chmod 707

Reference 
http://ubuntuforums.org/archive/index.php/t-763605.html
http://linux.vbird.org/linux_basic/0210filepermission.php
http://klaus580925.pixnet.net/blog/post/28185261-%5B伺服器的背叛%5D---解決-apache-的-403-forbidden-問

Apache in linux Ubuntu(1)


root@chihhang-desktop:/etc# ./init.d/apache2 restart

Error message 
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
   ...done.
Solve
   vi /etc/apache2/httpd.conf
ServerName localhost 

http://plus-now.com/?p=4

Successful message
 * Restarting web server apache2
 ... waiting    ...done.


Sunday, October 16, 2011

vi in Linux

W. 上下右左會出現ABCD in the insert mode
vi ~/.vimrcset nocompatible
Q. It doesn't work with MacVim (and GUI Vim). I'm only able to delete text from the line I'm in. If I switch to normal mode or if I move the cursor to another line I'm not able to delete text with backspace anymore and I have to delete it with 'x' in normal mode. 
set backspace+=indent,eol,start set backspace=2 
Q. color for c language
:syntax on 
Q. disconnection
ServerAliveInterval 60 sec








u
復原前一個動作。(常用)








[Ctrl]+r
重做上一個動作。(常用)

Q. Page down, Page up.

Then CTRL-B and CTRL-F should do the trick.

referance
http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html (Home of vim)
http://vim.1045645.n5.nabble.com/MacVim-and-backspace-td1216153.html
http://doc.linuxpk.com/80773.html 
http://homepage.ttu.edu.tw/u9106240/page_main/vim_menu.html
http://greenisland.csie.nctu.edu.tw/wp/2005/09/10/329/

Monday, September 26, 2011

Command in Linux - find

初步概念
最近一直在做一些資料整理,但總覺得一個一個搬檔案殺檔案,真的是件很瑣碎的事情,於是就想了一些辦法能夠減少這樣的次數。
Work Env.
find \. -name "*.png" -exec ./$1 {} {}.z \;
Piggy Note
我想發明電腦就是要為了能夠幫助人處理一些瑣碎的事情

Sunday, September 25, 2011

vimdiff

初步概念
在Team work的作業環境下,該如何將別人的程式有效的結合自己的程式,當然你可以一份一份的將程式碼看過一遍,在區分找出不同之處加以修改,不過這樣的過程非常耗時且毫無效率可言,於是就有人想出該如何利用其他工具來達到目的,vimdiff就是用來分辨兩者的程式碼有何不同且能修改程式
Work Env.
#apt-get install vim-full

do - Get changes from other window into the current window.
dp - Put the changes from current window into the other window.
]c - Jump to the next change. 
[c - Jump to the previous change. 
Ctrl W + Ctrl W - Switch to the other split window. 
:diffupdate - diff update  
:syntax off - syntax off  
zo - open folded text 
zc - close folded text
Piggy Note
在Windows裡用了許多好用的軟體作為寫程式的輔助,但在Linux中的概念總覺得不太方便界面不人性化,不過在vimdiff中打破這項觀念,這套軟體真的可以跟beyond compare作抗衡。
Referance
http://www.debianadmin.com/vimdiff-edit-two-or-three-versions-of-a-file-with-vim-and-show-differences.html
http://amjith.blogspot.com/2008/08/quick-and-dirty-vimdiff-tutorial.html

Friday, September 2, 2011

序論-業界視野

小時候常常從長輩們嘴裡探討說
社會就像是一個大染缸,白的進去也會黑的出來。
小時候總是不明白其中的道理,等到長大了出社會了,經過沈澱後才發現固中的道理所在。其實環境很容易改變一個人,但一個人卻很難改變這個世界。當我們長大了有了自己思考的方式和做事行為,在這過程我們能學習成長的就是周遭的環境。但我們唯一能掌握能就是自己,雖然我們不能像偉人一樣改變世界,但我們卻可以改變自己挑戰自己,心思清楚的走出淤泥而不染。

我希望能透過這個Blog來分享工作成長,記錄我的工作過程,如何思考如何解決問題,所得到及衍生出的專業技能與想法,藉由這分享過程中獲得更多的喜悅。
至航
於民國一百年九月九號首寫

Register Transfer Level Design with Verilog (1) [ebook]

設計程式之所以有趣不外乎是它的千變萬化,同樣的結果卻有不同的寫法。 但這些不同寫法當中也並沒有分誰對誰錯,也沒有制定標準來規範何事該用何解。 這也就是我們設計者的珍貴!! [1] Primitive Instantiations 在Verilog中最基本的邏輯...