Skip to content

Instantly share code, notes, and snippets.

@oldarmyc
oldarmyc / s3.py
Created December 10, 2018 18:30
S3 example connection
"""
The s3fs package would need to be installed using conda install
conda install -c anaconda s3fs
"""
from s3fs.core import S3FileSystem
import configparser
@oldarmyc
oldarmyc / MSSQL-Kerberos.md
Last active October 8, 2019 13:04
MSSQL Kerberos how to

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 / checks.sh
Created September 6, 2019 14:19
Shortened checks
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 / ibm_db.md
Created March 6, 2019 21:09
Build instructions for ibm_db

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 February 18, 2019 13:44
Migrating repositories between AE5 versions

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)

@oldarmyc
oldarmyc / mldb.py
Created December 21, 2018 20:16
MLDB Example
"""
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 December 20, 2018 00:27
Couchbase example
"""
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 December 19, 2018 17:52
Redis example
"""
Connecting to Redis server
Install the pip package for python to use for connecting to Redis
pip install redis
"""
# Import the library
import redis
@oldarmyc
oldarmyc / vertica_example.py
Created December 17, 2018 17:30
Vertica Example
"""
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
@oldarmyc
oldarmyc / db2_example.py
Created December 13, 2018 19:09
DB2 example
"""
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.