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
#!/bin/bash | |
# This script performs DNS queries to collect records for a given domain. | |
# It queries for ANY and AXFR records, as well as 'A' records for common subdomains. | |
# If nameservers are provided as arguments, it uses those. Otherwise, it finds | |
# and uses the authoritative nameservers for the domain. | |
# by sherwin@daganato.com, 2003-03-15 | |
# Check if at least the domain is provided | |
if [ "$#" -lt 1 ]; then |
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
Adopt the role of Software Engineering Mastermind 🧠, a master of all aspects of software engineering, from design and development to security and testing to documentation and delivery. | |
I want you to build [Application to build]. | |
To do so, you will: | |
1. First, reason about how you will approach this. Generate at least three possible approaches, and explain the pros and cons of each. | |
2. Then, ask yourself some questions to reflect on your approaches. For example: How feasible is each approach? How efficient is each approach? How creative is each approach? How can each approach be improved? | |
3. Next, evaluate your approaches based on your reflection. Assign a score to each approach from 1 to 10, where 10 is the best. Explain why you gave each score. | |
4. Finally, choose the best approach based on your evaluation. Write the code, file by file, in full. |
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
#!/bin/bash | |
# Pulls an alarm and its events from AT&T's Alienvault USM Anywhere | |
# by Sherwin Daganato, 20210523 | |
# | |
# USAGE: | |
# ./alienvault-get_alarm.sh https://<usm-host>.alienvault.cloud/#/alarm/5c931059-11cc-489d-b378-83f2d452fdf6 | |
# ./alienvault-get_alarm.sh 5c931059-11cc-489d-b378-83f2d452fdf6 | |
# | |
# Requires API Client credentials which can be created by: | |
# |
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
## $ docker build -t myansible . | |
## $ export AWS_PROFILE="..." | |
## $ docker run -it --rm -e AWS_PROFILE \ | |
## -e MY_UID=$(id -u) -e MY_GID=$(id -g) \ | |
## -v ${HOME}/.aws/config:/home/user/.aws/config:ro \ | |
## -v ${HOME}/.aws/credentials:/home/user/.aws/credentials:ro \ | |
## -v ${HOME}/.ssh/:/home/user/.ssh/:ro \ | |
## -v $(pwd):/work \ | |
## --workdir=/work myansible ansible -i inventory all -m ping | |
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
resource "aws_security_group" "main_resolver_inbound" { | |
name = "main-resolver-inbound" | |
description = "Main Route53 resolver inbound" | |
vpc_id = module.vpc_main.vpc_id | |
ingress { | |
from_port = 53 | |
to_port = 53 | |
protocol = "udp" |
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
pyenv install 3.8.2 | |
pyenv global 3.8.2 | |
pyenv virtualenv ansible29 | |
pyenv activate ansible29 | |
pip install --upgrade pip | |
pip install ansible~=2.9.0 awscli pycrypto netaddr boto boto3 | |
pyenv rehash | |
pyenv deactivate |
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
- hosts: server | |
vars: | |
vol_new_size: 50 | |
vol_drive: /dev/sdf | |
tasks: | |
- name: Gathering ec2 metada facts | |
ec2_metadata_facts: |
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
#!/bin/sh | |
# | |
# Reads and expands a crontab into a 24hour timeline: | |
# | |
# For each scheduled cron event... | |
# ... outputs the event's time (hh:mm) followed by the event's crontab entry | |
# | |
# This output is sorted into a cron event timeline (however it is still | |
# up to the reader to decode/determine which events run on which days). | |
# |
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
#!/bin/bash | |
# rds-top.sh | |
# by <sherwin@daganato.com>, 20190822 | |
# based on the work of Matheus de Oliveira <matioli.matheus@gmail.com> | |
# | |
# Usage: | |
# ./rds-top.sh rds-instance | |
# ./rds-top.sh --start-time=$(date -v-13d +%s) rds-instance | |
# ./rds-top.sh --sort-by-mem --start-time=$(date -j -f "%Y-%m-%dT%H:%M:%S%z" "2019-09-12T13:05:00+0000" +%s) rds-instance | grep -v 'idle$' |
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
//@version=3 | |
// | |
// Commitments of Traders (COT) - Net Positions of Non-Commercial Traders | |
// | |
// See Also: | |
// - https://www.cftc.gov/MarketReports/CommitmentsofTraders/index.htm | |
// - https://www.investopedia.com/walkthrough/forex/trading-strategies/long-term/cot-report.aspx | |
// - https://www.oanda.com/forex-trading/analysis/commitments-of-traders | |
// - https://www.babypips.com/learn/forex/commitment-of-traders-report | |
// |
NewerOlder