Skip to content

Instantly share code, notes, and snippets.

@KensoDev
KensoDev / main.py
Last active May 10, 2023 11:17
Lambda function to notify slack on ECS failed deployments
"""
Get notification from ECS when a deployment is failing. Post to slack
This lambda function receives a notification from a cloudwatch log filter when
an ECS deployment fails, it creates a hash based on the cluster arn and then
task definition and saves the file in S3.
To make sure we don't get duplicate, if we already have a file in S3, we don't
resend the notification.
local M = {}
M.WinMove = function(command_key)
local curwin = vim.api.nvim_get_current_win()
vim.cmd(string.format("wincmd %s", command_key))
if curwin == vim.api.nvim_get_current_win() then
if command_key:match("[jk]") then
vim.cmd("wincmd v")
{
"Volumes": [
{
"AvailabilityZone": "us-west-2a",
"Attachments": [
{
"AttachTime": "2013-09-17T00:55:03.000Z",
"InstanceId": "i-a071c394",
"VolumeId": "vol-e11a5288",
"State": "attached",
{
"DBInstances": [
{
"PubliclyAccessible": false,
"MasterUsername": "mymasteruser",
"MonitoringInterval": 0,
"LicenseModel": "general-public-license",
"VpcSecurityGroups": [
{
"Status": "active",
" .vimrc / init.vim
" The following vim/neovim configuration works for both Vim and NeoVim
" ensure vim-plug is installed and then load it
call functions#PlugLoad()
call plug#begin('~/.config/nvim/plugged')
" General {{{
" Abbreviations
abbr funciton function
@KensoDev
KensoDev / delete-versions.sh
Created March 16, 2016 05:33
Delete old ElasticBeanstalk application versios
echo "Starting to delete versions of $APP"
while read ver; do
echo "Deleting version $ver"
aws elasticbeanstalk delete-application-version --version-label $ver --profile $PROFILE --application-name $APP
echo "Version $ver deleted!"
done
function isGreatThanTen(num) {
if (num > 10) {
return true
}
return false;
}
Performing ProcessImagesJob from DelayedJob(high_priority) with arguments: "GalleryImage", 69953, "image", ["small", "medium"]
GalleryImage Load (1.2ms) SELECT "gallery_images".* FROM "gallery_images" WHERE "gallery_images"."id" = $1 LIMIT 1 [["id", 69953]]
assets-funzing-dev.s3.amazonaws.com
443
0
1
false
assets-funzing-dev.s3.amazonaws.com
8.8.8.8 10 ms 10 ms 9 ms 21 ms 48 ms 77 ms 10 ms 22 ms 10 ms 49 ms 26.60
8.8.4.4 10 ms 10 ms 11 ms 9 ms 31 ms 172 ms 11 ms 38 ms 10 ms 10 ms 31.20
cloudflare 10 ms 10 ms 11 ms 11 ms 17 ms 11 ms 10 ms 15 ms 11 ms 15 ms 12.10
level3 15 ms 10 ms 10 ms 9 ms 11 ms 12 ms 11 ms 14 ms 10 ms 12 ms 11.40
google 19 ms 9 ms 13 ms 28 ms 51 ms 68 ms 14 ms 22 ms 10 ms 29 ms 26.30
quad9 11 ms 10 ms 16 ms 17 ms 10 ms 22 ms 21 ms 32 ms 20 ms 65 ms 22.40
freenom 33 ms 47 ms 34 ms 31 ms 75 ms 93 ms 32 ms 49 ms 44 ms 62 ms 50.00
opendns 10 ms 11 ms 22 ms 39 ms 11 ms 49 ms 10 ms 48 ms 10 ms 21 ms 23.10
norton 13 ms 11 ms 14 ms 11 ms 12 ms 16 ms 11 ms 11 ms 11 ms 12 ms 12.20
cleanbrowsing 18 ms 36 ms 24 ms 18 ms 18 ms 159 ms 18 m
import csv
import urllib2
import sys
import multiprocessing
with open("users.csv", 'r') as csvfile:
rows = [row for row in csv.reader(csvfile)]
csvfile.close()
def check(row):