顯示具有 Ubuntu 標籤的文章。 顯示所有文章
顯示具有 Ubuntu 標籤的文章。 顯示所有文章

2011年12月2日 星期五

install gcc-4.1 under Ubuntu

目前系統gcc版本是4.4.3

nelson@swdev:~/eMbedded/crosstoolchain/crosstool-0.43$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)

此版本編譯cross toolchain都會遇到麻煩

像是
http://blog.chinaunix.net/space.php?uid=20543672&do=blog&id=94333
 所提到的
*** buffer overflow detected ***: arm-9tdmi-linux-gnu-ar terminated

所以需要改裝gcc 4.1版本


ubuntu上安裝挺簡單的

sudo apt-get install gcc-4.1

primesw@swdev:~$ sudo apt-get install gcc-4.1
[sudo] password for primesw:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.32-34-generic linux-headers-2.6.32-34
  linux-headers-2.6.32-34-server
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  cpp-4.1 gcc-4.1-base
Suggested packages:
  gcc-4.1-locales gcc-4.1-multilib gcc-4.1-doc libmudflap0-dev
The following NEW packages will be installed:
  cpp-4.1 gcc-4.1 gcc-4.1-base
0 upgraded, 3 newly installed, 0 to remove and 142 not upgraded.
Need to get 3,360kB of archives.
After this operation, 7,528kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  gcc-4.1-base cpp-4.1 gcc-4.1
Install these packages without verification [y/N]? y
Get:1 http://cn.archive.ubuntu.com/ubuntu/ lucid/universe gcc-4.1-base 4.1.2-27u                                                                                        buntu1 [209kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu/ lucid/universe cpp-4.1 4.1.2-27ubuntu                                                                                        1 [2,550kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu/ lucid/universe gcc-4.1 4.1.2-27ubuntu                                                                                        1 [600kB]
Fetched 3,360kB in 28s (119kB/s)
Selecting previously deselected package gcc-4.1-base.
(Reading database ... 282346 files and directories currently installed.)
Unpacking gcc-4.1-base (from .../gcc-4.1-base_4.1.2-27ubuntu1_amd64.deb) ...
Selecting previously deselected package cpp-4.1.
Unpacking cpp-4.1 (from .../cpp-4.1_4.1.2-27ubuntu1_amd64.deb) ...
Selecting previously deselected package gcc-4.1.
Unpacking gcc-4.1 (from .../gcc-4.1_4.1.2-27ubuntu1_amd64.deb) ...
Processing triggers for man-db ...
Setting up gcc-4.1-base (4.1.2-27ubuntu1) ...

Setting up cpp-4.1 (4.1.2-27ubuntu1) ...
Setting up gcc-4.1 (4.1.2-27ubuntu1) ...



就可以在/usr/bin下看到嚕
ls /usr/bin/gcc*
/usr/bin/gcc  /usr/bin/gcc-4.1  /usr/bin/gcc-4.4  /usr/bin/gccbug-4.1



接下來需要做soft link

sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.1 /usr/bin/gcc

之後使用gcc -v
 就可以發現版本換嚕

gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --with-tune=generic --enable-checking=release x86_64-linux-gnu
Thread model: posix
gcc version 4.1.3 20080704 (prerelease) (Ubuntu 4.1.2-27ubuntu1)

透過Facebook分享

2011年11月23日 星期三

2011年11月21日 星期一

upgrade firefox from 3.6 to 8.0 under 10.04

   sudo add-apt-repository ppa:mozillateam/firefox-stable
   sudo apt-get update
   sudo apt-get upgrade



透過Facebook分享

2011年11月3日 星期四

如何將tcpdump移植到arm嵌入式系統

Follow http://read-and-thinking.blogspot.com/2009/06/tcpdumparm.html

下載
libpcap-1.1.1
tcpdump-4.1.1

build licpcap-1.1.1

 1. 修改configure file
註解掉6901~6905
#if test -z "$with_pcap" && test "$cross_compiling" = yes; then
# { { echo "$as_me:$LINENO: error: pcap type not determined when cross-compiling; use --with-pcap=..." >&5
#echo "$as_me: error: pcap type not determined when cross-compiling; use --with-pcap=..." >&2;}
# { (exit 1); exit 1; }; }
#fi

註解掉7237~7241
# if test $ac_cv_linux_vers = unknown ; then
# { { echo "$as_me:$LINENO: error: cannot determine linux version when cross-compiling" >&5
#echo "$as_me: error: cannot determine linux version when cross-compiling" >&2;}
# { (exit 1); exit 1; }; }
# fi

./configure --host=arm-none-linux


確認Makefile的CC不是gcc而是你的cross compile的名字
就代表ok嚕
接下來
make

產生libpcap.so.1.1.1

就代表成功嚕

build tcpdump-4.1.1


 1. 修改configure
註解掉 4411~4415

# if test $ac_cv_linux_vers = unknown ; then
# { { echo "$as_me:$LINENO: error: cannot determine linux version when cross-compiling" >&5
#echo "$as_me: error: cannot determine linux version when cross-compiling" >&2;}
# { (exit 1); exit 1; }; }
# fi

./configure --host=arm-none-linux

檢查是否成功的方式與上述相同

確認成功後
make
產生tcpdump
就代表成功嚕

可以用file看一下

file tcpdump
tcpdump: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), not stripped





透過Facebook分享

2011年10月27日 星期四

GMAIL沒辦法顯示網頁

MIS又在搞鬼了

使用DHCP自動取得IP
會幫你設定DNS Server
看到192.168.10.10

gmail.com無法顯示頁面
wireshark看到192.168.10.10不解析domain name
造成網頁顯示無法正常的關鍵

Ubuntu環境下
右上角連線符號按下滑鼠右鍵
點擊編輯連線
選擇有線/無線網路  (看你目前使用哪種網路)
選擇該網路後 按下編輯 (位於右方)
輸入密碼後
切到IPv4設定
方法
切換:"自動(DHCP)"到"只用自動(DHCP)位址"
DNS伺服器
填入 168.95.1.1 (中華電信)
or 8.8.8.8 (google public dns server)

就可以正常顯示gmail登入畫面嚕

透過Facebook分享

2011年9月29日 星期四

2011年9月21日 星期三

將Ubuntu遠端程式的畫面顯示在local端

使用 ssh -X acount@ipaddress 登入遠端 以firefox為例 登入後 type firefox 就可以在local顯示遠端的firefox嚕

透過Facebook分享

2011年9月14日 星期三

Install Asterisk - Voip Sip Server

add key
add repository

install asterisk
正在設定 libvpb0
This is the numeric code for the region your phone system will be operating in (eg. 61 for Australia or 33 for France). It is used to configure the default regional standards that Voicetronix telephony hardware should comply with.
ITU-T telephone code:
61
確定

按照設定值61

install asterisk-dahdi


Ref:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+Packages?focusedCommentId=18415792&#AsteriskPackages-InstallingAsterisk

透過Facebook分享

install 32bit adobe reader under 64bit ubuntu

使用
sudo dpkg -i --force-architecture AdobeReader_cht-8.1.7-1.i386.deb

裝成功
可以用

透過Facebook分享

2011年9月13日 星期二

mount under 11.04

掛載位於Ubuntu下分享出來的目錄到Ubuntu local

指令要改成

sudo mount -t cifs //172.18.1.2/Release /media/ReleaseServer -o username=xxx,password=ooo,codepage=cp950,iocharset=utf8

 用以下指令也行

sudo mount //172.18.1.2/Release /media/ReleaseServer -o username=xxx,password=ooo,codepage=cp950,iocharset=utf8

變方便了?

拿掉codepage and ischarset也行

sudo mount //172.18.1.2/Release /media/ReleaseServer -o username=xxx,password=ooo

透過Facebook分享

2011年9月9日 星期五

7z壓縮與解壓縮指令


7z壓縮指令
7z a -mx=9 -mmt 壓縮檔名 被壓縮的資料夾或檔名

7z解壓縮指令
7z x 壓縮檔名 -o輸出資料夾

-o與輸出資料夾中間不要有空格
不然
7z會回報
Error:
Incorrect command line

Ref:
http://moto.debian.tw/viewtopic.php?f=23&t=11927
man 7z

透過Facebook分享

2011年8月31日 星期三

殺掉關不掉的程式

aMsn一直不給我關掉
很奇怪

我用ps -x找出aMsn的PID

然後用kill
sudo kill PID

Ref:
http://www.pcnet.idv.tw/pcnet/linux/linux_command.htm#049ps

透過Facebook分享

2011年8月24日 星期三

如何編譯rapidsvn source code

首頁:http://rapidsvn.tigris.org/




Pre-build:
build subversion source
sudo apt-get source subversion
sudo apt-get build-dep subversion
sudo ./configure
sudo make
sudo make install


build wxWidgets
http://www.wxwidgets.org/downloads/
安裝步驟教學
http://wiki.wxpython.org/InstallingOnUbuntuOrDebian


你需要到這裡註冊帳號
http://subversion.tigris.org/servlets/ProjectDocumentList

svn checkout http://rapidsvn.tigris.org/svn/rapidsvn/trunk
需要用到上面註冊好的帳號密碼

切換到rapidsvn目錄

./configure
make
sudo make install

rapidsvn會產生到src下

過程message應該沒有人有興趣


透過Facebook分享

2011年8月23日 星期二

svn log get by date

一般
svn log path
會將完整的log顯示出來(Linux上RapidSVN就是這樣做)
造成每次看log的時候都會很慢
尤其當log內容很多的時候

其實大部分的時候
是需要看看最近改了些什麼
所以就可以用svn log帶上日期的方式去get某一部份的log資料
這樣就會快上許多(ToriseSVN就是這麼做)

command:
svn log http://x.x.x.x/svn/wimax/mt7119/branches/aa623a_BaaaaBaaaaa -r {2011-07-05}:{2011-08-23}

這是一個貢獻opensource的好機會
1. 提供patch給RapidSVN
2. create a project enhance RapidSVN (如果提供patch給RapidSVN沒人理的話)

Ref:
http://svn.haxx.se/users/archive-2006-08/0737.shtml

透過Facebook分享

2011年8月19日 星期五

安裝多個firefox在Ubuntu上

你可以到這邊下載
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/  - 升級包
ftp://ftp.mozilla.org/pub/firefox/releases/ - 安裝檔

 Ref:
http://liunian.info/mutiple-version-firefox.html

將下載好的firefox-3.6.20.tar.bz2, firefox-4.0.tar.bz2 解壓縮好

進入各個目錄後 下這個重要的command
./firefox -profilemanager -no-remote


cd firefox-3.6.20/
./firefox -profilemanager -no-remote
建立設定檔
下一步
輸入新設定檔案名稱  firefox-3.6.20
選擇資料夾(使用者設定,偏好設定都會存在在此)
按下完成
啟動Firefox




透過Facebook分享

2011年8月15日 星期一

pastie test on blogger

失效了?
<script src='http://pastie.org/2373978.js'></script>

透過Facebook分享

bootchart for embedded - bootchart-lite

安裝java
安裝ant
<script src='http://pastie.org/2373889.js'></script>

download bootchart 

build bootchart
<script src='http://pastie.org/2373891.js'></script>

使用bootchart.jar去產生png ok

<script src='http://pastie.org/2373911.js'></script>

先前問題:
使用sudo apt-get install bootchart
所安裝出來的工具bootchart
直接產生png目前會有問題
錯誤訊息如下
http://pastie.org/2373917


Ref:
http://blog.csdn.net/magicyu2/article/details/6292440

透過Facebook分享

2011年6月27日 星期一

ubuntu 7-zip 壓縮檔案

ubuntu 7-zip 壓縮檔案 @ 小弟弟 :: 痞客邦 PIXNET ::: "- 已使用 Google 工具列寄出"

Install 7-zip under ubuntu



語法:
7z a -mx=9 -mmt 壓縮檔名 被壓縮的資料夾或檔名

透過Facebook分享

2011年6月24日 星期五

防止Ubuntu重開機會清除/tmp下的資料

需要修改rcS

sudo vim /etc/default/rcS

將TMPTIME改成-1
ex.
TMPTIME=-1

以後重新開機就不會刪除/tmp下的資料嚕

透過Facebook分享

2011年6月10日 星期五

抓取Ubuntu samba網芳的資料有問題

Ubuntu Server放置含有subversion資料的資料
透過samba分享出來

直接抓取有權限問題

主要因為跨檔案系統
ex. ext4, samba, ...
造成權限不保留的問題

建議將server端的資料做tar
然後在copy tar file到local端

透過Facebook分享