Instantly share code, notes, and snippets.

View hugo-gitlab-ci.yml
image: registry.gitlab.com/pages/hugo:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
pages:
script:
- hugo
artifacts:
paths:
View goroutines-closures-2.go
package main
import (
"fmt"
"time"
)
func main() {
for i := 0; i <= 9; i++ {
i := i // Seems odd, but it's legal and idiomatic.
View goroutines-closures.go
package main
import (
"fmt"
"time"
)
func main() {
for i := 0; i <= 9; i++ {
go func() { fmt.Println(i) }()
View symlink-tree.txt
View SymlinkTest.java
package com.example;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
View system.conf.properties
[Manager]
# Limit maximum of open files
DefaultLimitNOFILE=65535
View limits.conf.sh
#<domain> <type> <item> <value>
guido soft nofile 2048
guido hard nofile 10240
View SamlBootstrapInit.java
@Bean
public static SAMLBootstrap samlBootstrap() {
// return new SAMLBootstrap();
return new SamlBootstrapSha256();
}
View SamlBootstrapSha256.java
public class SamlBootstrapSha256 extends SAMLBootstrap {
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
throws BeansException {
super.postProcessBeanFactory(beanFactory);
BasicSecurityConfiguration config =
(BasicSecurityConfiguration) Configuration.getGlobalSecurityConfiguration();
View SamlKeyStore.java
@Bean
public KeyManager keyManager() {
DefaultResourceLoader loader = new DefaultResourceLoader();
Resource storeFile = loader.getResource("classpath:/saml/samlKeystore.jks");
String storePass = "secure";
Map<String, String> passwords = new HashMap<>();
passwords.put("samuraj", "secure");
String defaultKey = "samuraj";
return new JKSKeyManager(storeFile, storePass, passwords, defaultKey);