Skip to content

Instantly share code, notes, and snippets.

@iperdomo
iperdomo / adb.log
Created October 20, 2014 16:43
adb.log using JBoss Keycloak and OIDC Android sample
D/Authenticator(22923): addAccount called with accountType com.lnikkila.oidcsample.account, authTokenType com.lnikkila.oidcsample.TOKEN_TYPE_ID.
D/Authenticator(22923): Created new intent with authorisation URL 'https://login.akvotest.org/auth/realms/akvo/tokens/login?client_id=foobar&redirect_uri=app://oidcsample.lnikkila.com&response_type=code&scope=openid%20profile%20offline_access&prompt=login&display=touch'.
I/ActivityManager( 2189): START u0 {cmp=com.lnikkila.oidcsample/.oidc.authenticator.AuthenticatorActivity (has extras)} from pid 22923
D/AuthenticatorActivity(22923): Initiated activity for getting authorisation with URL 'https://login.akvotest.org/auth/realms/akvo/tokens/login?client_id=foobar&redirect_uri=app://oidcsample.lnikkila.com&response_type=code&scope=openid%20profile%20offline_access&prompt=login&display=touch'.
I/ActivityManager( 2189): Displayed com.lnikkila.oidcsample/.oidc.authenticator.AuthenticatorActivity: +122ms
D/AuthenticatorActivity(22923): WebView loading URL 'https://login.akv
@iperdomo
iperdomo / adb.log
Created October 20, 2014 14:29
adb.log using JBoss Keycloak and OIDC Android sample
D/Authenticator(20490): Authenticator created.
D/Authenticator(20490): addAccount called with accountType com.lnikkila.oidcsample.account, authTokenType com.lnikkila.oidcsample.TOKEN_TYPE_ID.
D/Authenticator(20490): Created new intent with authorisation URL 'https://login.akvotest.org/auth/realms/akvo/tokens/login?client_id=android&redirect_uri=app://oidcsample.lnikkila.com&response_type=code&scope=openid%20profile%20offline_access&prompt=login&display=touch'.
I/ActivityManager( 2189): START u0 {cmp=com.lnikkila.oidcsample/.oidc.authenticator.AuthenticatorActivity (has extras)} from pid 20490
D/AuthenticatorActivity(20490): Initiated activity for getting authorisation with URL 'https://login.akvotest.org/auth/realms/akvo/tokens/login?client_id=android&redirect_uri=app://oidcsample.lnikkila.com&response_type=code&scope=openid%20profile%20offline_access&prompt=login&display=touch'.
I/ActivityManager( 2189): Displayed com.lnikkila.oidcsample/.oidc.authenticator.AuthenticatorActivity: +182ms
D/dalvikvm( 2189): GC
@iperdomo
iperdomo / flow-api.php
Created August 15, 2014 13:14
Sample code for FLOW API
<?
// NOTE: requires php5-cli, php5-curl
$access_key = $argv[1];
$secret = $argv[2];
$url = $argv[3];
$date = time(); // UNIX timestamp
@iperdomo
iperdomo / Random.java
Created August 14, 2014 17:51
SecureRandom test
import java.security.SecureRandom;
import org.apache.commons.codec.binary.Base64;
public class Random {
public static void main(String[] args) {
// http://docs.oracle.com/javase/7/docs/api/java/security/SecureRandom.html
@iperdomo
iperdomo / 651.diff
Created August 5, 2014 17:14
Sample changes for akvo-flow issue #651
diff --git a/GAE/src/com/gallatinsystems/common/util/MemCacheUtils.java b/GAE/src/com/gallatinsystems/common/util/MemCacheUtils.java
index a2e6c80..f78408b 100644
--- a/GAE/src/com/gallatinsystems/common/util/MemCacheUtils.java
+++ b/GAE/src/com/gallatinsystems/common/util/MemCacheUtils.java
@@ -27,7 +27,6 @@ import net.sf.jsr107cache.Cache;
import net.sf.jsr107cache.CacheFactory;
import net.sf.jsr107cache.CacheManager;
-import com.gallatinsystems.framework.dao.BaseDAO;
import com.google.appengine.api.memcache.MemcacheService;
@iperdomo
iperdomo / s3-copy.sh
Created July 26, 2014 10:24
Amazon S3 - Incremental copy using s3cmd
#!/bin/bash
set -e
CFG="$1"
SRC="$2"
DST="$3"
FOLDER="$4"
echo "Getting ${FOLDER} list for ${SRC}"
@iperdomo
iperdomo / S3Test.java
Last active April 13, 2018 06:41
Testing S3 REST API
package org.akvo.aws.s3;
import java.io.File;
import java.io.IOException;
import java.security.Key;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
@iperdomo
iperdomo / md-watch
Last active August 29, 2015 13:59
Watches a markdown file and produces html
#!/bin/sh
set -e
inotifywait -m -e modify "$1" | while read line; do markdown "$1" > "$2"; done;
2014-04-13 15:46:26,670 INFO [javax.servlet.ServletContextListener] Welcome to Seam 2.3.1.Final
2014-04-13 15:46:27,444 INFO [org.jboss.seam.init.Initialization] reading /WEB-INF/components.xml
2014-04-13 15:46:27,557 INFO [org.jboss.seam.init.Initialization] reading properties from: /seam.properties
2014-04-13 15:46:27,589 INFO [org.jboss.seam.Component] Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
2014-04-13 15:46:27,602 INFO [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.cache.cacheProvider
2014-04-13 15:46:27,603 INFO [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.resourceLoader
2014-04-13 15:46:27,603 INFO [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.web.parameters
2014-04-13 15:46:27,603 INFO [org.jboss.seam.init.Initialization] two components with sam
2014-04-13 15:46:16,185 INFO [javax.servlet.ServletContextListener] Welcome to Seam 2.2.2.Final
2014-04-13 15:46:16,873 INFO [org.jboss.seam.init.Initialization] reading /WEB-INF/components.xml
2014-04-13 15:46:16,953 INFO [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.web.rewriteFilter
2014-04-13 15:46:16,969 INFO [org.jboss.seam.init.Initialization] reading properties from: /seam.properties
2014-04-13 15:46:17,052 INFO [org.jboss.seam.Component] Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
2014-04-13 15:46:17,068 INFO [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.web.isUserInRole
2014-04-13 15:46:17,069 INFO [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.manager
2014-04-13 15:46:17,069 INFO [org.jboss.seam.init.Initialization] two components with same name,