Skip to content

Instantly share code, notes, and snippets.

View cooniur's full-sized avatar

Tongliang Liu cooniur

  • Netflix
  • Mountain View, CA
View GitHub Profile
#!/bin/bash
#
# chkconfig: 2345 95 20
# description: Tomcat 8 start/stop/status init.d script
# processname: tomcat
#
# Tomcat 8 start/stop/status init.d script
#
# Updates:
# @author: Tongliang Liu <[email protected]>
@cooniur
cooniur / ansible-datetime 1.9.4
Last active March 22, 2016 00:20
Ansible Datetime
{
"ansible_date_time": {
"date": "2015-04-20",
"day": "20",
"epoch": "1429565280",
"hour": "14",
"iso8601": "2015-04-20T21:28:00Z",
"iso8601_micro": "2015-04-20T21:28:00.106961Z",
"minute": "28",
"month": "04",
@cooniur
cooniur / ansible-ec2-module-output
Created April 20, 2015 21:43
Ansible EC2 module output
{
"changed": true,
"instance_ids": [
"i-1a2b3c4d"
],
"instances": [
{
"ami_launch_index": "0",
"architecture": "x86_64",
"dns_name": "",
@cooniur
cooniur / .inputrc
Created April 23, 2015 00:38
Linux/Mac: ~/.inputsrc
# Make Tab autocomplete regardless of filename case
set completion-ignore-case on
# List all matches in case multiple possible completions are possible
set show-all-if-ambiguous on
# Immediately add a trailing slash when autocompleting symlinks to directories
set mark-symlinked-directories on
ProxyPass /data http://localhost:8080/clinicaldata timeout=1800
ProxyPassReverse /data http://localhost:8080/clinicaldata
@cooniur
cooniur / bulk-indexing-optimization
Last active August 29, 2015 14:19
ES Optimization
# Optimization for re-indexing
These settings can be turned on/off to increase performance when doing re-indexing of existing large dataset
### Disable refresh while re-indexing `page 161`
You can turn off automatic refreshes while you are building a big new index, and then turn them back on when you start using the index in production:
Before re-indexing:
POST /my_logs/_settings
@cooniur
cooniur / logstash.conf
Created June 6, 2015 08:28
Logstash + SpringBoot + Logback
input {
file {
path => [ "/etc/myapp/myapp.log" ]
}
}
filter {
multiline {
pattern => "^(%{LOGBACK_TIMESTAMP})"
patterns_dir => "/etc/logstash/grok/patterns"
@cooniur
cooniur / JavaScript.sublime-settings
Last active October 21, 2015 23:22
JavaScript settings for Sublime Text 2
{
// The number of spaces a tab is considered equal to
"tab_size": 2,
// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": true,
// If translate_tabs_to_spaces is true, use_tab_stops will make tab and
// backspace insert/delete up to the next tabstop
"use_tab_stops": true,
@cooniur
cooniur / .gitignore
Created October 25, 2015 01:35
Git Ignore File Template
# Project specific files (Please add your project specific files into this section)
# Java/Groovy specific files
*.class
*.jar
*.war
*.ear
# Log files
logs
@cooniur
cooniur / playbook.yml
Created April 26, 2016 05:15
PostgreSQL Ansible Add DB & User
- name: "Create database"
postgresql_db:
name={{ postgres_db_name }}
state=present
become_user: postgres
- name: "Create db user"
postgresql_user:
db={{ postgres_db_name }}
name={{ postgres_db_user }}