工作,学习,生活,这里将会有一些记录. 备用域名:http://meisw.51099.com 注册 | 登陆
浏览模式: 标准 | 列表2017年06月的文章

libiconv

 In file included from progname.c:26:0:

./stdio.h:1010:1: error: ‘gets’ undeclared here (not in a function)
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
 
 

cd /tmp/libiconv-1.14/srclib

vi stdio.in.h

 找到这行内容:

_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");

替换成:
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16) _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); #endif

注意:结尾的#endif也要包括。

在 NginX 上为证书配置 OCSP Stapling

 

在 NginX 上为证书配置 OCSP Stapling

 
https://quchao.com/entry/how-to-configure-ocsp-stapling-on-nginx-for-the-certificates-issued-by-lets-encrypt/
 
 
 
nginx,apache,iis,tomcat
http://blog.csdn.net/aerchi/article/details/72877851
 
 
 

WordPress整站开启HTTPS协议,让站内链接支持SSL证书

define('FORCE_SSL_LOGIN', true); 

define('FORCE_SSL_ADMIN', true); 

 
 
//WordPress SSL at 2016/12/29 update add_filter('get_header', 'fanly_ssl'); function fanly_ssl(){ 	if( is_ssl() ){ 		function fanly_ssl_main ($content){ 			$siteurl = get_option('siteurl'); 			$upload_dir = wp_upload_dir(); 			$content = str_replace( 'http:'.strstr($siteurl, '//'), 'https:'.strstr($siteurl, '//'), $content); 			$content = str_replace( 'http:'.strstr($upload_dir['baseurl'], '//'), 'https:'.strstr($upload_dir['baseurl'], '//'), $content); 			return $content; 		} 		ob_start("fanly_ssl_main"); 	} }

https://zhangzifan.com/wordpress-ssl-link.html

Golang给目录按时间排序.正则、时间条件搜索文件

 http://blog.csdn.net/fyxichen/article/details/50991805

golang时间函数处理

golang时间处理
相关包 "time"

  • 时间戳 
    当前时间戳

    fmt.Println(time.Now().Unix()) # 1389058332

     

  • str格式化时间
    当前格式化时间

    fmt.Println(time.Now().Format("2006-01-02 15:04:05")) # 这是个奇葩,必须是这个时间点, 据说是go诞生之日, 记忆方法:6-1-2-3-4-5 # 2014-01-07 09:42:20

     

  • 时间戳转str格式化时间

    str_time := time.Unix(1389058332, 0).Format("2006-01-02 15:04:05") fmt.Println(str_time) # 2014-01-07 09:32:12
  • str格式化时间转时间戳
    这个比较麻烦

    the_time := time.Date(2014, 1, 7, 5, 50, 4, 0, time.Local) unix_time := the_time.Unix() fmt.Println(unix_time) # 389045004

    还有一种方法,使用time.Parse

    the_time, err := time.Parse("2006-01-02 15:04:05", "2014-01-08 09:04:41") if err == nil {         unix_time := the_time.Unix() 	fmt.Println(unix_time)		 } # 1389171881

 

http://studygolang.com/articles/669
--------------------

Go 如何获取三个月前的月份日期

  1. func main () {
  2. now := time.Now()
  3.  
  4. yesterday := now.AddDate( 0, -1, 0 )
  5. bef_yes := yesterday.AddDate ( 0, -1, 0 )
  6.  
  7. fmt.Printf("Today:%s\n", now.Format("200601"))
  8. fmt.Printf("Yesterday:%s\n", yesterday.Format("200601"))
  9. fmt.Printf("Yesterdat before Yesterday:%s\n",bef_yes.Format("200601"))
 http://www.golangtc.com/t/51bd288c320b5264b800001c
 
--------------
时间比较

先把当前时间格式化成相同格式的字符串,然后使用time的Before, After, Equal 方法即可.

1
2
3
4
5
6
7
8
9
time1 := "2015-03-20 08:50:29"
time2 := "2015-03-21 09:04:25"
//先把时间字符串格式化成相同的时间类型
t1, err := time.Parse("2006-01-02 15:04:05", time1)
t2, err := time.Parse("2006-01-02 15:04:05", time2)
if err == nil && t1.Before(t2) {
  //处理逻辑
  fmt.Println("true")
}
 http://www.jb51.net/article/64705.htm
--------------
golang time 时间的加减法
http://blog.csdn.net/codyguo/article/details/53009451
 

使用golang生成证书

 http://studygolang.com/articles/9959

 
http://blog.csdn.net/yevvzi/article/details/54346519

ssl and acme_tiny.py

 openssl genrsa 4096 > account.key
wget http://dl.wdlinux.cn/files/openssl/openssl-1.0.2k.tar.gz
tar zxvf openssl-1.0.2k.tar.gz
cd openssl-1.0.2k
./config --prefix=/usr/local/openssl102k
make
mkdir /etc/ssl
cp apps/openssl.cnf /etc/ssl/
cd ..
openssl req -new -sha256 -key domain.key -subj "/" -reqexts SAN -config <(cat /etc/ssl/openssl.cnf <(printf "[SAN]\nsubjectAltName=DNS:51099.com,DNS:www.51099.com")) > domain.csr
mkdir /www/web/challenges
vi /www/wdlinux/nginx/conf/vhost/51099.com.conf
service nginxd restart
python -v
wget https://raw.githubusercontent.com/diafygi/acme-tiny/master/acme_tiny.py --no-check-certificate
python acme_tiny.py --account-key ./account.key --csr ./domain.csr --acme-dir /www/web/challenges/ > ./signed.crt
pip
yum install python-pip
wget "https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9" --no-check-certificate
tar zxvf pip-9.0.1.tar.gz
cd pip-9.0.1
python setup.py install
cd ..
python acme_tiny.py --account-key ./account.key --csr ./domain.csr --acme-dir /www/web/challenges/ > ./signed.crt
pip install argparse
python acme_tiny.py --account-key ./account.key --csr ./domain.csr --acme-dir /www/web/challenges/ > ./signed.crt
wget -O - https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem > intermediate.pem
cat signed.crt intermediate.pem > chained.pem
wget -O - https://letsencrypt.org/certs/isrgrootx1.pem > root.pem
cd ..
ls /www/
mv ssl /www/
cd /www/
cd ssl/
cp chained.pem domain.key /www/wdlinux/nginx/conf/cer/
openssl req -new -sha256 -key domain.key -subj "/" -reqexts SAN -config <(cat /etc/ssl/openssl.cnf <(printf "[SAN]\nsubjectAltName=DNS:baidu.com.com,DNS:www.baidu.com")) > baidu.csr
python acme_tiny.py --account-key ./account.key --csr ./baidu.csr --acme-dir /www/web/challenges/ > ./baidu.crt
vim acme_tiny.py
vi /bin/renew_cert.sh
#!/bin/bash
cd /www/ssl/
python acme_tiny.py --account-key account.key --csr domain.csr --acme-dir /www/web/challenges/ > signed.crt || exit
wget -O - https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem > intermediate.pem
cat signed.crt intermediate.pem > chained.pem
service nginx reload
chmod 700 /bin/renew_cert.sh
#0 0 1 * * root /bin/renew_cert.sh

以太坊生态系统中的工具和技术

 http://ethfans.org/posts/tools-and-technologies-in-the-ethereum-ecosystem

Records:912