Skip to content

Instantly share code, notes, and snippets.

@bryan-lott
bryan-lott / user.behaviors
Last active August 27, 2016 14:16
Lighttable user.behaviors file
;; User behaviors
;; -----------------------------
;; Modify this file to add and subtract behaviors. Behaviors allow customization of
;; almost any aspect of LightTable e.g. show line numbers or current theme.
;; A behavior has the following format:
;;
;; [:TAG :BEHAVIOR OPTIONAL_ARGUMENTS]
;;
;; * A tag indicates in what context the behavior applies. Common tags are :app and :editor which respectively
;; indicate the behavior can be used anywhere and the behavior only applies to editors.
Parinfer
go-outline
multi-cursor
go-plus
nord-atom-syntax
Sublime-Style-Column-Selection
go-signature-statusbar
nord-atom-ui
ariake-dark-syntax
highlight-line
DavidAnson.vscode-markdownlint-0.7.2
lei.theme-chromodynamics-1.0.8
HookyQR.beautify-1.0.2
lukehoban.go-0.6.61
PeterJausovec.vscode-docker-0.0.14
mohsen1.prettify-json-0.0.3
RoscoP.ActiveFileInStatusBar-1.0.2
ms-vscode.sublime-keybindings-2.0.1
Stephanvs.dot-0.0.1
mushan.vscode-open-iterm2-0.0.2
@bryan-lott
bryan-lott / dict_map_bools_to_strings.py
Created February 28, 2018 21:41
python dict mapping bools to strings
bool_val = True
result = {True: 'IS', False: 'IS NOT'}[bool_val]
print("Mapping {} awesome".format(result))
@bryan-lott
bryan-lott / move.py
Created July 13, 2018 15:42
Move files from one folder to another
import shutil
import os
src = 'source'
dst = 'destination'
for f in os.listdir(src):
shutil.move(os.path.join(src, f), dst)

Keybase proof

I hereby claim:

  • I am bryan-lott on github.
  • I am bryanlott (https://keybase.io/bryanlott) on keybase.
  • I have a public key whose fingerprint is 49F8 B969 D780 8AAF 9D4D 56EF 5F23 2B86 00FE 4BB5

To claim this, I am signing this object:

@bryan-lott
bryan-lott / ecs_find_by_ip.py
Last active July 22, 2020 00:52
Search all of AWS ECS for Private IP Address
ip_address = '123.456.789.012'
import boto3
from pprint import pprint
ecs = boto3.client('ecs')
for cluster in ecs.list_clusters()['clusterArns']:
arns = ecs.list_tasks(cluster=cluster)['taskArns']
if arns:
for t in ecs.describe_tasks(cluster=cluster, tasks=arns)['tasks']:
for c in t['containers']:
@bryan-lott
bryan-lott / cloudwatch_export_all_logs_to_s3.py
Created July 28, 2020 21:04
Export all logs to s3 from cloudwatch over a date range
# requires https://pypi.org/project/retry for the create export
import boto3
from retry.api import retry_call
from_time: int = 0 # start time
to_time: int = 0 # end time
destination: str = '' # destination s3 bucket
destination_prefix: str = 'CloudWatchLogs' # key prefix inside the bucket
cw = boto3.client('logs')