Skip to content

Instantly share code, notes, and snippets.

@Prussia
Prussia / hive-jdbc-example.R
Created September 3, 2019 12:23 — forked from ianmcook/hive-jdbc-example.R
Query Apache Hive from R using JDBC
# Copyright 2018 Cloudera, Inc.
#
# 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,
@Prussia
Prussia / sync-clock.sh
Created April 27, 2018 05:11
Sync clock with ntpd on Alpine Linux (Docker.app VM)
#!/bin/sh
hwclock -s
@Prussia
Prussia / README.md
Created April 6, 2018 03:25 — forked from sieyip/README.md
Installing Kafka on Mac OS X

Installing Kafka on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@Prussia
Prussia / file0.txt
Created December 14, 2017 13:07 — forked from giwa/file0.txt
Install hive on Mac with Homebrew ref: http://qiita.com/giwa/items/dabf0bb21ae242532423
$ brew update
$ brew install hive
for(Footer f : ParquetFileReader.readFooters(conf, fs, false)){
for(BlockMetaData b : f.getParquetMetadata().getBlocks()){
rowCount += b.getRowCount();
}
jps | awk '$2 != "Jps" {print $1}' | xargs kill
@Prussia
Prussia / ss-install.md
Created October 30, 2017 01:51 — forked from aa65535/ss-install.md
shadowsocks-libev install at Debian or CentOS

Debian

cd /tmp
# 编译环境准备&安装依赖包
apt-get install --no-install-recommends build-essential autoconf libtool libssl-dev libpcre3-dev asciidoc xmlto git
# 克隆源码
git clone --recursive https://github.com/shadowsocks/shadowsocks-libev.git
# 开始编译
@Prussia
Prussia / docker-cleanup-resources.md
Created October 12, 2017 03:18 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@Prussia
Prussia / remove-docker-containers.md
Created July 4, 2017 03:59 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
1. create tools.policy file:
grant {
permission java.security.AllPermission;
};
2. run to start jstatd:
jstatd -J-Djava.security.policy=tools.policy