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 / install-tomcat-8.5.14.sh
Created March 18, 2018 04:12 — forked from Clivern/install-tomcat-8.5.14.sh
How to Install Apache Tomcat 8 on Ubuntu 16.04
#!/bin/bash
# For More Info http://clivern.com/how-to-install-apache-tomcat-8-on-ubuntu-16-04
sudo apt-get update
sudo apt-get install default-jdk
sudo apt-get install unzip
cd /opt
curl -O http://apache.mirrors.ionfish.org/tomcat/tomcat-8/v8.5.15/bin/apache-tomcat-8.5.15.zip
sudo unzip apache-tomcat-8.5.15.zip
sudo mv apache-tomcat-8.5.15 tomcat
@backslash112
backslash112 / install-tomcat-8.5.14.sh
Created March 18, 2018 04:12 — forked from Clivern/install-tomcat-8.5.14.sh
How to Install Apache Tomcat 8 on Ubuntu 16.04
#!/bin/bash
# For More Info http://clivern.com/how-to-install-apache-tomcat-8-on-ubuntu-16-04
sudo apt-get update
sudo apt-get install default-jdk
sudo apt-get install unzip
cd /opt
curl -O http://apache.mirrors.ionfish.org/tomcat/tomcat-8/v8.5.15/bin/apache-tomcat-8.5.15.zip
sudo unzip apache-tomcat-8.5.15.zip
sudo mv apache-tomcat-8.5.15 tomcat

Script to install zsh and oh-my-zsh for ubuntu 16.04

Install zsh

apt install zsh

Install oh-my-zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Plugins for ~/.zshrc

plugins=(

@backslash112
backslash112 / install-spark-with-docker.md
Last active April 18, 2018 18:42
QuickStart: Try Spark with Docker
@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 / 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 / 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 / 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-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