Instantly share code, notes, and snippets.

View commands.sh
# Count IP address from nginx log file https://www.mkyong.com/nginx/count-ip-address-in-nginx-access-logs/
sudo awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -nr
View jenkins.nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
View AmazonSESSample.groovy
@Grab('javax.mail:mail:1.4.7')
import java.util.Properties
import javax.mail.*
import javax.mail.internet.*
final String FROM = "SENDER@EXAMPLE.COM" // Replace with your "From" address. This address or domain must be verified.
final String TO = "RECIPIENT@EXAMPLE.COM" // Replace with a "To" address. If your account is still in the
// sandbox, this address must be verified.
View UrlMappings.groovy
"/"(view:"/blog/index")
"/admin"(view:"/admin/index")
View CustomValidationTagLib.groovy
package com.hussain.pf
import groovy.xml.MarkupBuilder
import org.apache.commons.lang.StringEscapeUtils
import org.codehaus.groovy.grails.plugins.web.taglib.ValidationTagLib
class CustomValidationTagLib extends ValidationTagLib {
/**