Archive

Posts Tagged ‘linux’

Debian使用备忘之WIFI配置(WPA2)

May 29th, 2010

硬件环境:Thinkpad x61 kc1

Intel 3945 ABG 无线网卡

系统:Debian Lenny 5.0.4

1.安装iwlwifi固件

aptitude install firmware-iwlwifi

2.激活驱动
modprobe iwl3945

3配置interfaces 文件,在系统启动时自动连接wlan
vim /etc/network/interfaces

auto wlan0
iface wlan0 inet dhcp
pre-up ip link set wlan0 up
pre-up iwconfig wlan0 essid your-ssid
wpa-ssid your-ssid
wpa-psk your-password

参考文档:

http://wiki.debian.org/WiFi/HowToUse

http://wiki.debian.org/iwlwifi

admin linux, 开发笔记 , , ,

Linux 命令备忘

April 21st, 2009
命令 用途 示例 备注
lftp 多线程下载 lftp -c “pget -n 10 http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tgz”
yum groupinstall {LANGUAGE-support}(Red  hat 系列) 安装语言支持 yum groupinstall chinese-support
update-rc.d

(Debian)

系统服务管理 update-rc.d sendmail start 99  2 3 4 5 . stop 99 1 .

update-rc.d sendmail remove

说明: 左边的命令,设置sendmail 在 runlevel 2 3 4 5 启动 优先级为99,再runlevel 1 停止 优先级为99,优先级是0~99的数字,数字越大代表的优先级越低.
rcconf

(Debian)

系统服务管理 rcconf 只能简单的控制服务启用与否,和RedHat,Centos的ntsysv类似
useradd -s /usr/bin/nologin 添加不能登录账号 useradd -s /usr/bin/nologin william
passwd -l 锁定用户 passwd -l william
passwd -u 解锁用户 passwd -u william
sudo su -l 通过sudo切换到root模式
sudo passwd -Sa | awk ‘($2 == “L”)’ 查看系统被锁定的用户
dpkg-reconfigure locales 重新选择系统语言 debian 系统
tzselect 重新选择系统时区 debian系统 refer to http://www.debian-administration.org/articles/213
adduser -s shell /sbin/nologin

admin linux , , , , , ,

在Linux下配置Tomcat自动启动的简单方法

April 11th, 2008

1.安装好JDK和Tomcat, 测试可以正常运行Tomcat.

2.在/etc/init.d 目录下创建名为tomcat的文件(如该目录下已经有同名文件, 则改成其他名字), 该文件内容如下:

#!/bin/sh

# chkconfig: 345 88 14# description: Tomcat Daemon

#Change to your Jdk directoryJAVA_HOME=/opt/jdkexport JAVA_HOME

#Change to your Tomcat directoryCATALINA_HOME=/opt/tomcatexport CATALINA_HOME

# Determine and execute action based on command line parameter

case "$1" instart)echo "Starting Tomcat..."sleep 2$CATALINA_HOME/bin/startup.sh;;stop)echo "Shutting down Tomcat..."sleep 2$CATALINA_HOME/bin/shutdown.sh;;*)echo "Usage: $1 {start|stop}";;esacexit 0

其中以下两行必须要出现在文件中:

# chkconfig: 345 88 14                     ---表示该脚本应该在运行级 3, 4, 5 启动,启动优先权为88,停止优先权为 14。这3组值可以根据自己的情况调节

# description: Tomcat Daemon               ---?

3.在命令行输入以下命令修改文件tomcat的运行级别

chmod a+x /opt/init.d/tomcat

4.在命令行输入以下命令以测试服务可以正常启动

service tomcat start
servive tomcat stop

5.然后将tomcat加入到系统服务中,以便可以自动启动

cd /opt/init.dchkconfig --add tomcat

6.可以通过以下命令查看tomcat服务的详情. 具体的chkconfig命令详情请查看网上资料

chkconfig --list

admin Java世界 ,