This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###修改ubuntu初始密码 | |
#sudo passwd root | |
###修改主机名 | |
#/etc/hostname | |
#/etc/hosts | |
###安装ssh服务 | |
#sudo apt-get install openssh-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@Iven sysconfig]# cat iptables | |
# Generated by iptables-save v1.4.7 on Mon Jun 1 00:04:12 2015 | |
*nat | |
:PREROUTING ACCEPT [49:4737] | |
:POSTROUTING ACCEPT [2:144] | |
:OUTPUT ACCEPT [2:144] | |
-A PREROUTING -p tcp -m tcp --dport 22222 -j REDIRECT --to-ports 22 | |
COMMIT | |
# Completed on Mon Jun 1 00:04:12 2015 | |
# Generated by iptables-save v1.4.7 on Mon Jun 1 00:04:12 2015 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test{ | |
public String a = "hello"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>发觉自己的爱好!做有意义的事,倾听</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* see http://caterpillar.onlyfun.net/Gossip/DesignPattern/SingletonPattern.htm | |
* http://www.jackforfun.com/2007/07/java-synchronized.html | |
*/ | |
public class Singleton { | |
private static Singleton instance = null; | |
private Singleton(){} | |
public static Singleton getInstance() { | |
if (instance == null){ | |
synchronized(Singleton.class){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.util.Scanner; | |
public class ScissorStoneCloth { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SingleInstance { | |
private static class InstanceHolder { | |
public static final SingleInstance instance = new SingleInstance(); | |
} | |
public static SingleInstance getInstance() { | |
return InstanceHolder.instance; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum SingletonEnum { | |
/** | |
* 定义一个枚举的元素,它就代表了Singleton的一个实例。 | |
*/ | |
uniqueInstance; | |
/** | |
* 单例可以有自己的操作 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.context.support.ClassPathXmlApplicationContext; | |
import org.springframework.orm.hibernate3.SessionFactoryUtils; |
OlderNewer