Skip to content

Instantly share code, notes, and snippets.

@edimetia3d
Last active June 20, 2025 14:38
Show Gist options
  • Save edimetia3d/4d93de1824b51cd72639ddc5abd6d088 to your computer and use it in GitHub Desktop.
Save edimetia3d/4d93de1824b51cd72639ddc5abd6d088 to your computer and use it in GitHub Desktop.
dev_env
{
"proxies": {
"http-proxy": "socks5://192.168.50.217:10808",
"https-proxy": "socks5://192.168.50.217:10808",
"no-proxy": "127.0.0.0/8"
}
}
if type rg &> /dev/null; then
export FZF_DEFAULT_COMMAND='rg --files'
export FZF_DEFAULT_OPTS='-m'
fi
function grepcode(){
grep $1 ./ -r -n -I
}
function findfile(){
find ./ -name "*$1*"
}
function lsmake(){
make -qp | awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ {split($1,A,/ /);for(i in A)print A[i]}'
}
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd $SCRIPT_DIR
rm -rf dev_resource
mkdir dev_resource
cd dev_resource
curl https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.appimage -o nvim.appimage -L
chmod u+x nvim.appimage
git clone --depth 1 https://github.com/junegunn/fzf.git fzf
./fzf/install --bin
git clone --depth 1 [email protected]:edimetia3d/nvim_cfg.git nvim_cfg
curl https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -o plug.vim -L
curl https://gist.githubusercontent.com/edimetia3d/4d93de1824b51cd72639ddc5abd6d088/raw/bashrc -o bashrc -L
curl https://gist.githubusercontent.com/edimetia3d/4d93de1824b51cd72639ddc5abd6d088/raw/install_dev_res.sh -o install_dev_res.sh -L
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd $SCRIPT_DIR
install_cuda_container_toolkit() {
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.17.8-1
sudo apt-get install -y \
nvidia-container-toolkit=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
nvidia-container-toolkit-base=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
libnvidia-container-tools=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
libnvidia-container1=${NVIDIA_CONTAINER_TOOLKIT_VERSION}
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
}
#install_cuda_container_toolkit
# install packages
sudo apt-get update &&
sudo apt-get install ripgrep python3-dev python3 python3-venv python3-pip \
lsb-release wget software-properties-common bash-completion \
cmake gcc clang clang-format gdb git iproute2 tree tmux build-essential firefox gedit \
libfuse2 language-pack-zh-hans ttf-wqy-microhei ccache ninja-build lld -y
# config vim to neovim
CUSTOM_NVIM_PATH=`realpath nvim.appimage`
set -u
sudo update-alternatives --install /usr/bin/vi vi "${CUSTOM_NVIM_PATH}" 110
sudo update-alternatives --install /usr/bin/vim vim "${CUSTOM_NVIM_PATH}" 110
# install fzf
rm -rf ~/.fzf
ln -s $PWD/fzf ~/.fzf
~/.fzf/install
echo "source $PWD/bashrc" >> $HOME/.bashrc
# setup vim configs
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload
cp plug.vim "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/
pushd nvim_cfg
mkdir -p $HOME/.config/nvim
rm -rf $HOME/.config/nvim/init.vim
ln -s $PWD/vimrc $HOME/.config/nvim/init.vim
rm -rf $HOME/.vimrc
ln -s $PWD/vimrc $HOME/.vimrc
rm -rf $HOME/.ideavimrc
ln -s $PWD/ideavimrc $HOME/.ideavimrc
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment