Skip to content

Instantly share code, notes, and snippets.

@Sunnyztj
Sunnyztj / gist:0d4b4d334808c3481e2d0e80d6c3fc17
Last active May 17, 2017 01:24
Wordpress Gmail SMTP Setting
1. Install WP-Mail-SMTP Plugins
2. Setup WP-Mail-SMTP
3. Update google account security level. 强制允许所有用户访问安全性较低的应用(不推荐)
(https://admin.google.com/AdminHome?pli=1&fral=1#ServiceSettings/notab=1&service=securitysetting&subtab=lesssecureappsaccess)
@Sunnyztj
Sunnyztj / gist:4dea7e4818fea0ba97ae3a97e7648ba2
Created May 17, 2017 01:23
Wordpress Gmail SMTP Setting
1. Install WP-Mail-SMTP Plugins
2. Setup WP-Mail-SMTP
3. Update google account security level.
(https://admin.google.com/AdminHome?pli=1&fral=1#ServiceSettings/notab=1&service=securitysetting&subtab=lesssecureappsaccess)
@Sunnyztj
Sunnyztj / gist:5e5324ec0296eff37a96376fe8f8d7c1
Created May 17, 2017 01:23
Wordpress Gmail SMTP Setting
1. Install WP-Mail-SMTP Plugins
2. Setup WP-Mail-SMTP
3. Update google account security level.
(https://admin.google.com/AdminHome?pli=1&fral=1#ServiceSettings/notab=1&service=securitysetting&subtab=lesssecureappsaccess)
@Sunnyztj
Sunnyztj / gist:f970f40622cb165135fbcf283791c993
Created February 27, 2017 23:56
How To Protect WordPress from XML-RPC Attacks on Ubuntu 14.04
https://www.digitalocean.com/community/tutorials/how-to-protect-wordpress-from-xml-rpc-attacks-on-ubuntu-14-04
https://www.luciancancescu.com/blog/2015/03/how-to-integrate-fontawesome-in-your-ios-project/
@Sunnyztj
Sunnyztj / gist:984ae724e7e74a155e527adb6be269c5
Created January 8, 2017 13:40
wkhtmltopdf 中文字体问题解决方案
安装ubuntu 中文字体 : https://wiki.ubuntu.com.cn/%E5%AD%97%E4%BD%93
@Sunnyztj
Sunnyztj / gist:56ed1ed3fc6ff3f372ab89a4afb8d36b
Created December 27, 2016 04:17
I18n root path setting
1.routes.rb
root to: 'application#redirect_to_home_index'
get '/:locale', to: "home#index", as: 'home'
2. application_controller.rb
def redirect_to_home_index
redirect_to home_path
end
@Sunnyztj
Sunnyztj / gist:99f109fd5ab6b18121f2888d35f43a08
Created September 17, 2016 10:30
Blocking IP addresses in Linux with iptables
Block IP addresses
Using iptables
Most system administrators will already be familiar with iptables. It is around for quite a while, and by default enabled within the Linux kernel. Within this article we are going to configure iptables to block one or multiple IP addresses. This may come in handy when you get repeating port scans, or see failed login attempts in your log files.
Check existing iptables configuration
First step is to validate existing rules.
iptables -L
Manually blocking a single IP address
http://josephndungu.com/tutorials/gmail-like-chat-application-in-ruby-on-rails
https://www.digitalocean.com/community/tutorials/how-to-optimize-apache-web-server-performance
https://www.digitalocean.com/community/questions/apache-2-4-with-php5-fpm