sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
# Set the maximum number of open file descriptors
ulimit -n 20000000
# Set the memory size for TCP with minimum, default and maximum thresholds
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
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 Event.NoneEvent | |
import kotlin.random.Random | |
import kotlin.time.Duration.Companion.milliseconds | |
import kotlinx.coroutines.* | |
import kotlinx.coroutines.flow.* | |
/** | |
* You can edit, run, and share this code. | |
* play.kotlinlang.org | |
*/ |
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
const { | |
generateKeyPairSync, | |
publicEncrypt, | |
publicDecrypt, | |
privateEncrypt, | |
privateDecrypt | |
} = require('crypto'); | |
//generate a key pair RSA type encryption with a .pem format | |
const { publicKey, privateKey } = generateKeyPairSync('rsa', { |
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
class A(val a: Int = 10){ | |
fun getAValue(b: Int, c: Int): Int { | |
return a+b+c; | |
} | |
} | |
object Test{ | |
inline fun <reified T> callMethod(obj: T, methodName: String, vararg params: Any?): Any? { | |
val method = T::class.java.methods.single{ it.name == methodName} | |
return method.invoke(obj, *params) |