Skip to content

Instantly share code, notes, and snippets.

View dima767's full-sized avatar
🎯
Focusing

Dmitriy Kopylenko dima767

🎯
Focusing
View GitHub Profile
@mindblender
mindblender / cas_overlay_ui.md
Created October 13, 2017 20:04
CAS Overlay UI Theme Notes

CAS Overlay UI

Steps

  1. Create the following directories, if they are not already there:
  2. In the overlay directory:
    • mkdir -p src/main/webapp
    • mkdir -p src/main/resources
    • touch ./src/main/resources/custom_messages.properties - unique messages
    • mkdir -p ./src/main/resources/static
  • mkdir -p ./src/main/resources/static/css
@fitzoh
fitzoh / SpringCloudGatewayApplication.java
Created September 7, 2017 01:24
Canary deploys with spring-cloud-gateway (2.0.0-M1)
@EnableGateway
@SpringBootApplication
public class SpringCloudGatewayApplication {
private final String cookieName = "beta_active";
private final String headerName = "X-Beta-active";
private final String betaActiveValue = "true";
/**
* They're in the beta if they have a cookie or request header set
@dain
dain / Directions for creating PEM files
Last active October 16, 2023 09:11
Create Java KeyStore from standard PEM encoded private key and certificate chain files
# To regenerate the test key and certificates
# Generate an RSA private key and convert it to PKCS8 wraped in PEM
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform pem -outform pem -nocrypt -out rsa.key
# Generate a certificate signing request with the private key
openssl req -new -key rsa.key -out rsa.csr
# Sign request with private key
openssl x509 -req -days 10000 -in rsa.csr -signkey rsa.key -out rsa.crt
@jasonk000
jasonk000 / nodejs-sample.js
Last active September 10, 2025 17:41
Using x.509 certs with JWS/JWT/JWK
#!/usr/bin/env node
import fs from 'fs'
import jose from 'node-jose'
import pem from 'pem'
async function run () {
try {
// keystore to stick our node-jose keys before we do signing
let keystore = jose.JWK.createKeyStore()
@cwest
cwest / cf-mvp.sh
Last active March 21, 2016 09:34
#!/usr/bin/env bash
set -ex
# ____ _ _ _____ _ __ ____ ______
# / ___| | ___ _ _ __| | ___|__ _ _ _ __ __| |_ __ _ _ | \/ \ \ / / _ \
# | | | |/ _ \| | | |/ _` | |_ / _ \| | | | '_ \ / _` | '__| | | | | |\/| |\ \ / /| |_) |
# | |___| | (_) | |_| | (_| | _| (_) | |_| | | | | (_| | | | |_| | | | | | \ V / | __/
# \____|_|\___/ \__,_|\__,_|_| \___/ \__,_|_| |_|\__,_|_| \__, | |_| |_| \_/ |_|
# |___/
@graemerocher
graemerocher / migrate-jira-to-github-issues.groovy
Last active November 19, 2024 15:23
JIRA to Github Issues Migration Script
@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.0')
@Grab(group='joda-time', module='joda-time', version='2.7')
import wslite.rest.*
import org.joda.time.*
import org.joda.time.format.*
import groovy.xml.*
import groovy.json.*
import static java.lang.System.*
import groovy.transform.*
@christian-blades-cb
christian-blades-cb / vpn_fix.sh
Last active January 23, 2024 15:09
Fix issues with using boot2docker with Cisco's AnyConnect
#!/usr/bin/env bash
# If you're using docker-machine, call this script with your
# environment name
# Ex: ./vpn_fix dev
DEFAULTVM="boot2docker-vm"
[ $(id -u) = 0 ] || { echo "You must be root (or use 'sudo')" ; exit 1; }
report_success ()
@keithhamilton
keithhamilton / gist:9b618e99eb58779b665f
Last active August 29, 2015 14:04
Java Installs for IntelliJ IDEA on OS X Yosemite
#!/bin/bash
# Oracle hasn't updated the Java 1.7u65 installer to support Yosemite,
# so here's a way to get it installed.
# This is actually what I used to get IntelliJ IDEA running, but even
# if you aren't running that IDE, this is a quick script to get Java
# going strong on your fresh install of OS X 10.10
# Install Java 6 for OS X
@JacobASeverson
JacobASeverson / WebSecurityConfig
Last active August 7, 2025 12:47
Example java config for using CAS with Spring Security
@Configuration
@EnableWebMvcSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
public ServiceProperties serviceProperties() {
ServiceProperties serviceProperties = new ServiceProperties();
serviceProperties.setService("https://localhost:8443/cas-sample/j_spring_cas_security_check");
serviceProperties.setSendRenew(false);
return serviceProperties;
anonymous
anonymous / AttributeGeneratingDAO.java
Created January 3, 2013 16:08
Sketch of an attribute DAO that computes a new attribute value from the input. One would wrap this up in a parent DAO that merges with an echo of the input, or something, to ensure the resulting user attribute map returned from the whole attributes subsystem retains the username mapped as an attribute as well, as well as any other attributes col…
package net.unicon.cas.addons.persondir;
import java.util.List;
import java.util.Map;
...
/**
* Sketch of an attribute DAO that computes a new attribute value from the input.
*/