Category Archives: Unix/Linux

Shell的知识点整理

这几天抽了点时间看了一下《Advanced Bash-Scripting Guide》, 之前一直觉得shell这门脚本很有意思,虽然用得不多,但感觉shell这门脚本似乎有点粗糙,但看了abs-guide之后就觉得shell还是很强大的,很多高级特性之前都没曾接触过,平时也用得不算很多。浏览了一下abs-guide之后做了一些简单的笔记,方便以后查看,每个”echo ===”之间就是代码片段,在bash version 3.2.48下测试过,点解高亮区的”view source”可以直接复制所有代码。

Posted in Unix/Linux | Leave a comment

在Debian搭建SVN

今天在Linode买的vps上搭了个svn,简单记录一下过程和遇到的问题。 先说遇到的问题吧,基本上就是 1. “Could not open the requested SVN filesystem”; 2. “Server sent unexpected return value (403 Forbidden) in response to OPTIONS “. 第一个问题是因为开始没有搞清楚创建一个和多个svn repository的区别,而第二个是因为权限设置的问题。 svn服务器比较重要的涉及安全的问题就是用户认证、访问授权以及传输加密。根据官方的介绍,搭建svn有几种方式,各有优劣,我用的是Apache + mod_dav_svn+Basic Auth。 具体流程如下,以多个为例,单个的只是参数的差别: 1. 安装所需软件 apt-get install subversion subversion-tools apache2 libapache2-svn 2. 创建存放的路径 … Continue reading

Posted in Unix/Linux | Leave a comment

VirtualBox拷贝vdi丢失eth0

今天用VirtualBox的工具去拷贝虚拟机vdi文件的时候,在拷贝出来的vdi文件中找不到eth0。 # debian lenny VBoxManage clonevdi old.vdi new.vdi 拷贝成功,但当打开new.vdi的时候就出现eth0找不到了。原来是使用VBoxManage的时候不但会为新的vdi文件产出新的UUID,还会为其分配一个新的mac地址,以避免冲突,这样在debian中就会把新的mac地址设置为eth1,结果就杯具了。 解决方法有2个,其实差不多: 在new.vdi中,修改/etc/udev/rules.d/70-persistent-net.rules,一般会有eth0和eth1两行,把eth0那行去掉,然后将eth1改成eth0。 把/etc/udev/rules.d/70-persistent-net.rules中的内容直接删除,然后重启,让系统自动去检测网卡,然后重新生成该文件。其实在copy之前就可以删掉了,这样所有copy出来的都不用修改了,让系统自己去检测。 /etc/udev/rules.d/70-persistent-net.rules这个文件是在网卡有变动的时候才会变化的,里面记录着网卡的信息,虽然VBoxManage会为new.vdi创建新的网卡,但是debian的行为是把这个网卡作为新增的网卡记录在/etc/udev/rules.d/70-persistent-net.rules中,而没有进行调整,所以使用的还是有冲突的eth0。

Posted in Unix/Linux | 2 Comments

Crontab

Intro: crontab  is  the  program used to install, deinstall or list the tables used to drive the cron(8) daemon in Vixie Cron.  Each user can have their own crontab, and though these are files in /var/spool/cron/crontabs, they are not intended … Continue reading

Posted in Unix/Linux | 4 Comments

Debian Package系统学习小结

这里先介绍一下创建repository的步骤和apt-get命令的相关数据流程,以后有时间再将其他的细节补充。 一、创建repository locate root direcotry, create pool move binary and source packages to pool generate Packages, Sources file (dpkg-scanpackages, dpkg-scansources) create Release file and signature Release.gpg (apt-ftparchive, gpg) publish repository : http, ftp, file 下面这个是创建repository的简单脚本:

Posted in Unix/Linux | Leave a comment