Bouldering problems recorded between March and May 2019 at Movement Climbing Fitness Baker and the newly opened “The Spot Denver”
Bouldering problems recorded between March and May 2019 at Movement Climbing Fitness Baker and the newly opened “The Spot Denver”
If you google for this question, you’ll find a bunch of crap answers about creating tasks and checking the task graph, bullshit.
All you need to do is check if a parameter has been passed to gradle.
Keep it simple and stupid:
(If you’re working with an android project, you can define that variable before the android {
section starts)
Then, if you need to do something different somewhere else down in your script, say, ask for a key alias and key password to sign your release (because they invoked ./gradlew assembleRelease
you do:
TL; Tell me already what to do:
Add the jdk.crypto.cryptoki
module to the list of --add-modules
parameter to your jlink
command invocation
If you’re reading this you’re one of the few developers out there that wanted to distribute a java 9+ app (using either jdk 9, jdk 10, jdk 11 or jdk 12, as of this writing) with a smaller version of the jdk, to build your custom jre, you used the jlink tool.
When you run your app using the full JRE that comes with the OpenJDK, your app is working fine when it comes to making https requests, but when you run your app using your custom jre you get the following error when opening https connections
This issue occurs because your JRE is missing lots of Cipher Suites that come with the full JDK.
With your JDK, you can try to check the list of supported ciphers with this one liner using the jrunscript tool:
however that might not work for your custom JRE if you haven’t included the scripting module, so here’s a Java program I made that prints all the available Ciphers of your JRE
If you run PrintCiphers
on your OpenJDK’s full JRE, you will see almost 50 Cipher Suites available:
but if you use your custom JRE to run PrintCiphers
you will see only 23 Cipher Suites available:
To solve the problem you must add the jdk.crypto.cryptoki
module to the list of --add-modules
parameter to your jlink
command invocation, next time your run PrintCiphers
you should see the full list of Cipher Suites and your SSL handshake issues should be gone.
https://github.com/gubatron/yuca
If your app can’t handle or doesn’t really need installing a full featured and heavy search engine like Lucene, nor you want to depend on a SQL database for indexing and doing simple search based strings you can use Yuca to index documents under any number of arbitrary keys which can be grouped under tags.
The shared library currently weighs ~170kb without any packing optimizations, we hope to reduce the size further in the near future.
Today, Wed May 9th the library is only available as a C++ shared or static library, the goal is to have bindings for popular programming languages, the first being Java since I need to use it on Android apps I’m developing.
If you feel like you need something like this and you’re not coding in C++, please create an issue on the github repository asking for the language bindings that you need and I’ll try to prioritize your request for the next set of language bindings.
So you build your Kotlin app, you went through the trouble of creating a build.gradle script that you build with
gradle assemble
this outputs a a “build/libs/kotlin.jar” .jar file, but you have no clue how to run your Kotlin code from the command line.
Doing it by hand with “java -cp
gradle run
or even
gradle -b /home/myuser/mykotlinapp/build.gradle run
in case you need to run your Kotlin script from a cronjob.
Make sure you have the following inside your build.gradle script in order to make the “run” task available
apply plugin: 'application'
// DO notice the "Kt" suffix on the class name below, if you don't use the Kt generated class you will get errors
mainClassName = 'com.myapp.MyKotlinAppKt'
// optional: add one string per argument you want as the default JVM args
applicationDefaultJvmArgs = ["-Xms512m", "-Xmx1g"]
What if I don’t want to use gradle, and just java
ok… ok…
java -cp $KOTLIN_LIB/kotlin-runtime.jar:build/libs/kotlin.jar:
Today one of our wordpress sites had very high server load and it was being caused by MySQL
So I went to the mysql console, and looked up the process list:
So this guy is appearing a lot
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
Let’s see how it’s behaving with explain
explain SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
It’s scanning 226k rows to get its search results!
Probably some moronic plugin is doing this and wordpress does not add an index on that table. The solution is simple, let’s add an index!
ALTER TABLE wp_options ADD INDEX (`autoload`);
Now let’s run explain
again
From scanning 226k it went down to 408!, 3 orders of magnitude drop.
And now the CPU load went below 4%, crisis averted.