Skip to content

Instantly share code, notes, and snippets.

View white-poto's full-sized avatar
🏠
busy

white-poto

🏠
busy
View GitHub Profile
@tareqabedrabbo
tareqabedrabbo / Pipelined SET.java
Created May 3, 2011 20:59
Redis Pipelines and Transactions
Pipeline pipeline = jedis.pipelined();
long start = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
pipeline.set("" + i, "" + i);
}
List<Object> results = pipeline.execute();
long end = System.currentTimeMillis();
System.out.println("Pipelined SET: " + ((end - start)/1000.0) + " seconds");
@markalanevans
markalanevans / redis-init-rhel
Created November 3, 2011 03:22
Simple RedHat Redis init.d script
#!/bin/sh
#
# redis Startup script for Redis Server
#
# chkconfig: - 90 10
# description: Redis is an open source, advanced key-value store.
#
# processname: redis-server
# config: /etc/redis.conf
# pidfile: /var/run/redis.pid
@alobato
alobato / start-stop-example.sh
Created March 3, 2012 23:09
start-stop-example
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
# Must be a valid filename
NAME=foo
PIDFILE=/var/run/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=/usr/local/bin/bar
@jamiesun
jamiesun / daemon.py
Created July 12, 2012 10:20
一个python守护进程的例子
#! /usr/bin/env python2.7
#encoding:utf-8
#@description:一个python守护进程的例子
#@tags:python,daemon
import sys
import os
import time
import atexit
from signal import SIGTERM
@anthonybishopric
anthonybishopric / extensions.md
Last active April 12, 2016 00:48
Interesting PHP Extensions. These aren't necessarily good to use right off the shelf, but serve as inspiration for things that could be built.
@dbuenzli
dbuenzli / sdl-install.sh
Created May 18, 2014 23:19
SDL install script
#!/bin/sh -ex
V=2.0.3
curl -OL http://www.libsdl.org/release/SDL2-${V}.tar.gz
tar -zxvf SDL2-${V}.tar.gz
cd SDL2-${V}
sudo apt-get install build-essential mercurial make cmake autoconf automake \
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
@v5tech
v5tech / Hive编程指南读书笔记.md
Last active December 17, 2019 12:49
Hive编程指南读书笔记

<<Hive编程指南>>读书笔记

1. 设置hive以本地模式运行(即使当前用户是在分布式模式或伪分布式模式下执行也使用这种模式)

set hive.exec.model.local.auto=true;

若想默认使用这个配置,可以将这个命令添加到$HOME/.hiverc文件中

@forthxu
forthxu / STD3Des.java
Last active September 21, 2018 12:58
3des加密java版和php版
// javac test3.java
// java test3
import java.security.Key;
import javax.crypto.Cipher;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;
import javax.crypto.spec.IvParameterSpec;
@jkbradley
jkbradley / LDA_SparkDocs
Created March 24, 2015 23:56
LDA Example: Modeling topics in the Spark documentation
/*
This example uses Scala. Please see the MLlib documentation for a Java example.
Try running this code in the Spark shell. It may produce different topics each time (since LDA includes some randomization), but it should give topics similar to those listed above.
This example is paired with a blog post on LDA in Spark: http://databricks.com/blog
Spark: http://spark.apache.org/
*/
import scala.collection.mutable
@wuchong
wuchong / HBaseNewAPI.scala
Created April 6, 2015 15:34
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 {