Skip to content

Instantly share code, notes, and snippets.

@oldarmyc
oldarmyc / checks.sh
Created Sep 6, 2019
Shortened checks
View checks.sh
MODULES="overlay br_netfilter ebtables iptable_nat iptable_filter"
echo "Enabling Modules"
for i in ${MODULES}; do echo "$i" | tee /etc/modules-load.d/$i.conf > /dev/null; done
for i in ${MODULES}; do sudo modprobe $i; done
lsmod | grep 'overlay\|br_netfilter\|ebtables'
echo "Disabling SELinux"
sudo setenforce 0
sudo sed -i -- 's/SELINUX\=enforcing/SELINUX\=disabled/g' /etc/selinux/config
echo "Modifying Kernel Parameters"
@oldarmyc
oldarmyc / MSSQL-Kerberos.md
Last active Oct 8, 2019
MSSQL Kerberos how to
View MSSQL-Kerberos.md

Connecting to MS SQL using Kerberos Authentication

FreeTDS is as set of libraries that allows programs to talk to MS SQL Server. It doesn't currently support Kerberos authentication, however, so you'll need to rebuild the freetds package to enable the flag.

Rebuilding FreeTDS

  1. Pull down the existing recipe for the current conda packages for freetds located here: https://github.com/AnacondaRecipes/freetds-feedstock
git clone https://github.com/AnacondaRecipes/freetds-feedstock.git
@oldarmyc
oldarmyc / ibm_db.md
Created Mar 6, 2019
Build instructions for ibm_db
View ibm_db.md

To build the ibm_db package you would need to execute the following steps.

conda skeleton pypi ibm_db

Once complete a directory labeled ibm_db will be created, and inside that directory you will have a meta.yaml file.

If you would like to build the package for a specific python version you can edit the meta.yaml file

@oldarmyc
oldarmyc / migration_repository.md
Last active Feb 18, 2019
Migrating repositories between AE5 versions
View migration_repository.md

Migrating an Anaconda Enterprise 5 Repository

When faced with the prospect of moving between versions of AE5, you might be wondering what to do about your repository. Mirroring large repos can take hours. Plus, you may have custom channels that platform users have created to share packages. Follow the steps below to make the process of migrating your repository easier.

Before you begin:

Ensure that you have SSH access between both the existing and new clusters, so that files can be moved within and between systems.

The following processes use the root user, but root access is not required to complete the tasks.

On the newly installed cluster (version 5.2.3)

View mldb.py
"""
MLDB example using the pymldb library
Note: pymldb only works in python 2
The pip packages you would need to install and use the are pymldb and tqdm
pip install pymldb tqdm
"""
# Import the library
@oldarmyc
oldarmyc / couchbase.py
Created Dec 20, 2018
Couchbase example
View couchbase.py
"""
To get started will have to install a few packages to get things running
# Download the release RPM from couchbase that sets up the couchbase repositories
wget http://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-4-x86_64.rpm
# Install the RPM using yum
sudo yum localinstall couchbase-release-1.0-4-x86_64.rpm -y
# Install the needed packages required for the pip package install
@oldarmyc
oldarmyc / redis.py
Created Dec 19, 2018
Redis example
View redis.py
"""
Connecting to Redis server
Install the pip package for python to use for connecting to Redis
pip install redis
"""
# Import the library
import redis
View vertica_example.py
"""
To install the vertica driver would need to install via conda
conda install -c conda-forge vertica-python
Import the vertica python library
"""
import vertica_python
import json
View db2_example.py
"""
Import the ibm_db library
Will need to ensure that gcc is installed in the project environment as well. To do this will need to
go to the environment terminal and install gcc through yum using the following command.
sudo yum install gcc -y
After gcc installs you can install the pip package ibm_db using the following command.
@oldarmyc
oldarmyc / cassandra.py
Created Dec 10, 2018
Cassandra example connection
View cassandra.py
"""
Import the cassandra libraries that will be needed to connect to the cassandra cluster.
Note: Currently the cassandra-driver is only available for python 2.7 on conda-forge
Example install of package
conda install -c conda-forge cassandra-driver
"""
from cassandra.auth import PlainTextAuthProvider
from cassandra.cluster import Cluster