Skip to content

Instantly share code, notes, and snippets.

View csotomon's full-sized avatar
🎯
Focusing

Camilo Soto Montoya csotomon

🎯
Focusing
View GitHub Profile
@csotomon
csotomon / dockerfile
Last active August 26, 2021 19:45
Python AWS lambda dockerfile for connecting to SQL Server databases
FROM public.ecr.aws/lambda/python:3.9
ADD requirements.txt .
ADD app.py ${LAMBDA_TASK_ROOT}
RUN yum update -y \
&& curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo \
&& yum remove unixODBC-utf16 unixODBC-utf16-devel \
&& ACCEPT_EULA=Y yum install -y msodbcsql17 \
&& ACCEPT_EULA=Y yum install -y mssql-tools \
@csotomon
csotomon / function.json
Last active August 21, 2020 04:18
secured azure function
{
"scriptFile": "__init__.py",
"bindings": [
{
"authLevel": "function",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
@csotomon
csotomon / function.json
Created August 21, 2020 04:11
anonymous functions
{
"scriptFile": "__init__.py",
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
@csotomon
csotomon / __init__.py
Created August 21, 2020 04:01
azure function with pyodbc
import logging
import pyodbc
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
return func.HttpResponse(f"This Azure function rocks. With pyodbc version {pyodbc.version}")
import logging
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
return func.HttpResponse("This Azure function rocks")
@csotomon
csotomon / Dockerfile
Last active August 21, 2020 01:28
Azure Function with dockers lab
# To enable ssh & remote debugging on app service change the base image to the one below
# FROM mcr.microsoft.com/azure-functions/python:3.0-python3.8-appservice
FROM mcr.microsoft.com/azure-functions/python:3.0-python3.8
# install FreeTDS and dependencies
RUN apt-get update \
&& apt-get install unixodbc -y \
&& apt-get install unixodbc-dev -y \
&& apt-get install freetds-dev -y \
&& apt-get install freetds-bin -y \
@csotomon
csotomon / app.component.ts
Created March 22, 2018 15:17
Angular-jQuery app.component.ts
import { Component, OnInit } from '@angular/core';
import * as jQuery from 'jquery';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'app';
@csotomon
csotomon / app.component.html
Created March 22, 2018 15:16
Angular-jQuery app.component.html
<!--The content below is only a placeholder and can be replaced.-->
<div style="text-align:center">
<h1>
Welcome to {{ title }}!
</h1>
</div>
<div id="divHolaMundo"></div>
@csotomon
csotomon / .angular-cli.json
Created March 22, 2018 15:10
Angular-jQuery angular-cli config
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "angular-jquery"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
@csotomon
csotomon / Vagrantfile
Last active April 5, 2024 13:48
Vagrant ubuntu with mysql server
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at