想不到163上也出现了一个源镜像,据说就是以前cn99的那个。
http://mirrors.163.com/
用了一下,速度很快,但不是最新的。
//EOF
Read More...
2009-02-07
网易的源
Posted by
Davy Hawk
at
2/07/2009 09:19:00 AM
0
comments
2008-11-30
Linux 中使用NetBeans部署、运行Web应用要注意目录权限设置
使用的是 tomcat
要注意以下几个目录的权限要当前用户可写
$CATALINA_HOME/conf/Catalina/localhost/
$CATALINA_HOME/webapps/
$CATALINA_HOME/work/Catalina/localhost/
$CATALINA_HOME/temp/
否则,有可能会出现无法写入部署目录而部署失败:
Failed to deploy application at context path /xxx
另外,还要注意
$CATALINA_HOME/bin/
下几个.sh文件的当前用户执行权限,不然tomcat都无法运行。
//EOF Read More...
Posted by
Davy Hawk
at
11/30/2008 10:02:00 AM
0
comments
2008-11-18
Linux Admin IQ Test
問題見:
http://www.infoworld.com/tools/quiz/news/IQ2008linux-news-quiz.php
只的了 65 分啊~~
Question 1: Which vendor has never branded its own Linux?
5 points
c. IBM
Even SCO briefly offered its own Linux product. Big Blue, despite being an enthusiastic Linux backer, has always partnered with other distributors instead of packaging its own version of the OS.
Question 2: Why GRUB over LILO?
5 points
d. You want to boot from a network
LILO supports a wide variety of boot configurations, but you'll need the more modern GRUB if you want to boot from a network.
Question 4: What's a "shebang"?
5 points
a. A unique sequence of characters that indicates the start of a shell script
Short for "shell bang," shebang is a hash or pound sign (#) followed by an exclamation mark (!), known in Unix parlance as a "bang."
Question 8: Which graphics chip vendor hasn't released a Linux driver?
5 points
c. Nvidia
Although most of the competition has released open source drivers for at least some of their graphics chips, Nvidia has remained a staunch holdout.
Question 15: What's the benefit of noatime?
5 points
a. It improves performance by reducing the frequency of disk writes
Normally, Linux will update the time stamp on a file every time it is accessed. With the noatime option, the kernel will update files only when their contents are changed.
Question 16: Which virt tech allows Windows VMs to run on Linux?
5 points
c. Xen
Most of the virtualization software listed can only launch other instances of Linux. Xen can support Windows virtual machines also, provided your processor supports Intel VT or AMD-V technology.
Question 17: What's a "binary blob"?
5 points
a. A driver that is loaded into the kernel as a binary object, for which no source code is available
The Linux community is divided over the practice of running closed source code as part of the Linux kernel, but when hardware vendors refuse to release their specifications, it's often the only option.
//EOF Read More...
Posted by
Davy Hawk
at
11/18/2008 02:21:00 PM
0
comments
2008-10-14
OpenOffice 3.0 在 KDE 下的一点小问题
3.0速度快了很多,感觉很爽!
但是有个小问题,就是:
“Tools”等几个菜单项选中的时候会挂掉(Arch 的 KDE4桌面环境)
解决方法:
export OOO_FORCE_DESKTOP=gnome
就好了,据说是因为3.0里面没有支持KDE的主题所致。
//EOF
Read More...
Posted by
Davy Hawk
at
10/14/2008 08:39:00 AM
0
comments
2008-09-28
用kexec快速切换内核
详见:http://www.linuxsir.org/main/node/296
总的来说:
- 内核版本必需为 2.6.13 或以上,因为自该版本起内置了 kexec 系统调用的程序。
- 内核编译需加入 kexec 支援
Processor type and features --->
[*] kexec system call (EXPERIMENTAL)- 系统需要安装 kexec-tools
- 用 /sbin/kexec 加载另一内核,语法是:
kexec -l <kernel-image> --append="<command-line-options>"
如:
kexec -l /boot/lfskernel-2.6.25.4 --append="root=/dev/sda6 ro nomce vga=0x317"- 想重启内核,就以 kexec -e 来切换。
//EOF Read More...
Posted by
Davy Hawk
at
9/28/2008 01:33:00 PM
0
comments
2008-08-05
proftpd 限制用户目录
proftpd 是个不错的FTP服务端。
在 /etc/proftpd.conf 中配置
DefaultRoot ~
即可将登录的用户限制在其$HOME中(要不然用户登录后连"/"都能访问)。
另外加入
<Limit LOGIN>
DenyUser username
</Limit>
可限制登录用户。
//EOF Read More...
Posted by
Davy Hawk
at
8/05/2008 09:49:00 AM
0
comments
2008-08-01
Linux 版 QQ ?
听说 TX 出了 Linux 版的QQ,我下载了 tar 版的。
但是,这个可怜的QQ,在我的硬盘上仅存在了 10秒不到~~
马上就被我删掉了,太恶心了~~
花哨的界面和简陋的功能严重不匹配~ 有心思做花哨的界面还不如多花点心思来完善功能。
//EOF
Read More...
Posted by
Davy Hawk
at
8/01/2008 10:43:00 PM
0
comments
2008-07-29
用上KDE4.1了
昨天 Arch 官方升级了KDE到4.1,昨天没注意,今天早上开始时吓了一跳~~
不过也好,迟早是要升级的。就是刚开始从3.5到4.1还有些不太适应。
//EOF
Read More...
Posted by
Davy Hawk
at
7/29/2008 08:12:00 AM
0
comments
2007-09-12
sys_calls
/usr/include/asm/unistd.h (sys/syscall.h)
the system call numbers:
| sys_call name | sys_call num.(hex) |
|---|---|
| restart_syscall | 0 |
| _exit | 1 |
| fork | 2 |
| read | 3 |
| write | 4 |
| open | 5 |
| close | 6 |
| waitpid | 7 |
| create | 8 |
| link | 9 |
| unlink | a |
| execve | b |
| chdir | c |
| time | d |
| mknod | e |
| chmod | f |
| lchown | 10 |
| break | 11 |
| oldstat | 12 |
| lseek | 13 |
| getpid | 14 |
| mount | 15 |
| oldumount | 16 |
| setuid | 17 |
| getuid | 18 |
| stime | 19 |
| ptrace | 1a |
| alarm | 1b |
| oldfstat | 1c |
| pause | 1d |
| utime | 1e |
| stty | 1f |
| gtty | 20 |
| access | 21 |
| nice | 22 |
| ftime | 23 |
| sync | 24 |
| kill | 25 |
| rename | 26 |
| mkdir | 27 |
| rmdir | 28 |
| dup | 29 |
| pipe | 2a |
| times | 2b |
| prof | 2c |
| brk | 2d |
| setgid | 2e |
| getgid | 2f |
| signal | 30 |
| geteuid | 31 |
| getegid | 32 |
| acct | 33 |
| umount2 | 34 |
| lock | 35 |
| ioctl | 36 |
| fcntl | 37 |
| mpx | 38 |
| setpgid | 39 |
| ulimit | 3a |
| oldolduname | 3b |
| umask | 3c |
| chroot | 3d |
| ustat | 3e |
| dup2 | 3f |
| getppid | 40 |
| getpgrp | 41 |
| setsid | 42 |
| sigaction | 43 |
| sgetmask | 44 |
| ssetmask | 45 |
| setreuid | 46 |
| setregid | 47 |
| sigsuspend | 48 |
| sigpending | 49 |
| sethostname | 4a |
| setrlimit | 4b |
| getrlimit | 4c /* Back compatible 2Gig limited rlimit */ |
| getrusage | 4d |
| gettimeofday | 4e |
| settimeofday | 4f |
| getgroups | 50 |
| setgroups | 51 |
| select | 52 |
| symlink | 53 |
| oldlstat | 54 |
| readlink | 55 |
| uselib | 56 |
| swapon | 57 |
| reboot | 58 |
| readdir | 59 |
| mmap | 5a |
| munmap | 5b |
| truncate | 5c |
| ftruncate | 5d |
| fchmod | 5e |
| fchown | 5f |
| getpriority | 60 |
| setpriority | 61 |
| profil | 62 |
| statfs | 63 |
| fstatfs | 64 |
| ioperm | 65 |
| socketcall | 66 |
| syslog | 67 |
| settimer | 68 |
| gettimer | 69 |
| stat | 6a |
| lstat | 6b |
| fstat | 6c |
| olduname | 6d |
| iopl | 6e |
| vhangup | 6f |
| idle | 70 |
| vm86old | 71 |
| wait4 | 72 |
| swapoff | 73 |
| sysinfo | 74 |
| ipc | 75 |
| fsync | 76 |
| sigreturn | 77 |
| clone | 78 |
| setdomainname | 79 |
| uname | 7a |
| modify_ldt | 7b |
| adjtimex | 7c |
| mprotect | 7d |
| sigprocmask | 7e |
| create_module | 7f |
| init_module | 80 |
| delete_module | 81 |
| get_kernel_syms | 82 |
| quotactl | 83 |
| getpgid | 84 |
| fchdir | 85 |
| dbflush | 86 |
| sysfs | 87 |
| personality | 88 |
| afs_syscall | 89 /* Syscall for Andrew File System */ |
| setfsuid | 8a |
| setfsgid | 8b |
| _llseek | 8c |
| getdents | 8d |
| _newselect | 8e |
| flock | 8f |
| msync | 90 |
| readv | 91 |
| writev | 92 |
| getsid | 93 |
| fdatasync | 94 |
| _sysctl | 95 |
| mlock | 96 |
| munlock | 97 |
| mlockall | 98 |
| munlockall | 99 |
| sched_setparam | 9a |
| sched_getparam | 9b |
| sched_setscheduler | 9c |
| sched_getscheduler | 9d |
| sched_yield | 9e |
| sched_get_priority_max | 9f |
| sched_set_priority_min | a0 |
| sched_rr_get_interval | a1 |
| nanosleep | a2 |
| mremap | a3 |
| setresuid | a4 |
| getresuid | a5 |
| vm86 | a6 |
| query_module | a7 |
| poll | a8 |
| nfsservctl | a9 |
| setresgid | aa |
| getresgid | ab |
| prctl | ac |
| rt_sigreturn | ad |
| rt_sigaction | ae |
| rt_sigprocmask | af |
| rt_sigpending | b0 |
| rt_sigtimedwait | b1 |
| rt_sigqueueinfo | b2 |
| rt_sigsuspend | b3 |
| pread64 | b4 |
| pwrite64 | b5 |
| chown | b6 |
| getcwd | b7 |
| capget | b8 |
| capset | b9 |
| sigaltstack | ba |
| sendfile | bb |
| getpmsg | bc /* some people actually want streams */ |
| putpmsg | bd /* some people actually want streams */ |
| vfork | be |
| ugetrlimit | bf /* SuS compliant getrlimit */ |
| mmap2 | c0 |
| truncate64 | c1 |
| ftruncate64 | c3 |
| tkill | ee |
| io_setup | f5 |
| io_destory | f6 |
| io_getevents | f7 |
| io_submit | f8 |
| io_cancel | f9 |
| exit_group | fc |
| timer_create | 103 |
| timer_settime | 104 |
| timer_gettime | 105 |
| timer_getoverrun | 106 |
| timer_delete | 107 |
| clock_settime | 108 |
| clock_gettime | 109 |
| clock_getres | 10a |
| clock_nanosleep | 10b |
| tgkill | 10e |
| utimes | 10f |
| kexec_load | 11b |
| waitid | 11c |
| /* sys_setaltroot | 11d */ |
| add_key | 11e |
| request_key | 11f |
| keyctl | 120 |
| ioprio_set | 121 |
| ioprio_get | 122 |
| inotify_init | 123 |
| inotify_add_watch | 124 |
| inotify_rm_watch | 125 |
| migrate_pages | 126 |
| openat | 127 |
| mkdirat | 128 |
| mknodat | 129 |
| fchownat | 12a |
| futimesat | 12b |
| fstatat64 | 12c |
| unlinkat | 12d |
| renameat | 12e |
| linkat | 12f |
| symlinkat | 130 |
| readlinkat | 131 |
| fchmodat | 132 |
| faccessat | 133 |
| getcpu | 13e |
//EOF Read More...
Posted by
Davy Hawk
at
9/12/2007 09:04:00 PM
0
comments
2007-08-14
ALD
ALD(Assembly Language Debugger)
is a simple beautiful baseline POSIX debugger.
if you wanna debug a asm program this will be a better choice
http://ald.sourceforge.net
//EOF
Read More...
Posted by
Davy Hawk
at
8/14/2007 05:31:00 PM
0
comments
2007-07-07
Linux下实现getch()
Linux下的int getchar(void)在默认情况下需要Enter后才能继续。那么可否像DOS下那样即时返回的呢?
回答是肯定的:
- 使用curses库的getch()。
- read /dev/input/event0 (kernel >= 2.6)
- 将stdin改成unbuffered:
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
int getch (void)
{
int c = 0;
struct termios tm_old, tm;
int ret = 0;
ret = tcgetattr (STDIN_FILENO, &tm_old);
assert (ret==0);
memcpy (&tm, &tm_old, sizeof(tm));
tm.c_lflag &= ~(ICANON | ECHO | ECHOE | ECHOK | ECHONL | ECHOPRT | ECHOKE | ICRNL);
tcsetattr (STDIN_FILENO, TCSANOW, &tm);
c = fgetc(stdin);//getchar();
ret = tcsetattr (STDIN_FILENO, TCSANOW, &tm_old);
assert (ret==0);
return c;
}
//EOF Read More...
Posted by
Davy Hawk
at
7/07/2007 05:54:00 PM
0
comments
2007-07-04
amulecmd
~/.aMule/amule.conf
AcceptExternalConnections=1
ECPassword=<md5 string> # get this string with this:$ echo "your passwd" | md5sum | cut -d ' ' -f 1
then:
$ amuled &
you can using amulecmd do a simply control.
$ amulecmd -P "your passwd" [-c "control cmd"]
//EOF Read More...
Posted by
Davy Hawk
at
7/04/2007 08:44:00 AM
0
comments
2007-06-14
GNU Go
GNU Go is a free program that plays the game of Go.
you can using this to play Go with your PC.
but, GNU Go need a GUI.
then, qGo(QT 3) or Quarry(GTK+ 2) will be needed.
GNU Go : http://www.gnu.org/software/gnugo/
qGo : http://sourceforge.net/projects/qgo/
Quarry : http://home.gna.org/quarry/
//EOF
Read More...
Posted by
Davy Hawk
at
6/14/2007 08:45:00 PM
0
comments
2007-05-13
终于决定用Tor了
托我们伟大的国网(GFW)的福,这两天blogspot又不能访问了。。。
而以前的两个代理inblogs和pkblogs又都下线了,不想找别的代理,终于描上了以前听说过的Tor。
其实,原来别人也推荐过我用Tor,主要是保密方面的因素,而我平常也没什么好保密的,也就没有方在心上。
实际上Tor的特性决定了它在除通信保密之外很强的一个用途——可以当作灵活的代理来用——当然为了不要占用大家的资源只能用来作些通信量较小的工作,下载大文件那是最好不要做的。
安装配置方式,使用方法,Tor的主页上都说的很清楚了:
http://tor.eff.org/index.html.zh-cn
//EOF
Read More...
Posted by
Davy Hawk
at
5/13/2007 03:51:00 PM
0
comments
2007-04-29
随便说两句
最近从Windows转向Linux的桌面用户很多,其中有一部分是被最近Linux上兴起的3D桌面吸引,但很大一部分是不能忍受Windows下多如牛毛的病毒之害的。
唉~怎么说呢?
如果说Windows是个人人得以上之的妓女的话。那么Linux无疑是一个气质高雅的优美女孩,这种高雅的气质是由内而外的,这种高雅的气质不可否认的是来自于Unix。
(注意:是优美而不是完美,优美总是那么的可爱,但完美偶尔是会让人觉得反感的)
嗯。。。
并不是说Linux下就没有病毒了,Linux下生产病毒的可能性是很大的,只不过长久以来Linux的使用者都是一些技术群体,对于这些大家都心照不宣(病毒创造出来后最终受害者是谁?何必更自己过不去呢?)。
而且,由于Linux的这种由内而外的高雅气质,即使有病毒但能够危害到系统基础构架的却基本没有。相当于是穿着一件性感漂亮的内衣,不小心弄脏了,洗一洗,或者大不了丢掉再去换一件新的。并不用花费太多的代价,不用吃药,不用动手术,更加不用“重生”、换人。
当然,不能排除某些牛人狠狠钻研内核后找出某些危险的漏洞,而加以利用的可能性。但这样的牛人有几个?他们会这样不负责任么?即使造出来也不会像现在Windows下的那么泛滥吧。
以上说这么多,其实我并没有诽谤Windows的意思。
只不过,想让新用Linux的那批人正确的看待这件事(病毒)。
其实,Windows刚开始流行之初也是没有这么泛滥的病毒之灾的,当时Windows的大多数使用者也只是一些技术人员,当PC迅速普及之后才有这么泛滥的病毒之灾。难道是之前的那些资格深厚的技术人员还不如当今的那些技术小混混么?很明显不是的,技术的积累不是一朝一夕的事情,看看当今Windows下的那些病毒真正有技术含量的有几个?绝大多数都是小混混的流氓作品罢了。
其实我真的很担心,让太多的人染指Linux 会玷污她那高雅的气质,毕竟人多了就杂 难免会掺杂那么几个混混流氓在里面。
//EOF
Read More...
Posted by
Davy Hawk
at
4/29/2007 09:48:00 AM
1 comments
2007-04-20
console下特殊文件名的操作
有时候会碰到一些特殊的文件名如:"-aaa"
因为文件操作命令会自动把"-"后面跟的东西解析成option,所以一般来说都不能成功。
可以在文件名前面用参数“--”(两个减号),来达到操作这种文件的目的。如:
$ ls -l -- -aaa
(对于其他特殊字符可以用""把文件名括起来,或在特殊字符前加"\"解析符号)
另外,对于非ASCII字符命名的文件操作。(当前系统还未安装该语言支持时)
例:当前目录下有名为“abc你好”的目录
1.利用自动补全功能
$ cd abc<这里按Tab键> 自动补完后回车就可进入(前提是当前目录下无其他以"abc"开头的文件名)
2.需要工具 hexdump(util-linux包中)。
$ ls -ad abc* |hexdump -c
0000000 a b c 304 343 272 303 \n
$ cd `printf "abc\304\343\272\303"`
当然,如果当前目录存在多个以abc开头的文件就会麻烦很多,只有你自己通过后面的编码值来确定那个才是你真正需要的了。
//EOF
Read More...
Posted by
Davy Hawk
at
4/20/2007 10:00:00 AM
0
comments
2007-04-19
mount nfs: "can't read superblock"
# showmount -e 192.168.1.21
Export list for 192.168.1.21:
/home/share (everyone)
# mount -t nfs 192.168.1.21:/home/share /mnt/tmp
mount: 192.168.1.21:/home/share: can't read superblock
Solution: try using the -o nolock option from the nfs mount command
# mount -t nfs 192.168.1.21:/home/share /mnt/tmp -o nolock
//EOF Read More...
Posted by
Davy Hawk
at
4/19/2007 01:41:00 PM
0
comments
2007-04-03
用Arch了!
其实老早就听说过Arch的大名,但是由于之前一直使用的是RedHat系的,所以之前不想、也不敢放弃RedHat。
01年接触Unix/Linux,02年开始用的RedHat9,之后出FC后用了FC4/FC5/FC6。
中间用过一次Debian、试过一次Ubuntu都不习惯
去年11月开始又开始了近乎自虐的LFS,由于都是是自己编译的运行的那个速度不是盖的啊!
但编译的过程是异常痛苦的,有了LFS的经历也不敢Gentoo了。
Suse去年11月之后就不在我的考虑之列了。
对Mandriva和Slackware还是感兴趣的,尤其是Mandriva。但也不想浪费太多精力
苦苦守候4月1日Arch0.8的发行,终于选定了自己最终的归宿——Arch!!
当然正式使用前当然少不了虚拟机上的试运行
一个current的CD也就500来MB,base安装(带gcc的)后也就400MB多点。
当然,运行速度也是相当快的,虽然和自己优化编译的LFS没得比,但比FC6还是快多了。
配置也很简单(不是指图形界面哦)——配置文件都放在理所当然的地方、配置的方法也是理所当然的。
pacman, ABS 都很容易操作。
上手还是相当容易的,当然前提是你有使用Linux的基础了 :)
决定了,明天就正式安装。
(当然,我短期内还是不会放弃RedHat的)
//EOF
Read More...
Posted by
Davy Hawk
at
4/03/2007 08:06:00 PM
0
comments
2007-03-11
NOSIGPIPE
在Unix系统下,如果send/recv在等待协议传送数据时网络断开的话,调用send/recv的进程会接收到一个SIGPIPE信号,进程对该信号的默认处理是进程终止。
处理方法:
在初始化时调用signal(SIGPIPE,SIG_IGN)忽略该信号(只需一次)
其时send或recv函数将返回-1,errno为EPIPE,可视情况关闭socket或其他处理
gdb:
gdb默认收到sigpipe时中断程序,可调用handle SIGPIPE nostop print
另外,FreeBSD/MacOSX中有个 SO_NOSIGPIPE 可通过setsockopt设置
SO_NOSIGPIPE do not generate SIGPIPE, instead return EPIPE
(见FreeBSD的setsockopt(2))
但找了半天我的FC6 Linux中却没得 SO_NOSIGPIPE。。。
只好用signal(SIGPIPE,SIG_IGN)吧。
//EOF Read More...
Posted by
Davy Hawk
at
3/11/2007 04:30:00 PM
0
comments
