Last active
May 30, 2025 08:49
-
-
Save twinkfrag/817b0cea6bbd4063002b52765799a7b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat << EOF >> .bashrc | |
# ---------------------------- | |
if [ -f ~/.bash.bashrc ]; then | |
. ~/.bash.bashrc | |
fi | |
# ---------------------------- | |
EOF | |
# なんでubuntuの標準エディタはnanoなの | |
sudo update-alternatives --config editor | |
# - wslが起動できる環境はWindowsの認証後だからwslユーザーのsudoはパス無しでよくない? | |
# - 複数terminalで別々にsudoタイムアウトされるのはさすがに面倒 | |
sudo visudo --file=/etc/sudoers.d/00_default | |
cat <<EOF >/dev/null | |
wsl ALL=NOPASSWD: ALL | |
Defaults timestamp_type=global | |
EOF | |
# wsl側でパーミッションを設定できるようにする | |
sudo tee /etc/wsl.conf <<EOF >/dev/null | |
[automount] | |
options = "metadata" | |
[interop] | |
appendWindowsPath = false | |
[boot] | |
systemd = true | |
EOF | |
# hostname/terminalのタイトルを変更する場合は以下を追記 | |
# /etc/wsl.conf | |
cat <<EOF >/dev/null | |
[network] | |
hostname = WSL-Ubuntu-18 | |
generateHosts = false | |
EOF | |
# /etc/hosts | |
cat <<EOF >/dev/null | |
127.0.2.1 WSL-Ubuntu-18. WSL-Ubuntu-18 | |
EOF | |
# mklink | |
ln -s /mnt/c/Users/owner/.ssh ~/.ssh | |
chmod 700 ~/.ssh | |
chmod 600 ~/.ssh/* | |
ln -s /mnt/c/Users/owner/.bash.bashrc ~/.bash.bashrc | |
rm ~/.bash_history | |
ln -s /mnt/c/Users/owner/.bash_history ~/.bash_history | |
ln -s /mnt/c/Users/owner/.vimrc ~/.vimrc | |
ln -s /mnt/c/Users/owner/.vim-tiny.vimrc ~/.vim-tiny.vimrc | |
# install | |
curl https://get.docker.com | sh | |
sudo gpasswd -a wsl docker | |
sudo apt install -y build-essential libssl-dev libreadline-dev zlib1g-dev libffi-dev zip unzip | |
# https://github.com/anyenv/anyenv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment