分类目录归档:网络技巧

在nginx服务器设置wordpress伪静态

刚刚打开博客文章突然就404了,吓我一大跳。最后上网查询了一下资料发现是伪静态设置的问题。因为使用的是nginx的系统,所以不能设置.htaccess文件,而需要通过设置conf文件来实现伪静态,以下为综合网上资料,实验有效的方法。

打开nginx配置文件nginx.conf,在location段添加下面这一行代码:

location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename)
{
rewrite (.*) /index.php;
}
}

继续阅读

在linux上利用wget下载冷门文件

经常有的时候我们需要从国外的网站上下载一些比较大个的文件,速度就成了让人很头疼的问题。开着电脑彻夜下载,既不环保也不科学。现在有种叫离线下载的东西灰常好用,但是对于国外的某些资源,速度也相当堪忧,所以我们可以先利用国外的vps或主机,用wget工具下载到服务器上再用迅雷的离线转存回来即可,下面就简单的介绍一下。

wget的的详细介绍及说明请见wiki

一般的文件直接用wget "文件url" 的格式就可以下载,针对有cookie限制的网站,可以使用下列命令:

wget --load-cookies cookies.txtURL” -Ofilename

其中cookies.txt是网站的cookies文件,可用Export Cookies这个插件。URL是文件的下载地址。后面空格加上文件的重命名,这样就可以快速下载国外冷门文件了。

 

Signing iOS mobileconfig files with your certificate

If you’ve ever used Apple’s iPhone Configuration Utility, you’ve probably noticed that it says ‘Unsigned’ when you send the .mobileconfig file to your device. To sign the profile, export or email the config file to yourself, have your certificate files handy, and type the following:

openssl smime \
-sign \
-signer your-cert.pem \
-inkey your-priv-key.pem \
-certfile TheCertChain.pem \
-nodetach \
-outform der \
-in ConfigProfile.mobileconfig \
-out ConfigProfile_signed.mobileconfig

The files you’ll need are:

your-cert.pem – this is the certificate you’ve been issued
your-priv-key.pem – this is your private key
TheCertChain.pem – this is the certificate chain (optional, in some cases)
ConfigProfile.mobileconfig – This is the unsigned copy of your configuration profile

The original instructions are located here.

SSH远程会话管理工具 – screen使用教程(转)

在刚接触Linux时最怕的就是SSH远程登录Linux VPS编译安装程序时远程执行的命令也被迫停止,只能重新连接,重新运行。今天就介绍一款远程会话管理工具 - screen命令。

一、screen命令是什么?

Screen是一个可以在多个进程之间多路复用一个物理终端的全屏窗口管理器。Screen中有会话的概念,用户可以在一个screen会话中创建多个screen窗口,在每一个screen窗口中就像操作一个真实的telnet/SSH连接窗口那样。

二、如何安装screen命令?

除部分精简的系统或者定制的系统大部分都安装了screen命令,如果没有安装,CentOS系统可以执行:yum install screen ;

Debian/Ubuntu系统执行:apt-get install screen 。 继续阅读

Chrome离线安装包下载(exe以及msi版)

关于 Chrome
Chrome 是款非常好的浏览器,详细的就不介绍了,大家自行 Google 或 Baidu。官方安装方法通常是下载一个安装器,再通过安装器下载安装包,有时候因为某些原因,安装器下载速度令人崩溃,所以离线安装包就是福音了。

下载离线安装包
说了这么多废话,下面是离线安装包的下载方法:

正式版 https://www.google.com/chrome/eula.html?hl=zh-CN&standalone=1
测试版 https://www.google.com/chrome/eula.html?hl=zh-CN&standalone=1&extra=betachannel
开发版 https://www.google.com/chrome/eula.html?hl=zh-CN&standalone=1&extra=devchannel

打开上面链接后,和在线安装一样会出现“许可协议”界面和两个安装选项,点击“接受并安装”即可下载到Chrome浏览器离线安装包,文件名为ChromeStandaloneSetup.exe,与在线安装相同,下载下来的都是最新版的Chrome浏览器。

URL 后缀含义
standalone=1 :确认下载离线安装包
platform=win :适用平台为 Windows 系统,platform=win表示下载32位,platform=win64表示下载64位
installdataindex=defaultbrowser :安装后设置 Chrome 为当前默认浏览器
extra=stablechannel :指定版本为稳定版(版本有stablechannel、betachannel、devchannel、canarychannel)

下载 Chrome msi 版的链接:
https://www.google.com/chrome/eula.html?msi=true