This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
file { | |
path => "/var/log/tomcat8/localhost_access_log*" | |
start_position => beginning | |
sincedb_path => "/dev/null" | |
ignore_older => 0 | |
type => "access_log" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Program: | |
# Install docker engine. | |
# History: | |
# 2016/09/01 Anson First release | |
# 2016/09/02 Anson Second release: tomcat:8.5 & verify docker command is exist | |
# Set environment path. | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin | |
export PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while read oldrev newrev ref | |
do | |
if [[ $ref =~ .*/master$ ]]; | |
then | |
cd /git/project/path || exit | |
unset GIT_DIR | |
git pull | |
mvn clean package | |
sshpass -p password scp from_path username@remote_url:to_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps aux | grep ^tomcat | awk '{print$2}' | xargs kill -9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>CSS selector *= vs ~=</title> | |
</head> | |
<body> | |
<h1 class="header" data-now="day">ALL SHOPS</h1> | |
<div class="promotion-bar" data-promotion-detail="day">John Bar</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sample.entity; | |
import java.math.BigDecimal; | |
import javax.persistence.Column; | |
import javax.persistence.Entity; | |
import javax.persistence.Id; | |
import javax.persistence.IdClass; | |
import javax.persistence.Lob; | |
import javax.persistence.Table; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script> | |
function driveRequest() { | |
var request = gapi.client.drive.files.get({ | |
'fileId': 'File ID' | |
}); | |
request.then(function(response) { | |
// response is the result. | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
</head> | |
<body> | |
<div id="pageLoadStatus"></div> | |
<script> | |
var _ = {}; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define JSON. | |
var contents = { | |
'en-US': { | |
'title': 'Hello!' | |
}, | |
'zh-TW': { | |
'title': '哈囉!' | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reference: http://www.concretepage.com/forum/thread?qid=462 | |
/* | |
This is for #1 and #2. | |
<div id="userInfo" data-user-name="Anson">Anson</div> | |
*/ | |
function nativeJS() { // #1 | |
var userInfo = document.getElementById("userInfo"); | |
var name = userInfo.getAttribute("data-user-name"); |