Last active
December 25, 2021 16:05
-
-
Save 5lx/3c25315cf02f7a8919d3129d57a45dc9 to your computer and use it in GitHub Desktop.
Revisions
-
5lx revised this gist
Dec 25, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -50,6 +50,7 @@ set -g history-limit 100000 set -g mouse on set -g default-terminal "screen-256color" # fix less/man mouse scrolling when enabled the mouse mode in tmux tmux_commands_with_legacy_scroll="nano less more man git" bind-key -T root WheelUpPane \ -
5lx revised this gist
Dec 25, 2021 . 1 changed file with 20 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -44,8 +44,26 @@ cd git clone https://github.com/gpakosz/.tmux.git ln -s -f .tmux/.tmux.conf cp .tmux/.tmux.conf.local . cat <<EOF >> .tmux.conf.local set -g history-limit 100000 set -g mouse on set -g default-terminal "screen-256color" tmux_commands_with_legacy_scroll="nano less more man git" bind-key -T root WheelUpPane \ if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \ 'send -Mt=' \ 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ "send -t= Up" "copy-mode -et="' bind-key -T root WheelDownPane \ if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \ 'send -Mt=' \ 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ "send -t= Down" "send -Mt="' EOF # vim echo "set ttymouse=xterm2" >> .vimrc -
5lx revised this gist
Jan 22, 2019 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -56,8 +56,11 @@ cd sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \ ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-autosuggestions.git \ ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions # sed -i "s/^\(ZSH_THEME\s*=\s*\).*\$/\1\"agnoster\"/" .zshrc sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ zsh-syntax-highlighting/" .zshrc sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ zsh-autosuggestions/" .zshrc sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ colored-man-pages/" .zshrc # need these two line to fix zsh-completion command duplicated # Ref: https://github.com/sindresorhus/pure/issues/300#issuecomment-328744993 -
5lx revised this gist
Jan 9, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # Resize. Suppose /dev/sda2 (LVM) pvresize /dev/sda2 lvextend /dev/mapper/fedora-root -l+100%FREE # For ext2/3/4 resize2fs /dev/mapper/fedora-root # For xfs xfs_growfs / -
5lx revised this gist
Jan 9, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Resize. Suppose /dev/sda2 (LVM) pvresize /dev/sda2 lvextend /dev/mapper/fedora-root -l+100%FREE # assuming ext2/3/4 -
5lx revised this gist
Sep 10, 2018 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -59,6 +59,10 @@ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \ # sed -i "s/^\(ZSH_THEME\s*=\s*\).*\$/\1\"agnoster\"/" .zshrc sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ zsh-syntax-highlighting/" .zshrc sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ colored-man-pages/" .zshrc # need these two line to fix zsh-completion command duplicated # Ref: https://github.com/sindresorhus/pure/issues/300#issuecomment-328744993 echo "export LANG=en_US.UTF-8" >> .zshrc echo "export LC_ALL=en_US.UTF-8" >> .zshrc # conda wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -
5lx revised this gist
Jul 3, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Resize. Suppose /dev/sda2 is the LVM pvresize /dev/sda2 lvextend /dev/mapper/fedora-root -l+100%FREE # assuming ext2/3/4 -
5lx revised this gist
Jul 3, 2018 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,11 @@ # Resize pvresize /dev/sda2 lvextend /dev/mapper/fedora-root -l+100%FREE # assuming ext2/3/4 resize2fs /dev/mapper/fedora-root # For xfs xfs_growfs / # Install Software sudo dnf -y update sudo dnf -y groupinstall "development tools" -
5lx revised this gist
Jun 11, 2018 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # Install Software sudo dnf -y update sudo dnf -y groupinstall "development tools" sudo dnf -y install vim wget curl htop tmux bzip2 unzip net-tools zsh util-linux-user # Add ssh keys mkdir ~/.ssh && chmod 700 ~/.ssh @@ -12,7 +12,7 @@ chmod 600 ~/.ssh/authorized_keys echo "PermitEmptyPasswords no" | sudo tee -a /etc/ssh/sshd_config > /dev/null echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config > /dev/null echo "PermitRootLogin no" | sudo tee -a /etc/ssh/sshd_config > /dev/null sudo dnf -y install fail2ban sudo cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local echo "[sshd]\nenabled = true" | sudo tee -a /etc/fail2ban/jail.local > /dev/null -
5lx revised this gist
Jun 11, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -20,6 +20,9 @@ sudo systemctl restart sshd sudo systemctl enable fail2ban sudo systemctl start fail2ban # Hostname sudo hostnamectl set-hostname blabla # docker sudo dnf -y install dnf-plugins-core sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo -
5lx revised this gist
Jun 4, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -54,4 +54,4 @@ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh echo "export PATH=\"/root/.miniconda3/bin:\$PATH\"" >> .zshrc sudo reboot now -
5lx revised this gist
Jun 4, 2018 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,13 +9,13 @@ curl https://github.com/5lx.keys >> ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys # ssh enforce echo "PermitEmptyPasswords no" | sudo tee -a /etc/ssh/sshd_config > /dev/null echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config > /dev/null echo "PermitRootLogin no" | sudo tee -a /etc/ssh/sshd_config > /dev/null sudo yum -y install fail2ban sudo cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local echo "[sshd]\nenabled = true" | sudo tee -a /etc/fail2ban/jail.local > /dev/null sudo systemctl restart sshd sudo systemctl enable fail2ban sudo systemctl start fail2ban -
5lx revised this gist
Jun 4, 2018 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,13 +9,13 @@ curl https://github.com/5lx.keys >> ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys # ssh enforce echo "PermitEmptyPasswords no" | sudo tee -a /etc/ssh/sshd_config echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config echo "PermitRootLogin no" | sudo tee -a /etc/ssh/sshd_config sudo yum -y install fail2ban sudo cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local echo "[sshd]\nenabled = true" | sudo tee -a /etc/fail2ban/jail.local sudo systemctl restart sshd sudo systemctl enable fail2ban sudo systemctl start fail2ban -
5lx revised this gist
Jun 4, 2018 . 1 changed file with 22 additions and 21 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,31 +1,32 @@ # Install Software sudo yum -y update sudo yum -y groupinstall "development tools" sudo yum -y install vim wget curl htop tmux bzip2 unzip net-tools zsh util-linux-user # Add ssh keys mkdir ~/.ssh && chmod 700 ~/.ssh curl https://github.com/5lx.keys >> ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys # ssh enforce sudo echo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config sudo echo "PasswordAuthentication no" >> /etc/ssh/sshd_config sudo echo "PermitRootLogin no" >> /etc/ssh/sshd_config sudo yum -y install fail2ban sudo cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local sudo echo "[sshd]\nenabled = true" >> /etc/fail2ban/jail.local sudo systemctl restart sshd sudo systemctl enable fail2ban sudo systemctl start fail2ban # docker sudo dnf -y install dnf-plugins-core sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo sudo dnf config-manager --set-enabled docker-ce-edge sudo dnf -y install docker-ce sudo systemctl enable docker sudo systemctl start docker # tmux cd -
5lx revised this gist
Jun 3, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # Install Software yum -y update yum -y groupinstall "development tools" yum -y install vim wget curl htop tmux bzip2 unzip net-tools zsh util-linux-user # Add ssh keys mkdir /root/.ssh && chmod 700 /root/.ssh -
5lx revised this gist
Jun 3, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -37,7 +37,7 @@ echo "set -g mouse on" >> .tmux.conf.local # vim echo "set ttymouse=xterm2" >> .vimrc echo "set mouse=a" >> .vimrc # zsh cd -
5lx revised this gist
Jun 2, 2018 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,8 +11,11 @@ chmod 600 /root/.ssh/authorized_keys # ssh enforce echo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config echo "PasswordAuthentication no" >> /etc/ssh/sshd_config yum -y install fail2ban cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local echo "[sshd]\nenabled = true" >> /etc/fail2ban/jail.local systemctl restart sshd systemctl enable fail2ban systemctl start fail2ban -
5lx revised this gist
Jun 2, 2018 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -19,6 +19,7 @@ systemctl start fail2ban # docker dnf -y install dnf-plugins-core dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo dnf config-manager --set-enabled docker-ce-edge dnf -y install docker-ce systemctl enable docker systemctl start docker @@ -44,4 +45,9 @@ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \ sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ zsh-syntax-highlighting/" .zshrc sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ colored-man-pages/" .zshrc # conda wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh echo "export PATH=\"/root/.miniconda3/bin:\$PATH\"" >> .zshrc reboot now -
5lx revised this gist
Jun 2, 2018 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,8 +8,13 @@ mkdir /root/.ssh && chmod 700 /root/.ssh curl https://github.com/5lx.keys >> /root/.ssh/authorized_keys chmod 600 /root/.ssh/authorized_keys # ssh enforce echo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config echo "PasswordAuthentication no" >> /etc/ssh/sshd_config systemctl restart sshd yum -y install fail2ban systemctl enable fail2ban systemctl start fail2ban # docker dnf -y install dnf-plugins-core @@ -39,4 +44,4 @@ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \ sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ zsh-syntax-highlighting/" .zshrc sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ colored-man-pages/" .zshrc reboot now -
5lx revised this gist
Jun 2, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,7 @@ curl https://github.com/5lx.keys >> /root/.ssh/authorized_keys chmod 600 /root/.ssh/authorized_keys echo "PasswordAuthentication no" >> /etc/ssh/sshd_config systemctl restart sshd # docker dnf -y install dnf-plugins-core @@ -38,4 +39,4 @@ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \ sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ zsh-syntax-highlighting/" .zshrc sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ colored-man-pages/" .zshrc source .zshrc -
5lx revised this gist
Jun 2, 2018 . 1 changed file with 26 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -13,4 +13,29 @@ echo "PasswordAuthentication no" >> /etc/ssh/sshd_config # docker dnf -y install dnf-plugins-core dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo dnf -y install docker-ce systemctl enable docker systemctl start docker # tmux cd git clone https://github.com/gpakosz/.tmux.git ln -s -f .tmux/.tmux.conf cp .tmux/.tmux.conf.local . echo "set -g history-limit 100000" >> .tmux.conf.local echo "set -g mouse on" >> .tmux.conf.local # vim echo "set ttymouse=xterm2" >> .vimrc echp "set mouse=a" >> .vimrc # zsh cd sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \ ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting # sed -i "s/^\(ZSH_THEME\s*=\s*\).*\$/\1\"agnoster\"/" .zshrc sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ zsh-syntax-highlighting/" .zshrc sed -i "s/^\(plugins\s*=\s*\).*\$/\1\(\n\ \ colored-man-pages/" .zshrc -
5lx created this gist
Jun 2, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ # Install Software yum -y update yum -y groupinstall "development tools" yum -y install vim wget curl htop tmux bzip2 unzip net-tools zsh # Add ssh keys mkdir /root/.ssh && chmod 700 /root/.ssh curl https://github.com/5lx.keys >> /root/.ssh/authorized_keys chmod 600 /root/.ssh/authorized_keys echo "PasswordAuthentication no" >> /etc/ssh/sshd_config # docker dnf -y install dnf-plugins-core dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo dnf install docker-ce