diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`where XXXXX is the size of the RAM disk in terms of memory blocks.
Notes:
| plugins { | |
| id 'org.springframework.boot' version '2.1.7.RELEASE' | |
| id 'io.spring.dependency-management' version '1.0.8.RELEASE' | |
| id 'java' | |
| id 'idea' | |
| id "com.ewerk.gradle.plugins.querydsl" version "1.0.10" | |
| id "io.franzbecker.gradle-lombok" version "3.2.0" | |
| } |
| export const ws = webSocket<WebsocketMessage>(`wss://${location.hostname}:${location.protocol === 'https:' ? 443 : 80}/ws/`); | |
| export const wsObserver = ws | |
| .pipe( | |
| retryWhen(errors => | |
| errors.pipe( | |
| delay(1000) | |
| ) | |
| ) | |
| ); |
| // create 6-digit | |
| public int create6digit() { | |
| SecureRandom sr = SecureRandom.getInstance("SHA1PRNG"); | |
| int verificationNumber = sr.nextInt(900000) + 100000; | |
| } | |
| @Configuration | |
| public class RetrofitConfig { |
| // get aes256 key : https://asecuritysite.com/encryption/keygen | |
| fun String.encrypt(secret: String): String { | |
| val keyData = secret.toByteArray() | |
| val ivData = secret.substring(0, 16).toByteArray() | |
| val aesKey = SecretKeySpec(keyData, "AES") | |
| val cipher = Cipher.getInstance("AES/CBC/PKCS5Padding") | |
| cipher.init(Cipher.ENCRYPT_MODE, aesKey, IvParameterSpec(ivData)) | |
| return String(Base64.getEncoder().encode(cipher.doFinal(this.toByteArray()))) | |
| } |