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
" perltest.vim - test driven development for Perl with vim | |
" | |
" ,t -- Run tests | |
" ,w -- Set current file as test file. Only this test will run. | |
" ,W -- Unset current test file. All tests will run. | |
" | |
" v1.02 - Updates at http://perlmonks.org/index.pl?node_id=434793 | |
function! Prove ( verbose, silent ) | |
if ! exists("g:testfile") |
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
#!/bin/sh | |
#check if i3lock is already running | |
pgrep i3lock > /dev/null && exit 1 | |
#make screenshot | |
scrot ~/lockscreen.png | |
#apply blur | |
mogrify -filter Gaussian -resize 20% -define filter:sigma=1 -resize 500% ~/lockscreen.png | |
#mogrify -blur 0x8 ~/lockscreen.png |
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
fun! Tidy() | |
silent exe ":update" | |
let pos1 = line(".") | |
exe '%!perltidy' | |
exe ':'.pos1 | |
endfun | |
autocmd BufWrite *.t,*.pm,*.pl,Rexfile call Tidy() | |
if exists("b:did_spell") |
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
#!/bin/sh | |
IMAGE="/tmp/scrocr.png" | |
scrot -s ${IMAGE} | |
mogrify -modulate 100,0 -resize 400% ${IMAGE} | |
tesseract ${IMAGE} stdout | xsel -bi | |
rm ${IMAGE} |
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.0']; | |
use Rex::Commands::Virtualization; | |
use Data::Dumper; | |
#parallelism 10; | |
use Rex::Group::Lookup::INI; | |
groups_file "hosts.ini"; | |
user "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
# put this file into ~/.vim/after/syntax/perl/rex.vim and then remove this line | |
syn keyword perlStatementScalar after after_task_finished before before_task_start bios_boot cache cat case checkout command content create_home delete_lines_according_to delete_lines_matching do_task desc download ensure extract group groups_file home initialize is_dir is_file is_symlink key_auth line LOCAL mode needs no_overwrite on_change on_rollback only_if options owner parallelism partition pass_auth password path private_key public_key regexp report repository rm sayformat share size source ssh_key sudo sudo_password transaction type umount unless unlink update_package_db update_system user upload | |
syn keyword perlStatementList account append_if_no_such_line append_or_amend_line batch chgrp chmod chown clearpart cmdb cp create_user cron_entry file get i_run ln mount mv pkg run run_task say sed service symlink task template | |
syn keyword perlStatementHash environment set | |
syn keyword perlString FALSE |
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 -base; | |
user 'deployer'; | |
password 'userpass'; | |
sudo_password 'userpass'; | |
sudo TRUE; | |
auth for => initialize => | |
user => 'root', | |
password => 'rootpass'; |
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
$ rex bench | |
[2015-06-13 15:27:07] <local> INFO - Running task bench on <local> | |
Benchmark: timing 100 iterations of new_large, new_small, old_large, old_small... | |
new_large: 2 0.11 0.11 0.62 0.03 100 None @ 114.94/s (n=100) | |
new_small: 2 0.06 0.16 0.52 0.06 100 None @ 125.00/s (n=100) | |
old_large: 108 0.17 0.21 101.85 5.35 100 None @ 0.93/s (n=100) | |
old_small: 2 0.11 0.28 0 0 100 None @ 256.41/s (n=100) | |
(warning: too few iterations for a reliable count) | |
Rate old_large new_large new_small old_small | |
old_large 0.930/s -- -99% -99% -100% |
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 -base; | |
task 'a', sub { | |
my $output_from_another_task = run_task 'b'; | |
say $output_from_another_task; | |
}; | |
task 'b', sub { | |
return 'I can pass scalars at least'; | |
}; |
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 -base; | |
use Getopt::Long; | |
my $buildserver; | |
GetOptions( 'buildserver=s' => \$buildserver ); | |
group buildserver => $buildserver; | |
task 'a', |
OlderNewer