Skip to content

Instantly share code, notes, and snippets.

@lielran
lielran / gist:3673dabdfbd95155b7189b8edd4670ad
Created July 19, 2020 13:20
get cfn stack PhysicalResourceId by resource type
aws cloudformation describe-stack-resources --stack-name $STACK_NAME | jq '.StackResources[]|select(.ResourceType=="AWS::DynamoDB::Table").PhysicalResourceId'
@lielran
lielran / extractModel.sh
Last active September 24, 2019 12:55
Extract custom model
#!/bin/sh
set -e
BASE_MODEL_DIR=$1
BASE_DIR="${AMENITY_PATH:-/data/VSA_Structure}"
CUSTOM_DATA_FOLDER="$BASE_DIR/custom_data"
echo "searching for custom model in the volume ${BASE_MODEL_DIR} to extract before SA engine"
if [ -d $BASE_MODEL_DIR ]
then
echo "Model mount was found. searching for model zip"
@lielran
lielran / cleanup_state_change_set.sh
Created March 11, 2019 14:08
change-set scripts
#!/bin/bash -euv
CHANGE_SET_NAME=${1:-"change-set"}
STAGE=${1:-"dev"}
SERVICE=${2:-"myService"}
STACK_NAME="$SERVICE-$STAGE"
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
lielran / plugin.js
Created March 8, 2019 12:27
AsyncServerlessPlugin
'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 = {};
@lielran
lielran / Aws cognito set user attribute
Last active October 8, 2017 06:59
Aws cognito cli's
aws cognito-idp admin-update-user-attributes
--user-pool-id eu-west-xxxxxx
--username xxxxyyyy@exeample.com
--user-attributes Name=email_verified,Value=true
@lielran
lielran / demo
Created April 20, 2015 19:49
terraform
curl localhost:8500/v1/catalog/nodes
curl localhost:8500/v1/catalog/services
dig @127.0.0.1 -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
@lielran
lielran / remove xml tag
Created June 2, 2014 10:10
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
lielran / Maven Integration(pom) for Android
Last active August 29, 2015 14:02
eXelate mobile SDK integration
<repositories>
<repository>
<id>exelate.repository</id>
<name>exelate-mobile</name>
<url>http://maven.exelate.com:8081/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependency>
@lielran
lielran / Curl -download the latest version
Created June 2, 2014 09:47
eXelate mobile SDK download
curl -o exelate-android-sdk.apklib -u public:exelate -L "http://maven.exelate.com:8081/nexus/service/local/artifact/maven/redirect?r=exelate-mobile&g=com.exelate&a=exelate-android-sdk&v=LATEST&e=apklib"
@lielran
lielran / curl
Created June 2, 2014 08:48
Sonatype Nexus REST api
curl -o file-name.jar -u user:pass -L "http://maven.server.com:8081/nexus/service/local/artifact/maven/redirect?r=[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