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 / defaults__main.yml
Created April 26, 2016 05:20
PostgreSQL Ansible Role
---
# defaults file for postgresql
postgresql_version: "9.5"
@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 / 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
@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 / 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 / _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 / 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: