Skip to content

Instantly share code, notes, and snippets.

@winse
winse / GZipFileWriteTest.java
Created September 11, 2014 09:34
io read/write
import static org.junit.Assert.assertEquals;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
diff --git a/src/main/java/com/cxy/redisclient/integration/I18nFile.java b/src/main/java/com/cxy/redisclient/integration/I18nFile.java
index 1df1322..302e279 100644
--- a/src/main/java/com/cxy/redisclient/integration/I18nFile.java
+++ b/src/main/java/com/cxy/redisclient/integration/I18nFile.java
@@ -49,6 +49,8 @@ public class I18nFile extends PropertyFile {
public static final String NAME = "NAME";
public static final String TYPE = "TYPE";
public static final String SIZE = "SIZE";
+ public static final String COMMENT = "COMMENT";
+
@winse
winse / npp-windows.bat
Created July 21, 2014 06:37
url-editable, 注册自定义的url-protocol
@echo off
rem npp-windows app...
rem http://stackoverflow.com/questions/636381/what-is-the-best-way-to-do-a-substring-in-a-batch-file
set fileRelativePath=%1
set filepath="%~dp0..\..\%fileRelativePath:~17,-1%"
start E:\local\usr\share\npp\notepad++.exe %filepath%
rem pause
@winse
winse / phoenix4.hello.sql
Last active August 29, 2015 14:04
phoenix4使用笔记
$ [hadoop@umcc97-44 phoenix-4.0.0-incubating]$ bin/sqlline.py localhost
/*
hbase(main):020:0> describe 't1'
DESCRIPTION ENABLED
't1', {NAME => 'f1', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE => '0', VERSIONS => '1', COMPRESS true
ION => 'NONE', MIN_VERSIONS => '0', TTL => 'FOREVER', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY => 'fals
e', BLOCKCACHE => 'true', METADATA => {'ENCODE_ON_DISK' => 'true'}}
1 row(s) in 0.0830 seconds
@winse
winse / windows-zkServers-README.md
Last active August 29, 2015 14:03
在windows下测试zkServers集群模式的脚本,无需添加额外的配置脚本以conf/zoo_sample.cfg为模板添加/覆盖其他额外的参数。同时添加客户端四字码状态查询功能。

基于zookeeper-3.4.5

理论上3.4+版本都可以用。把cmd脚本放到bin目录下。

使用方式

  • 启动多实例
windows-zkServers.cmd cluster [安装服务的个数] [当前启动的个数] 
# 下载hadoop2编译好的版本
[hadoop@umcc97-44 spark-1.0.0-bin-hadoop2]$ hadoop fs -put README.md ./
# 参考 http://spark.apache.org/docs/latest/quick-start.html
# http://spark.apache.org/examples.html
# https://github.com/apache/spark/tree/master/examples/src/main/java/org/apache/spark/examples
[hadoop@umcc97-44 spark-1.0.0-bin-hadoop2]$ bin/spark-shell
...
@winse
winse / workday-shell-history.md
Last active August 29, 2015 14:02
记录工作过程中使用的shell,以及相关。部分以图片形式保存到flickr。
  • 批量处理

以回帖的形式进行记录。

@winse
winse / X64-build-hadoop.shell.sh
Last active August 29, 2015 14:02
CentOS-X64编译hadoop-2.2.0
# root用户操作
apache-maven-3.0.4
jdk1.7.0_60
apache-ant-1.9.2
vim /etc/profile
source /etc/profile
## 节约点下载的时间,直接共享使用主机的maven数据
@winse
winse / ambari.public.log.sh
Last active August 29, 2015 14:02
Centos-x86使用public源安装ambari,server安装没问题,但是找不到agent!
winse@Lenovo-PC ~
$ ssh root@cluster
Last login: Sat Jun 21 20:54:19 2014 from 192.168.154.1
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# wget http://public-repo-1.hortonworks.com/ambari/c entos6/1.x/updates/1.6.0/ambari.repo
--2014-06-21 21:36:44-- http://public-repo-1.hortonworks.com/ambari/centos6/1.x /updates/1.6.0/ambari.repo
Resolving public-repo-1.hortonworks.com... 54.230.234.103, 54.230.234.83, 54.230.234.203, ...
Connecting to public-repo-1.hortonworks.com|54.230.234.103|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1074 (1.0K) [binary/octet-stream]
@winse
winse / tar.remote.sh
Last active August 29, 2015 14:02
一气呵成把tar文件上传到服务器,同时在服务器解压,同时过滤部分文件
winse@Lenovo-PC /cygdrive/e/local/opt
$ ssh hadoop@cluster ' cat | tar zxf - --exclude=sources --exclude=doc --exclude=*.cmd ' < ./hadoop-2.2.0.tar.gz
winse@Lenovo-PC /cygdrive/e/local/opt
$ ssh root@cluster ' cat | tar zxf - ' < ./jdk-7u60-linux-i586.gz