Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<!-- Link this id here to the repo ID in the mirror section -->
<id>repo</id>
<username>deployment</username>
<password>password</password>
@authsec
authsec / simple_apr.c
Last active July 17, 2016 11:51
Simple program utilizing the Apache Portable Runtime
#include <apr.h>
#include <apr_general.h>
#include <apr_pools.h>
#include <stdlib.h>
#include <stdio.h>
#include <apr_strings.h>
#include <apr_time.h>
/* Compile this beast with
* $> export APR_LIBS="`apr-1-config --cflags --cppflags --includes --ldflags --link-ld --libs`"
@authsec
authsec / startFlow.java
Created July 17, 2016 11:23
Start a Faces Flow Programmatically
FacesContext context = FacesContext.getCurrentInstance();
FlowHandler handler = context.getApplication().getFlowHandler();
handler.transition(context, null, handler.getFlow(context, "", FLOW_NAME), null, "");
return FLOW_NAME;
@authsec
authsec / switchToPostgres.sh
Created July 13, 2016 21:52
Switch Roller from Derby to PostgreSQL
#!/bin/sh
TARGET=/opt/roller
TARGET_TMP=${TARGET}/tmp
DBNAME="rollerdb"
DBUSER="roller"
DBPASSWORD="roller"
echo "Switching to postgres ..."
echo "I hope you created the rollerdb before ..."
@authsec
authsec / rollerGlassFish.sh
Created July 13, 2016 21:42
Automated Roller Installer Script
#!/bin/sh
TARGET=/opt/roller
TARGET_TMP=${TARGET}/tmp
UPLOADS=$TARGET/uploads
THEMES=$TARGET/themes
PLANET_CACHE=$TARGET/planetcache
SEARCH_INDEX=$TARGET/searchindex
KEY1="coffeeCrewSetupKey1"
KEY2="coffeeCrewSetupKey2"
@authsec
authsec / gist:455940a3f6bd5673c1c9dd16ea4ec0af
Created June 29, 2016 22:06
Variables for Roller installation
root@sigusr1:$
TARGET=/opt/roller
TARGET_TMP=${TARGET}/tmp
UPLOADS=$TARGET/uploads
THEMES=$TARGET/themes
PLANET_CACHE=$TARGET/planetcache
SEARCH_INDEX=$TARGET/searchindex
#ROLLER_FILENAME="apache-roller-4.0.1-snapshot-20080211.tar.gz"
ROLLER_FILENAME="apache-roller-4.1-snapshot-m1.tar.gz"
CTX_ROOT="blogs"
@authsec
authsec / backupRemoteDirToQnap.sh
Last active June 16, 2016 19:41
Script to backup a remote directory to your local QNAP storage
#!/bin/sh
# Script to periodically synchronize a remote directory with your
# local QNAP storage.
# Source folders/user on remote machine
BACKUP_SOURCE_USER="backup-user"
BACKUP_SOURCE_HOST="backuphost.example.com"
BACKUP_SOURCE_FOLDER="/backup/subdir"
package org.coffeecrew.examples.enumeration;
public class Main {
public static void main(String[] args) {
for (ProgrammingLanguage pl: ProgrammingLanguage.values()) {
printProgrammingLanguage(pl);
printMoreAdjacent(ProgrammingLanguage.C, pl);
}
}
package org.coffeecrew.examples.enumeration;
/**
* This enumeration describes the hardware adjacency
* of the specified programming languages.
* @author j
*/
public enum ProgrammingLanguage {
/* ASM is hardware ;) */
@authsec
authsec / Index.java
Created June 1, 2016 21:23
ReST Endpoint Catch All
@ApplicationScoped @Path("/") @Produces(MediaType.TEXT_HTML)
public class Index {
@GET @Path("/{any : .*}")
public Response root() {
return Response.ok().entity("<!DOCTYPE html>\n" +
"<html>\n" +
" <head>\n" +
" <title>Response</title>\n" +
" </head>\n" +