Skip to content

Instantly share code, notes, and snippets.

View schnell18's full-sized avatar

Justin Zhang schnell18

View GitHub Profile
@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
@schnell18
schnell18 / remove_vb_disk_file.sh
Last active February 24, 2020 04:53
remove virtualbox disk file
GUEST="slave-1"
vboxmanage list hdds \
| sed -e '/./{H;$!d;}' -e 'x;/'"$GUEST"'/!d;' \
| grep UUID | egrep -v Parent | awk '{print $2}' \
| xargs -I{} vboxmanage closemedium disk {} --delete
# vboxmanage list hdds \
# | sed -e '/./{H;$!d;}' -e 'x;/'"$GUEST"'/!d;' \
# | grep UUID | egrep -v Parent | awk '{print $2}' \
# | xargs -I{} echo vboxmanage closemedium disk {} --delete
@schnell18
schnell18 / flyway-mysql-5.6-error.txt
Created January 5, 2020 11:19
flyway mysql 5.6 error
> Task :flyway:flywayMigrate FAILED
:flyway:flywayMigrate (Thread[Execution worker for ':',5,main]) completed. Took 9.075 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':flyway:flywayMigrate'.
> Error occurred while executing flywayMigrate
Flyway Enterprise Edition or MySQL upgrade required: MySQL 5.6 is no longer supported by Flyway Community Edition, but still supported by Flyway Enterprise Edition.
@schnell18
schnell18 / disable-appamor.sh
Last active January 5, 2020 10:59
Script to fix failure to stop docker container on Ubuntu 18.04 w/ appamor enabled.
# sudo docker-compose down
# Stopping flyway_db_1 ... error
#
# ERROR: for flyway_db_1 cannot stop container: b507d5ca35c67a38164df406656c32484390353b51f43357d565b25aa7cfbfd1: Cannot kill container b507d5ca35c67a38164df406656c32484390353b51f43357d565b25aa7cfbfd1: unknown error after kill: runc did not terminate sucessfully: container_linux.go:388: signaling init process caused "permission denied"
# : unknown
# Removing network flyway_default
# ERROR: error while removing network: network flyway_default id 8bdd09b60e327fce1aad7bf887ec9a14a2aade50b03b1acee6f3befc1fc08b56 has active endpoints
#
# uname -a
# Linux omen4-hp 5.0.0-37-generic #40~18.04.1-Ubuntu SMP Thu Nov 14 12:06:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
@schnell18
schnell18 / add-to-developer-group.sh
Created October 20, 2019 14:27
Add user to developer groups
sudo dscl . append /Groups/_developer GroupMembership justin
# install tools
sudo apt-get install pkg-config cmake
# install dependencies
sudo apt-get install \
libssh2-1-dev \
libssl-dev \
zlib1g-dev \
libncurses5-dev \
libncursesw5-dev \
@schnell18
schnell18 / go_get_proxy.sh
Created April 21, 2019 01:29
setup go get proxy
# go get use git clone behind the screen
# and git does not seem to honor
# environment vairable 'http_proxy' or 'https_proxy'
# So you have to setup both environment variable
# and git global config 'http.proxy' or 'https.proxy'
git config --global http.proxy http://127.0.0.1:1081
git config --global https.proxy http://127.0.0.1:1081
export http_proxy=http://127.0.0.1:1081
export https_proxy=http://127.0.0.1:1081
@schnell18
schnell18 / show_cache_path.gradle
Last active December 1, 2018 08:40
Script show cache path
apply plugin: 'java'
repositories{
mavenCentral()
}
dependencies{
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
}