Hunter的大杂烩

December 1, 2019

免费APACHE SSL证书安装

Filed under: 技术话题 — hunter @ 3:41 pm

参考:
https://letsencrypt.org/zh-cn/getting-started/
https://www.cnblogs.com/stulzq/p/8628163.html


yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
yum install certbot python2-certbot-apache
certbot certonly -d 你的域名 -d *.你的域名 --manual --preferred-challenges dns

(more…)

November 30, 2019

apache安装ssl证书

Filed under: 技术话题 — hunter @ 11:13 pm

从证书服务商得来的压缩包里,只有一个公钥crt和一个证书链文件,缺少私钥key文件,百思不得其解,最后只能自己手动在服务器上生成一个csr和key文件,重新向证书服务商请求Rekey,用新得来的crt文件配置上apache了:

openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr

November 29, 2019

新mysql安装参数

Filed under: 技术话题 — hunter @ 10:40 pm

mysqld –initialize-insecure -u mysql

November 16, 2019

不同进程操作共享内存内数据指针的三种方法

Filed under: 技术话题 — hunter @ 11:25 pm

一、参考IBM方式,重载new方法,见:https://www.ibm.com/developerworks/cn/linux/l-shared/index.html
二、类似IBM,自定义new方法的alloc参数,自定义内存分配,
译文参见:http://www.cppblog.com/doing5552/archive/2010/07/24/121197.aspx
原文:http://www.ddj.com/cpp/184401639
三、高大上用BOOST
参见:http://lday.me/2017/12/17/0019_boost_share_memory_ipc/

November 14, 2019

封禁穷举SSH密码的垃圾

Filed under: 技术话题 — hunter @ 6:21 pm


#!/bin/sh

datestr=`date -d '2 minutes ago' +"%b %e %H"`

/usr/bin/systemctl restart firewalld

sleep 10
/usr/bin/grep -w "authentication failure" /var/log/secure |/usr/bin/grep "$datestr"|grep rhost|grep pam_unix|awk '{print $14}'|awk -F '=' '{print $2}'|sort|uniq -c|sort -n > iplist
cat iplist|while read line
do
num=`echo $line|awk '{print $1}'`
if [ $num -gt 10 ];then
ip=`echo $line|awk '{print $2}'`
/usr/sbin/iptables -I INPUT -s $ip -j DROP
fi
done

Older Posts »

Powered by WordPress