kubectl run mysql-client --image=mysql:5.7 -it --rm --restart=Never -- /bin/bash
mysql -h mysql-service -uroot -proot_password -e 'SHOW databases;'
OR
mysql -h mysql-service -uroot -proot_password
This guide is targetted at intermediate or expert users who want low-level control over their Python environments.
When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. This helps keep each workflow in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. The guide here covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda). See the Using the workflow section to view the end result.
| -- before: data_json = {object: {id: 123, result: null}} | |
| -- after: data_json = {object: {id: 123}} | |
| UPDATE events | |
| SET data_json = data_json::jsonb #- '{object,result}' | |
| WHERE json_typeof(data_json->'object'->'result') = 'null'; |
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :
| global | |
| log /dev/log local0 | |
| log /dev/log local1 notice | |
| chroot /var/lib/haproxy | |
| stats socket /run/haproxy/admin.sock mode 660 level admin | |
| stats timeout 30s | |
| user haproxy | |
| group haproxy | |
| daemon | |
| maxconn 2048 |
| # Create a container from the mongo image, | |
| # run is as a daemon (-d), expose the port 27017 (-p), | |
| # set it to auto start (--restart) | |
| # and with mongo authentication (--auth) | |
| # Image used is https://hub.docker.com/_/mongo/ | |
| docker pull mongo | |
| docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth | |
| # Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception) | |
| # add a root user |
| #!/usr/bin/env bash | |
| # http://papers.ch/speeding-up-your-mac-osx-terminal-input/ | |
| #echo "Disable press-and-hold for keys in favor of key repeat" | |
| #defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false | |
| echo "Set a blazingly fast keyboard repeat rate" | |
| defaults write NSGlobalDomain KeyRepeat -int 0.02 |
| ,_---~~~~~----._ | |
| _,,_,*^____ _____``*g*\"*, | |
| / __/ /' ^. / \ ^@q f | |
| [ @f | @)) | | @)) l 0 _/ | |
| \`/ \~____ / __ \_____/ \ | |
| | _l__l_ I | |
| } [______] I | |
| ] | | | | | |
| ] ~ ~ | | |
| | | |