Skip to content

Instantly share code, notes, and snippets.

Dan Pritts danpritts

Block or report user

Report or block danpritts

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
danpritts / semanage-addports
Last active Nov 10, 2017
wrapper for semanage port -a - takes a list, checks to see if any on list are already defined, adds whatever else is needed
View semanage-addports
#!/usr/bin/perl -w
# add an port to an selinux foo_port_t
# don't attempt to re-add ports that are already there - that is very slow
# possible to-do: see if a port is already added as someother_port_t
use Getopt::Long;
my $port_type='';
danpritts /
Last active Jan 11, 2020
Automatically tag EC2 snapshots and volumes based on their attached AMIs/instances
# most credit to the original:
# Tag snapshots based on their associated AMI and volumes based on attached instance.
# format:
# (AMI:db5|db5) /dev/sda1 (1/4)
# (AMI:db5|db5) /dev/sdb (2/4)
# Best practice: create IAM user
# Simplest privilege to get it to work with reasonable security: use predefined policy "ReadOnlyAccess"
You can’t perform that action at this time.