1)Windows+R键,打开运行,输入gpedit.msc,打开本地组策略编辑器;
2)打开本地组策略编辑器,计算机配置=>管理模板=>网络=>Lanman 工作站;
3)双击“启用不安全的来宾登录”;
4)选择“已启用”,点确定;
1)Windows+R键,打开运行,输入gpedit.msc,打开本地组策略编辑器;
2)打开本地组策略编辑器,计算机配置=>管理模板=>网络=>Lanman 工作站;
3)双击“启用不安全的来宾登录”;
4)选择“已启用”,点确定;
将
dashboard_addr 的后面的值改为
dashboard_addr = 0.0.0.0 即可
特别注意:
下载文件, /attachments/1212/vpn_centos_pptpd.sh
安装命令:bash vpn_centos_pptpd.sh
选择 1 :安装 vpn
选择 2 :添加 vpn 账号(安装完后,随时可以使用 bash vpn_centos_pptpd.sh 来选择 2 添加 vpn 账号。当然也可以直接编辑 /etc/ppp/chap-secrets
vpn_centos_pptpd.sh 文件代码
#!/bin/bash
function installVPN(){
echo “begin to install VPN services”;
#check wether vps suppot ppp and tun
#判断centos版本
if grep -Eqi “release 5.” /etc/redhat-release; then
ver1=’5′
elif grep -Eqi “release 6.” /etc/redhat-release; then
ver1=’6′
elif grep -Eqi “release 7.” /etc/redhat-release; then
ver1=’7′
fi
yum install curl -y
yum install epel-release -y
if [ “$ver1” == “7” ]; then
#centos7要安装iptables把默认防火墙关了。
systemctl stop firewalld.service
systemctl disable firewalld.service
yum install iptables-services -y
#centos7需要加这个权限,否则不会开机自动执行
chmod +x /etc/rc.d/rc.local
fi
#先删除已经安装的pptpd和ppp
rm -rf /etc/pptpd.conf
rm -rf /etc/ppp
yum install -y ppp pptpd
#写配置文件
mknod /dev/ppp c 108 0
echo 1 > /proc/sys/net/ipv4/ip_forward
echo “mknod /dev/ppp c 108 0” >> /etc/rc.local
echo “echo 1 > /proc/sys/net/ipv4/ip_forward” >> /etc/rc.local
echo “localip 172.16.36.1” >> /etc/pptpd.conf
echo “remoteip 172.16.36.2-254” >> /etc/pptpd.conf
echo “ms-dns 8.8.8.8” >> /etc/ppp/options.pptpd
echo “ms-dns 8.8.4.4” >> /etc/ppp/options.pptpd
pass=`openssl rand 6 -base64`
if [ “$1” != “” ]
then pass=$1
fi
echo “vpn pptpd ${pass} *” >> /etc/ppp/chap-secrets
iptables -t nat -A POSTROUTING -s 172.16.36.0/24 -j SNAT –to-source `curl ip.cn | awk -F ‘ ‘ ‘{print $2}’ | awk -F ‘:’ ‘{print $2}’`
iptables -A FORWARD -p tcp –syn -s 172.16.36.0/24 -j TCPMSS –set-mss 1356
iptables -I INPUT -p gre -j ACCEPT
iptables -I INPUT -p tcp -m tcp –dport 1723 -j ACCEPT
service iptables save
if [ “ver1” == “7” ]; then
systemctl enable iptables.service
systemctl enable pptpd.service
systemctl restart iptables.service
systemctl restart pptpd.service
else
chkconfig iptables on
chkconfig pptpd on
service iptables start
service pptpd start
fi
echo “================================================”
echo “感谢 pptpd vpn一键安装包”
echo -e “VPN的初始用户名是:\033[41;37m vpn \033[0m, 初始密码是: \033[41;37m ${pass} \033[0m”
echo “你也可以直接 vi /etc/ppp/chap-secrets修改用户名和密码”
echo “================================================”
}
function addVPNuser(){
echo “input user name:”
read username
echo “input password:”
read userpassword
echo “${username} pptpd ${userpassword} *” >> /etc/ppp/chap-secrets
service iptables restart
service pptpd start
}
echo “which do you want to?input the number.”
echo “1. install VPN service”
echo “2. add VPN user”
read num
case “$num” in
[1] ) (installVPN);;
[2] ) (addVPNuser);;
*) echo “nothing,exit”;;
esac
使用方法:
将如下脚本内容,存储为pptpd.sh,然后运行:
sh pptpd.sh
yum remove -y pptpd ppp
iptables –flush POSTROUTING –table nat
iptables –flush FORWARD
rm -rf /etc/pptpd.conf
rm -rf /etc/ppp
wget http://www.diahosting.com/dload/dkms-2.0.17.5-1.noarch.rpm
wget http://www.diahosting.com/dload/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
wget http://www.diahosting.com/dload/pptpd-1.3.4-1.rhel5.1.i386.rpm
wget http://www.diahosting.com/dload/ppp-2.4.4-9.0.rhel5.i386.rpm
yum -y install make libpcap iptables gcc-c++ logrotate tar cpio perl pam tcp_wrappers
rpm -ivh dkms-2.0.17.5-1.noarch.rpm
rpm -ivh kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
rpm -qa kernel_ppp_mppe
rpm -Uvh ppp-2.4.4-9.0.rhel5.i386.rpm
rpm -ivh pptpd-1.3.4-1.rhel5.1.i386.rpm
mknod /dev/ppp c 108 0
echo 1 > /proc/sys/net/ipv4/ip_forward
echo “mknod /dev/ppp c 108 0” >> /etc/rc.local
echo “echo 1 > /proc/sys/net/ipv4/ip_forward” >> /etc/rc.local
echo “localip 172.16.36.1” >> /etc/pptpd.conf
echo “remoteip 172.16.36.2-254” >> /etc/pptpd.conf
echo “ms-dns 8.8.8.8” >> /etc/ppp/options.pptpd
echo “ms-dns 8.8.4.4” >> /etc/ppp/options.pptpd
pass=`openssl rand 6 -base64`
if [ “$1” != “” ]
then pass=$1
fi
echo “vpn pptpd ${pass} *” >> /etc/ppp/chap-secrets
iptables -t nat -A POSTROUTING -s 172.16.36.0/24 -j SNAT –to-source `ifconfig | grep ‘inet addr:’| grep -v ‘127.0.0.1’ | cut -d: -f2 | awk ‘NR==1 { print $1}’`
iptables -A FORWARD -p tcp –syn -s 172.16.36.0/24 -j TCPMSS –set-mss 1356
service iptables save
chkconfig iptables on
chkconfig pptpd on
service iptables start
service pptpd start
echo “VPN service is installed, your VPN username is vpn, VPN password is ${pass}”
现在都升级了光宽带,电信移动都送了猫,原来的Westell_327W ADSL一体机没有用了,就换了下来 但是发现原来的那个雷科的 很不稳定,本来想去买个路由器来试试看,但是发现竟然Westell_327W这个可以关闭ADSL功能,WAN1口可以改为WAN口 直接做无线路由器使用,真的是太开心啦。哈哈。现在已经换上用,不知道有没有 比原来的雷科稳定。
[download id=”3″]
# 阻止列出所有文件
IndexIgnore *
# 阻止列出include文件夹
IndexIgnore /include
# 禁止浏览目录
Options -indexes
1. 添加磁盘,查看磁盘状况
[root@db1 /]# fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 151 1305 9277537+ 83 Linux
/dev/sda2 1 150 1204843+ 82 Linux swap
Partition table entries are not in disk order
Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
从查询结果看出,多了一个/dev/sdb的盘
2. 用fdisk 对/dev/sdb 进行分区
[root@db1 /]# fdisk /dev/sdb
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-652, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-652, default 652):
Using default value 652
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
再次查看分区情况,多出来一个/dev/sdb1 的区,这个1是我们在前面指定的,如果我们指定2,就变成 sdb2了。
[root@db1 /]# fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 151 1305 9277537+ 83 Linux
/dev/sda2 1 150 1204843+ 82 Linux swap
Partition table entries are not in disk order
Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 652 5237158+ 83 Linux
[root@db1 /]#
3. 格式化 /dev/sdb1 分区
[root@db1 /]# mkfs -t ext3 /dev/sdb1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
655360 inodes, 1309289 blocks
65464 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
4. 创建目录 并将 /dev/sdb1 挂在到该目录下
[root@db1 /]# ls
backup dev initrd media opt sbin sys usr
bin etc lib misc proc selinux tftpboot var
boot home lost+found mnt root srv tmp
[root@db1 /]# mkdir /u01
[root@db1 /]# ls
backup dev initrd media opt sbin sys u01
bin etc lib misc proc selinux tftpboot usr
boot home lost+found mnt root srv tmp var
[root@db1 /]# mount /dev/sdb1 /u01
5. 验证挂载是否成功
[root@db1 /]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 9131772 7066884 1601012 82% /
none 454256 0 454256 0% /dev/shm
/dev/sdb1 5154852 43040 4849956 1% /backup
6. 设置开机自动挂载
[root@db1 /]# vi /etc/fstab
# This file is edited by fstab-sync – see ‘man fstab-sync’ for details
LABEL=/ / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
/dev/sdb1 /u01 ext3 defaults 0 0
/dev/hdc /media/cdrom auto pamconsole,exec,noauto,m
anaged 0 0
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,m
anaged 0 0
时间修改
date 月日时分年.秒
date -s可以直接设置系统时间
比如将系统时间设定成1996年6月10日的命令如下。
#date -s 06/10/96
将系统时间设定成下午1点12分0秒的命令如下。
#date -s 13:12:00
使用软件:WinSetupFromUSB
最新的版本是0.2.1(09.Apr.2009更新),0.2.1版支持安装Win7,但是0.2.1的U盘启动界面与本文使用的0.1.1版本不同,所以建议阅读此文并安装WinXP的用户还是下载0.1.1版。 使用方法: 第一步,安装WinSetupFromUSB,安装完后,运行桌面上的WinSetupFromUSB快捷方式,打开WinSetupFromUSB程序窗口,首先对U盘进行格式化,点击HP format tool(P format too)按钮,如图: 第二步,在弹出的HP USB Disk Storage Tool窗口中点击“Start”键(一定要确认“Device”项是你想要格式化的U盘) 第三步,格式化完成后,点击HP USB Disk Storage Tool窗口中的“Close”键,回到WinSetupFromUSB程序窗口,点击“Browse”按钮选择XP安装文件所在的路径(例如XP安装盘所在的光驱盘符) 第四步,选择正确的XP安装文件所在路径后,点击“GO”按钮开始向U盘拷贝安装XP所需的文件 第五步,文件复制成功后,会弹出如下提示(大致意思是说,使用U盘安装XP过程要从U盘引导3次): 第六步,点击确定,将U盘拔下来插到另一台要用U盘安装系统的电脑上,开机进入BIOS(目前多数笔记本都是按F2进入BIOS),将U盘引导的优先级设置为最高。 第七步,保存设置,重新启动电脑,出现如下画面(不用按任何键,稍等二十秒,电脑会自动进入XP安装界面): 注意事项:如果硬盘上已经安装了Windows XP,想通过U盘重新安装系统,出现上面的画面后不做任何操作有可能会自动启动硬盘里现有的系统,此时应该在出现“Second part of XP Professional setup+Start Windows for first time”这句话时,手动调整选项至“First part of Windows XP Professional setup”并敲回车键确认。 第八步,向往常一样,安装Windows XP:
注意事项:在安装XP过程中还会重新启动两次,继续保持从U盘引导即可,不用动任何键,U盘安装程序会自动转到XP安装后续的图形化安装界面及用户名、计算机名等设置界面,直到第一次登录的XP的桌面再将U盘拔下即可。
发现MYSQL链接错误,找了原因,启动的时候出现 如下错误
ERROR! MySQL manager or server PID file could not be found!
找了好久也找不到原因,后来去了VPS控制重启试下,发现空间占用95%,感觉估计可能是空间满了的缘故。后来删除了MYSQL的日志,重新启动发现果然没问题了。
省的麻烦,也不会去看日志,禁用方法为:
vi /etc/my.cnf把里面的
#log-bin=mysql-bin
#binlog_format=mixed
注释掉,重启mysql服务即可.