Skip to content

Instantly share code, notes, and snippets.

View ikane's full-sized avatar

Ibrahima Kane ikane

  • Paris
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<Pattern>.%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg %n
</Pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>TRACE</level>
</filter>
server.port = 8443
server.ssl.key-store=classpath:sample.jks
#server.ssl.key-store=file://var/tmp/sample.jks
#server.ssl.key-store=file:///K:/DEV/SSL/sample.jks
server.ssl.key-store-password = secret
server.ssl.key-password = password
@Api(value = "xxx")
@FrameworkEndpoint
@SessionAttributes("authorizationRequest")
public class OAuthAuthorizationEndpoint {
private AuthorizationEndpoint authorizationEndpoint;
/**
* @param endpoint
* base AuthorizationCheckpoint
@ikane
ikane / PortalApi.java
Last active June 18, 2017 13:50
portal-service
@PostMapping(path="/change_password")
public ResponseEntity<Void> changePassword(@RequestBody MmsUserDto userDTO) {
try {
LOGGER.debug("!!! Changing password for {}", userDTO.getId());
MmsUser user = mmsUserService.findOneById(userDTO.getId());
if(!this.passwordEncoder.matches(userDTO.getPassword(), user.getPassword())) {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
BEGIN
--Bye Sequences!
FOR i IN (SELECT us.sequence_name FROM USER_SEQUENCES us)
LOOP
EXECUTE IMMEDIATE 'drop sequence '|| i.sequence_name ||'';
END LOOP;
--Bye Tables!
FOR i IN (SELECT ut.table_name FROM USER_TABLES ut)
@ikane
ikane / oracle_create_role.sql
Created July 14, 2017 05:34
Create ROLE in ORACLE Database
spool &1\oracle_create_role.log
set echo on
DROP ROLE R_MMS_ADMIN;
CREATE ROLE R_MMS_ADMIN;
GRANT CONNECT TO R_MMS_ADMIN;
GRANT RESOURCE TO R_MMS_ADMIN;
GRANT CREATE SESSION TO R_MMS_ADMIN;
#!/usr/bin/env bash
export MY_NAME="Ibou from my_env_variable.sh file"
#To put in /etc/profile.d/my_env_variables.sh
@ikane
ikane / maven-tempate-archtype.html
Created July 25, 2017 05:10
Maven Template archtype creation from existing project
Create archetype
------------------------
mvn archetype:create-from-project
>> target/generated-sources/archetype
>> main/resources has two folders:
1. archetype-resources – this is the project template and what will be generated when the archetype is run
2. META-INF/maven – this contains the archetype-metadata.xml file which has the settings and options when generating a new project.
wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
chmod +x ./jq
cp jq /usr/bin
@ikane
ikane / SecurityConfig.java
Created September 11, 2017 04:56 — forked from virgium03/SecurityConfig.java
Spring Security Java configuration for Pre-authenticated scenario
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.AccessDecisionVoter;
import org.springframework.security.access.vote.AffirmativeBased;
import org.springframework.security.access.vote.RoleVoter;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.ProviderManager;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;