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
# bash and Gnu grep assumed | |
crtinfo () { | |
# accept command line cert name, or look for first *crt file in current directory | |
if [[ -n $1 ]] ; then | |
CERT=$1 | |
else | |
CERTARRAY=(*crt) | |
CERT=${CERTARRAY[0]} | |
if [[ -n ${CERTARRAY[1]} ]] ;then |
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 | |
echo "ID STATE NAME" | |
for vm in `vim-cmd vmsvc/getallvms | awk '{ print $1 }' | grep -v Vmid`; | |
do | |
echo -ne "${vm}\t" | |
vim-cmd vmsvc/get.summary ${vm} | egrep 'name = |powerState ' | sed 's/[,"]//g; s/poweredOn/ON/; s/poweredOff/OFF/ ;s/suspended/SUSP/' | awk 1 ORS=' ' | awk '{ print $3, "\t", $6}' | |
done | |
----- |
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
#!/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=''; |
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
# most credit to the original: https://gist.github.com/brandond/6b4d22eaefbd66895f230f68f27ee586 | |
# 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" |