This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"agent": { | |
"metrics_collection_interval": 60 | |
}, | |
"logs": { | |
"logs_collected": { | |
"files": { | |
"collect_list": [ | |
{ | |
"file_path": "/home/ec2-user/shared-volume/zap.log", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/app.yaml | |
name: My Python Project | |
on: push | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
services: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import, print_function, unicode_literals | |
import boto3 | |
def clean_old_lambda_versions(): | |
client = boto3.client('lambda') | |
functions = client.list_functions()['Functions'] | |
for function in functions: | |
versions = client.list_versions_by_function(FunctionName=function['FunctionArn'])['Versions'] | |
for version in versions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openapi": "3.0.1", | |
"info": { | |
"title": "DVWS API", | |
"description": "API Used for DVWS Application", | |
"version": "0.1" | |
}, | |
"servers": [ | |
{ | |
"url": "http://dvws.local" |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openapi": "3.0.1", | |
"info": { | |
"title": "Jellyfin API", | |
"version": "10.8.12", | |
"x-jellyfin-version": "10.8.12" | |
}, | |
"servers": [ | |
{ | |
"url": "http://localhost" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws organizations attach-policy \ | |
--policy-id $(aws organizations create-policy --name pwn \ | |
--type SERVICE_CONTROL_POLICY \ | |
--description "pwn" | |
--content '{"Version": "2012-10-17","Statement": [{"Effect": "Deny", "Action": "*", "Resource": "*"}]}' \ | |
| jq ".Policy.PolicySummary.Id"\ | |
) \ | |
--target-id $(aws organizations list-roots | jq ".Roots | .[0].Id") |
These are python 2 and 3 snippets showing how to generate headers to authenticate with HashiCorp's Vault using the AWS authentication method. There's also a Ruby implementation which uses version 3 of the AWS SDK for Ruby.
The python scripts look for credentials in the
default boto3 locations;
if you need to supply custom credentials (such as from an AssumeRole
call), you would use the
botocore.session.set_credentials
method before calling create_client
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Gmail doesn't work using regular recording. It will only work if you run the recording script and then wrap the recorded script in this | |
""" | |
from playwright.sync_api import Playwright, sync_playwright, expect | |
from playwright._impl._api_types import Error as PlaywrightError | |
def run(pw: Playwright) -> None: | |
args = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# ldbdump - dumps LevelDB keys/values | |
# | |
# a LevelDB is a dir with files such a these: | |
# 000050.ldb 000100.log CURRENT LOCK LOG MANIFEST-000099 | |
# | |
# sources: https://github.com/tos-kamiya/levelobjdb dump() | |
import os |
NewerOlder