Skip to content

Instantly share code, notes, and snippets.

View schnell18's full-sized avatar

Justin Zhang schnell18

View GitHub Profile

Problem statement

The command "mvn dependency:resolve" and "mvn dependency:resolve-plugins" fails on internal dependency on a multi-module project. It defeats the attempt to create a dependency layer and increase docker build speed when only application code is changed.

COPY pom.xml .

COPY powerjob-server-remote/pom.xml powerjob-server-remote/pom.xml

@schnell18
schnell18 / errorcode-prop-conv.md
Created May 23, 2021 03:15
Vim macro to convert ErrorCode to .properties file

The vim macro:

ea.��ýaldf(f,r=ldf";D0guw

converts ErrorCode:

SYSTEM_ERROR                              (1, "系统错误"),
DB_ERROR                                  (2, "数据库错误"),
PARAM_ERROR                               (10, "参数错误"),

OPTIMISTIC_LOCK_ERROR (100, "并发乐观锁错误"),

@schnell18
schnell18 / tmux-template
Last active October 15, 2024 23:37
tmux template
#!/bin/sh
# Check to see if we're already running the session
tmux has-session -t main &> /dev/null
if [ $? != 0 ] ; then
# Create overall tmux session
tmux new-session -d -s main -n java > /dev/null
tmux split-window -v
@schnell18
schnell18 / fix-grub-win-missing.md
Created March 12, 2021 14:42
fix grub Windows entry missing problem

Grub got some needed security updates 62. Note that os-prober is now disabled by default for security reasons: broken patch 36; fixed patch 57. More infos about it here 167. To restore the old behavior, open a terminal and issue

sudo echo GRUB_DISABLE_OS_PROBER=false >> /etc/default/grub && sudo update-grub 
@schnell18
schnell18 / virtualization-check.sh
Last active February 11, 2021 05:35
Verify the virtualization support on various OSes
# Verify the virtualization support on your Linux OS
# (a non-empty output indicates supported virtualization):
grep -E --color 'vmx|svm' /proc/cpuinfo
# Verify the virtualization support on your macOS
# (VMX in the output indicates enabled virtualization)
sysctl -a | grep -E --color 'machdep.cpu.features|VMX'
@schnell18
schnell18 / max-temp-reducer.rb
Created June 5, 2020 13:02
Max temperature reducer in Ruby
#!/usr/bin/env ruby
last_key, max_val = nil, -1000000
STDIN.each_line do |line|
key, val = line.split("\t")
if last_key && last_key != key
puts "#{last_key}\t#{max_val}"
last_key, max_val = key, val.to_i
else
last_key, max_val = key, [max_val, val.to_i].max
@schnell18
schnell18 / ipython-setup.md
Created April 19, 2020 10:22
Load line_profiler and memory_profiler

Introduction

install line_profiler module

conda install line_profiler

load line_profiler into ipython on startup

cat<<EOF > ~/.ipython/profile_default/startup/001-load-line-profiler.ipy

%load_ext line_profiler

@schnell18
schnell18 / settings-manjaro.json
Created April 4, 2020 13:11
VS Code LaTeX Workshop manjaro settings /w okular
{
"latex-workshop.latex.autoBuild.run": "onFileChange",
"latex-workshop.message.error.show": true,
"latex-workshop.message.warning.show": true,
"latex-workshop.latex.tools": [{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-shell-escape",
@schnell18
schnell18 / settings.json
Last active March 22, 2020 15:06
VS Code settings.json w/ LaTeX workshop synctex setting
{
"go.formatTool": "goimports",
"go.docsTool": "guru",
"editor.largeFileOptimizations": false,
"latex-workshop.latex.autoBuild.run": "never",
"latex-workshop.message.error.show": false,
"latex-workshop.message.warning.show": false,
"latex-workshop.latex.tools": [{
"name": "xelatex",
"command": "xelatex",
@schnell18
schnell18 / fix_wifi.sh
Created March 10, 2020 14:43
Manjaro fix wifi connection disappear
sudo systemctl stop NetworkManager
sudo mv /var/lib/NetworkManager/NetworkManager.state /var/lib/NetworkManager/NetworkManager.state.bak
sudo systemctl stop NetworkManager