Skip to content

Instantly share code, notes, and snippets.

View hybby's full-sized avatar

drew jess hybby

View GitHub Profile
@hybby
hybby / jq-cheatsheet.txt
Last active June 4, 2021 15:04
jq Cheatsheet
# if one key equals something, print another key's value
$ jq -re '.StackResourceSummaries[] | select (.LogicalResourceId == "foo") | .PhysicalResourceId' < stack-resources.txt
lambda-physical-id
@hybby
hybby / get-sg-references-from-cfn-stack.sh
Created April 30, 2020 17:44
get-sg-references-from-cfn-stack
#!/bin/bash
# get-sg-references-from-cfn-stack.sh - get all references to a cfn stacks' sgs
# requirements: awscli, jq
USAGE="Usage: $0 <cfn-stack-name>"
# cfn stack name
STACK="$1"
if [[ -z "${STACK}" ]] ; then
echo "Invalid arguments"

Keybase proof

I hereby claim:

  • I am hybby on github.
  • I am hybby (https://keybase.io/hybby) on keybase.
  • I have a public key ASBllV0PgdQndKyfOkZ_BXVAVPGtBySAX9RDGfVQSQoOqwo

To claim this, I am signing this object:

#!/bin/bash
# doubleit.sh - prints out commands to double the desired size of an asg
# colors
red=$(echo -e "\033[00;91m")
green=$(echo -e "\033[00;92m")
yellow=$(echo -e "\033[00;93m")
blue=$(echo -e "\033[00;94m")
purple=$(echo -e "\033[00;35m")
white=$(echo -e "\033[00;97m")
@hybby
hybby / all-the-fixes-broken-plex.output
Created September 25, 2015 10:22
all-the-fixes-broken-plex
# deport disk group
root@host# vxdg deport datadb_DEV
# reinitialise disks using our actual offsets and lengths
root@host# vxdisk -f init xiv2_abcd puboffset=65744 publen=3159248592 privoffset=208 privlen=65536
root@host# vxdisk -f init xiv2_5678 puboffset=65792 publen=537549424 privoffset=256 privlen=65536
# recreate diskgroup from our edited backup file, then start volumes
root@host# vxdg init datadb_DEV xiv0_abcd=xiv2_abcd
root@host# vxdg -g datadb_DEV adddisk xiv1_1234=xiv2_5678
@hybby
hybby / what-i-changed-recreatedg.output
Created September 25, 2015 10:04
what-i-changed-recreatedg
sd xiv1_1234-01
dev=201/2243 # was 'VOLNODEV'
enabled=on # was 'off'
nodevice=off # was 'on'
da_name=xiv2_5678 # was 'xiv1_1234'
device_tag=xiv2_5678 # was 'xiv1_1234'
path=/dev/vx/dmp/xiv2_5678s3 # had to add this line
volatile=off # had to add this line
guid={74350bf4-61d6-11e5-aefb-2d0a7d14f38a} # was old guid
mediatype=hdd # was 'unknown'
@hybby
hybby / vxdisk-offsets-for-replace.output
Created September 25, 2015 09:56
vxdisk-offsets-for-replace
# our working LUN
root@host# vxdisk list xiv2_abcd | egrep '^public|^private'
public: slice=3 offset=65744 len=3159248592 disk_offset=48
private: slice=3 offset=208 len=65536 disk_offset=48
# our broken LUN. got it from an old /etc/vx/cbr/bk copy from 2012 (lucky)
public: slice=3 offset=65792 len=537549424 disk_offset=0
private: slice=3 offset=256 len=65536 disk_offset=0
@hybby
hybby / get-disk-associations.output
Created September 25, 2015 09:50
get-disk-associations
# get dmp node names, as veritas believes it
# because our original lun is missing, VxVM prints '-'. we change this for new disk, `xiv2_5678`
root@host# vxprint -g datadb_DEV -dF '%assoc'
xiv2_abcd
-
# get dm names, as veritas believes it
# numerous migrations have caused these to look weird. enclosure names have clearly changed
root@host# vxprint -g datadb_DEV -dF '%name'
xiv0_abcd
@hybby
hybby / get-disk-id-vxprint.output
Last active May 15, 2016 01:18
get-disk-id-vxprint
root@host# /etc/vx/bin/vxdisksetup -i xiv2_5678
root@host# vxdg init testdg 0000=xiv2_5678
root@host# vxprint -g testdg -dF '%dev'
201/2243
root@host# vxdg destroy test
root@host# vxdisk list xiv2_5678 | grep ^guid
guid: {74350bf4-61d6-11e5-aefb-2d0a7d14f38a}
@hybby
hybby / df-missing-plex-volume.output
Last active September 25, 2015 08:34
df-missing-plex-volume
# df -h | grep -i datadbdev
/dev/vx/dsk/datadb_DEV/datadbdev
100M 1.8M 93M 2% /datadbdev
/dev/vx/dsk/datadb_DEV/datadbdev-ora
1.6T 1.3T 289G 82% /datadbdev/ora
/dev/vx/dsk/datadbarc_DEV/datadbdev-ora-archivelog01
330G 59G 255G 19% /datadbdev/ora/archivelog01