This file contains 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
use Rex -feature => [ '1.4', 'exec_autodie' ]; | |
sudo_password 'sudo password'; | |
task test => sub { | |
say run 'whoami'; # should be normal user | |
sudo TRUE; | |
say run 'whoami'; # should be root | |
}; |
This file contains 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
use Rex -feature => [ '1.4', 'exec_autodie' ]; | |
use Rex::Hook::File::Diff; # show diff of file changes by Rex | |
use if $ENV{PREVIEW}, 'Rex::Hook::File::Impostor'; # use extra hooks if PREVIEW is true | |
desc 'Demonstrate file preview'; | |
task 'demo', sub { | |
file '/tmp/rex_file_preview_demo', content => scalar localtime(); | |
}; |
This file contains 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
#gpg | |
export GPG_TTY=$(tty) | |
gpg-connect-agent updatestartuptty /bye &> /dev/null | |
unset SSH_AGENT_PID | |
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then | |
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" | |
fi |
This file contains 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
ale | |
auto-pairs | |
diffchar.vim | |
eregex.vim | |
fzf.vim | |
goyo.vim | |
gundo.vim | |
limelight.vim | |
markdown-preview.nvim | |
mkdx |
This file contains 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
diff --git a/lib/Rex/Interface/Connection/OpenSSH.pm b/lib/Rex/Interface/Connection/OpenSSH.pm | |
index 33f01263..6ecbc462 100644 | |
--- a/lib/Rex/Interface/Connection/OpenSSH.pm | |
+++ b/lib/Rex/Interface/Connection/OpenSSH.pm | |
@@ -53,28 +53,16 @@ sub connect { | |
$self->{__auth_info__} = \%option; | |
Rex::Logger::debug("Using Net::OpenSSH for connection"); | |
- Rex::Logger::debug( "Using user: " . $user ); | |
- Rex::Logger::debug( Rex::Logger::masq( "Using password: %s", $pass ) ) |
This file contains 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
use 5.26; | |
use Rex; | |
task 'heredoc_run', sub { | |
run 'foo', command => <<~'EOF', | |
f=$(cat /tmp/num) | |
if [ "$f" == 2 ]; then | |
ls -l / >/tmp/foo.txt | |
else | |
ls -l / >/tmp/bar.txt |
This file contains 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
use 5.012; | |
use warnings; | |
use Rex -feature => [ '1.4', 'exec_autodie' ]; | |
BEGIN { | |
use Rex::Shared::Var; | |
share qw($should_restart @services_to_restart); | |
} |
This file contains 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
use v5.24; # for postfix dereferencing below | |
use strict; | |
use warnings; | |
use Rex -feature => [ '1.4', 'exec_autodie' ]; | |
use Rex::CMDB; | |
use File::Spec; | |
use YAML qw(LoadFile); |
This file contains 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
use Rex -feature => [qw(1.4 exec_autodie)]; | |
use Rex::Commands::SimpleCheck; | |
sayformat "[%h]>\t%s"; | |
task 'reboot', sub { | |
my $server = connection->server; | |
my $port = Rex::Config->get_port( server => $server ) || 22; |
This file contains 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
use Rex; | |
use Rex::Hook::File::Diff; | |
task 'diff_example', sub { | |
file '/tmp/diff.example', | |
content => gmtime(); | |
}; |
NewerOlder