Make Mysql throw an exception for Rails app to handle
daniel Mon, 10/30/2017 - 1:54pm
If you want to test what your rails app does when it hits a rails exception, one thing you can do is the following. Change the query slightly:
myDomainObj.where(my_param: "myval")
to:
myDomainObj.execute("SIGNAL SQLSTATE 'ERROR'")
Test Credit Card Links
daniel Fri, 10/27/2017 - 9:54am
- Read more about Test Credit Card Links
- Log in to post comments
Useful commands of the week
daniel Tue, 10/17/2017 - 1:21pm
Attach the contents of 1.txt as json to send to a url:
curl --data "@1.txt" -v -H "Content-Type: application/json" https://myapp.com
Grab 10,000 lines after matching, and then look only at the given thread
grep -A 10000 "09:55:.*My API endpoint.*ProviderSearch" myLog.log | grep pool-2-thread-28166
- Read more about Useful commands of the week
- Log in to post comments
Mysql links
daniel Fri, 09/29/2017 - 11:53am
Big Deletes by Rick James
Mysql Internal Locking
View processes locking tables in Mysql
Create temporary tables in mysql
Getting the disk size of a table in mysql
Specifying index to use for a query in mysql
Interpreting Explain Query output in mysql
Performing online updates with mysql
- Read more about Mysql links
- Log in to post comments
Change fonts size for SquirrelSql and other Java Swing Apps for hidpi monitors
daniel Wed, 09/27/2017 - 11:20am
Boils down to adding a couple of Java switches to the start script:
-Dswing.plaf.metal.controlFont=Tahoma-18 -Dswing.plaf.metal.userFont=Tahoma-18
For example, in squirrel-sql.sh, modify this line to include the above:
$JAVACMD -Xmx256m -Dswing.plaf.metal.controlFont=Tahoma-24 -Dswing.plaf.metal.userFont=Tahoma-24 -cp "$TMP_CP" $MACOSX_SQUIRREL_PROPS -splash:icons/splash.jpg net.sourceforge.squirrel_sql.client.Main --log-config-file "$UNIX_STYLE_HOME"/log4j.properties --squirrel-home "$UNIX_STYLE_HOME" $NATIVE_LAF_PROP $SCRIPT_ARGS
Working with Redis
daniel Tue, 09/26/2017 - 1:01pm
- Redis Datatypes
-
Redis Cheatsheet by LeCoupa
Command Description redis-cli redis client executable info display info about redis info keyspaces show databases equiv select [num] Use database equiv keys [pattern / *] List keys in db set [key value] get [key] mget [keys...] incr [key] incrBy [key incrementVal] decr [key] decrby [key decrementVal] del [key] ttl [key] expire [key seconds]
- Read more about Working with Redis
- Log in to post comments
java.time Duration in Hours and minutes
daniel Fri, 05/26/2017 - 1:00pm
Always cool to see people who create libraries answer questions in stackoverflow.
Here's the author of Joda time answering a good question about why duration.get calls are generally incorrect.
- Read more about java.time Duration in Hours and minutes
- Log in to post comments
Add BouncyCastle libs to Runtime of DropWizard
daniel Thu, 05/25/2017 - 11:14am
You can't add Bouncy Castle libs to the fatjar that Dropwizard creates due to signing issues. So you'll need to exclude them from the fatjar process, and then add them to the runtime script.
You'll need to modify your shade config in your pom:
Then drop the bouncy castle libs beside your fatjar and modify the start script:
exec java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -cp bcmail-jdk16-1.43.jar:bcprov-jdk16-1.43.jar -jar myFatJar.jar server config.yml
- Read more about Add BouncyCastle libs to Runtime of DropWizard
- Log in to post comments
Performance between Postgresql and Mongo
daniel Wed, 05/10/2017 - 3:03pm
Link is a little older, but looks interesting: From enterprisedb.com
- Read more about Performance between Postgresql and Mongo
- Log in to post comments
Npm and .gitignore
daniel Wed, 05/10/2017 - 3:01pm
Npm will ignore by default files that are matched in your .gitignore
from stackoverflow
- Read more about Npm and .gitignore
- Log in to post comments
