Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block doubledouble

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:21d83e8c491c0cd1f158
#sudo passwd root
#sudo apt-get install openssh-server
View gist:7723f67e18efba06f0cf
[root@Iven sysconfig]# cat iptables
# Generated by iptables-save v1.4.7 on Mon Jun 1 00:04:12 2015
-A PREROUTING -p tcp -m tcp --dport 22222 -j REDIRECT --to-ports 22
# Completed on Mon Jun 1 00:04:12 2015
# Generated by iptables-save v1.4.7 on Mon Jun 1 00:04:12 2015
View gist:1803350
public class Test{
public String a = "hello";
View 做有意义的事
View Singleton
* see
public class Singleton {
private static Singleton instance = null;
private Singleton(){}
public static Singleton getInstance() {
if (instance == null){
View 剪刀石头布
package test;
import java.util.Scanner;
public class ScissorStoneCloth {
* @param args
public static void main(String[] args) {
View java
private static void doCopyFile(File srcFile, File destFile, boolean preserveFileDate) throws IOException {
if (destFile.exists() && destFile.isDirectory()) {
throw new IOException("Destination '" + destFile + "' exists but is a directory");
FileInputStream fis = null;
FileOutputStream fos = null;
FileChannel input = null;
FileChannel output = null;
try {
doubledouble /
Last active Oct 6, 2015
public class SingleInstance {
private static class InstanceHolder {
public static final SingleInstance instance = new SingleInstance();
public static SingleInstance getInstance() {
return InstanceHolder.instance;
View SingletonEnum
public enum SingletonEnum {
* 定义一个枚举的元素,它就代表了Singleton的一个实例。
* 单例可以有自己的操作
View AbstractTestBean
package com.iteye.common.test;
import junit.framework.TestCase;
import org.hibernate.FlushMode;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.SessionFactoryUtils;
You can’t perform that action at this time.