Skip to content

Instantly share code, notes, and snippets.

@jameszh
jameszh / ADF_Scale_Azure_SQLDB.json
Created September 7, 2023 15:11 — forked from DaveRuijter/ADF_Scale_Azure_SQLDB.json
Azure Data Factory pipeline definition with a Web Activity to scale an Azure SQL Database. The pipeline is parameterized. The call to Azure SQL is synchronous, hence it waits for the db scale operation to complete.
{
"name": "ADF_Scale_Azure_SQLDB",
"properties": {
"activities": [
{
"name": "ADF_Scale_Azure_SQLDB",
"type": "WebActivity",
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
@jameszh
jameszh / Recursive-descent-backtracking.js
Created January 7, 2023 02:59 — forked from DmitrySoshnikov/Recursive-descent-backtracking.js
Recursive descent parser with simple backtracking
/**
* = Recursive descent parser =
*
* MIT Style License
* By Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
*
* In this short lecture we'll cover the basic (non-predictive, backtracking)
* recursive descent parsing algorithm.
*
* Recursive descent is an LL parser: scan from left to right, doing
@jameszh
jameszh / mwaa-create
Created December 2, 2020 18:27
Create MWAA environment
create-environment:
@aws mwaa --profile $(AWS_PROFILE) create-environment \
--dag-s3-path s3://$(S3_BUCKET)/dags \
--environment-class mw1.small \
--execution-role-arn $(ROLE_ARN) \
--name $(ENVIRONMENT_NAME) \
--max-workers 1 \
--network-configuration SecurityGroupIds=$(SG),SubnetIds=$(PRIVATE_SUBNET1),$(PRIVATE_SUBNET2) \
--source-bucket-arn arn:aws:s3:::$(S3_BUCKET) \
--webserver-access-mode PRIVATE_ONLY \

Keybase proof

I hereby claim:

  • I am jameszh on github.
  • I am jameszh (https://keybase.io/jameszh) on keybase.
  • I have a public key ASBzk-oIbNh3_7oIa5A0kL1jc0YGHMlVaB6gq55khrcFQgo

To claim this, I am signing this object:

@jameszh
jameszh / proxy
Created August 6, 2016 12:20 — forked from sheerun/proxy
Automatic SOCKS proxy setup through SSH connection on Mac OS X
# Script for automatic setup of SOCKS proxy through SSH connection.
# It automatically teardowns SOCKS configuration before stopping.
# It's supposed to work on Mac OS X 10.6+
#
# Author: Adam Stankiewicz (@sheerun)
#
[[ -n "$1" ]] || { echo "Usage: proxy user@example.com"; exit 1; }
# get service GUID and NAME (like Wi-Fi) to set SOCKS proxy
@jameszh
jameszh / proxy.js
Created June 22, 2016 20:10 — forked from nakedible-p/proxy.js
AWS ES proxy
var AWS = require('aws-sdk');
var http = require('http');
var httpProxy = require('http-proxy');
var express = require('express');
var bodyParser = require('body-parser');
var stream = require('stream');
if (process.argv.length != 3) {
console.error('usage: aws-es-proxy <my-cluster-endpoint>');
process.exit(1);
@jameszh
jameszh / BundleConfig.ps1
Last active August 29, 2015 14:26 — forked from mefellows/BundleConfig.ps1
Sysprepped Windows AMI using Packer
$EC2SettingsFile="C:\\Program Files\\Amazon\\Ec2ConfigService\\Settings\\BundleConfig.xml"
$xml = [xml](get-content $EC2SettingsFile)
$xmlElement = $xml.get_DocumentElement()
foreach ($element in $xmlElement.Property)
{
if ($element.Name -eq "AutoSysprep")
{
$element.Value="Yes"
}