Skip to content

Instantly share code, notes, and snippets.

View rch317's full-sized avatar
🎯
Focusing

Rob Hough rch317

🎯
Focusing
  • Indianapolis, IN
View GitHub Profile
@rch317
rch317 / aws_getPublicIP.sh
Created December 31, 2016 15:16
List out public IP usage per region
#!/bin/sh
for region in $(aws ec2 describe-regions |jq -r '.Regions[] | .RegionName');
do
echo "${region}"; aws ec2 describe-instances --region ${region} | \
jq -r '.Reservations[]
| .Instances[]
| select(.PublicIpAddress!=null)
| "\t" + .PublicIpAddress + " " + .InstanceId'
done
"remote": {
"type": "s3",
"config": {
"bucket": "s3-bucket",
"key": "/path/to/terraform.tfstate",
"region": "us-east-1"
}
},
@rch317
rch317 / vmware_fusion.md
Last active March 22, 2017 14:34
vmware fusion: tips and tricks

VMWare Fusion: Tips and Tricks

Assign Static IP to VM

  • Determine the MAC address of the network interface(s) you wish to assign a static IP to:
    • $ ip link
    • link/ether 00:0c:29:c5:05:d6 brd ff:ff:ff:ff:ff:ff
    • You can also view the vm guest network settings under advanced
  • Edit the dhcpd.conf file
  • /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf
@rch317
rch317 / cpe_db_user_grant.sh
Created April 20, 2017 01:17
Grant the cpe_db_user dbadm access to all of the available databases
#!/bin/bash
#
# Stole this from an existing jazzdb user script
#
for i in $(db2 list database directory|grep alias|awk '{print $4}')
do
db2 connect to $i;
db2 grant dbadm on database to user cpe_db_user;
db2 terminate;
done
@rch317
rch317 / sds_silent_install_response.xml
Created May 25, 2017 23:57
Silent install response file for SDS
<?xml version="1.0" encoding="UTF-8"?>
<!--The "acceptLicense" attribute has been deprecated. Use "-acceptLicense" command line option to accept license agreements.-->
<agent-input acceptLicense='true' clean='true' temporary='true'>
<server>
<repository location='/mnt/cdrom/ibm_sds'/>
<repository location='/mnt/cdrom/entitlement/ibm_sds_ent'/>
</server>
<profile id='IBM Security Directory Server' installLocation='/opt/ibm/ldap/V6.4'>
<data key='eclipseLocation' value='/opt/ibm/ldap/V6.4'/>
<data key='user.import.profile' value='false'/>
@rch317
rch317 / readme.md
Created July 17, 2017 14:48
Updating Vault

Updating Vault

  1. Pull existing data from vault vault read -format=json secret/some/vault | tee backup-$(date +%s).json update.json

  2. Edit the update.json to include new data, remove unneeded data.

{
		"USER1": "passw0rd",
 "USER2": "s3cr37",

Join Linux to Active Directory (RHEL/CentOS)

Below is what an admin would do manually. You will need to adjust the variables to work for you, obviously. These steps are similar in debian based Linux distributions, but with a twist. I didn't document that here, as I didn't see the need. They are relatively minor changes.

  1. Export some variables that we'll need.
### Set your domain
export adauth_domain=YOURDOMAIN.LAB
@rch317
rch317 / readme.md
Last active November 10, 2017 03:15
Notes for setting up a new mac

macOS Setup

A collection of tips & tricks I've used to setup my Mac after. Feel free to use whatever you want, or none at all. I'm no export mac user. This is just stuff that works for me.

Preferences

  • Keyboard > Text > Disable "Correct spelling automatically".
@rch317
rch317 / db2_notes.md
Last active October 3, 2017 14:25
DB2 Tips, Tricks and Other Random Stuff...

SQL1015N The database is in an inconsistent state. SQLSTATE=55025

db2 restart database ${db_name}

[db2inst1@SD00039LINVDAT ~]$ db2 drop database ${db_name}

  • SQL1031N The database directory cannot be found on the indicated file system.*
  • SQLSTATE=58031*
db2 uncatalog database ${db_name}

First, commented out all items. Added a data source for the datacenter

data "vsphere_datacenter" "datacenter" {
  name = "${var.vsphere_datacenter}"
}

Re-ran the plan:

terraform plan --out plan.out