Tuesday, September 19, 2006
pure-ftpd-mysql setting
http://www.linuxsky.net/html/200604/2948.html
首先必须确定本地用户能登录,否则的话
#cp /usr/sbin/pure-ftpd-mysql /usr/sbin/pure-ftpd 。
使用mysql的root帐号比较方便,所以是
grant all privileges on FTP.* to localhost identified by '123456'
最后PureFTP User Management能使用的话而虚拟用户不能使用的话就是pureftpd的设置问题了,注意ftp根目录和ftp用户的所属关系。
必须在系统里面建立一个名为ftp的用户,当然也要把/etc/pure-ftpd/conf/NoAnonymous 改为no。
我是这个做的:useradd ftp -g ftpgroup -d /yourftpdir -s /etc
首先必须确定本地用户能登录,否则的话
#cp /usr/sbin/pure-ftpd-mysql /usr/sbin/pure-ftpd 。
使用mysql的root帐号比较方便,所以是
grant all privileges on FTP.* to localhost identified by '123456'
最后PureFTP User Management能使用的话而虚拟用户不能使用的话就是pureftpd的设置问题了,注意ftp根目录和ftp用户的所属关系。
必须在系统里面建立一个名为ftp的用户,当然也要把/etc/pure-ftpd/conf/NoAnonymous 改为no。
我是这个做的:useradd ftp -g ftpgroup -d /yourftpdir -s /etc
Thursday, September 07, 2006
remind
在哪里能找到免费的域名
forum.prayaya.com中这个forum代表什么,怎么能实现
vsftpd的3种登陆方式:
http://www.linuxsir.org/bbs/showthread.php?t=270044
http://linux.chinaunix.net/docs/2006-08-29/2589.shtml
正则表达式 Regular Expression
ssh对于内网的应用
http://linuxsir.org/bbs/showthread.php?t=37295
http://linuxsir.org/bbs/showthread.php?t=274449
forum.prayaya.com中这个forum代表什么,怎么能实现
vsftpd的3种登陆方式:
http://www.linuxsir.org/bbs/showthread.php?t=270044
http://linux.chinaunix.net/docs/2006-08-29/2589.shtml
正则表达式 Regular Expression
ssh对于内网的应用
http://linuxsir.org/bbs/showthread.php?t=37295
http://linuxsir.org/bbs/showthread.php?t=274449
make cloop tool
#!/bin/bash
#引导程序
BOOTLOADER=""
#制作ISO
MKBOOTISO=""
#制作CLOOP文件
MKCLOOP=""
#源
SOURCE=""
#是否使用日期结尾的文件名?
USEDATE=""
#程序名
PROGRAMNAME=$0
#压缩算法
COMPRESS="9"
#清空临时文件
FLUSH=""
#帮助
usage()
{
echo "使用方法:$PROGRAMNAME [选项]
选项:
-h 本页
-7 使用7zip压缩,压缩率比默认的gzip略高,但所花时间会多很多
-b 指定引导程序(小写grub或isolinux,缺省为isolinux)
-c 目标cloop文件名
-d 在目标ISO文件名加上日期、时间
-f 清除制作时的一些临时文件
-i 目标ISO文件名
-s 源目录/cloop文件名"
return 1
}
while [ -n "$1" ]; do
case $1 in
-h) usage;shift 1;; # 帮助
-b) shift 1;BOOTLOADER=$1;shift 1;;
-i) shift 1;MKBOOTISO=$1;shift 1;;
-c) shift 1;MKCLOOP=$1;shift 1;;
-s) shift 1;SOURCE=$1;shift 1;;
-d) shift 1;USEDATE="yes";;
-7) shift 1;COMPRESS="-1";shift 1;;
-f) shift 1;FLUSH="yes";;
--) shift;break;; # 已经没有选项
-*) echo "错误: 没有$1选项. $0 -h查看帮助";;
*) break;;
esac
done
make_cloop()
{
TYPE=$(file $SOURCE |cut -f 2 -d " ")
if [ "$TYPE" == "ISO" ];then
/usr/bin/create_compressed_fs -B 65536 -L $COMPRESS -r $SOURCE $MKCLOOP
return 0
else
mkisofs -R -U -V "inlsd.org filesystem" -publisher "INLSD www.inlsd.org" -hide-rr-moved -cache-inodes -no-bak -pad $SOURCE |/usr/bin/create_compressed_fs -L $COMPRESS -B 65536 -r - $MKCLOOP
return 0
fi
return 1
}
make_boot_iso()
{
if [ -z "$BOOTLOADER" ] -o [ "$BOOTLOADER" == "isolinux" ];then
mkisofs -pad -l -r -J -v -V "INLSD SYSTEM" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o $MKBOOTISO $SOURCE
return 0
elif [ "$BOOTLOADER" == "grub" ];then
mkisofs -pad -l -r -J -v -V "INLSD SYSTEM" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/grub/stage2_eltorito -hide-rr-moved -o $MKBOOTISO $SOURCE
return 0
else
echo "错误!-b参数不是grub或isolinux!"
fi
return 1
}
if [ ! -x /usr/bin/create_compressed_fs ];then
echo "错误,没有cloop工具。"
exit 1
fi
if [ ! -x /usr/bin/mkisofs ];then
echo "错误,没有mkisofs工具。"
exit 1
fi
if [ -n "$USEDATE" ];then
MKBOOTISO=$(echo $MKBOOTISO|sed 's/\.[iI][Ss][Oo]$//g')$(date +%Y%m%d-%H%M%S).iso
fi
if [ -n "$MKBOOTISO" -a -n "$MKCLOOP" ];then
echo "错误!-i参数不能与-c或-d参数同时使用!"
exit 1
fi
if [ -n "$FLUSH" -a -n "$MKCLOOP" ];then
rm -rf $SOURCE/.??* $SOURCE/home/* $SOURCE/home/.??* $SOURCE/root/* $SOURCE/root/.??* $SOURCE/etc/sysconfig/* $SOURCE/var/cache/apt/*cache.bin $SOURCE/var/tmp/* $SOURCE/var/tmp/.??* $SOURCE/tmp/* $SOURCE/tmp/.??* $SOURCE/var/lib/apt/lists/debian.cn99.com*
rm $SOURCE/mnt/*
rmdir $SOURCE/media/*
touch $SOURCE/etc/sysconfig/xsession-commands
fi
if [ -n "$MKBOOTISO" ];then
make_boot_iso
elif [ -n "$MKCLOOP" ];then
make_cloop
else
usage
fi
#引导程序
BOOTLOADER=""
#制作ISO
MKBOOTISO=""
#制作CLOOP文件
MKCLOOP=""
#源
SOURCE=""
#是否使用日期结尾的文件名?
USEDATE=""
#程序名
PROGRAMNAME=$0
#压缩算法
COMPRESS="9"
#清空临时文件
FLUSH=""
#帮助
usage()
{
echo "使用方法:$PROGRAMNAME [选项]
选项:
-h 本页
-7 使用7zip压缩,压缩率比默认的gzip略高,但所花时间会多很多
-b 指定引导程序(小写grub或isolinux,缺省为isolinux)
-c 目标cloop文件名
-d 在目标ISO文件名加上日期、时间
-f 清除制作时的一些临时文件
-i 目标ISO文件名
-s 源目录/cloop文件名"
return 1
}
while [ -n "$1" ]; do
case $1 in
-h) usage;shift 1;; # 帮助
-b) shift 1;BOOTLOADER=$1;shift 1;;
-i) shift 1;MKBOOTISO=$1;shift 1;;
-c) shift 1;MKCLOOP=$1;shift 1;;
-s) shift 1;SOURCE=$1;shift 1;;
-d) shift 1;USEDATE="yes";;
-7) shift 1;COMPRESS="-1";shift 1;;
-f) shift 1;FLUSH="yes";;
--) shift;break;; # 已经没有选项
-*) echo "错误: 没有$1选项. $0 -h查看帮助";;
*) break;;
esac
done
make_cloop()
{
TYPE=$(file $SOURCE |cut -f 2 -d " ")
if [ "$TYPE" == "ISO" ];then
/usr/bin/create_compressed_fs -B 65536 -L $COMPRESS -r $SOURCE $MKCLOOP
return 0
else
mkisofs -R -U -V "inlsd.org filesystem" -publisher "INLSD www.inlsd.org" -hide-rr-moved -cache-inodes -no-bak -pad $SOURCE |/usr/bin/create_compressed_fs -L $COMPRESS -B 65536 -r - $MKCLOOP
return 0
fi
return 1
}
make_boot_iso()
{
if [ -z "$BOOTLOADER" ] -o [ "$BOOTLOADER" == "isolinux" ];then
mkisofs -pad -l -r -J -v -V "INLSD SYSTEM" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o $MKBOOTISO $SOURCE
return 0
elif [ "$BOOTLOADER" == "grub" ];then
mkisofs -pad -l -r -J -v -V "INLSD SYSTEM" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/grub/stage2_eltorito -hide-rr-moved -o $MKBOOTISO $SOURCE
return 0
else
echo "错误!-b参数不是grub或isolinux!"
fi
return 1
}
if [ ! -x /usr/bin/create_compressed_fs ];then
echo "错误,没有cloop工具。"
exit 1
fi
if [ ! -x /usr/bin/mkisofs ];then
echo "错误,没有mkisofs工具。"
exit 1
fi
if [ -n "$USEDATE" ];then
MKBOOTISO=$(echo $MKBOOTISO|sed 's/\.[iI][Ss][Oo]$//g')$(date +%Y%m%d-%H%M%S).iso
fi
if [ -n "$MKBOOTISO" -a -n "$MKCLOOP" ];then
echo "错误!-i参数不能与-c或-d参数同时使用!"
exit 1
fi
if [ -n "$FLUSH" -a -n "$MKCLOOP" ];then
rm -rf $SOURCE/.??* $SOURCE/home/* $SOURCE/home/.??* $SOURCE/root/* $SOURCE/root/.??* $SOURCE/etc/sysconfig/* $SOURCE/var/cache/apt/*cache.bin $SOURCE/var/tmp/* $SOURCE/var/tmp/.??* $SOURCE/tmp/* $SOURCE/tmp/.??* $SOURCE/var/lib/apt/lists/debian.cn99.com*
rm $SOURCE/mnt/*
rmdir $SOURCE/media/*
touch $SOURCE/etc/sysconfig/xsession-commands
fi
if [ -n "$MKBOOTISO" ];then
make_boot_iso
elif [ -n "$MKCLOOP" ];then
make_cloop
else
usage
fi
小李的blog
http://huanff.blog.sohu.com/
the minimun required for X launch
xserver-xorg, xbase-clients, xfonts-base
Wednesday, September 06, 2006
shell for debmirror
#cat /mnt/hdd11/debmirror.etch.sh
#debmirror debmirror.sarge/ -host 221.6.69.11 -arch i386 --progress --dist sarge --ignore-release-gpg --nosource --exclude=potato
#debmirror debmirror.security/ -host security.debian.org -arch i386 --progress -r /debian-security --dist sarge/updates --section=main,contrib,non-free --ignore-release-gpg --nosource --exclude=potato
#debmirror debmirror.etch/ -host debian.cn99.com -e http -arch i386 --progress --dist etch --ignore-release-gpg --nosource --exclude=potato
debmirror debmirror.etch/ -host debian.inlsd.com -e http -arch i386 --progress --dist etch --ignore-release-gpg --nosource --exclude=potato
#debmirror debmirror.sid/ -host 221.6.69.11 -arch i386 --progress --dist sid --ignore-release-gpg --nosource --exclude=potato
#halt
#debmirror debmirror.sarge/ -host 221.6.69.11 -arch i386 --progress --dist sarge --ignore-release-gpg --nosource --exclude=potato
#debmirror debmirror.security/ -host security.debian.org -arch i386 --progress -r /debian-security --dist sarge/updates --section=main,contrib,non-free --ignore-release-gpg --nosource --exclude=potato
#debmirror debmirror.etch/ -host debian.cn99.com -e http -arch i386 --progress --dist etch --ignore-release-gpg --nosource --exclude=potato
debmirror debmirror.etch/ -host debian.inlsd.com -e http -arch i386 --progress --dist etch --ignore-release-gpg --nosource --exclude=potato
#debmirror debmirror.sid/ -host 221.6.69.11 -arch i386 --progress --dist sid --ignore-release-gpg --nosource --exclude=potato
#halt
mplayer for debian
echo "deb http://www.debian-multimedia.org etch main" >> /etc/apt/source.list
VOA radio
mplayer -cache 100 rtsp://a1702.l211048984.c2110.g.lr.akamaistream.net:554/live/D/1702/2110/v0001/reflector:48984
Knoppix's file systme cloop
mount -o loop xxx.iso /cdrom
extract_compressed_fs /cdrom/KNOPPIX/KNOPPIX > cloop.iso
umount /cdrom
mount -o loop cloop.iso /cdrom
cp -av /cdrom/* /xxx
用這個方法解開,不要安裝
解開後chroot方法安裝軟件
extract_compressed_fs /cdrom/KNOPPIX/KNOPPIX > cloop.iso
umount /cdrom
mount -o loop cloop.iso /cdrom
cp -av /cdrom/* /xxx
用這個方法解開,不要安裝
解開後chroot方法安裝軟件
disk's R&R
backup:
dd if=/dev/hda of= backup-hda.mbr count=1 bs=512
sfdisk -d /dev/hda > backup-hda.sf
restore
dd if=backup-hda.mbr of=/dev/hda
sfdisk /dev/hda < backup-hda.sf
dd if=/dev/hda of= backup-hda.mbr count=1 bs=512
sfdisk -d /dev/hda > backup-hda.sf
restore
dd if=backup-hda.mbr of=/dev/hda
sfdisk /dev/hda < backup-hda.sf
qemu boot an ISO
qemu -cdrom prayaya-linux-en-20060825.iso -hda /dev/sda -boot d
xmms' font setting for zh_CN
-*-*-medium-r-normal--16-*-*-*-*-*-gb2312.1980-0,*-r-*
DNS 3322.org's auto config
lynx -mime_header -auth=username:password "http://www.3322.org/dyndns/update?system=dyndns&hostname=myhost.3322.org"
dhcpd.conf
option domain-name-servers 192.168.1.22;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.30 192.168.1.100;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
}
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.30 192.168.1.100;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
}
Speeding up work at Linux command line part # 1
http://www.cyberciti.biz/nixcraft/vivek/blogger/2005/08/speeding-up-work-at-linux-command-line.html
Working at shell prompt is an essential task for any Linux system administration. However many newcomers find it difficult to work at bash prompt. Here are some tricks to speed up your work.
(A) Shortcut keys for command editing:
CTRL+L : Clear the screen
CTRL+R : To search for a command in command history. For example yesterday or few hourse back you typed 'a very very long command' and you need same command again. Then hit CTRL+R and type first few letters of command.
CTRL+C : Cancel command
CTRL+Z : Suspend command
CTRL+T : transpose characters. For example by misspelled command date:
$ daet
Sure you can rub the last two character and retype it again, but wait just hist CTRL+T and you are done:
$ daet [CTRL+T]
Result into character transpose:
$ date
ALT+T OR ESC+T: transpose words. For example you typed:
$ filename rm
To correct it just hit ALT+T
$ filename rm [ALT+T]
And you have correct command to remove a file.
$ rm filename
CTRL+U : Deletes entire line
CTRL+K : Deletes to end of line from current cursor position
HOME OR CTRL+A : Moves cursor to beginning of line
END OR CTRL+E : Moves cursor to end of line
(B)Recall last argument from previous command – to save time
ALT+. (hold down ALT key and press period/dot)
For example first you typed the mkdir command as follows:
$ mkdir -p /tmp/demo/software/qtapp
Now you would like change directory to /tmp/demo/software/qtapp, then type cd and press ALT+.:
$ cd [PRESS alt+.]
(C) Command completion
Most of the Linux admin uses TAB key to complete command names and files names. So let us say you would like to mount something then:
i) Type word mo:
$ mo
ii) Hit TAB key to complete word
$ mo [TAB]
iii) And end result should be:
$ mount
(D) List the possible completions
BASH also supports the possible completions of commands or text (file). For example you would like to list all the possible command starts with ls command:
$ ls [ESC]
Will display following text (above the current command line)
ls lsmod lsmod.modutils lspci lsusblsattr lsmod.Lmodutils lsof
Next time I will discuss more about advanced command line completions and other cool features.
*** If you enjoyed this article, grab our Feed OR Subscribe to the nixCraft email newsletter OR use Technorati to track all updates. ***
Working at shell prompt is an essential task for any Linux system administration. However many newcomers find it difficult to work at bash prompt. Here are some tricks to speed up your work.
(A) Shortcut keys for command editing:
CTRL+L : Clear the screen
CTRL+R : To search for a command in command history. For example yesterday or few hourse back you typed 'a very very long command' and you need same command again. Then hit CTRL+R and type first few letters of command.
CTRL+C : Cancel command
CTRL+Z : Suspend command
CTRL+T : transpose characters. For example by misspelled command date:
$ daet
Sure you can rub the last two character and retype it again, but wait just hist CTRL+T and you are done:
$ daet [CTRL+T]
Result into character transpose:
$ date
ALT+T OR ESC+T: transpose words. For example you typed:
$ filename rm
To correct it just hit ALT+T
$ filename rm [ALT+T]
And you have correct command to remove a file.
$ rm filename
CTRL+U : Deletes entire line
CTRL+K : Deletes to end of line from current cursor position
HOME OR CTRL+A : Moves cursor to beginning of line
END OR CTRL+E : Moves cursor to end of line
(B)Recall last argument from previous command – to save time
ALT+. (hold down ALT key and press period/dot)
For example first you typed the mkdir command as follows:
$ mkdir -p /tmp/demo/software/qtapp
Now you would like change directory to /tmp/demo/software/qtapp, then type cd and press ALT+.:
$ cd [PRESS alt+.]
(C) Command completion
Most of the Linux admin uses TAB key to complete command names and files names. So let us say you would like to mount something then:
i) Type word mo:
$ mo
ii) Hit TAB key to complete word
$ mo [TAB]
iii) And end result should be:
$ mount
(D) List the possible completions
BASH also supports the possible completions of commands or text (file). For example you would like to list all the possible command starts with ls command:
$ ls [ESC]
Will display following text (above the current command line)
ls lsmod lsmod.modutils lspci lsusblsattr lsmod.Lmodutils lsof
Next time I will discuss more about advanced command line completions and other cool features.
*** If you enjoyed this article, grab our Feed OR Subscribe to the nixCraft email newsletter OR use Technorati to track all updates. ***