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
@cooniur
cooniur / LICENSE
Last active June 6, 2022 03:38
Namecheap DDNS Module for Synology NAS 7.1
Copyright (c) 2022 Tongliang Liu
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@cooniur
cooniur / _etc_ssh_sshd_config
Last active June 30, 2022 01:16
macOS ssh server: passwordless login
Description:
This file is located at `/etc/ssh/sshd_config`.
Search for `enable passwordless ssh login` to see the options that need to be turned on/off.
------[Begin File Content]-----------------------
# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $
@cooniur
cooniur / conn.groovy
Last active December 19, 2016 22:01
Groovy script using MySQL
@GrabConfig(systemClassLoader=true )
@Grab("mysql:mysql-connector-java:5.1.40")
import groovy.sql.Sql
def sql = Sql.newInstance("jdbc:mysql://localhost:3306/test", "root", "root", "com.mysql.jdbc.Driver")
def users = sql.rows("SELECT * FROM users")
println "Users: ${users.size()}"
@cooniur
cooniur / pattern.txt
Created December 4, 2016 05:03
Logstash Nginx Pattern
'$http_host '
'$remote_addr [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" '
'$request_time '
'$upstream_response_time'
www.myapp.com
10.10.10.10 [06/Jun/2015:19:03:26 +0000]
"GET /gateway/api/feed/home?page=0 HTTP/1.1" 200 14732
@cooniur
cooniur / statsd-test.sh
Created December 4, 2016 05:02
StatsD test via CLI
#!/bin/bash
while :
do
echo -n "example.statsd.counter.changed:$((((RANDOM %10)+1)*3))|c"| nc -w 1 -u statsd.myapp.com 8125
done
@Component
class IntegrationJobTriggerBeanProcessor implements BeanPostProcessor {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final IntegrationJobTriggerTaskInitializer triggerTaskInitializer;
private final IntegrationJobTriggerDefaultSchedules defaultSchedules;
private final IntegrationJobScheduleService jobScheduleService;
@Autowired
public IntegrationJobTriggerBeanProcessor(IntegrationJobTriggerTaskInitializer triggerTaskInitializer,
IntegrationJobTriggerDefaultSchedules defaultSchedules,
@cooniur
cooniur / defaults__main.yml
Created April 26, 2016 05:20
PostgreSQL Ansible Role
---
# defaults file for postgresql
postgresql_version: "9.5"
@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 }}
@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 / 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,