- 挂载:
#将src目录挂在到/dst/目录上,在执行umount操作之前原本/dst/目录中的内容不能被访问 mount -o bind /src/ /dst/
- 取消挂载:
umount /src/
Technology is not the only, Mind is supreme
linux相关内容
#将src目录挂在到/dst/目录上,在执行umount操作之前原本/dst/目录中的内容不能被访问 mount -o bind /src/ /dst/
umount /src/
以下操作请在root用户下完成,文件位置可自拟
#创建一个1G的文件 dd if=/dev/zero of=/swapfile bs=1024 count=1048576 #格式化为swap文件 mkswap /swapfile #使swap生效 swapon /swapfile #修改启动挂载 echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
1、临时修改:使用hostname命令即可使计算机名临时变为指定的名字,如hostname test就可以使计算机在重启之前的名字变为test。
2、永久修改:
chkconfig --list #列出所有的系统服务 chkconfig --add httpd #增加httpd服务 chkconfig --del iptables #删除iptables服务(关闭防火墙) chkconfig --list #列出系统所有的服务启动情况 chkconfig --list mysqld #列出mysqld服务设置情况 chkconfig mysqld on #使mysqld服务开机启动(运行级别2、3、4、5) chkconfig iptables off #禁止mysqld服务开机启动(关闭防火墙)
64位的linux下使用AVD启动android模拟器会报错,centOS会提示bad ELF interpreter而ubuntu只会提示NoSuchFile
这是由于从google下载的android虽然是x86_64的sdk包,但里边实际上是含有32位的程序的(或者说是对32位的相关包有依赖),所以需要安装32位的lib
对于ubuntu:
sudo apt-get install ia32-libs lib32ncurses5 lib32stdc++6
对于centOS:
yum install glibc.i686 yum install libstdc++.so.6
安装完毕后即可。
本文的主要目标为:在墙外的服务器安装openvpn来达到访问互联网的目的,前提是你应该至少有一台墙外服务器,付费或者免费均可。
以下为正文
sudo apt-get install openvpn easy-rsa
为了方便起见,以下在root用户下进行,使用sudo -i来切换至root用户
mkdir /etc/openvpn/easy-rsa/ cp -r /usr/share/easy-rsa/* /etc/openvpn/easy-rsa/ cd /etc/openvpn/easy-rsa/
ssh 无密码登录要使用公钥与私钥。linux下可以用用ssh-keygen生成公钥/私钥对,下面我以CentOS为例。
有机器A(192.168.1.155),B(192.168.1.181)。现想A通过ssh免密码登录到B。
1.在A机下生成公钥/私钥对。
[chenlb@A ~]$ ssh-keygen -t rsa -P ”
-P表示密码,-P ” 就表示空密码,也可以不用-P参数,这样就要三车回车,用-P就一次回车。
它在/home/chenlb下生成.ssh目录,.ssh下有id_rsa和id_rsa.pub。
2.把A机下的id_rsa.pub复制到B机下,在B机的.ssh/authorized_keys文件里,我用scp复制。
[chenlb@A ~]$ scp .ssh/id_rsa.pub chenlb@192.168.1.181:/home/chenlb/id_rsa.pub
chenlb@192.168.1.181’s password:
id_rsa.pub 100% 223 0.2KB/s 00:00
由于还没有免密码登录的,所以要输入密码。
3.B机把从A机复制的id_rsa.pub添加到.ssh/authorzied_keys文件里。
[chenlb@B ~]$ cat id_rsa.pub >> .ssh/authorized_keys
[chenlb@B ~]$ chmod 600 .ssh/authorized_keys
authorized_keys的权限要是600。
4.A机登录B机。
[chenlb@A ~]$ ssh 192.168.1.181
The authenticity of host ‘192.168.1.181 (192.168.1.181)’ can’t be established.
RSA key fingerprint is 00:a6:a8:87:eb:c7:40:10:39:cc:a0:eb:50:d9:6a:5b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.1.181’ (RSA) to the list of known hosts.
Last login: Thu Jul 3 09:53:18 2008 from chenlb
[chenlb@B ~]$
第一次登录是时要你输入yes。
现在A机可以无密码登录B机了。
小结:登录的机子可有私钥,被登录的机子要有登录机子的公钥。这个公钥/私钥对一般在私钥宿主机产生。上面是用rsa算法的公钥/私钥对,当然也可以用dsa(对应的文件是id_dsa,id_dsa.pub)
想让A,B机无密码互登录,那B机以上面同样的方式配置即可。
本文转自:http://chenlb.iteye.com/blog/211809
本文根据http://www.reviewboard.org/docs/manual/1.7/admin/installation/linux/而来
在墙内安装这个的时候,要准备一个好用的http代理,goagent就可以.,以下的步骤说不定哪个步骤就不能进行了,所以推荐先export http_proxy=http://ip:port ,如果执行某个命令莫名的失败了,请多执行几次。另外开始之前更新一下ubuntu:
We recommend Apache or Nginx as the most robust and featureful server for running WordPress, but any server that supports PHP and MySQL will do. That said, we can’t test every possible environment andeach of the hosts on our hosting page supports the above and more with no problems.
整个网站都是基于Amazon提供的各项服务的:服务器为EC2,数据库为RDS
由于Amazon的云服务器中unix-like的操作系统除了自家的AMI只有Ubuntu了,所以就把论坛搭在了Ubuntu上,以下是操作过程: