bash(1)
can be started in interactive mode or non-interactive mode. It can
also act as a login shell or a non-login shell.
bash(1)
is started in interactive mode by your terminal emulator and can also
be started in interactive mode like this:
bash
\usepackage{sectsty} | |
\sectionfont{\clearpage} |
import boto3 | |
import time | |
from datetime import datetime, timedelta | |
def execute_log_query(log_group, query, days_to_search): | |
start_time = int((datetime.today() - timedelta(days=days_to_search)).timestamp()) | |
end_time=int(datetime.now().timestamp()) | |
client = boto3.client('logs') | |
start_query_response = client.start_query(logGroupName=log_group,startTime=start_time,endTime=end_time,queryString=query,) | |
query_id = start_query_response['queryId'] |
import random | |
import time | |
import boto3 | |
securityhub = boto3.client('securityhub') | |
def configure(mas): | |
if settings.get('MasterAccountId'): |
(There are better ways to do this, such as making a small Python program to load in the data as binary instead of hex—but this is what I did in a pinch and it worked well for what I needed!)
Last executed 2019-06-25 with the v4 dump:
<QueryList> | |
<Query Id="0"> | |
<Select Path="Security"> | |
*[EventData[Data[@Name='QueryName'] and (Data='www.google.com')]] | |
</Select> | |
</Query> | |
</QueryList> |
At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.
git commit --amend
This will open your $EDITOR
and let you change the message. Continue with your usual git push origin master
.
import os, urllib, json, sys | |
import requests | |
import boto3 | |
url_credentials = {} | |
url_credentials['sessionId'] = os.environ['AWS_ACCESS_KEY_ID'] | |
url_credentials['sessionKey'] = os.environ['AWS_SECRET_ACCESS_KEY'] | |
url_credentials['sessionToken'] = os.environ['AWS_SESSION_TOKEN'] | |
json_string_with_temp_credentials = json.dumps(url_credentials) |
REM %1 - AWS credential profile for the AssumRole API call | |
REM %2 - The ARN of the role to assume | |
REM %3 - The name of the newly created role session | |
aws --profile %1 sts assume-role --role-arn %2 --role-session-name %3 | python -c "import sys,json;data=sys.stdin.read();creds=json.loads(data);print(f'set AWS_ACCESS_KEY_ID={creds[""Credentials""][""AccessKeyId""]}');print(f'set AWS_SECRET_ACCESS_KEY={creds[""Credentials""][""SecretAccessKey""]}');print(f'set AWS_SESSION_TOKEN={creds[""Credentials""][""SessionToken""]}')" |
import json | |
import urllib.request | |
import urllib.parse | |
# Global counter for samples from the same domain | |
DOMAIN_COUNTS = {} | |
def get_urls(filename): |