BowerStudios.com

  • My Lab
  • Family
  • Friends
  • Professional
  • About

Graceful shutdown of Tomcat and threads

daniel —Fri, 10/12/2018 - 10:19am

  • Tomcat's Graceful Shutdown with Daemons and Shutdown Hooks
  • Graceful shutdown of threads and executor
  • How to stop a running TimerTask
  • Java
  • Read more about Graceful shutdown of Tomcat and threads
  • Log in to post comments

Code Stats with Team City and Intellij Links

daniel —Fri, 10/12/2018 - 10:17am

  • Running Inspections in Intellij
  • Team City Stats
  • Java
  • Read more about Code Stats with Team City and Intellij Links
  • Log in to post comments

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:

  • github for the plugin
  • Docs
  • Build Management and Source Control
  • Read more about TeamCity and Github webhooks
  • Log in to post comments

Chatbots

daniel —Fri, 10/12/2018 - 10:05am

  • Java Chatbot based on ALICE
  • Java
  • 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;

  • SQL
  • Read more about Get table create statement from command line (mysql)
  • Log in to post comments

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

  • SQL
  • 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

  • SQL
  • 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

From Baeldung.com

  • Java
  • Read more about Working with Configuration Properties in Spring Boot
  • Log in to post comments

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

  • Programming
  • Read more about Logback Mapped Diagnostic Context
  • Log in to post comments

Rubber Duck Debugging and chatbots

daniel —Mon, 02/26/2018 - 9:04am

Rubber Duck Debugging Bot

It is based on the elizabot by Joseph Weizenbaum. User mohlendo has a wrapper for hubot on Github

  • Programming
  • Read more about Rubber Duck Debugging and chatbots
  • Log in to post comments

Pages

  • « first
  • ‹ previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • …
  • next ›
  • last »
Subscribe to BowerStudios.com RSS

Navigation

  • Search
  • Recent content
  • Contact Me
  • Mail
  • Pass Hasher
  • Bower Studios Admin

Quotes

daniel —Mon, 02/26/2007 - 12:29pm

There's a way to do it better - find it.

—

Thomas A. Edison

  • Log in to post comments
  • daniel's quotes

Popular content

Last viewed:

  • Limit HttpClient with Timeouts
  • When to use different types of Grails/Gorm Querying options
  • Down the Drain
  • Thomas A. Edison
  • The Parable of Two Programmers

Copyright 2022 Daniel Bower
  • My Lab
  • Family
  • Friends
  • Professional
  • About