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 / 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 / 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 / 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-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-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-pull.sh
Created May 16, 2018 14:22
Blog: Start a Remote MySQL Server with Docker quickly
docker pull mysql/mysql-server:latest
@backslash112
backslash112 / pom.xml
Created May 15, 2018 02:34
Blog: Create Maven Project with Servlet in IntelliJ IDEA 2018
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
@backslash112
backslash112 / DemoServlet.java
Last active May 15, 2018 02:30
Blog: Create Maven Project with Servlet in IntelliJ IDEA 2018
@WebServlet("/DemoServlet")
public class DemoServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<h3>Hello World!</h3>");
}
}
@backslash112
backslash112 / install-spark-with-docker.md
Last active April 18, 2018 18:42
QuickStart: Try Spark with Docker