BowerStudios.com

  • My Lab
  • Family
  • Friends
  • Professional
  • About

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

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'")

  • Ruby
  • Read more about Make Mysql throw an exception for Rails app to handle
  • Log in to post comments

Test Credit Card Links

daniel —Fri, 10/27/2017 - 9:54am

Paypal

Bluesnap

  • Programming
  • Read more about Test Credit Card Links
  • 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 —Wed, 08/31/2011 - 12:47am

Computers must be male. As soon as you commit to one you realize that if you had waited a little longer, you could have obtained a better model. In order to get their attention, you have to turn them on. Big power surges knock them out for the rest of the day.

—

Author Unknown

  • Log in to post comments
  • daniel's quotes

Popular content

Last viewed:

  • Thomas A. Edison
  • Professional
  • Bash Prompt customizations
  • UUID-OSSP functions install changed in postgresql 9.1
  • PostgreSQL - yesterday, today, tomorrow, now example - TIMESTAMP, DATE, TIME examples

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