Skip to content

Instantly share code, notes, and snippets.

@dacrome
dacrome / ExtensionMap
Created September 30, 2014 15:24
This is an example how to make it easier to response the extensions from the OsiamController
import org.osiam.resources.scim.ExtensionFieldType;
import java.util.HashMap;
import java.util.Map;
public class ExtensionMap {
private String urn;
private Map<String, String> namedTypePairs = new HashMap<>();
@dacrome
dacrome / ExtensionService
Created September 30, 2014 15:35
This is an example for an ExtensionService and the updated ExtensionController with the changes from here: https://gist.github.com/dacrome/a04f2377f70676fc5230
// sorry, no imports
@Service
@Transactional // I know this should be in the respository, but one layer deeper than controller. yay!
public class ExtensionService {
@Inject
private ExtensionDao dao;
public List<ExtensionMap> getAllExtensions() {
@dacrome
dacrome / gist:31edbb3b9e894258e937
Created October 15, 2014 05:21
configuration of available fields and which are required for the self-administration registration html form
original.org.osiam.html.form.fields=fieldName:required
original.org.osiam.html.form.fields=formattedName:true\
,familyName:false\
,givenName:true
@dacrome
dacrome / recovery.conf
Created March 29, 2015 01:38
postgres recovery.conf sample
# -------------------------------
# PostgreSQL recovery config file
# -------------------------------
#
# Edit this file to provide the parameters that PostgreSQL needs to
# perform an archive recovery of a database, or to act as a replication
# standby.
#
# If "recovery.conf" is present in the PostgreSQL data directory, it is
# read on postmaster startup. After successful recovery, it is renamed
@dacrome
dacrome / gist:0f9226cd859758c877a3
Created May 25, 2015 22:07
Disable Thymeleaf Template Location Check
@Autowired
public void disableTemplateLocationCheck(ThymeleafProperties properties) {
properties.setCheckTemplateLocation(false);
}
@dacrome
dacrome / haproxy.cfg
Created August 4, 2015 08:27
HAProxy Config
global
maxconn 2000
user haproxy
group haproxy
listen tcp-in *:80
timeout connect 3600s
timeout client 60m
timeout server 60m
mode tcp
@dacrome
dacrome / spring ldap config
Created August 20, 2015 20:57
spring ldap config
auth
.authenticationProvider(provider)
.ldapAuthentication()
.userDnPatterns(dnPatterns)
.groupSearchBase(groupSearchBase)
.contextSource().url(url);
@dacrome
dacrome / After
Created October 11, 2015 18:51
ObjectMapper with Jersey Client
public Client updateClient(String updateClientId, Client client, AccessToken accessToken) {
Client updatedClient = null;
try {
updatedClient = targetEndpoint.path(CLIENT_ENDPOINT).path(updateClientId)
.request(MediaType.APPLICATION_JSON)
.property(HttpAuthenticationFeature.HTTP_AUTHENTICATION_USERNAME, clientId)
.property(HttpAuthenticationFeature.HTTP_AUTHENTICATION_PASSWORD, clientSecret)
.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout)
.property(ClientProperties.READ_TIMEOUT, readTimeout)
@dacrome
dacrome / osiam.properties
Created November 3, 2015 22:23
OSIAM vagrant vm properties
# Home URL (needed for self reference)
org.osiam.home=http://localhost:8080/osiam
#
# Database configuration (PostgreSQL)
#
org.osiam.db.vendor=postgresql
org.osiam.db.driver=org.postgresql.Driver
org.osiam.db.url=jdbc:postgresql://localhost:5432/ong
org.osiam.db.username=ong

Keybase proof

I hereby claim:

  • I am dacrome on github.
  • I am dacrome (https://keybase.io/dacrome) on keybase.
  • I have a public key whose fingerprint is 7A96 0E97 4464 5452 2B57 531D 0924 59FD 5F0D 73B2

To claim this, I am signing this object: