按照gentoo alsa document
关掉genkernel里的oss 和alsa,留着sound=y
然后emerge alsa-driver alsa-utils alsa-tools
rc-update del esound default
rc-update add alsasound default
运行aslaconf,找到破声卡
似乎没问题了
然而发现X起来的时候出来好几个不能调节音量的错误信息
mplayer在-ao oss模式下一切正常
但是在-ao alsa只能root出声,普通用户不出声
在google上查到要把普通用户加到audio组里
但是在user and group management里没有audio组
发现下面有一个打钩的地方显示所有用户和组
打钩
加到audio里,还是一样啊?!
没辙了
进irc问别人吧
一个叫Chris什么的人回答要logout completely才行
呵呵
果然如此
出现数个不能调节音量的错误是因为自己过去加了好几个applet但是都没有显示出来
BTW,这个Chris回答过好几个问题了,相信他肯定不记得我
也就是说他整天挂在irc channel里,啥问题都能回答。。。
$ cat helloqt.cxx
#include “qapplication.h”
#include “qlabel.h”
int main( int argc , char **argv )
{
QApplication app( argc , argv ) ;
QLabel *hello = new QLabel(
“《font color=blue》Hello 《i》QT《/i》”"《/font》”,
0 ) ;
app.setMainWidget( hello ) ;
hello->show() ;
return app.exec() ;
}
$ g++ helloqt.cxx -o helloqt -I/usr/qt/3/include -L/usr/qt/3/lib -lqt
$ ./helloqt
先cvs checkout -l -d dir .
-l 是 local的意思
-d是指定的目录
然后 cd dir
把module原来的目录copy过来
然后cvs add moduledir
然后cvs commit
然后进入moduledir
再cvs commit
Setting up a Win32 Toolchain with SDL and wxWidgets in Gentoo
Everyone of us always wanted to have the ability to compile for Windows and Unix in one makefile, right?
Unfortunately, there is very few documentation on this topic and I had quite a hard time to get things working the way I wanted to. I wrote this small HOWTO to share the way I managed to build my toolchain to other people.
I like writing games and most gamers use Windows. I didn’t want to leave my Linux setup to compile the games for Windows, so I needed a MingW toolchain with SDL and wxWidgets, for those are the two cross platform APIs I use.
Compiling the toolchain
Here we can go with ebuilds, there are some nice in the portage tree:
emerge xmingw-binutils
emerge xmingw-gcc
emerge xmingw-w32api
emerge xmingw-runtime
emerge xmingw-gcc
You have to do it in this order and you have to compile gcc twice, yes. If you don’t you wont get a c++ compiler, i don’t know exactly why.
Gentoo will put the toolchain into /opt/xmingw.
Setting the environment variables
Everytime you want to compile something for Windows, you have to set some environment variables first. The best is to put them into a small script:
export PATH=”/opt/xmingw/bin:/opt/xmingw/i386-mingw32msvc/bin:$PATH”
export CC=”i386-mingw32msvc-gcc”
export CXX=”i386-mingw32msvc-g++”
unset CFLAGS
unset CPPFLAGS
unset CXXFLAGS
unset LDFLAGS
export CFLAGS=”-I/opt/xmingw/i386-mingw32msvc/include”
export CXXFLAGS=”-I/opt/xmingw/i386-mingw32msvc/include”
After you have set the environment variables you can configure a program to compile for Win32 by running ./configure –target=i386-mingw32msvc –host=i386-mingw32msvc –build=i386-linux
Compiling SDL
Download the latest cvs version of SDL from here. Untar it into a working directory and cd into SDL-1.2/. Now run your script to set the environment variables mentioned above. After that you can configure SDL:
./autogen.sh
./configure –target=i386-mingw32msvc –host=i386-mingw32msvc
–build=i386-linux –enable-cdrom –enable-threads –enable-timers
–enable-endian –enable-file –enable-cpuinfo –enable-opengl
–disable-shared –prefix=/opt/xmingw/i386-mingw32msvc
–disable-shared will even remove the dependency on SDL.dll, if you don’t want that, leave this parameter out.
Now you can call make and make install. If you have to su to run make install, don’t forget to set your environment variables again (I forgot that at first).
Now for a little tweak: cd into /opt/xmingw/i386-mingw32msvc/bin and create a symbolic link.
ln -s i386-mingw32msvc-sdl-config sdl-config
This way, if you run sdl-config in your Makefile, the right sdl-config will be executed. (wxWidgets does this automatically for wx-config)
Compiling wxWidgets
Download a wxAll package from here. I used 2.4.2, I didn’t try any newer versions. Untar it and cd into wxWindows-2.4.2/.
Don’t forget to run your environment script and then run
./autogen.sh
./configure –target=i386-mingw32msvc –host=i386-mingw32msvc –build=i386-linux –with-msw –disable-threads –disable-shared –disable-unicode –with-opengl –prefix=/opt/xmingw/i386-mingw32msvc
I recommend to disable threads because else the programs will depend on some MingW libraries. You should also disable shared, because else the programs will depend on the wxWidgets libraries (and I think I ran into some more trouble). If you don’t disable unicode, the programs will only work on WinNT/2k/XP, not on 9x.
After that you can run make and make install just like you did for SDL.
Now you should have a fully working MingW+SDL+wxWidgets toolchain. I compiled 2 games I made and they ran fine in wine after compiling. I didn’t test them on Windows, yet but I strongly believe they will run. If you run into troubles, please report them to me.
list modules:
cvs co -c
list tags:
cvs history -a -T
make -C /usr/src/linux-2.6.12 M=`pwd` modules
Makefile:
obj-m := helloworld.o
helloworld.c:
#include 《linux/init.h》
#include 《linux/module.h》
MODULE_LICENSE( “Dual BSD/GPL” );
static int hello_init( void )
{
printk( KERN_ALERT “Hello, world!\n” ) ;
return 0 ;
}
static void hello_exit( void )
{
printk( KERN_ALERT “Goodbye, cruel world\n” ) ;
}
module_init( hello_init ) ;
module_exit( hello_exit ) ;
看看/etc/passwd里的ftp用户home目录是不是不一致。。。
如果出telnetd: All network ports in use.
那可能是
/etc/fstab中的devpts没有mount
none /dev/pts devpts noauto,gid=5,mode=620 0 0
身份证号码15位升18位
身份证18位验证
18位身份证标准在国家质量技术监督局于1999年7月1日实施的GB11643-1999《公民身份号码》中做了明确的规定。 GB11643-1999《公民身份号码》为GB11643-1989《社会保障号码》的修订版,其中指出将原标准名称”社会保障号码”更名为”公民身份号码”,另外GB11643-1999《公民身份号码》从实施之日起代替GB11643-1989。GB11643-1999《公民身份号码》主要内容如下:
一、范围
该标准规定了公民身份号码的编码对象、号码的结构和表现形式,使每个编码对象获得一个唯一的、不变的法定号码。
二、编码对象
公民身份号码的编码对象是具有中华人民共和国国籍的公民。
三、号码的结构和表示形式
1、号码的结构
公民身份号码是特征组合码,由十七位数字本体码和一位校验码组成。排列顺序从左至右依次为:六位数字地址码,八位数字出生日期码,三位数字顺序码和一位数字校验码。
2、地址码
表示编码对象常住户口所在县(市、旗、区)的行政区划代码,按GB/T2260的规定执行。
3、出生日期码
表示编码对象出生的年、月、日,按GB/T7408的规定执行,年、月、日代码之间不用分隔符。
4、顺序码
表示在同一地址码所标识的区域范围内,对同年、同月、同日出生的人编定的顺序号,顺序码的奇数分配给男性,偶数分配给女性。
5、校验码
(1)十七位数字本体码加权求和公式
S = Sum(Ai * Wi), i = 0, … , 16 ,先对前17位数字的权求和
Ai:表示第i位置上的身份证号码数字值
Wi:表示第i位置上的加权因子
Wi: 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2
(2)计算模
Y = mod(S, 11)
(3)通过模得到对应的校验码
Y: 0 1 2 3 4 5 6 7 8 9 10
校验码: 1 0 X 9 8 7 6 5 4 3 2
四、举例如下:
北京市朝阳区: 11010519491231002X
广东省汕头市: 440524188001010014
15位升18的方法
根据〖中华人民共和国国家标准 GB 11643-1999〗中有关公民身份号码的规定,公民身份号码是特征组合码,由十七位数字本体码和一位数字校验码组成。排列顺序从左至右依次为:六位数字地址码,八位数字出生日期码,三位数字顺序码和一位数字校验码。
地址码表示编码对象常住户口所在县(市、旗、区)的行政区划代码。生日期码表示编码对象出生的年、月、日,其中年份用四位数字表示,年、月、日之间不用分隔符。顺序码表示同一地址码所标识的区域范围内,对同年、月、日出生的人员编定的顺序号。顺序码的奇数分给男性,偶数分给女性。校验码是根据前面十七位数字码,按照ISO 7064:1983.MOD 11-2校验码计算出来的检验码。下面举例说明该计算方法。
15位的身份证编码首先把出生年扩展为4位,简单的就是增加一个19,但是这对于1900年出生的人不使用(这样的寿星不多了)
某男性公民身份号码本体码为34052419800101001,首先按照公式⑴计算:
∑(ai×Wi)(mod 11)……………………………………(1)
公式(1)中:
i—-表示号码字符从由至左包括校验码在内的位置序号;
ai—-表示第i位置上的号码字符值;
Wi—-示第i位置上的加权因子,其数值依据公式Wi=2(n-1)(mod 11)计算得出。
i 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
ai 3 4 0 5 2 4 1 9 8 0 0 1 0 1 0 0 1 a1
Wi 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2 1
ai×Wi 21 36 0 25 16 16 2 9 48 0 0 9 0 5 0 0 2 a1
根据公式(1)进行计算:
∑(ai×Wi) =(21+36+0+25+16+16+2+9+48++0+0+9+0+5+0+0+2) = 189
189 ÷ 11 = 17 + 2/11
∑(ai×Wi)(mod 11) = 2
然后根据计算的结果,从下面的表中查出相应的校验码,其中X表示计算结果为10:
∑(ai×WI)(mod 11) 0 1 2 3 4 5 6 7 8 9 10
校验码字符值ai 1 0 X 9 8 7 6 5 4 3 2
根据上表,查出计算结果为2的校验码为所以该人员的公民身份号码应该为 34052419800101001X。
哈哈,用proz代替wget了
# These settings were set by the catalyst build script that automatically built this stage
# Please consult /etc/make.conf.example for a more detailed example
CFLAGS=”-O3 -march=i686 -fomit-frame-pointer”
CHOST=”i686-pc-linux-gnu”
CXXFLAGS=”${CFLAGS}”
USE=”MONO wxwindows”
FETCHCOMMAND=”/usr/local/bin/proz -f -r –no-getch \${URI} && mv \${FILE} \${DISTDIR}”
GENTOO_MIRRORS=”http://10.180.0.25
http://ftp.linuxforum.net/gentoo/
http://www.zentek-international.com/mirrors/gentoo/
http://ftp.gentoo.or.kr/
http://mirror.gentoo.gr.jp http://gentoo.gg3.net/”