Goal: Connect to MSSQL using FreeTDS / ODBC in Python.
Host: Ubuntu 11.10 x86_64
Install:
sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy
In /etc/odbcinst.ini:
#!/usr/bin/env python | |
import sys, paramiko | |
if len(sys.argv) < 5: | |
print "args missing" | |
sys.exit(1) | |
hostname = sys.argv[1] | |
password = sys.argv[2] |
{"states":{"state":[{"name":"Alabama","shortCode":"AL"},{"name":"Alaska","shortCode":"AK"},{"name":"American Samoa","shortCode":"AS"},{"name":"Arizona","shortCode":"AZ"},{"name":"Arkansas","shortCode":"AR"},{"name":"Armed Forces Europe","shortCode":"AE"},{"name":"Armed Forces Pacific","shortCode":"AP"},{"name":"Armed Forces the Americas","shortCode":"AA"},{"name":"California","shortCode":"CA"},{"name":"Colorado","shortCode":"CO"},{"name":"Connecticut","shortCode":"CT"},{"name":"Delaware","shortCode":"DE"},{"name":"District of Columbia","shortCode":"DC"},{"name":"Federated States of Micronesia","shortCode":"FM"},{"name":"Florida","shortCode":"FL"},{"name":"Georgia","shortCode":"GA"},{"name":"Guam","shortCode":"GU"},{"name":"Hawaii","shortCode":"HI"},{"name":"Idaho","shortCode":"ID"},{"name":"Illinois","shortCode":"IL"},{"name":"Indiana","shortCode":"IN"},{"name":"Iowa","shortCode":"IA"},{"name":"Kansas","shortCode":"KS"},{"name":"Kentucky","shortCode":"KY"},{"name":"Louisiana","shortCode":"LA"},{"name":"Maine" |
Goal: Connect to MSSQL using FreeTDS / ODBC in Python.
Host: Ubuntu 11.10 x86_64
Install:
sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy
In /etc/odbcinst.ini:
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from Crypto.Cipher import AES | |
import base64 | |
import random | |
import hashlib | |
import os | |
class AesCrypt256: |
from Crypto.Cipher import AES | |
from Crypto import Random | |
BS = 16 | |
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
unpad = lambda s : s[0:-ord(s[-1])] | |
class AESCipher: | |
def __init__( self, key ): | |
""" |
Well the sputnik kernel might have better support for the web camera and some other minor things, but all of a sudden it started crashing over and over again and I was not able to track down the reason. Back on kernel 3.10.6 and it has been running fine since, will keep this gist updated as things progress.
I'm currently employed as a Backend developer for an e-commerce company and I received a new laptop to work on, which is a Dell XPS 13. While this laptop comes in a Ubuntu version, the one I received at work was not that model but a core I5 with Win8P.
import os | |
import boto3 | |
def connect_ecs(region=None): | |
return boto3.client( | |
'ecs', | |
aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID'), | |
aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY'), | |
region_name=region or os.environ.get('AWS_EC2_REGION', 'us-east-1'), | |
) |