A running example of the code from:
- http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang
- http://nesv.github.io/golang/2014/02/25/worker-queues-in-go.html
Small refactorings made to original code:
## Configure eth0 | |
# | |
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
NM_CONTROLLED="yes" | |
ONBOOT=yes | |
HWADDR=A4:BA:DB:37:F1:04 | |
TYPE=Ethernet | |
BOOTPROTO=static |
#!/usr/bin/env bash | |
{ # this ensures the entire script is downloaded # | |
nvm_has() { | |
type "$1" > /dev/null 2>&1 | |
} | |
if [ -z "$NVM_DIR" ]; then | |
NVM_DIR="$HOME/.nvm" |
#on cluster | |
thrift /spark/sbin/start-thriftserver.sh --master yarn-client | |
#ssh tunnel, direct 10000 to unused 8157 | |
ssh -i ~/caserta-1.pem -N -L 8157:ec2-54-221-27-21.compute-1.amazonaws.com:10000 [email protected] | |
#see this for JDBC config on client http://blogs.aws.amazon.com/bigdata/post/TxT7CJ0E7CRX88/Using-Amazon-EMR-with-SQL-Workbench-and-other-BI-Tools |
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
// Name of the struct tag used in examples | |
const tagName = "validate" |
// 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. |
#!/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 |
# 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 |
A running example of the code from:
Small refactorings made to original code:
#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 |