Articles By: zwxie

ubuntu 下快速安装交叉编译工具

开始做嵌入式开发的朋友都在前期配置交叉编译工具而烦恼,网上的交叉编译工具的教程很多,但是要么很繁琐要么就是资料不全。那么怎么样快速而又简单地配置交叉编译工具呢,我们现在就用ubuntu里面的apt-get工具快速安装交叉编译工具。

1,添加一个源到/etc/apt/sources.list里,

           sudo gedit /etc/apt/sources.list
           deb http://www.emdebian.org/debian/ stable main

保存关闭;更新一下源列表

         sudo apt-get install emdebian-archive-keyring
         sudo apt-get update

3.更新成功后;我们开始安装arm 交叉编译环境

        sudo apt-get install gcc-4.4-arm-linux-gnueabi
        sudo apt-get install gcc-4.4-arm-linux-gnueabi-base
        sudo apt-get install gcc-4.3-arm-linux-gnueabi
        sudo apt-get install gcc-4.3-arm-linux-gnueabi-base
        sudo apt-get install libc6-dev-armel-cross
        sudo apt-get install binutils-arm-linux-gnueabi

4.测试,输入arm,然后会出现自动补全,就证明环境变量起效了,再补全输入

        arm-linux-gnueabi-gcc -v

出现如下面这样,就证明安装成功了:

       Using built-in specs.
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.5-4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,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 --enable-nls --with-gxx-include-dir=/usr/arm-linux-gnueabi/include/c++/4.3.5 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-sjlj-exceptions --enable-checking=release --program-prefix=arm-linux-gnueabi- --includedir=/usr/arm-linux-gnueabi/include --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabi
Thread model: posix
gcc version 4.3.5 (Debian 4.3.5-4)

补充:在sudo apt-get install gcc-4.4-arm-linux-gnueabi时,遇到了这样的问题:

ubuntu:~$ sudo apt-get install gcc-4.3-arm-linux-gnueabi
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run `apt-get -f install’ to correct these:
The following packages have unmet dependencies:
gcc-4.3-arm-linux-gnueabi: Depends: gcc-4.3-arm-linux-gnueabi-base (= 4.3.5-4) but it is not going to be installed
Depends: cpp-4.3-arm-linux-gnueabi (= 4.3.5-4) but it is not going to be installed
Depends: binutils-arm-linux-gnueabi (>= 2.19.1) but it is not going to be installed
Recommends: libc6-dev-armel-cross (>= 2.5) but it is not going to be installed
libmpfr4: Depends: libgmp10 but it is not installable
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

解决办法:

ubuntu:~$ sudo apt-get install libc6-dev-armel-cross

ubuntu:~$ sudo apt-get install binutils-arm-linux-gnueabi

安装libmpfr4,下载地址:http://www.anheng.com.cn/debian/pool/main/m/mpfr4/libmpfr4_3.0.0-9_i386.deb

ubuntu:~$sudo dpkg -i libmpfr4_3.0.0-9_i386.deb

ubuntu:~$ sudo apt-get install cpp-4.3-arm-linux-gnueabi

安装libgmp10,下载地址:http://www.anheng.com.cn/debian/pool/main/g/gmp/libgmp10_5.0.1+dfsg-7_i386.deb

ubuntu:~$sudo dpkg -i libgmp10_5.0.1+dfsg-7_i386.deb

ubuntu:~$ sudo apt-get install gcc-4.3-arm-linux-gnueabi-base

ubuntu:~$sudo apt-get install gcc-4.4-arm-linux-gnueabi

怎样将Ubuntu Linux变成Windows 7的模样

Ubuntu具备相当不错的桌面主题系统、视觉效果和养眼程序,不过你或许还是喜欢Windows 7 Aero的精美、透明度和开始菜单。今日我们将为你展示怎样将Ubuntu转换为Windows 7的模样。
当然,这不会是一模一样,不过两者足够接近,乍一看去,许多人都会以为这就是Windows 7。继续阅读,看看该怎么做吧。
我们先来输入一些命令,只需打开终端窗口并输入以下内容:
cd ~/
sudo wget http://web.lib.sun.ac.za/ubuntu/files/help/theme/gnome/win7-setup.sh
sudo chmod 0755 ~/win7-setup.sh

这将下载一个脚本文件以备后面使用,该文件告知计算机该下载哪些文件来完成Win7主题包的安装。一旦完成,会弹出一个窗口,告知你安装现在即将开始,只需点击OK就好了。 (更多…)

一些桌面美化的资源,Conky,Wallpaper,Icon

1.壁纸 4张   下载地址



 

2漂亮的Conky主题

2.1 Conky Meet Faenza


2.2 Conky Launchpad

2.3Conky Ken

 

3.仿MAC的图标      KDE下载地址 Gnome下载地址

 

 

搭建企业级邮件系统 iRedMail

一 软件环境
最近负责一个公司网站和邮件系统的搭建,以前自己一直没有仔细的研究过邮件系统的从零开始搭建工作,趁现在工作之余也同时将文档整理一次;
主要针对快捷高效搭建,简单实用为主,基本够一个人数50-100的小型公司使用。

操作系统:CentOS release 5.3 (Final) x86_64
数据库:mysql Ver 14.12 Distrib 5.0.45
php:php 5.2 up
邮件系统:postfix 2.5.6 + iredmail 0.4.0
webmail:RoundCube 1.0.2

iRedMail 0.4.0 下载地址:这里

二 安装过程
因许多软件涉及到yum安装,这里我给出国内一个非常快的Centos镜像,请 这里下载
1. 数据库和邮件系统安装
mysql 安装和postfix 安装 全部采取yum安装

$ yum install -y mysql mysql-server mysql-devel
$ yum install -y postfix

2.php安装

$ yum install -y php php-ldap php-gd php-imap php-mysql php-pear php-mbstring

3.iredmail 安装
下载解压 iRedMail-0.4.0.tar.bz2
安装指令:

$ cd /path/to/iRedMail-x.y.z/
$ cd pkgs/
$ sh get_all.sh
$ cd ../
$ sh iRedMail.sh

安装过程详细介绍请参看:戳这里
注:
a:安装之前请先行设定mysql的root帐号和密码;空密码不被接受;
b:其中数据库只需选择mysql即可;
c:webprogrem选择RoundCube即可,其他默认;
d:请记住设定的mail admin的帐号和密码。

三 配置过程
因为iRedMail的高度整合,使得配置过程异常的简单。甚至可以不需要对postfix进行多余设定;
注意修改以下基本配置:iRedmail安装过程中已经增加的这部分设定,请在配置文件的最末尾处修改

1. myorigin
myorigin参数指明发件人所在的域名。如果你的用户的邮件地址为user@domain.com,则该参数指定@后面的域名。缺省 地,postfix使用本地主机名作为myorigin,但是建议你最好使用你的域名,因为这样更具有可读性。比如:安装postfix的主机为 mail.domain.com则我们可以这样指定myorigin:

myorigin = domain.com
当然我们也可以引用其他参数,如:
myorigin = $mydomain

2. mydestination
mydestination参数指定postfix接收邮件时收件人的域名,换句话说,也就
是你的postfix系统要接收什么样的邮件。比如:你的用户的邮件地址为user@domain.com, 也就是你的域为domain.com, 则你就需要接收所有收件人为user_name@domain.com的邮件。与myorigin一样,缺省地,postfix使用本地主机名作为 mydestination。如:

mydestination = $mydomain
mydestination = domain.com

3. notify_classes
在postfix系统中,必须指定一个postfix系统管理员的别名指向一个用户,
只有这样,在用户遇到问题时才有报告的对象,postfix也才能将系统的问题报告给管理员。notify_classes参数就是用来指定向postfix管理员报告错误时的信息级别。共有以下几种级别:

bounce:将不可以投递的邮件的拷贝发送给postfix管理员。出于个人隐私的缘故,该邮件的拷贝不包含信头。

2bounce:将两次不可投递的邮件拷贝发送给postfix管理员。

delay:将邮件的投递延迟信息发送给管理员,仅仅包含信头。

policy:将由于UCE规则限制而被拒绝的用户请求发送给postfix管理员,包含整个SMTP会话的内容。

protocol:将协议的错误信息或用户企图执行不支持的命令的记录发送给postfix管理员。同样包含整个SMTP会话的内容。

resource:将由于资源错误而不可投递的错误信息发送给postfix管理员,比如:队列文件写错误等等。

software:将由于软件错误而导致不可投递的错误信息发送给postfix管理员。

缺省值为:

notify_classes = resource, software

4.myhostname
myhostname 参数指定运行postfix邮件系统的主机的主机名。缺省地,该值被设定为本地机器名。你也可以指定该值,需要注意的是,要指定完整的主机名。如:

myhostname = mail.domain.com

5.mydomain
mydomain参数指定你的域名,缺省地,postfix将myhostname的第一部分删除而作为mydomain的值。你也可以自己指定该值,如:

mydomain = domain.com

6.mynetworks
mynetworks 参数指定你所在的网络的网络地址,postfix系统根据其值来区别用户是远程的还是本地的,如果是本地网络用户则允许其访问。你可以用标准的A、B、C类网络地址,也可以用CIDR(无类域间路由)地址来表示,如:

192.168.1.0/24
192.168.1.0/26

7.inet_interfaces
inet_interfaces 参数指定postfix系统监听的网络接口。缺省地,postfix监听
所有的网络接口。如果你的postfix运行在一个虚拟的ip地址上,则必须指定其监听的地址。如:

inet_interfaces = all
inet_interface = 192.168.1.1

关于postfix的配置详细介绍可参看戳这里
需要注意的是dovecat配置在main.cf中的和master.cf的端口一致;否则会导致邮件发送失败;

#main.cf
content_filter = smtp-amavis:[127.0.0.1]:10024
#master.cf
127.0.0.1:10024  inet n  –   –   –   –  smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks_style=host
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks

以上设定完成后,确认启动postfix、policyd、dovecot、httpd、mysqld;

四、测试过程
1. 访问:http://your_server/mail/

以上设定正确,请登录测试发送邮件是否正常;

2. 增加邮件用户和邮箱容量大小配额设定
a.首先登录mysql;
b.依次执行以下指令:

mysql> use vmail;
Database changed
mysql> INSERT INTO mailbox (username, password, name, maildir, quota, domain, active)
->     VALUES (‘testuser@hiadmin.com’,  ‘$1$W.UWoG.0$Bnq8mcbsi1UhFVpiJ2jvY0′, ‘testuser’,  ‘hiamdin.com/testuser/’, ’2048′, ‘hiadmin.com’, ’1);
Query OK, 1 row affected (0.00 sec)

注:
#在mailbox生成用户帐号、密码、以及邮箱容量quota 2048为2GB
#其中password字段值,可以使用 openssl passwd -1 testuser生成;

mysql> INSERT INTO alias (address, goto, domain, active)
->     VALUES (‘testuser@hiadmin.com’, ‘testuser@hiadmin.com’, ‘hiadmin.com’, ’1);
Query OK, 1 row affected (0.00 sec)

注:
#alias 中生成别名;

c.也可以用iRedmail的tools 脚本;

———————————————-

$cd /path/to/iRedMail-0.4.0/tools

#该目录下有个create_mail_user_MySQL.sh的脚本,可以为你生成增加用户的sql语句;
#执行脚本前实现生成userlist.txt

$echo testuser >userlist.txt

#每行一个用户名即可

$sh create_mail_user_MySQL.sh userlist.txt

#生成output.sql
#登录到mysql,在vmail库中执行

mysql> source /path/to/output.sql

d.设定自己域名的mx记录,再登录RoundCube测试能否收发邮件!

源文

较Cool的Conky主题

这是5个很酷的Conky主题,使用它们不需要输入任何东西,只要下载、安装、运行就行。

Circles of imagination by ~clanlordus89

Suuuuny-conky by ~BigRZA

Conky Popup by ~FezVrasta

Conky Tiles by ~BigRZA


kindle 3用作modem共享3G上网 RT

大家都知道,kindle 3的3G上网是免费的,不过在kindle上看网页是比较痛苦的事情,要是kindle 3的3G上网能共享出来上网那就爽了,尤其在外面带了笔记本而又没WIFI的时候,也许就管用了。今天在网上看到了一个方法,翻译一下过来,我还试过呢。

原作者是用MAC电脑来举例的,其实别的电脑也差不多,懂些电脑知识的人比较容易理解,一共只要10步:

越狱和安装usbNetwork请看我之前的文章

1. 越狱你的Kindle

2. 安装usbNetwork,然后在kindle的根目录运行两条命令

;debugOn
 
~usbNetwork

3. 连接Kindle的USB到你的笔记本,然后手动配置笔记本IP成192.168.2.1。

4. 打开一个终端窗口运行

ssh root:fiona@192.168.2.2
或
telnet 192.168.2.2

5. 下载tcpdump-arm,然后再上传tcpdump-arm到Kindle并移动到home根目录。为防万一运行下“mntroot rw”。

6.在kindle 3上 输入

“~/tcpdump-arm -nAi ppp0 -s0″

找出Kindle使用3G上网时浏览器的x-fsn验证密匙

7. 在Kindle与笔记本之间创建一个用于代理的ssh连接

8. 如果sshd挂了,telnet到Kindle,重置与你笔记本之间的ssh

9. 安装Firefox浏览器一个叫做“Modify Headers”的插件,这样能在你浏览的页面里插入你的x-fsn密匙

10. 设置笔记本上Firefox的代理为127.0.0.1:8099,你也可以添加一个端口供SSL

这样就大功告成了。

不过 不是所用网站都没问题,貌似gmail就不行,而且没有iPhone的3G快(估计作为Modem也是需要性能的)。最重要的一点Amazon可以根据你 的x-fsn密匙知道你浏览哪些网站,可能会将免费的3G服务变成0.99美元/MB的收费服务,所以非必要的话就不要乱用。

转帖地址:  http://www.wincold.com/archives/116.html

原贴:http://balaganov.wordpress.com/2010/09/25/tethering-the-kindle-3/

禁止自动播放空白CD或DVD

Ubuntu will automatically launch a CD burning tool when you insert a blank data cd or dvd. This can sometimes interfere with something else you are doing right at that moment.

Ubuntu下当你插入空白CD或DVD时会自动运行CD刻录程序,这时它会打扰你正在做别的东西。

To disable this, navigate to System \ Preferences \ Removable Drives and Media:

那么就让我们禁用它吧 在 系统—> 首选项—>Removable Drives and Media:

Uncheck the box, and you will no longer autoplay blank discs.

取消掉 Burn a CD or DVD when a blank disc is inserted这个复选框,就不会再自动选行刻录程序了

blankcdauto