Skip to content

Instantly share code, notes, and snippets.

lielran / gist:3673dabdfbd95155b7189b8edd4670ad
Created Jul 19, 2020
get cfn stack PhysicalResourceId by resource type
View gist:3673dabdfbd95155b7189b8edd4670ad
aws cloudformation describe-stack-resources --stack-name $STACK_NAME | jq '.StackResources[]|select(.ResourceType=="AWS::DynamoDB::Table").PhysicalResourceId'
lielran /
Last active Sep 24, 2019
Extract custom model
set -e
echo "searching for custom model in the volume ${BASE_MODEL_DIR} to extract before SA engine"
if [ -d $BASE_MODEL_DIR ]
echo "Model mount was found. searching for model zip"
#!/bin/bash -euv
changeSetId=$(aws describe-change-set --change-set-name "$CHANGE_SET_NAME" --stack-name "$STACK_NAME" | jq -r '.ChangeSetId')
aws cloudformation delete-change-set --change-set-name "$changeSetId"
lielran / plugin.js
Created Mar 8, 2019
View plugin.js
'use strict';
const BbPromise = require('bluebird');
class ServerlessPlugin {
constructor(serverless, options) {
this.serverless = serverless;
this.options = options;
this.log = this.serverless.cli.log.bind(this);
this.commands = {};
View Aws cognito set user attribute
aws cognito-idp admin-update-user-attributes
--user-pool-id eu-west-xxxxxx
--user-attributes Name=email_verified,Value=true
View demo
curl localhost:8500/v1/catalog/nodes
curl localhost:8500/v1/catalog/services
dig @ -p 8600 consul.service.consul SRV
curl -v http://localhost:8500/v1/kv/?recurse
curl -X PUT -d 'test' http://localhost:8500/v1/kv/web/key1
curl -X PUT -d 'test' http://localhost:8500/v1/kv/web/key2?flags=42
View remove xml tag
TAG= "<percentageFloat>10.654656</percentageFloat>"
#expected = 10.654656
temp=$(echo $TAG |sed 's/[/]//g')
res=$(echo $temp |sed 's/[<percentageFloat>]//g')
lielran / Maven Integration(pom) for Android
Last active Aug 29, 2015
eXelate mobile SDK integration
View Maven Integration(pom) for Android
View Curl -download the latest version
curl -o exelate-android-sdk.apklib -u public:exelate -L ""
lielran / curl
Created Jun 2, 2014
Sonatype Nexus REST api
View curl
curl -o file-name.jar -u user:pass -L "[Repository id e.g. snapshot]&g=[GROUP-ID]&a=[ARTIFACT-ID]&v=[Version e.g. LATEST]&p=[pkg e.g. jar/war/ear/...]"
r - parameter is the maven repository - e.g. snapshot/release/3rd party
g - parameter is the maven groupid -e.g. com.exelate.datalinx or com.exelate.bdi
a - parameter is the maven artifactid(name of the project) - e.g. datalinx-backend or data-processor
v - parameter - version number e.g. LATEST or 1.0.0 or 1.0.0-SNAPSHOT