Skip to content

Instantly share code, notes, and snippets.

View caliburn1994's full-sized avatar

Chen Xiaojie caliburn1994

  • Japan
View GitHub Profile
@caliburn1994
caliburn1994 / google-map-with-japanese.js
Last active July 9, 2023 06:44
Visit Google Map with Japanese
// ==UserScript==
// @name Visit Google Map with Japanese
// @namespace https://gist.github.com/caliburn1994/ef993f676111627b9023f02d191c5d13
// @version 0.2
// @description Visit Google Map with Japanese
// @author caliburn1994
// @match https://*.google.com/maps*
// @exclude https://*.google.com/maps*hl=ja*
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
// @updateURL https://gist.githubusercontent.com/caliburn1994/ef993f676111627b9023f02d191c5d13/raw/google-map-with-japanese.js
@caliburn1994
caliburn1994 / terminal-1.sh
Last active October 28, 2020 16:14
Docker SSH Server + public key authentication . login as a normal user
user=www
mkdir data keys public
# copy public key to current dir, for safe.
cp ${HOME}/.ssh/id_rsa.pub public/
docker run -ti -p 2222:22 \
-v $(pwd)/public/id_rsa.pub:/etc/authorized_keys/$(user) \
-v $(pwd)/keys/:/etc/ssh/keys \
@caliburn1994
caliburn1994 / terminal-1.sh
Last active October 28, 2020 14:27
Docker SSH Server + public key authentication . login as root
mkdir data keys public
# copy public key to current dir, for safe.
cp ${HOME}/.ssh/id_rsa.pub public/
docker run -ti -p 2222:22 \
-v $(pwd)/public/id_rsa.pub:/root/.ssh/authorized_keys \
-v $(pwd)/keys/:/etc/ssh/keys \
-v $(pwd)/data/:/data/ \
-e SSH_ENABLE_ROOT=true \
@caliburn1994
caliburn1994 / terminal-1.sh
Created October 26, 2020 16:10
Docker SSH Server - Password Auth
mkdir entrypoint.d keys
# for set password
user=user1
password=pass123456
salt="KdN5Re3X2X18"
hash_password=$(echo ${password} | mkpasswd --stdin --method=sha-512 --salt ${salt})
cat << EOF > entrypoint.d/setpasswd.sh
#!/usr/bin/env bash
@caliburn1994
caliburn1994 / Vagrantfile
Last active November 16, 2020 15:54
install Docker in Vagrant Centos 7 2020-10-07
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
# config.vm.network "public_network", ip: "192.168.0.180",bridge:"ens33"
config.vm.provision :shell, path: "bootstrap.sh"
config.vm.provision "shell",run: "always", inline: <<-SHELL
ntpdate asia.pool.ntp.org
SHELL
@caliburn1994
caliburn1994 / tampermonkey
Created August 25, 2020 16:05
修改Google搜索引擎的链接颜色
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *www.google.com/*
// @grant none
// ==/UserScript==
@caliburn1994
caliburn1994 / vagrant_auto_completion.sh
Created March 13, 2020 15:09
vagrant autocompletion by curl
sudo curl --location https://raw.githubusercontent.com/hashicorp/vagrant/master/contrib/bash/completion.sh -o /etc/bash_completion.d/vagrant.sh
source /etc/bash_completion.d/vagrant.sh
@caliburn1994
caliburn1994 / pyenv.sh
Last active March 7, 2020 11:32
Ubuntu install a specific python version. Ubuntu下安装特定版本的python
# 依赖工具
# 参考:https://github.com/pyenv/pyenv/wiki/common-build-problems
echo "下载依赖工具"
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
# ↑和平台有关
# ↓与平台无关
echo "安装pyenv"
@caliburn1994
caliburn1994 / README.md
Last active October 7, 2020 04:31
Install Centos 7 using vagrant and install Docker in Centos 7. 通过Vagrant安装Centos7,然后再Centos7安装Docker
文件结构
.
|--bootstrap.sh
|--Vagrantfile

该代码用于安装一个centos虚拟机,并安装Docker