view release on metacpan or search on metacpan
use a different user to run the archiver, edit this script and change '--user
bgpmon' to the user you would like to use.
Next, make the script executable:
chmod +x /etc/init.d/bgpmon-archiver
If you would like the archiver to start up automatically each time the machine
restarts/reboots, do the following:
On Ubuntu:
view all matches for this distribution
view release on metacpan or search on metacpan
t/00-bgpmon-filter.t view on Meta::CPAN
#--test for file w/o permissions
=comment
TODO make sure you update the location for the files and stuff here
BGPmon::Filter::init();
my $output = `chmod 000 t/bgpmon-filter-config-no-permissions.txt 2>&1`;
if($?){
print "$!\n";
}
BGPmon::Filter::parse_config_file($location+"bgpmon-filter-config-no-permissions.txt");
$errCode = BGPmon::Filter::get_error_code('parse_config_file');
is($errCode, BGPmon::Filter::UNOPANABLE_CONFIG_FILE, "File w/o Permissions");
BGPmon::Filter::filterReset();
## put permissions back
$output = `chmod 555 t/bgpmon-filter-config-no-permissions.txt 2>&1`;
if($?){
print "$!\n";
}
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
t/00-bgpmon-filter.t view on Meta::CPAN
#--test for file w/o permissions
=comment
TODO make sure you update the location for the files and stuff here
BGPmon::Filter::init();
my $output = `chmod 000 t/bgpmon-filter-config-no-permissions.txt 2>&1`;
if($?){
print "$!\n";
}
BGPmon::Filter::parse_config_file($location+"bgpmon-filter-config-no-permissions.txt");
$errCode = BGPmon::Filter::get_error_code('parse_config_file');
is($errCode, BGPmon::Filter::UNOPANABLE_CONFIG_FILE, "File w/o Permissions");
BGPmon::Filter::filterReset();
## put permissions back
$output = `chmod 555 t/bgpmon-filter-config-no-permissions.txt 2>&1`;
if($?){
print "$!\n";
}
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
t/00-bgpmon-log.t view on Meta::CPAN
# try a failure opening a file - bad permissions
my $retu = unlink ($log_file);
my $reto = open($log_fh, "> $log_file");
close($log_fh);
chmod(0000, $log_file);
ok($reto != 0, "Making unreadable log file : $log_file");
$init_params{"log_file"} = $log_file;
test_init_failure("Testing bad log file permissions",
BGPmon::Log::LOG_INIT_FILE_OPEN_CODE,
BGPmon::Log::LOG_INIT_FILE_OPEN_MSG );
t/00-bgpmon-log.t view on Meta::CPAN
# test write fails for log_file
# tried removing and unlinking the file, but
# both yield no errors
# remove the file we are logging to
#$ret = unlink($log_file);
#chmod(0000, $log_file);
#ok($ret == 1, "Removing test log_file $log_file");
#$ret = BGPmon::Log::log_notice("help");
#$ret_code = BGPmon::Log::get_error_code("log_notice");
#$ret_msg = BGPmon::Log::get_error_msg("log_notice");
#ok(($ret == 1) &&
view all matches for this distribution
view release on metacpan or search on metacpan
perl-BIND-Config-Parser.spec view on Meta::CPAN
# please visit: http://perl.arix.com/
#
%prep
%setup -q -n %{pkgname}-%{version}
chmod -R u+w %{_builddir}/%{pkgname}-%{version}
%build
grep -rsl '^#!.*perl' . |
grep -v '.bak$' |xargs --no-run-if-empty \
%__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
view all matches for this distribution
view release on metacpan or search on metacpan
BSD::stat implements its own import mechanism to prevent performance
loss when $st_* is not needed
=head2 chflags
BSD::stat also adds chflags(). Like CORE::chmod it takes first
argument as flags and any following arguments as filenames.
for convenience, the followin constants are also set;
UF_SETTABLE 0x0000ffff /* mask of owner changeable flags */
UF_NODUMP 0x00000001 /* do not dump file */
so that you can go like
chflags(SF_ARCHIVED|SF_IMMUTABLE, @files);
just like CORE::chmod(), chflags() returns the number of files
successfully changed. when an error occurs, it sets !$ so you can
check what went wrong when you applied only one file.
to unset all flags, simply
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.old view on Meta::CPAN
# --- MakeMaker tools_other section:
SHELL = /bin/sh
CHMOD = chmod
CP = cp
LD = cc
MV = mv
NOOP = $(SHELL) -c true
RM_F = rm -f
view all matches for this distribution
view release on metacpan or search on metacpan
script/b2_client view on Meta::CPAN
# get_b2_session() will test those for us
my $obfuscated_content = unpack "h*", $args[0].':::'.$args[1];
my $file_location = '~/.b2_tokens';
path($file_location)->spew_raw( $obfuscated_content );
chmod 0600, $file_location;
print "B2 API Tokens saved to $file_location\n";
}
# subroutine to actually log into B2 with their tokens
view all matches for this distribution
view release on metacpan or search on metacpan
2. Install the default.conf:
mkdir /etc/yadw
cp <sharedir>/yadw/default.conf /etc/yadw
chmod 600 /etc/yadw/default.conf
2. Modify /etc/yadw/default.conf to your liking.
3. Run a manual full backup test. This will also prime the pump so to speak
for automated backups to run.
view all matches for this distribution
view release on metacpan or search on metacpan
bin/ezbackup view on Meta::CPAN
open my $fh, ">$cron_file" or die "failed to open $cron_file: $!";
print $fh "#!/bin/sh\n\n";
print $fh "nice $ez_path\n";
close $fh;
my_system("chmod 755 $cron_file");
}
sub install_cfg {
my $etc_dir = "/etc/ezbackup";
my $dist_dir = File::ShareDir::dist_dir("Backup-EZ");
my_system("mkdir -p $etc_dir");
my_system("cp $dist_dir/ezbackup.conf $etc_dir");
my_system("cp $dist_dir/ezbackup_exclude.rsync $etc_dir");
my_system("chmod 644 $etc_dir/*");
}
sub my_system {
my $cmd = shift;
print "$cmd\n";
view all matches for this distribution
view release on metacpan or search on metacpan
- updated Makefile.PL so ./configure is run before subdirs are built when parallel make (eg: make -j 4) is used
- generate error message instead of log message if bpc_poolWrite_unmarkPendingDelete() fails
- added & ~S_IFMT to chmod() mode argument
0.54: May 25, 2017
- checks the return value of check the return value of bpc_fileZIO_read() in BackupPC::XS::FileZIO::read()
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Badger/Filesystem.pm view on Meta::CPAN
return wantarray
? @stats
: \@stats;
}
sub chmod_path {
my $self = shift;
my $path = $self->definitive_write(shift);
chmod(shift, $path);
}
#-----------------------------------------------------------------------
# file manipulation methods
lib/Badger/Filesystem.pm view on Meta::CPAN
|| return $self->error_msg( copy_failed => $action, $from, $to, $! );
my $mode = $params->{ file_mode };
$mode = $params->{ mode } unless defined $mode;
$file->chmod($mode)
if $file && defined $mode;
return $file || $dest;
}
lib/Badger/Filesystem.pm view on Meta::CPAN
13 file is readable by current process
14 file is writeable by current process
15 file is executable by current process
16 file is owned by current process
=head2 chmod_path($path)
Changes the file permissions on a path.
$fs->chmod_path('/path/to/file', 0755);
=head1 FILE MANIPULATION METHODS
=head2 create_file($path)
view all matches for this distribution
view release on metacpan or search on metacpan
t/tlib/Test/BashCompletionTestUtils.pm view on Meta::CPAN
$results{path} = join($Config{path_sep}, $bin_dir, $ENV{PATH});
for my $cmd (@_) {
my $path = catfile($bin_dir->dirname, $cmd);
open(my $fh, '>', $path);
next unless $fh && chmod(0755, $path);
$results{cmd}{$cmd} = {path => $path, fh => $fh};
}
return \%results;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Basset/Logger.pm view on Meta::CPAN
my $temp = File::Temp->new;
my $name = $temp->filename;
$test->is(ref($o->handle($name)), 'GLOB', "created glob");
open (my $glob, $name);
$test->is($o->handle($glob), $glob, "set glob");
chmod 000, $name;
$test->is(scalar($o->handle($name)), undef, "could not set handle to unwritable file");
$test->is($o->errcode, "BL-01", "proper error code");
}
=end btest
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Batch/Batchrun/Retain.pm view on Meta::CPAN
warn("*** Copy from $Retain{ORIGINAL}\n*** to $currentfile \n *** FAILED: $!\n");
return(0);
}
}
if ( $Retain{CHMOD} and not chmod $Retain{CHMOD},$currentfile )
{
warn("*** CHMOD $Retain{CHMOD} of $currentfile\n FAILED: $!\n");
}
if ( $Retain{DELETE} and not unlink($Retain{ORIGINAL}) )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bencher/Scenario/GetoptLong/Runtime.pm view on Meta::CPAN
'value=s' => sub { },
'file=s' => sub { },
);
_
write_text("$tempdir/cli1", join("", @script_content));
chmod 0755, "$tempdir/cli1";
push @$pp, {
type => 'command',
name => "default",
cmdline => ["$tempdir/cli1"],
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bencher/Scenario/GetoptLongComplete/Completion.pm view on Meta::CPAN
'value=s' => sub { },
'file=s' => sub { },
);
_
write_text("$tempdir/cli1", join("", @script_content));
chmod 0755, "$tempdir/cli1";
push @$pp, make_completion_participant(
type => 'perl_code',
name=>"optname",
cmdline=>"$tempdir/cli1 --hel^",
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bencher/Scenario/GetoptLongEvenLess/Runtime.pm view on Meta::CPAN
'value=s' => sub { },
'file=s' => sub { },
);
_
write_text("$tempdir/cli1", join("", @script_content));
chmod 0755, "$tempdir/cli1";
push @$pp, {
type => 'command',
name => "default",
cmdline => ["$tempdir/cli1"],
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bencher/Scenario/PerinciCmdLine/InputStream.pm view on Meta::CPAN
my $progpath = "$tempdir/$progname";
if ($cmdline eq 'rawperl') {
write_text($progpath, "#!$^X\n" . <<'_');
my $num = 0; while (<>) { chomp; $num++ } print $num, "\n";
_
chmod 0755, $progpath;
} else {
my $res = gen_pericmd_script(
url => "/Perinci/Examples/Stream/count_lines",
cmdline => "Perinci::CmdLine::Lite",
output_file => $progpath,
view all matches for this distribution
view release on metacpan or search on metacpan
share/PerlCritic/Critic/Policy/InputOutput/RequireCheckedSyscalls.pm view on Meta::CPAN
Readonly::Array my @DEFAULT_FUNCTIONS => qw(
open close print say
);
# I created this list by searching for "return" in perlfunc
Readonly::Array my @BUILTIN_FUNCTIONS => qw(
accept bind binmode chdir chmod chown close closedir connect
dbmclose dbmopen exec fcntl flock fork ioctl kill link listen
mkdir msgctl msgget msgrcv msgsnd open opendir pipe print read
readdir readline readlink readpipe recv rename rmdir say seek seekdir
semctl semget semop send setpgrp setpriority setsockopt shmctl
shmget shmread shutdown sleep socket socketpair symlink syscall
view all matches for this distribution
view release on metacpan or search on metacpan
script/penchmarks view on Meta::CPAN
};
_BENCHMARK_
my $perm = (stat $fh)[2] & 07777;
chmod($perm | 0700, $fh) or die $!;
close $fh;
print "OK. Generated $file_path.";
}
view all matches for this distribution
view release on metacpan or search on metacpan
# --- MakeMaker tool_xsubpp section:
# --- MakeMaker tools_other section:
CHMOD = $(ABSPERLRUN) -MExtUtils::Command -e chmod --
CP = $(ABSPERLRUN) -MExtUtils::Command -e cp --
MV = $(ABSPERLRUN) -MExtUtils::Command -e mv --
NOOP = rem
NOECHO = @
RM_F = $(ABSPERLRUN) -MExtUtils::Command -e rm_f --
view all matches for this distribution
view release on metacpan or search on metacpan
}
sub DESTROY
{
my $self = shift ;
chmod 0777, @{ $self } ;
for (@$self) { 1 while unlink $_ } ;
}
END
{
view all matches for this distribution
view release on metacpan or search on metacpan
# --- MakeMaker tool_xsubpp section:
# --- MakeMaker tools_other section:
SHELL = /bin/sh
CHMOD = chmod
CP = cp
MV = mv
NOOP = $(TRUE)
NOECHO = @
RM_F = rm -f
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Big5.pm view on Meta::CPAN
my $e_script = Big5::escape_script($filename);
print {$fh} $e_script;
my $mode = (Ebig5::stat($filename))[2] & 0777;
chmod $mode, "$filename.e";
close($fh) or die "Can't close file: $filename.e: $!";
}
my $fh = gensym();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Big5HKSCS.pm view on Meta::CPAN
my $e_script = Big5HKSCS::escape_script($filename);
print {$fh} $e_script;
my $mode = (Ebig5hkscs::stat($filename))[2] & 0777;
chmod $mode, "$filename.e";
close($fh) or die "Can't close file: $filename.e: $!";
}
my $fh = gensym();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bigtop/Backend/CGI/Gantry.pm view on Meta::CPAN
$base_dir, "app.${file_type}cgi"
);
Bigtop::write_file( $cgi_file, $content->{ cgi } ) if $write_cgi;
chmod 0755, $cgi_file;
if ( $tree->get_config->{CGI}{with_server} ) {
next CONF_TYPE if ( $gantry_conf and $conf_type ne 'base' );
my $server_file = File::Spec->catfile(
lib/Bigtop/Backend/CGI/Gantry.pm view on Meta::CPAN
"app.${server_type}server"
);
Bigtop::write_file( $server_file, $content->{ server } );
chmod 0755, $server_file;
}
}
}
our $template_is_setup = 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/App/SELEX/RNAmotifAnalysis.pm view on Meta::CPAN
open( my $fh, '>', $batch_filename);
print {$fh} $workload[ $batch_num - 1];
close $fh;
# Make script file executable
system("chmod u+x $batch_filename");
# Run the script, if desired
if($run_scripts){
system("./$batch_filename &");
}
lib/Bio/App/SELEX/RNAmotifAnalysis.pm view on Meta::CPAN
curl -LOk http://xrl.us/cpanm
2. Make it executable
chmod u+x cpanm
3. Make a local lib/perl5 directory (if it doesn't already exist)
mkdir -p ~/lib/perl5
view all matches for this distribution
view release on metacpan or search on metacpan
install_dependencies.sh view on Meta::CPAN
if [ -e "$PRODIGAL_DIR/prodigal" ]; then
echo "Prodiagl already exists in $PRODIGAL_DIR"
else
echo "Creating prodigal symlink"
cp $PRODIGAL_DOWNLOAD_PATH $PRODIGAL_DIR
chmod u+x "${PRODIGAL_DIR}/${PRODIGAL_DOWNLOAD_FILENAME}"
ln -s "${PRODIGAL_DIR}/${PRODIGAL_DOWNLOAD_FILENAME}" ${PRODIGAL_DIR}/prodigal
fi
# Add things to PATH
update_path () {
view all matches for this distribution