Skip to content

Instantly share code, notes, and snippets.

View susimsek's full-sized avatar
🎯
Focusing

Şuayb Şimşek susimsek

🎯
Focusing
View GitHub Profile
@susimsek
susimsek / GenericPagedDto.java
Last active December 28, 2020 08:04
Spring Boot Generic Paged Class
public class GenericPagedDto<T> extends PageImpl<T> {
public GenericPagedDto(List<T> content, Pageable pageable, long total) {
super(content, pageable, total);
}
public GenericPagedDto(List<T> content) {
super(content);
}
@susimsek
susimsek / Invoice.java
Last active February 25, 2023 09:49
Spring Boot Mapstruct With Decorator Pattern
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@Entity
@FieldDefaults(level = AccessLevel.PRIVATE)
@Table(name = "invoices")
public class Invoice {
@Id
@susimsek
susimsek / CreateUserRequestModel.java
Last active August 10, 2024 17:55
Spring Boot Mapstruct With Password Encoder
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@FieldDefaults(level = AccessLevel.PRIVATE)
public class CreateUserRequestModel {
@NotBlank
@Size(min=2)
String firstName;
@susimsek
susimsek / ExecutionTimeAdvice.java
Last active September 6, 2024 17:21
Spring Boot Measure Execution Time using Spring AOP
@Aspect
@Component
@Slf4j
@ConditionalOnExpression("${aspect.enabled:true}")
public class ExecutionTimeAdvice {
@Around("@annotation(TrackExecutionTime)")
public Object executionTime(ProceedingJoinPoint point) throws Throwable {
long startTime = System.currentTimeMillis();
Object object = point.proceed();
@susimsek
susimsek / SwaggerConfig.java
Created January 13, 2021 10:13
Spring boot Swagger Pagination
@EnableSwagger2
@Configuration
public class SwaggerConfig {
@Bean
public Docket docket() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.paths(PathSelectors.any())
@susimsek
susimsek / README.md
Last active March 10, 2021 17:45
Openssl Cert Control

Openssl Cert Control

openssl s_client -showcerts -connect domain:port
@susimsek
susimsek / virtualmachines.csv
Last active October 31, 2021 09:39
Table of Virtual Machines to Install Using Vagrant
Hostname Ram Cpu Operating System Ip
nfsserver 512 MB 1 Core Ubuntu Server 20.04 LTS 192.168.12.9
haproxy 512 MB 1 Core Ubuntu Server 20.04 LTS 192.168.12.10
k8smaster 9728 MB 6 core Ubuntu Server 20.04 LTS 192.168.12.11
@susimsek
susimsek / Vagrantfile
Created October 31, 2021 10:01
Vagrantfile for VM Setup
$script = <<-SCRIPT
# echo "Preparing local node_modules folder…"
# mkdir -p /home/vagrant/app/sdk/vagrant_node_modules
# chown vagrant:vagrant /home/vagrant/app/sdk/vagrant_node_modules
echo "cd $1" >> /home/vagrant/.profile
echo "cd $1" >> /home/vagrant/.bashrc
echo "All good!!"
SCRIPT
@susimsek
susimsek / Vagrantfile
Created October 31, 2021 10:15
Vagrantfile for 3 Master and 3 Worker Node
$script = <<-SCRIPT
# echo "Preparing local node_modules folder…"
# mkdir -p /home/vagrant/app/sdk/vagrant_node_modules
# chown vagrant:vagrant /home/vagrant/app/sdk/vagrant_node_modules
echo "cd $1" >> /home/vagrant/.profile
echo "cd $1" >> /home/vagrant/.bashrc
echo "All good!!"
SCRIPT
@susimsek
susimsek / copy_fabricfiles.sh
Created October 31, 2021 10:58
Nfs Server Change Path
#!/bin/bash
NFS_DIR=/srv/kubedata
TARGET_PATH=$NFS_DIR/fabricfiles
FABRIC_FILES_PATH=/vagrant/k8s/fabricfiles
# Functions #########################################################################
function copy_fabricfiles(){
echo "## Copied fabric files"