Skip to content

Instantly share code, notes, and snippets.

View backslash112's full-sized avatar
🎯
Focusing

Cun Yang backslash112

🎯
Focusing
View GitHub Profile
@backslash112
backslash112 / docker-run.sh
Created May 16, 2018 14:23
Blog: Start a Remote MySQL Server with Docker quickly
docker run - name=mysql1 -d mysql/mysql-server
# print the logs of mysql1
docker logs mysql1
@backslash112
backslash112 / docker-run-with-env.sh
Created May 16, 2018 14:24
Blog: Start a Remote MySQL Server with Docker quickly
# stop and remove the container and run again:
docker stop mysql4 && docker rm mysql4
docker run - name=mysql1 -e MYSQL_ROOT_HOST=% -p 3306:3306 -d mysql/mysql-server
@backslash112
backslash112 / docker-exec.sh
Created May 16, 2018 14:25
Blog: Start a Remote MySQL Server with Docker quickly
# login into mysql
docker logs mysql1 2>&1 | grep GENERATED # check the automatically generated password of root user, copy it
docker exec -it mysql1 mysql -u root -p # parse and press the Enter key
@backslash112
backslash112 / docker-ps.sh
Created May 16, 2018 14:25
Blog: Start a Remote MySQL Server with Docker quickly
docker ps
# to check all the containers, include not-running containers
docker ps -a
@backslash112
backslash112 / alter-user.sql
Created May 16, 2018 14:26
Blog: Start a Remote MySQL Server with Docker quickly
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '<password>';
@backslash112
backslash112 / connect.console
Created May 16, 2018 14:28
java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
@backslash112
backslash112 / alter-user-2.sql
Created May 16, 2018 14:33
Blog: Start a Remote MySQL Server with Docker quickly
ALTER USER 'root'@'localhost' IDENTIFIED BY '<password>';
@backslash112
backslash112 / docker-images.sh
Created May 16, 2018 14:34
Blog: Start a Remote MySQL Server with Docker quickly
docker images
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@backslash112
backslash112 / print-leetcode-question.js
Created July 10, 2018 21:24
Pring Leetcode question
document.getElementsByTagName('body')[0].innerHTML = document.querySelectorAll('.question-description__3U1T')[0].innerHTML;
var css = 'body {line-height:1.2} p { font-size: 11px; margin:0px; padding:0px } pre {font-size:8px; margin:0px; padding:2px 4px} code {font-size:8px}',
head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet){
// This is required for IE8 and below.
style.styleSheet.cssText = css;