Skip to content

Instantly share code, notes, and snippets.

@mldeveloper01
mldeveloper01 / odbc_setup_macos.md
Created March 8, 2021 07:16 — forked from arvsrao/odbc_setup_macos.md
Guide to accessing MS SQL Server in Mac OS X via PyODBC

Since I spent essentially two full days figuring out how to access a corporate MS SQL database pythonicly, I figured I should leave some notes, for future reference and to aid other souls looking to do the same.

These instructions and the commands that follow, were executed on a MAC OS 10.8.3 system. Additionally, I found this blog [post][1] especially helpful during the debugging process.

On mac os, there is a default ODBC manager, iODBC. Other Unix based systems tend to use [unixODBC][2]. Look elsewhere for a discussion about the differences between these driver managers. The only feature we care about is being able to connect to SQL databases through [pyodbc][3], and at the time of this writing [pyodbc][3] requires iODBC as its manager.

Start by installing freeTDS libraries. FreeTDS allows unix programs to talk natively with MS SQL and SyBase databases.

brew intsall freetds
@mldeveloper01
mldeveloper01 / 100daysLog.md
Created November 7, 2018 14:06 — forked from abhinishetye/100daysLog.md
100DaysofMLCode

100 Days Of ML Code

Hi! I am Abhini, a Machine Learning Enthusiast and this is my log for the 100DaysOfMLCode Challenge

Day 1: July 08, 2018

Today's Progress: Understood the basics of Neural Network and how to build ANN. Also practiced Python on Hackerrank.

Thoughts: Cleared up my concepts on ANN in which I had earlier found confusing like Activation and Cost functions, Batch and Stochastic Gradient Descent and Backpropagation.

@mldeveloper01
mldeveloper01 / curl.md
Created November 5, 2018 09:08 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@mldeveloper01
mldeveloper01 / README-Template.md
Created July 20, 2018 10:24 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@mldeveloper01
mldeveloper01 / kmeansExample.py
Created July 18, 2018 07:26 — forked from iandanforth/kmeansExample.py
A pure python implementation of K-Means clustering. Optional cluster visualization using plot.ly.
#############################################################################
# Full Imports
from __future__ import division
import math
import random
"""
This is a pure Python implementation of the K-means Clustering algorithmn. The
original can be found here:
@mldeveloper01
mldeveloper01 / gist:4b9845744365401ba33469b05d0659bf
Created May 14, 2018 17:20 — forked from aws-scripting-guy/gist:884ffa9d44bd14f7493a670543284552
AWS EC2 metadata. Check attached IAM role from EC2 instance. Get temporary credentials.
# Get IAM Role name from Instance Profile Id
curl http://169.254.169.254/latest/meta-data/iam/info
# Get credentials
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name>
# More info
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
@mldeveloper01
mldeveloper01 / logging2.json
Created May 14, 2018 07:35 — forked from pmav99/config2.json
Python logging configuration using JSON
{
"logging": {
"version": 1,
"disable_existing_loggers": true,
"formatters": {
"brief": {
"class": "logging.Formatter",
"datefmt": "%I:%M:%S",
"format": "%(levelname)-8s; %(name)-15s; %(message)s"
},
@mldeveloper01
mldeveloper01 / logging2.json
Created May 14, 2018 07:35 — forked from pmav99/config2.json
Python logging configuration using JSON
{
"logging": {
"version": 1,
"disable_existing_loggers": true,
"formatters": {
"brief": {
"class": "logging.Formatter",
"datefmt": "%I:%M:%S",
"format": "%(levelname)-8s; %(name)-15s; %(message)s"
},
@mldeveloper01
mldeveloper01 / flask_app_logging.py
Created May 1, 2018 16:54 — forked from ivanleoncz/flask_app_logging.py
Demonstration of logging feature for a Flask App.
#/usr/bin/python3
""" Demonstration of logging feature for a Flask App. """
from logging.handlers import RotatingFileHandler
from flask import Flask, request, jsonify
from time import strftime
__author__ = "@ivanleoncz"
import logging
@mldeveloper01
mldeveloper01 / foo.log
Created May 1, 2018 12:41 — forked from ibeex/foo.log
Flask logging example
A warning occurred (42 apples)
An error occurred