Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Jumping Qu jumping

🎯
Focusing
  • Shanghai, China
View GitHub Profile
@jumping
jumping / flume-site-agent.xml
Created Jan 6, 2012 — forked from elubow/flume-site-agent.xml
Flume Configuration files
View flume-site-agent.xml
<!-- a1 (agent) -->
<configuration>
<property>
<name>flume.master.servers</name>
<value>$master_IP</value>
<description>This is the address for the config servers status server (http)</description>
</property>
<property>
<name>flume.collector.event.host</name>
View autoscale_sample
#################################################################################
# Import modules
#################################################################################
import os
import time
import sys
import socket
import string
View autoscaling_boto.py
"""
The MIT License (MIT)
Copyright (c) 2011 Numan Sachwani
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:
View gist:5fd23e5e8cfd1123adcaaf219178dba7
➜ testing terraform apply -target=aws_db_subnet_group.rds_one
aws_vpc.main: Creating...
cidr_block: "" => "10.0.0.0/16"
default_network_acl_id: "" => "<computed>"
default_security_group_id: "" => "<computed>"
dhcp_options_id: "" => "<computed>"
enable_classiclink: "" => "<computed>"
enable_dns_hostnames: "" => "true"
enable_dns_support: "" => "true"
instance_tenancy: "" => "<computed>"
View gist:9f1a0827decf678b22abc639094de7be
#https://play.golang.org/p/bGs5TPZksJ
#http://nathanleclaire.com/blog/2014/08/09/dont-get-bitten-by-pointer-vs-non-pointer-method-receivers-in-golang/
import "fmt"
type foo struct {
name string
}
type bar struct {
f *foo
@jumping
jumping / sysctl.conf
Last active Jul 4, 2016 — forked from kgriffs/sysctl.conf
Linux Web Server Kernel Tuning
View sysctl.conf
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
# Protection from SYN flood attack.
net.ipv4.tcp_syncookies = 1
View gist:e50932eca957ba5517c5ddb00e1ddc53
// Copyright 2015 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@jumping
jumping / mysql.py
Created Sep 2, 2016
an mysql lookup Module for Ansible
View mysql.py
#!/usr/bin/python
"""
Example Usage:
{{ lookup('mysql', ('1x.1xx.x.12', 'username', 'passwd', 'db_name', 'table_name', 'key_name')) }}
"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
@jumping
jumping / 1_simple.go
Created Jun 25, 2017 — forked from sosedoff/1_simple.go
Golang Custom Struct Tags Example
View 1_simple.go
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"