Skip to content

Instantly share code, notes, and snippets.

@seanyinx
seanyinx / docker-cleanup-resources.md
Created August 26, 2017 14:28 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

docker-compose

recreate and restart a running container

docker-compose.exe up -d --build <container>

restart a running container as part of docker-compose

docker-compose restart <container>

Shadowsocks

installing shadowsocks

yum install python-pip 
pip install shadowsocks

add /etc/shadowsocks.json

{

"enable" : true,

path-based routing

events {
  worker_connections  1024;  ## Default: 1024
}

http {
  server {
    listen 80;
    location /baidu {

proxy_pass https://www.baidu.com/; ## trailing / is important to pass request instead of redirecting it

mybatis configuration

spring boot application.yaml

mybatis:
  config-location :  classpath:mapper/mybatis-config.xml
  mapper-locations : classpath*:mapper/*Mapper.xml,classpath*:mapper/base/*Mapper.xml

mybatis-config.xml

 

data source initialization

    spring.datasource.schema=classpath*:schema-${platform}.sql
    spring.datasource.initialize=true
    spring.datasource.initialization-mode=always

jar & war deployment

maven release without push

mvn release:prepare -DautoVersionSubmodules=true -DreleaseVersion=2.0.14 -DdevelopmentVersion=2.0.15-SNAPSHOT -DpushChanges=false -Darguments="-DskipTests"

skip javadoc when release

mvn release:perform -Darguments="-Dmaven.javadoc.skip=true -DskipTests"

skip tests

mvn package -DskipTests
@seanyinx
seanyinx / git.md
Last active January 14, 2023 09:37

change author

#!/bin/sh

git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@seanyinx
seanyinx / tax.java
Created July 9, 2020 06:50
个税计算器
package com.github.seanyinx.tax;
import java.util.ArrayList;
import java.util.List;
public class TaxCalculator {
// 起征额
private static final int NO_TAX_SALARY = 5000;