Hack with Debian

    面朝大海,春暖花开~
备份一些东东  版权不归我管  李群表示理论  小企鹅小技巧  博客建站技术  迷人的篮球世界  好听的歌曲  只是随便写的  哈哈哈哈哈哈  数学牛人轶事  数学资料小抄  深入理解小企鹅  多彩三国世界 

如何修复升级debian时丢失gpg key的警告(zz)
latex 中使纸张横向
gcc linker option(--rpath)

rmingming@debian:~/src/blcr-0.4.2/examples/pthread_misc$ gcc -g -O2 -o pthread_misc_sleep100 pthread_misc_sleep100.c -L /usr/local/blcr-0.4.2/lib/ -lcr -lpthread -I /usr/local/blcr-0.4.2/include/ -Wl,--rpath=/usr/local/blcr-0.4.2/lib

或者:

rmingming@debian:~/src/blcr-0.4.2/examples/pthread_misc$ gcc -g -O2 -o pthread_misc_sleep100 pthread_misc_sleep100.c -L /usr/local/blcr-0.4.2/lib/ -lcr -lpthread -I /usr/local/blcr-0.4.2/include/ -Wl,--rpath -Wl,/usr/local/blcr-0.4.2/lib

其中-Wl,option表示将option传给linker,而-rpath dir选项表示把dir加入运行时库搜索路径.

本文由 rmingming 于2007年01月11日 下午09点10分 发表 | 阅读全文 | 评论 (0)

Linux on Laptop

Installing Debian Etch on a Thinkpad R60e

http://www.linux-on-laptops.com/

VGA out
Add Option "Clone" on the Section "Device" will make the Xorg clone the LCD output to VGA output.

Section "Device"
Identifier "Intel GMA 950"
Driver "i810"
BusID "PCI:0:2:0"
Option "AccelMethod" "EXA"
Option "Clone" "true"
Option "MointorLayout" "CRT,LFP"
EndSection

本文由 rmingming 于2006年12月09日 下午06点23分 发表 | 阅读全文 | 评论 (0)

如何使用.la后缀的库?

-bash-2.05b$ libtool --mode=link gcc -o ganglia-test ganglia-test.c /usr/lib/libganglia.la /home/admin/ganglia-3.0.2/ganglia-3.0.2/srclib/apr/libapr-0.la /home/admin/ganglia-3.0.2/ganglia-3.0.2/srclib/confuse/src/libconfuse.la /home/admin/ganglia-3.0.2/ganglia-3.0.2/srclib/expat/lib/libexpat.la
mkdir .libs
gcc -o .libs/ganglia-test ganglia-test.c /usr/lib/libganglia.so -lresolv /home/admin/ganglia-3.0.2/ganglia-3.0.2/srclib/apr/.libs/libapr-0.so -lrt -lm -lcrypt -lnsl -lpthread -ldl /home/admin/ganglia-3.0.2/ganglia-3.0.2/srclib/confuse/src/.libs/libconfuse.a /home/admin/ganglia-3.0.2/ganglia-3.0.2/srclib/expat/lib/.libs/libexpat.so -Wl,--rpath -Wl,/usr/local/apr/lib -Wl,--rpath -Wl,/usr/local/lib
creating ganglia-test
-bash-2.05b$

详情参看libtool官方文档.

本文由 rmingming 于2006年04月29日 上午11点38分 发表 | 阅读全文 | 评论 (0)

linux下录音软件

可以用audacity:http://audacity.sourceforge.net/
如果想导出为mp3格式的话,需要使用lame:http://lame.sourceforge.net/index.html
测试麦克风是否正常可以使用gnome-sound-recorder

本文由 rmingming 于2005年11月23日 上午07点59分 发表 | 阅读全文 | 评论 (0)

提取lumaqq中ip查询功能

参考源程序:http://qbit.100steps.net/ipdata/IPSeeker.jar
有两个main函数,其中IPSeekerShell中的是真正的主函数,不过由于它需要win下的一些库,故不能运行,报错信息未贴:

rmingming@debian:~/prozdownload/LumaQQ$ java -classpath ./IPSeeker.jar IPSeeker
华南理工大学
rmingming@debian:~/prozdownload/LumaQQ$ java -classpath ./IPSeeker.jar IPSeekerShell

稍微修改IPSeeker.java文件,在boom的config.php中修改:
function convert_ip_new($ip)
{
$java="/usr/local/jdk1.5.0/bin/java";
$seekerjar="IPSeeker";
$changelocale="export LC_ALL=zh_CN.GBK";
$changepath="cd /home/linux/java/";
$fromwhere=`$changelocale; $changepath; $java $seekerjar $ip|iconv -f gb2312 -t utf8`;
return trim($fromwhere,"\n");
}

本文由 rmingming 于2005年11月19日 下午01点45分 发表 | 阅读全文 | 评论 (0)

mplayer播放friends方法

播放过程中j键可以切换字幕语言。

rmingming@debian:~$ cat .mplayer/config
#unicode = true
#subcp = cp936
subcp = gb
#subcp = gb2312
#utf8 = true
stop-xscreensaver = true
slang = eng,chi
font = /usr/share/fonts/truetype/simsun/simsun.ttf
subfont-text-scale = 4
#缺省是5,稍大,故这里改为4.

本文由 rmingming 于2005年11月18日 下午06点01分 发表 | 阅读全文 | 评论 (0)

纯真IP数据库格式详解
ypchsh改NIS用户的登陆shell

需要rpc.yppasswdd以如下方式启动:
rpc.yppasswdd -e chsh

本文由 rmingming 于2005年10月20日 下午01点49分 发表 | 阅读全文 | 评论 (0)

生成Makefile

运行autoscan生成configure.scan,修改此文件,重命名为configure.in.
运行aclocal生成aclocal.m4
编写acconfig.h
运行autoheader生成config.h.in
编写Makefile.am
运行automake生成Makefile.in
运行autoconf生成configure
运行configure处理Makefile.in生成Makefile

autoscan 产生一个preliminary的configure.scan(ac,in),使用autoconf处理configure.in生成configure脚本。
使用automake配合Makefile.am文件生成Makefile.in文件,这步需要有configure.in文件.
利用configure处理Makefile.in文件生成Makefile文件。


man autoconf, man autoreconf, man autoscan, man autoheader, ......

man autoconf:
NAME
autoconf - Generate configuration scripts

SYNOPSIS
autoconf [OPTION] ... [TEMPLATE-FILE]

DESCRIPTION
Generate a configuration script from a TEMPLATE-FILE if given, or `configure.ac' if
present, or else `configure.in'. Output is sent to the standard output if TEMPLATE-FILE
is given, else into `configure'.

man autoscan:NAME
autoscan - Generate a preliminary configure.in

SYNOPSIS
autoscan [OPTION] ... [SRCDIR]

DESCRIPTION
Examine source files in the directory tree rooted at SRCDIR, or the current directory if
none is given. Search the source files for common portability problems, check for incom‐
pleteness of `configure.ac', and create a file `configure.scan' which is a preliminary
`configure.ac' for that package.

本文由 rmingming 于2005年10月20日 上午11点47分 发表 | 阅读全文 | 评论 (0)

swig and perl

Another possible compile problem comes from recent versions of Perl (5.8.0) and the GNU tools. If you see errors having to do with _crypt_struct, that means _GNU_SOURCE is not defined and it needs to be. So you should compile the wrapper like:

% g++ -c example_wrap.cxx -I/usr/lib/perl/5.8.0/CORE -D_GNU_SOURCE

-D_GNU_SOURCE is also included in the Perl ccflags, which can be found by running

% perl -e 'use Config; print $Config{ccflags};'

So you could also compile the wrapper like

% g++ -c example_wrap.cxx -I/usr/lib/perl/5.8.0/CORE \
`perl -e 'use Config; print $Config{ccflags}'`

本文由 rmingming 于2005年10月19日 下午05点13分 发表 | 阅读全文 | 评论 (0)

cd /var/yp; make 出错原因

有可能是因为/var分区已经满了的原因。

本文由 rmingming 于2005年10月17日 上午10点12分 发表 | 阅读全文 | 评论 (0)

vim常用操作
  • 移动,h,j,k,l
  • 删除,x,d,dd
  • 复制,y,yy
  • 粘贴,p
  • 块操作,类似ultraedit
  • 宏操作,q
  • 多窗口操作,ctrl+w
  • 杂项操作

本文由 rmingming 于2005年09月21日 上午09点51分 发表 | 阅读全文 | 评论 (0)

proftpd配置
安装gcc

实际上只拷贝了如下几个文件:
/usr/bin/gcc-4.0
/usr/bin/gcov-4.0
/usr/bin/gccbug-4.0
和目录/usr/lib/gcc/i486-linux-gnu/4.0.1/下的文件。(这是对4.0版本来说的,3.3版本以前(含)是放在/usr/lib/gcc-lib/i486-linux-gnu/目录下)。
可以参看
dpkg -c gcc-4.0_4.0.1-2_i386.deb |more

本文由 rmingming 于2005年08月26日 下午08点26分 发表 | 阅读全文 | 评论 (0)

mkinitrd相关

debian下是默认是按照cramfs文件系统来生成的。
而redhat下默认是按照ext2文件系统来生成的。

/usr/sbin/mkinitrd -o ../../aa.img-2.6.8-2 /lib/modules/2.6.8-2-386/
文件放在/tmp/下,这里的当前路径指的是/tmp/*****/initrd/,通过 -k 选项可以看到
正确的写法应该是:
/usr/sbin/mkinitrd -o /boot/aa.img-2.6.8-2 /lib/modules/2.6.8-2-386/
一定要用绝对路径。

本文由 rmingming 于2005年08月23日 上午11点14分 发表 | 阅读全文 | 评论 (0)

卸载loop设备

losetup -d /dev/loop2

losetup is short for "loop device setup"

本文由 rmingming 于2005年08月23日 上午11点07分 发表 | 阅读全文 | 评论 (0)