你正在浏览的是 网络笔记 目录

PPTP/L2TP/OPENVPN 三合一安装脚本

3 feet

为了让在内网的树莓派可以在家访问,在云主机上搭建VPN服务,然后通过iptables转发。

测试环境:

阿里云主机 CentOS 6.3

脚本下载地址:

本地安装版(百度加速乐):http://static.duimg.com/soft/vpn.tar.gz

在线安装版(阿里云CDN):http://static.v234.com/soft/vpn.tar.gz

升级内容:

1、MYSQL升级为5.5.35版本;

2、修正通过yum安装openvpn 2.3.2版本后没有自带easy-rsa的问题;

3、iptables新增MTU策略,解决只能访问有限的网站,SSH 可用,但 scp 不行,ftp 能握手,但传不了文件问题;

4、替换原DNS 8.8.8.8为114DNS:114.114.114.114

5、原有epel链接失效,已修复。后续如果再遇到失效从以下网址找到最新的版本:https://fedoraproject.org/wiki/EPEL/zh-cn

开启mysql远程帐号脚本

mysql -u root -proot;
grant all on *.* to username@'%' identified by 'password';
flush privileges;

其中 all 指定相关的操作, *.*说明数据库和表名, username表示用户名,‘%’这里写Host名称,允许所有就用‘%’,‘password’是密码。这里改成相应的值后进行操作就可以开启远程帐号访问

修改VPN服务器radius认证为远程服务器

修改参数在VPN服务器运行下面脚本

radius_server="radius服务器IP"
secret_key="v234.com"
etc_dir="/usr/local/etc"
sed -i -e "s/name=127.0.0.1/name=$radius_server/" /etc/openvpn/radiusplugin.cnf
sed -i -e "s/sharedsecret=testpw/sharedsecret=$secret_key/" /etc/openvpn/radiusplugin.cnf
sed -i -e "s/localhost:1812/$radius_server:1812/" $etc_dir/radiusclient/radiusclient.conf
sed -i -e "s/localhost:1813/$radius_server:1813/" $etc_dir/radiusclient/radiusclient.conf
mv -f $etc_dir/radiusclient/servers $etc_dir/radiusclient/servers.bak
cat >> $etc_dir/radiusclient/servers <<EOF
$radius_server $secret_key
EOF

修改参数在radius服务器运行下面脚本

client_ip="VPN服务器IP"
secret_key="v234.com"
etc_dir="/usr/local/etc"
iptables -A INPUT -i eth0 -p udp -s $client_ip --dport 1812 -j ACCEPT
iptables -A INPUT -i eth0 -p udp -s $client_ip --dport 1813 -j ACCEPT
cat >> $etc_dir/raddb/clients.conf <<EOF
client localhost {
 ipaddr = $client_ip
 secret = $secret_key
 require_message_authenticator = no
 nastype  = other
}
EOF

安装LNMP

wget -c http://soft.vpser.net/lnmp/lnmp1.0-full.tar.gz
tar zxvf lnmp1.0-full.tar.gz
cd lnmp1.0-full/
./centos.sh 2>&1 | tee lnmp.log

 

本版本依据以下脚本修改:

http://www.yishanhome.com/archives/307

Linode难道被黑了?

1 foot

今天一早收到Linode的邮件,全文如下:

Dear Linode customer,

     Linode administrators have discovered and blocked suspicious activity on the Linode network.  This activity appears to have been a coordinated attempt to access the account of one of our customers.  This customer is aware of this activity and we have determined its extent and impact.  We have found no evidence that any Linode data of any other customer was accessed.  In addition, we have found no evidence that payment information of any customer was accessed.

     We have been advised that law enforcement officials are aware of the intrusion into this customer’s systems. We have implemented all appropriate measures to provide the maximum amount of protection to our customers. Out of an abundance of caution, however, we have decided to implement a Linode Manager password reset. In so doing, we have immediately expired all current passwords. You will be prompted to create a new password the next time that you log into the Linode Manager. We also recommend changing your LISH passwords and, if applicable, regenerating your API key.

    The following represent best practices in creating new passwords:
Avoid using simple passwords based on dictionary words
Never use the same password on multiple sites or services
Never click on 'reset password' requests in unsolicited emails - instead go directly to the service
We apologize for the inconvenience. If you have any questions, please do not hesitate to contact our support team at support@linode.com.

佳能CP900 selphy photo print 1.4下载

8 feet

春节回家忘带光盘了,结果居然发现

selphy photo print 这个软件佳能官网上没的下载。找遍了网上也没有,郁闷。

于是回来把镜像提取出来,给各位光盘遗失或者没带光盘的朋友

http://yunpan.alibaba-inc.com/share/link/QB1qfmtO

链接更新:

http://pan.baidu.com/s/1kThuzmn

浙江国税VPDN 添加静态路由实现internet访问

3 feet

现在家里开税控发票必须联网,使用VPDN网络,实际就是一个L2TP 的VPN,拨了这个VPN之后就会改变本地的默认路由,全部访问都走专线。因为服务器端没做NAT,因此除了国税的指定网站外是无法访问Internet的。

准备工作:右键VPN连接–属性–网络–Internet协议版本4–属性–高级,将IP设置里的“在远程网络上使用默认网关”的勾掉。

我们可以通过添加静态路由的方式来解决,由于每次拨号获取到的IP都不同,因此我写了个BAT 批处理(XP):

@echo off
rasdial vpdn username password
for /f "tokens=15" %%i in ('ipconfig /all ^| find /i "10."') do (
set ip=%%i
echo %ip%
)
route add 100.0.0.0 mask 255.255.255.0 %ip%

WIN 7 下的BAT文件:

@echo off
rasdial vpdn username password
for /f "tokens=16" %%i in ('ipconfig ^| find /i "10."') do (
set ip=%%i
echo %ip%
)
route add 100.0.0.0 mask 255.255.255.0 %ip%

把以上文件中的vpdn替换为你的VPN名称,username和password替换为你的用户名和密码。把这个文件放到启动目录,就能开机自动拨VPN并添加静态路由了。

100.0.0.1这个地址就是国税的开票平台IP。
如果你想自动打开这个地址的话,可以加以下这行:
explorer.exe open=http://100.0.0.1:8001/ctais2/wssb/web.jsp

参考资料:http://gcp1126.blog.51cto.com/541139/787699

HTML5 私房音乐台

0 ~o~

今天发现一个基于HTML5的播放器做的挺漂亮的,是台湾一位学生做的。刚好有一域名闲置,就用起来吧:D

演示地址: http://suo.me

作者主页:

http://zespia.tw/blog/2012/02/04/lab-html5-audio/

 

您使用的是IE浏览器,请下载Chrome来获得更好的体验