Skip to content

Instantly share code, notes, and snippets.

View rajeevshukla's full-sized avatar
🎯
Focusing

Rajeev Shukla rajeevshukla

🎯
Focusing
View GitHub Profile
@rajeevshukla
rajeevshukla / pom.xml
Last active April 30, 2020 05:13
Maven Dependency
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
@rajeevshukla
rajeevshukla / jax-git-workshop.md
Created February 19, 2020 23:00 — forked from tlberglund/jax-git-workshop.md
JAX London Git Workshop Notes

JAX Git Workshop

Outline

  • git init project
  • git config --global user.name "Tim Berglund"
  • git config --global user.email "[email protected]"
  • git status
  • git add <file>
  • Diff
    • git diff
@rajeevshukla
rajeevshukla / saveAsORCTable.R
Last active September 14, 2019 17:52
R function to create ORC table dynamically and partitioning
saveAsORCTable<- function(df,master_table_name,partitionBy, mode="overwrite") {
dropSqlQuery<- paste("drop table if exists",master_table_name)
tempTableName<- paste("temp",master_table_name,sep = "_")
createTableQuery<-paste("create table ",master_table_name," using orc partitioned by (",toString(partitionBy),") as select * from",tempTableName,"limit 0")
createOrReplaceTempView(df,tempTableName)
columnNames<-colnames(df)
columnNames<-setdiff(columnNames,partitionBy)
columnNames<-append(columnNames,partitionBy)
insertQuery<-paste("insert into",master_table_name,"partition (",toString(partitionBy),") select",toString(columnNames),"from",tempTableName)
if(mode == "overwrite") {
@Configuration
@EnableEncryptableProperties
public class MyApplication {
...
}
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot</artifactId>
<version>2.1.1</version>
</dependency>
rajeev@Dell-Latitude-5480:~/.m2/repository/org/jasypt/jasypt/1.9.2$ java -cp jasypt-1.9.2.jar org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI input="oracle" password=secretkey algorithm=PBEWithMD5AndDES
----ENVIRONMENT-----------------
Runtime: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.181-b13
----ARGUMENTS-------------------
spring.datasource.jdbc-url=jdbc:oracle:thin:@localhost:1521/pls00p10
spring.datasource.username=oracle
spring.datasource.password=ENC(kmRyn5KQFd+M5hWMZEey1A==)
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
C:\Users\rajeev\.m2\repository\org\jasypt\jasypt\1.9.2>java -cp jasypt-1.9.2.jar org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI
input="actual_text_that_you_want_to_hide"
password=your_secret_key
algorithm=PBEWithMD5AndDES
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>