This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class SpringBatchConfiguration implements BatchConfigurer { | |
@Bean(name = "hsqlDataSource") | |
public DataSource hsqlDataSource() { | |
EmbeddedDatabaseBuilder embeddedDatabaseBuilder = new EmbeddedDatabaseBuilder(); | |
return embeddedDatabaseBuilder | |
.addScript("classpath:org/springframework/batch/core/schema-drop-hsqldb.sql") | |
.addScript("classpath:org/springframework/batch/core/schema-hsqldb.sql") | |
.setType(EmbeddedDatabaseType.HSQL).build(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.shootr.api.domain; | |
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; | |
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.springframework.hateoas.Resource; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.shootr.api.config; | |
import java.util.Arrays; | |
import java.util.concurrent.TimeUnit; | |
import javax.annotation.PreDestroy; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.boot.autoconfigure.AutoConfigureAfter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.shootr.api.web.rest.exception; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.validation.FieldError; | |
import org.springframework.web.bind.annotation.ControllerAdvice; | |
import org.springframework.web.bind.annotation.ExceptionHandler; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.shootr.api.config; | |
import java.util.List; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.http.converter.HttpMessageConverter; | |
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; | |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; | |
import com.fasterxml.jackson.annotation.JsonInclude.Include; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.common.cache.Cache; | |
import com.google.common.cache.CacheStats; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.actuate.endpoint.PublicMetrics; | |
import org.springframework.boot.actuate.metrics.Metric; | |
import org.springframework.cache.CacheManager; | |
import org.springframework.stereotype.Component; | |
import org.springframework.util.Assert; | |
import java.util.ArrayList; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Params: | |
# 1- filename in s3. Ex: mongobackup-tst-28-05-2015-1432802174.7z | |
# 2- source env. Ex: pro | |
# 3- target env to restore in. Ex: tst | |
# 4- target database name. Ex: databaseRestore | |
# ex: ./restore.sh mongobackup-tst-28-05-2015-1432802174.7z pro tst databaseRestore | |
# s3 file exists and ends with .tar.gz | |
if [ -z "$1" ] || [[ ! $1 =~ .*.7z ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ./backup.sh pro databaseName | |
# Validations | |
if [ -z "$1" ] ; then | |
echo `date`" specify a environment ['tst', 'pro']" | |
exit 1 | |
elif [ "$1" != "tst" ] && [ "$1" != "pro" ]; then | |
echo `date`" specify a valid environment ['tst', 'pro']" | |
exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.joda.time.Instant; | |
import org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventListener; | |
public class MongoSynchronizedListener extends AbstractMongoEventListener<Object> { | |
/** | |
* Called in MongoTemplate insert, insertList and save operations before the | |
* object is converted to a DBObject using a MongoConveter. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -n | openssl s_client -connect gitlab.com:443 | \ | |
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | \ | |
sudo tee '/usr/local/share/ca-certificates/gitlab_com.crt' | |
sudo update-ca-certificates |
OlderNewer