Skip to content

Instantly share code, notes, and snippets.

@andy012
andy012 / HBaseNewAPI.scala
Created March 7, 2017 11:35 — forked from wuchong/HBaseNewAPI.scala
Spark 下 操作 HBase 1.0.0 新版API
import org.apache.hadoop.hbase.util.Bytes
import org.apache.hadoop.hbase.{HColumnDescriptor, HTableDescriptor, TableName, HBaseConfiguration}
import org.apache.hadoop.hbase.client._
import org.apache.spark.SparkContext
import scala.collection.JavaConversions._
/**
* HBase 1.0.0 新版API, CRUD 的基本操作代码示例
**/
object HBaseNewAPI {
@andy012
andy012 / jvm_heap_usage.sh
Created November 17, 2016 03:54
get jvm heap usage with shell
#!/bin/bash
pidVal=$( ps -ef | grep "/data/www/tomcat-unifymonitor/conf/logging.properties -" | grep -v grep | awk -F' ' '{print $2}' | tr "\n" "," | cut -d ',' -f1 )
capacityLine=$(/usr/java/jdk1.7.0_65/bin/jstat -gccapacity ${pidVal} | tail -n 1 )
percentageLine=$(/usr/java/jdk1.7.0_65/bin/jstat -gcutil ${pidVal} | tail -n 1)
memValReal=`gawk -v v1="$capacityLine" -v v2="$percentageLine" 'BEGIN{
split(v1,cArray," ");
split(v2,pArray," ");
sum=0.0;
@andy012
andy012 / git.md
Created August 12, 2016 10:41 — forked from suziewong/git.md
Git的多账号如何处理? 1.同一台电脑多个git(不同网站的)账号 2.同一台电脑多个git(同一个网站的比如github的)多个账号

1.同一台电脑可以有2个git账号(不同网站的)

首先不同网站,当然可以使用同一个邮箱,比如我的github,gitlab,bitbucket的账号都是monkeysuzie[at]gmail.com 这时候不用担心密钥的问题,因为这些网站push pull 认证的唯一性的是邮箱 比如我的windows 上 2个账号一个gitlab 一个github (用的都是id_rsa)

host github
  hostname github.com
  Port 22

host gitlab.zjut.com

@andy012
andy012 / git-flow.md
Created July 29, 2016 09:52 — forked from yesmeck/git-flow.md
Git 开发流程

Git 协作流程

master 分支

master 永远处于稳定状态,这个分支代码可以随时用来部署。不允许在该分支直接提交代码。

develop 分支

开发分支,包含了项目最新的功能和代码,所有开发都在 develop 上进行。一般情况下小的修改直接在这个分支上提交代码。

@andy012
andy012 / 0_reuse_code.js
Created June 10, 2016 16:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console