Skip to content

Instantly share code, notes, and snippets.

View gist:e794f4aab1e32f2bb78c
### Keybase proof
I hereby claim:
* I am oldarmyc on github.
* I am oldarmyc (https://keybase.io/oldarmyc) on keybase.
* I have a public key whose fingerprint is 95DF 08CF FFFD 1430 FD0D 735C F024 5A3B 833F 1F8C
To claim this, I am signing this object:
View gist:67bb93f1832597fd8ed8fb40ecf93361
kubectl get pods . # Get the postgres pod
kubectl exec -it anaconda-enterprise-postgres-68b49746ff-fv7qk /bin/bash
su - postgres
psql
\c anaconda_auth
select email, enabled, first_name, last_name, username from user_entity;
All table headings incase you want to change the select.
id, emai, email_constraint, email_verified, enabled, federation_link, first_name, last_name, realm_id, username, created_timestamp, service_account_client_link, not_before
@oldarmyc
oldarmyc / instructions.md
Last active Nov 9, 2018
SSL certs by hand AE5
View instructions.md

To edit/set the SSL certificates by hand.

Before you being ensure that openjdk is installed. At the time of this java-1.8.0-openjdk is the current version on CentOS 7.5

yum install java-1.8.0-openjdk -y

Ensure you have your certificate and private key on the system you are running these commands.

@oldarmyc
oldarmyc / nfs_instructions.md
Created Nov 21, 2018
NFS and AE5 instructions
View nfs_instructions.md

On host server for NFS

yum install nfs-utils nfs-utils-lib -y

Create dir for nfs share and set permissions

mkdir /nfs
chmod 655 /nfs
chown nfsnobody:nfsnobody /nfs
@oldarmyc
oldarmyc / join_cluster.md
Last active Nov 27, 2018
Join cluster via command line
View join_cluster.md

Joining additional node to AE5 master through command line

Download the corresponding gravity binary from S3

# For AE 5.2.1
curl -O https://s3.amazonaws.com/ae-support/gravity-binary-5.2.1

# For AE 5.2.2
curl -O https://s3.amazonaws.com/ae-support/gravity-binary-5.2.2
@oldarmyc
oldarmyc / move_gravity.md
Created Nov 28, 2018
Move/replace /var/lib/gravity
View move_gravity.md

Changing out /var/lib/gravity

In the example below /dev/sdb was presented to the VM. You would use whatever disk was presented in your setup.

  1. Get the disks presented to the system
fdisk -l
  1. Create the partition on the disk. Using fdisk but you can use others i.e. gdisk
@oldarmyc
oldarmyc / example.py
Created Dec 10, 2018
MSSQL example connector
View example.py
"""
In order to use the example you must install pymssql from conda
conda install -c anaconda pymssql
"""
import pymssql
# Using an ini style credentials file for example so will use configparser
import configparser
@oldarmyc
oldarmyc / snowflake.py
Created Dec 10, 2018
Snowflake example connection
View snowflake.py
"""
Installing the connector it is recommended to use pip and not the conda-forge package
pip install snowflake-connector-python
"""
import snowflake.connector
import json
# Get credentials from kubernetes. The credentials were setup as a dictionary so will use json to load
@oldarmyc
oldarmyc / mongo.py
Created Dec 10, 2018
Mongo connection example
View mongo.py
"""
pymongo will need to be installed from conda for things to work properly
conda install -c anaconda pymongo
"""
import pymongo
import json
"""
Connect to the mongo server. In the example it is using the default auth mechanism
@oldarmyc
oldarmyc / postgresql.py
Created Dec 10, 2018
PostgreSQL example connection
View postgresql.py
"""
Package psycopg2 must be installed through conda for this to work
conda install -c anaconda psycopg2
"""
import psycopg2
import json
# Get credentials from kubernetes. The credentials were setup as a dictionary