TeamCity and Github webhooks
daniel Fri, 10/12/2018 - 10:12am
Might need to use github webhooks for Teamcity.
Doesn't seem straightforward to do (at least, it didn't work the first few times I tried), so here are some links:
- Read more about TeamCity and Github webhooks
- Log in to post comments
Chatbots
daniel Fri, 10/12/2018 - 10:05am
- Read more about Chatbots
- 1 comment
- Log in to post comments
Get table create statement from command line (mysql)
daniel Fri, 10/12/2018 - 10:03am
describe tablename;
MyISAM = no transactions
daniel Thu, 08/30/2018 - 10:56am
Let's see if I can remember it this time thanks to this answer from RandomSeed
Was testing a change to some transaction handling and was confused at the results. Turns out the random table I chose to test with was MyISAM instead of Innodb.
But now I know how to setup general query logging and slow query logging on MariaDb and Mysql on a mac.
I had to use some help from: ewalshe and Drew on how to locate my.cnf on a mac.
It ended up being in
/usr/local/etc/my.cnf
The config added:
[mysqld]
general-log
general-log-file=queries.log
log-output=file
slow_query_log=1
If you installed with homebrew, you'll have to restart the service with:
brew services stop mariadb; brew services start mariadb
Using the restart target won't work.
Can then tail those logs:
tail -f /usr/local/var/mysql/myhostname.* /usr/local/var/mysql/queries.log
Change myhostname as appropriate. Best to just do an ls in that dir.
The format of the general query log was interesting too as it wasn't straightforward that the id referenced a thread for the database
What's in the slow query log: MariaDb docs
As a bonus, some Isolation Level Docs for MariaDb
- Read more about MyISAM = no transactions
- Log in to post comments
Automysqlbackup on Mac
daniel Wed, 05/16/2018 - 12:48pm
This is great for making daily backups of your database, so that you can roll back to a known config.
Install
Use homebrew to install it.
brew install automysqlbackup
The config file is in /usr/local/etc/automysqlbackup/automysqlbackup.conf
You'll want to modify the excludes line to contain the following:
CONFIG_db_exclude=( 'information_schema' 'performance_schema' 'mysql')
create the directory /usr/local/var/backup:
mkdir -p /usr/local/var/backup
Usage
You can run manually with:
automysqlbackup
The databases should be saved to
cd /usr/local/var/backup/db
Optional: The "tree" command can be useful exploring that directory at the command line. You might need to install it via brew as well.
Generally, you can load those backups by first unzipping:
gunzip mydb_2018_04-04_10h00m.Friday.sql.gz
and then you can load it:
mysql < mydb_2018_04-04_10h00m.Friday.sql
or, with a password:
mysql -u myusername --password=THE_PASSWORD_GOES_HERE < mydb_2018_04-04_10h00m.Friday.sql
If the database already exists, you'll need to remove it.
Scheduling
Verify it is loaded in the mac scheduler with:
launchctl list | grep homebrew
Macs don't really use cron. They favor launchctl.
If it isn't there, you may need to copy:
cp /usr/local/Cellar/automysqlbackup/3.0-rc6/homebrew.mxcl.automysqlbackup.plist ~/Library/LaunchAgents
and then
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.automysqlbackup.plist
- Read more about Automysqlbackup on Mac
- Log in to post comments
Working with Configuration Properties in Spring Boot
daniel Mon, 02/26/2018 - 9:11am
Logback Mapped Diagnostic Context
daniel Mon, 02/26/2018 - 9:10am
Logback has an interesting feature for following a flow through a system: Mapped Diagnostic Contexts
- Read more about Logback Mapped Diagnostic Context
- Log in to post comments
Rubber Duck Debugging and chatbots
daniel Mon, 02/26/2018 - 9:04am
It is based on the elizabot by Joseph Weizenbaum. User mohlendo has a wrapper for hubot on Github
- Read more about Rubber Duck Debugging and chatbots
- Log in to post comments
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
