Skip to content

Instantly share code, notes, and snippets.

@hivefans
hivefans / 115.py
Last active March 17, 2020 02:03 — forked from wusuopu/115.py
a script auto to login 115|-|{"files":{"115.py":{"env":"plain"}},"tag":"bigdata"}
#!/usr/bin/env python
#-*- coding:utf-8 -*-
##
##
# Copyright (C)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation.
# 本程序是免费软件,基于GPL许可发布。
@hivefans
hivefans / ftp_download.py
Last active March 17, 2020 02:04 — forked from turbidsoul/ftp_download.py
ftp下载显示现在进度|-|{"files":{"ftp_download.py":{"env":"plain"}},"tag":"bigdata"}
import ftplib
import sys
from progressbar import ProgressBar
from progressbar.widgets import Percentage, FileTransferSpeed, ETA, Bar
if len(sys.argv) < 4:
print("请输入ftp地址,用户,密码和文件".decode("utf8"))
sys.exit(0)
@hivefans
hivefans / topkMR.java
Last active March 17, 2020 02:04 — forked from USCSU/topkMR.java
|-|{"files":{"topkMR.java":{"env":"plain"}},"tag":"bigdata"}
import java.io.IOException;
import java.util.*;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.*;
import org.apache.hadoop.mapreduce.lib.output.*;
@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
@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 / 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 / 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 / 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 / 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 / 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
#