Skip to content

Instantly share code, notes, and snippets.

# see also http://kbroman.org/github_tutorial/pages/init.html
git init
# > Initialized empty Git repository in /home/eyalgo/development/eclipse-projects/file-system/.git/
git remote add origin git@github.com:eyalgo/<repository>.git
git pull
# > remote: Counting objects: 7, done.
# > remote: Compressing objects: 100% (6/6), done.
# > remote: Total 7 (delta 1), reused 0 (delta 0)
/opt/hbase/hbase-0.94.18/bin/start.sh
/opt/hbase/hbase-0.94.18/bin/stop.sh
/opt/hbase/hbase-0.94.18/bin/rolling-restart.sh
public class DbCleanupRule implements TestRule {
private final DbConnectionManager connection;
public DbCleanupRule(DbConnectionManager connection) {
this.connection = connection;
}
@Override
public Statement apply(Statement base, Description description) {
return new DbCleanupStatement(base, connection);
public class DbConnectionRule extends ExternalResource {
private DbConnectionManager connection;
public DbConnectionRule() {
}
@Override
protected void before() throws Throwable {
ClassPathXmlApplicationContext ctx = null;
try {
@ContextConfiguration(locations = { "/META-INF/one-dao-TEST-ctx.xml", "/META-INF/two-TEST-ctx.xml" })
public class ExampleDaoTest extends AbstractJUnit4SpringContextTests {
@ClassRule
public static DbCleanupRule connectionRule = new DbCleanupRule ();
@Rule
public DbCleanupRule dbCleanupRule = new DbCleanupRule(connectionRule.getDbConnecttion());
@Autowired
import org.slf4j.Logger
import com.my.ProcessingJobResult
def Logger logger = jobLogger
//ProcessingJobResult is proprietary
def ProcessingJobResult result = jobResult
try {
logger.info("Deleting old webapps from CI - START")
def numberOfDirectoriesToKeep = 4 // Can be externalized to input parameter
package eyalgo;
import static org.hamcrest.Matchers.equalTo;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@eyalgo
eyalgo / pom.xml
Created November 17, 2014 14:14
part of pom file for compile and build, run it using clean compile assembly:single
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
# http://docs.mongodb.org/manual/reference/mongo-shell/
# under monog installation
mongo
# Print a list of all databases on the server
show dbs
show collections
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;
import rx.Observable;
import com.couchbase.client.java.AsyncBucket;