
linux
pythoner
这个作者很懒,什么都没留下…
展开
-
Linux下防火墙开启相关端口及查看已开启端口
Linux下防火墙开启相关端口及查看已开启端口 有时候我们辛辛苦苦安装了一个服务却发现无法访问,以为自己没有安装成功,其实解决的方法很简单,就是开启一下相关端口。比如说我安装了Nginx或Apache,那么就需要在防火墙上放行80端口。相关实例代码如下。 /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT #开启80端口...原创 2012-06-13 00:04:08 · 276 阅读 · 0 评论 -
Ubuntu上网问题
今天,安装了XFace桌面,但是出现一个问题,桥连方式无法上网了。家里是无线路由+ADSL宽带上网。在VMWARE上尝试使用NAT上网方式,并更改/etc/network/interfaces文件,清空内容之后输入以下内容:DHCPauto eth0iface eth0 inet dhcp然后重启网路服务:sudo /etc/init.d/networking re...2008-12-29 11:18:00 · 93 阅读 · 0 评论 -
Ubuntu中samba的安装与配置
Install Samba Server on UbuntuIf you want to share files between your Ubuntu and Windows computers, your best option is to use Samba file sharing.To install, first open a terminal window...2008-12-22 03:38:00 · 120 阅读 · 0 评论 -
在Dreamhost服务器上定制python环境
前段时间购买了一个Dreamhost共享空间,因为是促销,价格比Webfaction便宜很多,加上一个域名,一年的费用300来块。打算在上面搭建一个用Django开发的网站。因为比较忙,直到这两天才有时间去折腾它。然而发现系统中默认安装的是python2.4的版本,而我们没有root权限去直接升级python的版本,那么只能考虑在自己的用户目录上定制一个新的python环境。 曾...2010-03-25 17:58:09 · 123 阅读 · 0 评论 -
Ubuntu下VNC配置
通过将服务器配置成VNC SERVER,可以让其他主机使用图形方式登录这台服务器。在ubuntu下配置vnc server很简单,方法如下:[b]服务器端[/b]:1、先安装VNC服务程序:[code="shell"]$ sudo apt-get install vnc4-common vnc4server[/code]2、给当前用户设置vnc登录密码:[c...2010-03-22 18:13:41 · 342 阅读 · 0 评论 -
访问virtualbox虚拟机中架设的网站
翻译比较累,直接贴上原文:6.3.1. Configuring port forwarding with NATAs the virtual machine is connected to a private network internal to VirtualBox and invisible to the host, network services on the guest a...2010-03-19 15:50:23 · 396 阅读 · 0 评论 -
linux下配置防火墙
记录下:1.安装防火墙ufw[code="shell"]sudo aptitude install ufw[/code]2. 启动[code="shell"]sudo ufw enable[/code]3. 启用/取消 记录日志[code="shell"]sudo ufw logging on[/code]4. 为TCP启动80端...2009-12-04 15:52:07 · 101 阅读 · 0 评论 -
linux下ssh授权
写下这个作为备忘:1. 创建目录[code="shell"]mkdir ~/.ssh[/code]2. 生成密钥[code="shell"]ssh-keygen -t rsa[/code]3. 拷贝到目标计算机上[code="shell"]scp ~/.ssh/id_rsa.pub @:/home//[/code]4. 在目标计算...2009-12-04 15:31:18 · 151 阅读 · 0 评论 -
杭州Ubuntu镜像
deb http://mirror.lupaworld.com/ubuntu intrepid main restricted universe multiversedeb http://mirror.lupaworld.com/ubuntu intrepid-security main restricted universe multive...2008-12-06 14:16:00 · 100 阅读 · 0 评论 -
Linux 技巧: 用 cron 和 at 调度作业
转至:http://www.ibm.com/developerworks/cn/linux/l-job-scheduling.html如何轻松地管理系统</td></tr><tr valign="top">&...2008-11-24 15:51:00 · 129 阅读 · 0 评论 -
Linux中通过locale来设置字符集
在Linux中通过locale来设置程序运行的不同语言环境,locale由ANSI C提供支持。locale的命名规则为<语言>_<地区>.<字符集编码>,如zh_CN.UTF-8,zh代表中文,CN代表大陆地区,UTF-8表示字符集。在locale环境中,有一组变量,代表国际化环境中的不同设置:...2009-01-02 21:28:00 · 217 阅读 · 0 评论 -
linux更改用户名,域名
1. 我们在root权限下,使用命令: usermod -l new_user_name old_user_name 即可更改用户名。usermod的具体用法可以通过usermod --help查看。2. 同样在root权限下,使用命令:hostname -v new_host_name来更改域名。hostname的具体用法可以通过hostname --help查看。A...2009-01-06 14:23:00 · 1156 阅读 · 0 评论 -
Linux服务器主要配置
1. SVN配置[url]http://wiki.ubuntu.org.cn/SubVersion[/url]原创 2010-11-30 11:14:24 · 210 阅读 · 0 评论 -
useradd和adduser命令之间的区别
Linux下添加用户可以使用useradd命令,也可以使用adduser命令,关于两者的区别,一直没有留意,今天将两者的区别整理下:1. useradd是一个ELF可执行程序, 它会添加用户名,并创建和用户名相同的组名,但它并不在/home目录下创建基于用户名的目录,也不提示创建新的密码。-b, –base-dir BASE_DIR 指定home目录的base目录-d, –home...原创 2010-06-23 10:41:18 · 395 阅读 · 0 评论 -
文件名和文件内容批量替换
文件名替换: [code="shell"]ls | while read f; do echo mv "$f" "${f/AA/BB}"; done[/code]打印出来如果正确,就将上面大echo去掉,再执行一次,将真正替换。文件内容替换:[code="shell"]ls | while read f; do sed -i 's/AA/BB/g' $f; do...原创 2010-06-03 00:17:11 · 261 阅读 · 0 评论 -
SSH KEYGEN 免输入密码
ssh远程登录服务器时,为了避免输入密码,可以用以下方式进行免密码登录:1. 执行命令[code="shell"]ssh-keygen -t rsa[/code]或者[code="shell"]ssh-keygen -d (dsa)[/code]產生出 id_rsa, id_rsa.pub2. 将文件传到服务器上[code="shell"]scp...原创 2010-05-24 17:08:40 · 177 阅读 · 0 评论 -
Ubuntu9.04杭州镜像
deb http://mirror.lupaworld.com/ubuntu jaunty main restricted universe multiversedeb http://mirror.lupaworld.com/ubuntu jaunty-security main restricted universe multiversedeb http://mirror.lupawor...2009-09-10 10:16:55 · 115 阅读 · 0 评论 -
目录操作
[size=x-small;]目录是存储于磁盘上的数据结构,它由许多目录项组成。每个目录项描述了一个指向其它目录或文件的入口。目录的作用是把文件组织成层次结构,便于管理。[/size][size=x-small;]9.2.1[b] 工作目录[/b] 每一个进程都有一个当前目录和进程相关,获取当前目录用getcwd函数得到。其原型包含在unistd.h头文件中:[co...原创 2010-07-27 15:30:15 · 135 阅读 · 0 评论 -
Fcitx输入法安装
首先,安装fcitx[code="shell"]sudo aptitude install fcitx[/code]然后,启动fcitx[code="shell"]im-switch -s fcitx[/code]注销后重新登录,就能是fcitx生效。接下来就更改一下配置文件。Fcitx的配置文件在~/.fcitx/config,该文件为 GBK编码,在Ubun...原创 2010-05-06 13:11:57 · 156 阅读 · 0 评论 -
Ubuntu10.04终于出了
等了好久,终于等到这个号称Bug最少的版本的面世,晚上尝试下,hoho 下载地址: http://releases.ubuntu.com/10.04/2010-04-30 14:28:40 · 91 阅读 · 0 评论 -
HowTo: Install guest additions for VirtualBox on Debian Lenny 5.0
原文章地址:[url]http://www.ithowto.ro/2009/03/howto-install-guest-additions-for-virtualbox-on-debian-lenny-50/[/url]I have the following setup. The Host machine is running Windows Vista 64 with Virtual...原创 2010-01-29 14:52:40 · 121 阅读 · 0 评论 -
Ubuntu9.10 sources.list
Ubuntu9.10 sources.list: [code="sources"]deb http://ubuntu.srt.cn/ubuntu/ karmic main restricted universe multiversedeb http://ubuntu.srt.cn/ubuntu/ karmic-security main restricted universe mult...2009-11-23 13:40:42 · 124 阅读 · 0 评论 -
Debian下Apache SSL配置方法
1. 安装Apache2[code="command"]sudo apt-get install apache2[/code]2. 开启SSL模块[code="command"]sudo a2enmod ssl [/code]3. 创建证书可以使用apache内置的工具创建默认的证书,通过-days指定有效期。[code="command"]sudo apache2...2009-04-30 13:14:49 · 996 阅读 · 0 评论 -
使用Apache2作为django网站服务器
花费了一些时间配置Apache2,在此将一些配置信息贴上,以作备忘.整体采用的是Apache2 + mod-python + django 的方式.采用虚拟主机方式,在apache2目录中的sites-available中添加了一个网站的配置文件westlake,如下所示:[code="linux"]LoadModule python_module /usr/lib/apa...2009-04-29 20:49:40 · 201 阅读 · 0 评论 -
杭州Ubuntu镜像
deb http://mirror.lupaworld.com/ubuntu intrepid main restricted universe multiversedeb http://mirror.lupaworld.com/ubuntu intrepid-security main restricted universe multiversedeb http://mirror.lupawor原创 2008-12-06 14:16:00 · 654 阅读 · 0 评论 -
linux下python默认版本的选择
当你在linux系统下安装了不同版本的python, 怎样设定默认的版本的?其实很简单,下面的命令就能搞定:sudo ln -sf /usr/bin/python2.5 /usr/bin/python原创 2009-01-21 01:14:00 · 1712 阅读 · 0 评论 -
Linux中通过locale来设置字符集
在Linux中通过locale来设置程序运行的不同语言环境,locale由ANSI C提供支持。locale的命名规则为语言>_地区>.字符集编码>,如zh_CN.UTF-8,zh代表中文,CN代表大陆地区,UTF-8表示字符集。在locale环境中,有一组变量,代表国际化环境中的不同设置:1. LC_COLLATE定义该环境的排序和比较规则2. LC_CTYPE用于字符分类和字符串处转载 2009-01-02 21:28:00 · 2461 阅读 · 0 评论 -
linux更改用户名,域名
1. 我们在root权限下,使用命令: usermod -l new_user_name old_user_name 即可更改用户名。usermod的具体用法可以通过usermod --help查看。2. 同样在root权限下,使用命令:hostname -v new_host_name来更改域名。hostname的具体用法可以通过hostname --help查看。ADDON:hostname原创 2009-01-06 14:23:00 · 3550 阅读 · 0 评论 -
Ubuntu上网问题
今天,安装了XFace桌面,但是出现一个问题,桥连方式无法上网了。家里是无线路由+ADSL宽带上网。在VMWARE上尝试使用NAT上网方式,并更改/etc/network/interfaces文件,清空内容之后输入以下内容:DHCPauto eth0iface eth0 inet dhcp然后重启网路服务:sudo /etc/init.d/networking restart网络连接成功。原创 2008-12-29 11:18:00 · 723 阅读 · 0 评论 -
Debian/Ubuntu下配置Subversion Server
安装Apache2 #sudo apt-get install apache2安装SVN #sudo apt-get install subversion libapache2-svn 配置Apache2的配置文件 /etc/apache2/mods-available/dav_svn.conf <Location /svn>DAV svnSVNParent原创 2008-11-04 19:45:00 · 1970 阅读 · 0 评论 -
svn:ignore操作
This is just a note to myself, since I seem to keep forgetting how to do that properly. After reading the chapter in the svn-bookproperly and using enough [–]help I figured it out and I am scar转载 2008-09-03 22:35:00 · 2492 阅读 · 0 评论 -
su, su - 以及sudo
su只能切换到管理员用户权限,不使用管理员的登陆脚本和搜索路径 su-不但能切换到管理员权限而且使用管理员登陆脚本和搜索路径 sudo:功能:对于root授权的用户,可使用该命令临时切换到root用户环境下。 授权文件为 /etc/sudoers 文件,只要里面有你的大名,你就享有sudo特权。 visudovi /etc/sudoers # User privile原创 2008-07-31 17:48:00 · 534 阅读 · 0 评论 -
opensuse 11.0安装使用中的一些问题
by ncforestfrom: http://ncforest.blog.163.com/blog/static/295626642008519113549639我选择的桌面是kde41、安装.DVD硬盘安装如果在NTFS分区,会出错,提示找不到媒体问题。在fat32分区则一切正常。对于NTFS找不到媒体问题问题可以用下面的方法解决:1) 按ctrl+alt+F2进入控制台,输入mount -l转载 2008-07-29 02:25:00 · 2069 阅读 · 0 评论 -
Ubuntu中安装pgasync的问题
从http://jamwt.com/pgasync/下载该包,安装其安装的教程执行命令:sudo python setup.py install 然而,出现一下问题: --------------------------------------------------------------------------------------------------------------------原创 2008-12-22 02:29:00 · 862 阅读 · 0 评论 -
Ubuntu中samba的安装与配置
Install Samba Server on UbuntuIf you want to share files between your Ubuntu and Windows computers, your best option is to use Samba file sharing.To install, first open a terminal window and enter the转载 2008-12-22 03:38:00 · 1642 阅读 · 0 评论 -
Debian下在Apache2中安装配置xsendfile模块
至于xsendfile模块的作用就不多说了,反正能较大程度提升文件下载的性能。以下是我在实际操作过程中总结出的配置步骤:1.首先,添加xsendfile的源到sources.list中:[code="linux"]deb http://ppa.launchpad.net/damokles/ubuntu hardy maindeb-src http://ppa.launchpad...2009-04-29 20:36:15 · 334 阅读 · 0 评论 -
Debian系统配置说明
Chapter 12. Debian系统配置文件说明Table of Contents12.1. /etc/passwd、/etc/shadow和/etc/group12.2. /etc/login.defs12.3. /etc/securetty12.4. ~/.gnomerc12.5. ~/.gtkrc.zh_...2008-11-04 20:58:00 · 275 阅读 · 0 评论 -
Debian/Ubuntu下配置Subversion Server
安装Apache2#sudo apt-get install apache2安装SVN#sudo apt-get install subversion libapache2-svn 配置Apache2的配置文件 /etc/apache2/mods-available/dav_svn.conf<Location /svn>DAV s...2008-11-04 19:45:00 · 111 阅读 · 0 评论 -
debian镜像地址
deb http://www.anheng.com.cn/debian/ testing maindeb-src http://www.anheng.com.cn/debian/ testing main#deb http://debian.cn99.com/debian/ testing main#deb-src http://debian.cn99.com/debian...2008-10-17 15:57:00 · 860 阅读 · 0 评论 -
svn:ignore操作
This is just a note to myself, since I seem to keep forgetting how to do that properly. After reading the chapter in the svn-bookproperly and using enough [–]help I figured it out and I am scared ...2008-09-03 22:35:00 · 151 阅读 · 0 评论