Created
May 6, 2025 15:38
-
-
Save NLXZ/b3a8588bc65b05d52bba3f67cd20f310 to your computer and use it in GitHub Desktop.
Script to enable Evil-WinRM remote path completion.
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
#!/bin/sh | |
current_version=$(ruby -e 'puts RUBY_VERSION' | cut -d. -f1,2) | |
version="$current_version.0" | |
dir_path=$(pwd) | |
# Install needed package | |
sudo apt update | |
sudo apt install -y libreadline-dev | |
# Download source code and compile the readline extension | |
wget https://ftp.ruby-lang.org/pub/ruby/2.7/ruby-2.7.8.tar.gz | |
tar -xf ruby-2.7.8.tar.gz | |
cd ruby-2.7.8/ext/readline | |
ruby ./extconf.rb | |
make | |
# Patch current version of the ruby readline extension: | |
sudo cp /usr/lib/x86_64-linux-gnu/ruby/$version/readline.so /usr/lib/x86_64-linux-gnu/ruby/$version/readline.so.bk 2>/dev/null | |
sudo cp -f readline.so /usr/lib/x86_64-linux-gnu/ruby/$version/readline.so | |
# Clean up files | |
cd $dir_path | |
rm -rf ruby-2.7.8* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment