要过年了,为电脑吹吹尘
电脑,你辛苦了,为你吹吹尘,感谢在过去的一年里,你给我带来的乐趣和收入(虽然不多)。
家用台式机,普通的,两千块钱就可以用三几年,可以打打游戏,可以听听歌,可以看看电影,还可以看看淘宝店……
电脑,你辛苦了,为你吹吹尘,感谢在过去的一年里,你给我带来的乐趣和收入(虽然不多)。
家用台式机,普通的,两千块钱就可以用三几年,可以打打游戏,可以听听歌,可以看看电影,还可以看看淘宝店……
有网友提问,想在 nginx 阻止指点站点的 referer 来路访问。
环境:CentOS 7,nginx 1.12
过程:
在 server 站点配置内容中,在 location 的命令位置上添加以下内容:
location / {
valid_referers www.baidu.com www.360.cn;
if ($invalid_referer = ''){
return 403;
}
}
参考:
感谢张天给机会安装。
SMRT Analysis 软件能帮助科研人员对基因测序。单安装包集成tomcat, mysql等,自动安装,挺方便。
环境:Ubuntu 16.04 64位(或许Ubuntu 14更合适些), SMRT Analysis 2.3,计划安装在 /home/smrtanalysis,单机安装,无job manager system。
过程:
参考:
有不少网友在使用阿里云ECS实例时,发现无法发出邮件,因为新近创建的ECS实例默认禁止连接外网TCP 25端口,避免滥发邮件。
环境:Debian 8,postfix 2.11,使用免费的阿里云云邮账户发信
过程:
创建 /etc/stunnel/stunnel.conf 配置文件,内容如下,监听本地11125端口,连接 smtp.aliyun.com:465
[smtp-tls-wrapper]
accept = 11125
client = yes
connect = smtp.aliyun.com:465
创建或修改 /etc/postfix/sasl/sasl_passwd 文件,写上相应的服务器地址、端口和登录名密码,如下例:
[localhost]:11125 anqunhe@aliyun.com:password
修改 /etc/postfix/main.cf 文件,修改 relayhost = [localhost]:11125 , 添加SMTP验证信息:
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = swas.anqun.org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = swas.anqun.org, localhost, localhost.localdomain, localhost
# relayhost =
relayhost = [localhost]:11125
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
#### SMTP
# Enable SASL authentication
smtp_sasl_auth_enable = yes
# Disallow methods that allow anonymous authentication
smtp_sasl_security_options = noanonymous
# Location of sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
# Enable STARTTLS encryption
# smtp_tls_security_level = encrypt
# Location of CA certificates
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_generic_maps = hash:/etc/postfix/generic
因为多数免费邮箱限定发信人是登录名(如anqunhe@aliyun.com),所以在 /etc/postfix/generic 文件里填写可能发信的地址,如:www-data,wordpress
www-data anqunhe@aliyun.com
wordpress anqunhe@aliyun.com
参考:
看到云友在安装foxphp遇到了小问题,所以实践一下。
环境:debian 8,nginx 1.6, php 5.6,foxphp3.0.1
过程:
修改站点配置文件 /etc/nginx/sites-enabled/default ,修改静态化规则内容:
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}