Skip to content

Instantly share code, notes, and snippets.

View yingzhuo's full-sized avatar

應卓 yingzhuo

  • Shanghai, China
View GitHub Profile
@yingzhuo
yingzhuo / qpifd
Created September 26, 2019 03:08
基于SpringBoot的Web程序监听多个端口 #spring boot
package com.github.yingzhuo.carnival.mvc.autoconfig;
import lombok.Getter;
import lombok.Setter;
import lombok.val;
import org.apache.catalina.connector.Connector;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.context.properties.ConfigurationProperties;
@yingzhuo
yingzhuo / lhotr
Created September 26, 2019 03:11
清除apt cache #docker #dockerfile
RUN apt-get update && apt-get install -y \
aufs-tools \
automake \
build-essential \
curl \
all\
your\
other\
packages && \
rm -rf /var/lib/apt/lists/*
@yingzhuo
yingzhuo / ecsyz
Created September 26, 2019 03:18
用xml文件编写properties #java
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>comment</comment>
<entry key="key">value</entry>
</properties>
@yingzhuo
yingzhuo / Makefile
Last active October 31, 2019 00:59
golang语言项目用的makefile示例 #golang #makefile
TIMESTAMP := $(shell /bin/date "+%F %T")
NAME := snowflake
VERSION := 1.0.1
LDFLAGS := -s -w \
-X 'main.BuildVersion=$(VERSION)' \
-X 'main.BuildGitBranch=$(shell git describe --all)' \
-X 'main.BuildGitRev=$(shell git rev-list --count HEAD)' \
-X 'main.BuildGitCommit=$(shell git rev-parse HEAD)' \
-X 'main.BuildDate=$(shell /bin/date "+%F %T")'
@yingzhuo
yingzhuo / ivubk
Created September 26, 2019 09:21
run spring boot jar as system service #spring #systemctl
[Unit]
Description=My Service
After=syslog.target
[Service]
ExecStart=/opt/java-8-home/bin/java -Xms256m -Xmx4G -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -jar /opt/playground/playground.jar --spring.profiles.active=dev --server.port=3323
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
@yingzhuo
yingzhuo / example.go
Created October 31, 2019 00:57
load stdin #golang
func loadStdin() string {
info, err := os.Stdin.Stat()
if err != nil {
return ""
}
if info.Mode()&os.ModeCharDevice != 0 || info.Size() <= 0 {
return ""
}
@yingzhuo
yingzhuo / README-Template.md
Created November 28, 2019 07:41 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites