Skip to content

Instantly share code, notes, and snippets.

@dzcpy
Last active November 21, 2023 00:47
Show Gist options
  • Save dzcpy/3dd534719e21ffb75111b08bb3d721ea to your computer and use it in GitHub Desktop.
Save dzcpy/3dd534719e21ffb75111b08bb3d721ea to your computer and use it in GitHub Desktop.
Debian setup
#!/bin/sh
apt update
apt dist-upgrade -y
apt purge vim-tiny -y
apt install curl build-essential cmake pkg-config git zsh fonts-powerline apt-transport-https dirmngr sudo htop vim xz-utils net-tools socat -y
apt autoclean -y
userdel games
userdel lp
userdel news
userdel irc
groupdel floppy
groupdel cdrom
groupdel dialout
# caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
apt update
apt install caddy -y
# node.js
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_21.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
apt update
apt install nodejs -y
# bbr
bash -c "$(curl -fsSL https://github.com/teddysun/across/raw/master/bbr.sh)"
rm install_bbr.log
# spacevim
bash -c "$(curl -fsSL https://raw.githubusercontent.com/liuchengxu/space-vim/master/install.sh)"
# oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/plugins/zsh-syntax-highlighting
#sh -c "$(curl -fsSL https://raw.staticdn.net/robbyrussell/oh-my-zsh/master/tools/install.sh)"
sed -i '/^ export /s/^ //g' ~/.zshrc
sed -i '/ZSH_THEME="robbyrussell"/s/robbyrussell/agnoster/g' ~/.zshrc
sed -i '/plugins=(git)/s/git/git docker docker-compose node npm yarn pm2 zsh-autosuggestions zsh-syntax-highlighting/g' ~/.zshrc
echo "" >> ~/.zshrc
echo "# Fixing ghost character problem https://github.com/ohmyzsh/ohmyzsh/issues/6985#issuecomment-411381589" >> ~/.zshrc
echo "export LC_ALL=en_US.UTF-8" >> ~/.zshrc
echo "" >> ~/.zshrc
echo "# Fixing home end buttons https://medium.com/code-kings/zsh-oh-my-zsh-how-to-configure-home-and-end-keys-to-work-properly-while-connecting-putty-ssh-to-ba94a0835672" >> ~/.zshrc
echo "bindkey \"\033[1~\" beginning-of-line" >> ~/.zshrc
echo "bindkey \"\033[4~\" end-of-line" >> ~/.zshrc
# postgresql
apt install postgresql postgresql-contrib postgis
# rclone
curl https://rclone.org/install.sh | sudo bash
rclone config
# mongodb
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
apt update
apt install mongodb-org -y
# docker
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
echo "deb https://download.docker.com/linux/debian buster stable" | tee /etc/apt/sources.list.d/docker.list
apt update
apt -y install docker-ce
# speedtest
bash <(curl -Lso- https://git.io/superspeed)
# youtube-dl
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
youtube-dl -f best -ciw -o "%(title)s-r%(resolution)s-v%(view_count)s-l%(like_count)s-%(id)s.%(ext)s" --write-thumbnail -v <url-of-channel>
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 -ciw -o "%(title)s-r%(resolution)s-v%(view_count)s-l%(like_count)s-%(id)s.%(ext)s" --write-thumbnail -v <url-of-channel>
# build hasura, requires at least 32G ram
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
apt install postgresql postgresql-contrib postgis libpq-dev libssl-dev libgmp3-dev libmariadb-dev libtinfo-dev libpcre3 libpcre3-dev unixodbc-dev python2 python3
cd /srv/
git clone https://github.com/hasura/graphql-engine
cd graphql-engine
echo 2.11.1 > "$(git rev-parse --show-toplevel)/server/CURRENT_VERSION"
ln -s cabal/dev.project cabal.project.local
cabal new-update
cabal new-build graphql-engine
strip --strip-unneeded graphql-engine
#!/bin/sh
apt update
apt upgrade -y
apt install -y mariadb-server php-fpm php-mysql php-mbstring php-curl php-gd php-imagick php-dom php-zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment