Skip to content

Instantly share code, notes, and snippets.

@hivefans
hivefans / elasticsearch.yml
Last active March 17, 2020 02:04 — forked from reyjrar/elasticsearch.yml
|-|{"files":{"elasticsearch.yml":{"env":"plain"}},"tag":"bigdata"}
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@hivefans
hivefans / BatchSameRowExample.java
Last active March 17, 2020 02:03
BatchSameRowExample.java|-|{"files":{"BatchSameRowExample.java":{"env":"plain"}},"tag":"bigdata"}
package client;
// cc BatchSameRowExample Example application using batch operations, modifying the same row
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.TableName;
@hivefans
hivefans / nested_example.bash
Last active March 17, 2020 02:04 — forked from dedico/nested_example.bash
|-|{"files":{"nested_example.bash":{"env":"plain"}},"tag":"bigdata"}
# setup
# delete index
curl -XDELETE 'http://localhost:9200/hotels/'
# create index
curl -XPOST 'http://localhost:9200/hotels/'
# create mapping
curl -XPOST localhost:9200/hotels/nested_hotel/_mapping -d '{
"nested_hotel":{
"properties":{
"rooms": {
@hivefans
hivefans / flume-ng-agent
Last active March 17, 2020 02:04 — forked from ottomata/flume-ng-agent
|-|{"files":{"flume-ng-agent":{"env":"plain"}},"tag":"bigdata"}
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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
#
@hivefans
hivefans / haproxy.cfg
Last active March 17, 2020 02:03 — forked from GABeech/haproxy.cfg
|-|{"files":{"haproxy.cfg":{"env":"plain"}},"tag":"bigdata"}
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password
@hivefans
hivefans / spark_log_extract.py
Last active March 17, 2020 02:04 — forked from 2shou/spark_log_extract.py
|-|{"files":{"spark_log_extract.py":{"env":"plain"}},"tag":"bigdata"}
# coding: utf-8
# command example:
# $ spark-submit spark_log_extract.py \
# --name test \
# --notblankkeys dn,stm,ev_ac,pg_url \
# --filterregex ".*(=ac_pl\`|=ac_dl\`).*" \
# --usegzip \
# /path/to/source \
# /path/to/atom \
@hivefans
hivefans / yupyupnope.conf
Last active March 17, 2020 02:03 — forked from yosemitebandit/yupyupnope.conf
|-|{"files":{"yupyupnope.conf":{"env":"plain"}},"tag":"bigdata"}
server {
listen 80;
server_name www.yupyupnope.com;
rewrite ^/(.*) https://yupyupnope.com/$1 permanent;
}
server {
listen 80;
server_name yupyupnope.com;
rewrite ^/(.*) https://yupyupnope.com/$1 permanent;
@hivefans
hivefans / hiveserver2.py
Last active March 17, 2020 02:03 — forked from 2shou/hiveserver2.py
|-|{"files":{"hiveserver2.py":{"env":"plain"}},"tag":"bigdata"}
# coding: utf-8
from TCLIService import TCLIService
from TCLIService.ttypes import TOpenSessionReq, TGetTablesReq, TFetchResultsReq, \
TStatusCode, TGetResultSetMetadataReq, TGetColumnsReq, TType, TTypeId, \
TExecuteStatementReq, TGetOperationStatusReq, TFetchOrientation, TCloseOperationReq, \
TCloseSessionReq, TGetSchemasReq, TCancelOperationReq, THandleIdentifier, \
TOperationHandle, TOperationState
from thrift import Thrift
@hivefans
hivefans / slideshare-dl.py
Last active March 17, 2020 02:03 — forked from julionc/slideshare-dl.py
|-|{"files":{"slideshare-dl.py":{"env":"plain"}},"tag":"bigdata"}
#!/usr/bin/env python2.7
#-*- coding: utf-8 -*-
import os,sys
import urllib2
from BeautifulSoup import BeautifulSoup
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import portrait,A4,landscape
reload(sys)
sys.setdefaultencoding('utf-8')
@hivefans
hivefans / pushbullet_logging.py
Last active March 17, 2020 02:03 — forked from ficapy/pushbullet_logging.py
|-|{"files":{"pushbullet_logging.py":{"env":"plain"}},"tag":"bigdata"}
#!/usr/bin/env python
#coding:utf-8
import logging
import requests
import json
_session = requests.Session()
#APT KEY