Skip to content

Instantly share code, notes, and snippets.

View lavie's full-sized avatar

assaf lavie

View GitHub Profile
@lavie
lavie / id_rsa.pub
Created July 29, 2018 14:07
Assaf Lavie's public SSH key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAsc1lsWeRLv16aYgtdO374wBRQ+T3w0tULJIjugzRzUOTV+YElWU0pHbPdBqpeKv/5Ab62wc1QD4j0ALi9qvBnVUvPd57zKdiUP7O31eEw9fuYwEP0Ru1nLVwLUmma8JodAiQ+Dw8iLQDEms++xbY0OwGLlQseFDhFoH9tP4VLYXbS/38bjG86sCuK+SLpmqYnCXi64V9SXZk1+JRI7rd0+8Re2T7YL7EqIIKrJIosJLw3Nign2D+6TrP3HnbEVURmKUQUayzS4+pbZ+vHm9XrPLSLpifd9BiETAXmnvrb1Qy8yzO3CjxiPZ3Z9rPlwE1DzKYyQglY5Gb/Jhj417c5Q== b@assaflavie.com
@lavie
lavie / id_rsa.pub
Created July 29, 2018 14:07
Assaf Lavie's public SSH key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAsc1lsWeRLv16aYgtdO374wBRQ+T3w0tULJIjugzRzUOTV+YElWU0pHbPdBqpeKv/5Ab62wc1QD4j0ALi9qvBnVUvPd57zKdiUP7O31eEw9fuYwEP0Ru1nLVwLUmma8JodAiQ+Dw8iLQDEms++xbY0OwGLlQseFDhFoH9tP4VLYXbS/38bjG86sCuK+SLpmqYnCXi64V9SXZk1+JRI7rd0+8Re2T7YL7EqIIKrJIosJLw3Nign2D+6TrP3HnbEVURmKUQUayzS4+pbZ+vHm9XrPLSLpifd9BiETAXmnvrb1Qy8yzO3CjxiPZ3Z9rPlwE1DzKYyQglY5Gb/Jhj417c5Q== b@assaflavie.com
exports.handler = (event, context, callback) => {
const msg = `Hello ${event.name || ‘World’}!`;
callback(null, { status: 200, body: msg });
};
@lavie
lavie / aws.json
Created August 25, 2017 05:28
AWS Console Chrome Bookmarks
{
"regions":[
{
"id":"us-east-1",
"name":"US East",
"location":"N. Virginia"
},
{
"id":"us-east-2",
"name":"US East",
@lavie
lavie / iam.js
Last active June 9, 2018 03:13
Every IAM permission in one page
{
"AWS Database Migration Service": {
StringPrefix: "dms",
Actions: ["AddTagsToResource", "CreateEndpoint", "CreateReplicationInstance", "CreateReplicationSubnetGroup", "CreateReplicationTask", "DeleteEndpoint", "DeleteReplicationInstance", "DeleteReplicationSubnetGroup", "DeleteReplicationTask", "DescribeAccountAttributes", "DescribeConnections", "DescribeEndpointTypes", "DescribeEndpoints", "DescribeOrderableReplicationInstances", "DescribeRefreshSchemasStatus", "DescribeReplicationInstances", "DescribeReplicationSubnetGroups", "DescribeReplicationTasks", "DescribeSchemas", "DescribeTableStatistics", "ListTagsForResource", "ModifyEndpoint", "ModifyReplicationInstance", "ModifyReplicationSubnetGroup", "RefreshSchemas", "RemoveTagsFromResource", "StartReplicationTask", "StopReplicationTask", "TestConnection"],
ARNFormat: "arn:aws:dms:<region>:<account>:<resource>",
ARNRegex: "arn:aws:dms:.+",
HasResource: !1
},
"Amazon Mobile Targeting": {
StringPref
@lavie
lavie / ec2
Last active May 18, 2017 11:32
ssh into ec2 instance with fuzzy search based on ec2 tags
#!/bin/bash -e
# Requirements:
# - fzf
# - aws cli
# - jq
# Optional:
# - GNU Parallel (makes it faster)
@lavie
lavie / replace-asg-instances.sh
Last active August 27, 2018 07:35
Bash script to replace all ASG instances (by flagging them as Unhealthy, ASG does the rest)
#!/bin/bash
# Usage `./replace-asg-instances.sh my-asg-name`
# Will set all instances to Unhealthy, so they are replaced by the ASG.
# Notice this is meant to work with EC2 health-check ASG, not ELB health-checks.
if [[ $1 == "" ]]; then
echo Usage "./replace-asg-instances.sh my-asg-name"
exit 1
fi
node {
stage('build') {
git 'https://github.com/cloudshare/express-ws-chat.git'
cloudshareDockerMachine {
sh 'docker-compose build'
}
}
}
@lavie
lavie / lines.md
Last active November 9, 2023 13:53
line continuations in Vim

How do you append line continuation marks to a block of text at a fixed (maximum + 1) column?

e.g. turning this:

some_command argument 
  -o option1
  --some-flag
  -option 2

Into this:

@lavie
lavie / search_results.js
Last active July 1, 2016 05:58
Adds prefix to google search result links, so they're easier to hit with Vimium
// ==UserScript==
// @name Google Search Result Markers
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Adds prefix to Google search result links, to make it easier to hit them with Vimium
// @author Assaf Lavie
// @match https://*.google.co.il/*
// @match https://*.google.com/*
// @require http://code.jquery.com/jquery-latest.js
// @grant none