Skip to content

Instantly share code, notes, and snippets.

View tecmaverick's full-sized avatar

AbrahamJP tecmaverick

View GitHub Profile
@tecmaverick
tecmaverick / SqlDbType2DbType.cs
Last active March 23, 2022 04:47
Convert .Net Type to SqlDbType or DbType and vise versa
//Convert .Net Type to SqlDbType or DbType and vise versa
//This class can be useful when you make conversion between types .The class supports conversion between .Net Type , SqlDbType and DbType .
using System;
using System.Collections;
using System.Data;
namespace Devintelligence.Common.Data
{
/// <summary>
@tecmaverick
tecmaverick / ULS Log Entries
Created July 11, 2011 19:17
SharePoint 2010 Sandbox Code
01:25:18.94 SPUCHostService.exe (0x0A8C) 0x0D58 SharePoint Foundation Sandboxed Code Service fe8a Medium - - Unable to activate worker process proxy object within the worker process: ipc://fe3bdb40-dbc3-4322-b772-b34a5752336c:7000
01:25:18.94 SPUCHostService.exe (0x0A8C) 0x0D58 SharePoint Foundation Sandboxed Code Service fe8c Medium - - Error activating the worker process manager instance within the worker process. - Inner Exception: System.InvalidOperationException: Unable to activate worker process proxy object within the worker process: ipc://fe3bdb40-dbc3-4322-b772-b34a5752336c:7000 at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWorkerProcessProxies()
01:25:18.94 SPUCHostService.exe (0x0A8C) 0x0D58 SharePoint Foundation Sandboxed Code Service ei0t Medium - Process creation/initialization threw an exception. Stopping this process. "ipc://fe3bdb40-dbc3-4322-b772-b34a5752336c:7000"
@tecmaverick
tecmaverick / LINQTest.cs
Created August 4, 2012 06:46
LINQ Test
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Xml.Linq;
namespace LINQTest
{
class Program
mkcd() { mkdir -p "$@" && cd "$_"; }
..() { cd .. }
alias cls='clear'
alias ls='ls -altrh'
alias rmd='rm -rf $@'
## convert HTML POST data or HTTP GET query string to JSON
## get the raw post data from the AWS built-in variable and give it a nicer name
#if ($context.httpMethod == "POST")
#set($rawAPIData = $input.path("$"))
#elseif ($context.httpMethod == "GET")
#set($rawAPIData = $input.params().querystring)
#set($rawAPIData = $rawAPIData.toString())
#set($rawAPIDataLength = $rawAPIData.length() - 1)
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength))
## convert HTML POST data or HTTP GET query string to JSON
## get the raw post data from the AWS built-in variable and give it a nicer name
#if ($context.httpMethod == "POST")
#set($rawAPIData = $input.path("$"))
#elseif ($context.httpMethod == "GET")
#set($rawAPIData = $input.params().querystring)
#set($rawAPIData = $rawAPIData.toString())
#set($rawAPIDataLength = $rawAPIData.length() - 1)
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength))
@tecmaverick
tecmaverick / DeleteENIs
Created August 30, 2018 00:55
View and delete ENIs created by lambda in "available" status
#Specify the region you want to run your scripts
region_val="ap-southeast-2"
#View Lambda function name asscoiated with ENIs in *in-use* status in a specific AWS region
aws ec2 describe-network-interfaces \
--filters "Name=description,Values='AWS Lambda VPC ENI*'" "Name=status,Values='in-use'" \
--query "NetworkInterfaces[].[RequesterId,Status,NetworkInterfaceId]" \
--output text --region $region_val
#View Lambda function name asscoiated with ENIs in *available* status in a specific AWS region
@tecmaverick
tecmaverick / SearchLambdaFunctionByName
Created August 30, 2018 02:37
Search Lambda functions by name across all AWS region
#Search for lambda function by partial name across all AWS regions
#Excluding ap-northeast-3 region because of exception while calling list-functions for this region
aws ec2 describe-regions \
--query 'Regions[?RegionName!=`ap-northeast-3`].[RegionName]' \
--output text | \
xargs -I {} \
aws lambda list-functions \
--query "Functions[].[FunctionArn]" \
--output text --region {} | \
@tecmaverick
tecmaverick / AWSServiceSupportedRegions
Last active August 30, 2018 04:46
Python boto3 script to view supported regions for an AWS service
#Before executing the script ensure you have the latest version of AWS CLI installed
#pip install awscli --upgrade
import boto3
s = boto3.Session()
print s.get_available_regions("lambda")
@tecmaverick
tecmaverick / AWSServiceNames
Created August 30, 2018 04:41
View AWS service names to be used for invoking API from postman
#Note for invoking customer created APIGateway endpoint the servicename should be execute-api instead of apigateway
import boto3
s = boto3.Session()
print s.get_available_services()