Skip to content

Instantly share code, notes, and snippets.

View fivesmallq's full-sized avatar
🎯
Focusing

fivesmallq fivesmallq

🎯
Focusing
View GitHub Profile
@fivesmallq
fivesmallq / Ignored-URLs.txt
Last active December 11, 2015 00:19
vichrome 配置
http*://mail.google.com/*
http*://www.google.co*/reader/*
http*://docs.google.com/*
http*://www.google.com/calendar/*
http*://www.qingcloud.com/*
http*://pbsz.ebank.cmbchina.com/*
http*://console.qingcloud.com/terminal/*
http*://www.taobao.com/*
http*://www.alipay.com/*
@fivesmallq
fivesmallq / definitions.json
Created January 8, 2014 04:19
rest client init json.
{
"requests":[
{"key":"Accept","desc":"Content-Types that are acceptable.","example":"Accept: text/plain"},
{"key":"Accept-Charset","desc":"Character sets that are acceptable","example":"Accept-Charset: utf-8"},
{"key":"Accept-Encoding","desc":"Acceptable encodings","example":"Accept-Encoding: <compress | gzip | deflate | identity>"},
{"key":"Accept-Language","desc":"Acceptable languages for response","example":"Accept-Language: en-US"},
{"key":"Authorization","desc":"Authentication credentials for HTTP authentication","example":"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="},
{"key":"Cache-Control","desc":"Used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain","example":"Cache-Control: no-cache"},
{"key":"Connection","desc":"What type of connection the user-agent would prefer","example":"Connection: close"},
{"key":"Cookie","desc":"an HTTP cookie previously sent by the server with Set-Cookie","example":"Cookie: $Version=1; Skin=new;"
Enable Shared Folders on vmware Fusion (4.x)+ (Example OS: Linux Ubuntu 12.x as guest OS)
1. First update your linux system:
sudo apt-get update
sudo apt-get install -y build-essential
sudo aptitude -y safe-upgrade
2. Reboot your system just in case you have a new kernel
sudo shutdown -r now
/*
* Zed Attack Proxy (ZAP) and its related class files.
*
* ZAP is an HTTP/HTTPS proxy for assessing web application security.
*
* 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
@fivesmallq
fivesmallq / InjectorImpl.java
Last active August 29, 2015 14:00
guice just in time
/**
* Returns a just-in-time binding for {@code key}, creating it if necessary.
*
* @throws ErrorsException if the binding could not be created.
*/
private <T> BindingImpl<T> getJustInTimeBinding(Key<T> key, Errors errors, JitLimitation jitType)
throws ErrorsException {
boolean jitOverride = isProvider(key) || isTypeLiteral(key) || isMembersInjector(key);
synchronized (state.lock()) {
public class Fibonacci {
public static void main(String[] args) {
int result = 0;
int first = 0, second = 1;
int sum = 0;
for (;;) {
result = first + second;
if (result > 4000000) {
break;
package com.novacloud.data.job.demo;
import java.io.IOException;
import java.util.Iterator;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileInputFormat;
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- Replace the group ID with your group ID -->
<groupId>com.mycompany.hadoopproject</groupId>
<!-- Replace the artifact ID with the name of your project -->
<artifactId>my-hadoop-project</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
2014-05-29 16:21:20.007 java[3866:1003] Unable to load realm info from SCDynamicStore
14/05/29 16:21:20 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2014-05-29 16:21:20.091 java[3866:1003] Unable to load realm info from SCDynamicStore
14/05/29 16:21:21 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
14/05/29 16:21:21 WARN mapred.JobClient: No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String).
14/05/29 16:21:21 INFO input.FileInputFormat: Total input paths to process : 1
14/05/29 16:21:21 INFO hdfs.DFSClient: Exception in createBlockOutputStream
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
14/05/30 16:02:47 WARN conf.Configuration: fs.default.name is deprecated. Instead, use fs.defaultFS
2014-05-30 16:02:47.807 java[27723:1003] Unable to load realm info from SCDynamicStore
2014-05-30 16:02:47.809 java[27723:1003] Unable to load realm info from SCDynamicStore
14/05/30 16:02:47 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
14/05/30 16:02:47 WARN conf.Configuration: fs.default.name is deprecated. Instead, use fs.defaultFS
14/05/30 16:02:48 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
14/05/30 16:02:48 WARN mapred.JobClient: No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String).
14/05/30 16:02:57 INFO mapred.FileInputFormat: Total input paths to process : 1
14/05/30 16:02:57 INFO hdfs.DFSClient: Exception in createBlockOutputStream