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/env python3 | |
# | |
# AUTHOR: Jardel Weyrich <jweyrich at gmail dot com> | |
# | |
import argparse | |
import os | |
import subprocess | |
DEFAULT_DOTENV_FILE = '.env.dev' | |
DEFAULT_PROFILE = 'default' |
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
interface TimeUnit { | |
[key: string]: number; | |
} | |
const TIME_UNITS: TimeUnit = { | |
"year": 3.154e+10, | |
"month": 2.628e+9, | |
"week": 6.048e+8, | |
"day": 8.64e+7, | |
"hour": 3.6e+6, |
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
psql -h <host> -U <user> -W -d postgres | |
SELECT * from pg_stat_activity; | |
SELECT * from pg_stat_database; | |
# Queries running during >5 minutes | |
SELECT | |
pid, | |
datname, | |
query, |
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
#pragma once | |
//#include <cassert> | |
#include <iostream> | |
#include <openssl/evp.h> | |
#include <openssl/pem.h> | |
#include "sslpkix/iosink.h" | |
#include "sslpkix/common.h" | |
namespace sslpkix { |
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
UPDATE wp_options SET option_value = replace(option_value, 'https://OLDDOMAIN', 'https://NEWDOMAIN') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'https://OLDDOMAIN','https://NEWDOMAIN'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'https://OLDDOMAIN', 'https://NEWDOMAIN'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://OLDDOMAIN','https://NEWDOMAIN'); |
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
SELECT * | |
FROM sys.dm_exec_requests | |
CROSS APPLY sys.dm_exec_sql_text(sql_handle); | |
SELECT TOP 30 | |
creation_time | |
, last_execution_time | |
, total_physical_reads | |
, total_logical_reads |
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
# Enable packet forwarding | |
net.ipv4.ip_forward = 1 | |
# Disable ICMP redirects | |
net.ipv4.conf.eth0.send_redirects = 0 |
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 | |
PROFILE=default | |
REGION=us-east-1 | |
aws --profile=$PROFILE --region=$REGION --output=text ec2 describe-instances \ | |
--query "Reservations[*].Instances[*].[InstanceType, State.Name, Platform, Tags[?Key=='Name']]" | |
aws --profile=$PROFILE --region=$REGION --output=json ec2 describe-instances \ | |
| jq '.Reservations[].Instances[] | "\(.InstanceType); \(.State.Name); \(.Platform); \(.Tags[]//[]|select(.Key=="Name")|.Value)"' |
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 | |
SAMPLES_DIRECTORY="../pev/samples/" | |
OUTPUT_FILE="result.json" | |
PEV_TOOL_COMMAND="./src/build/readpe -f json" | |
# npm install jsonlint -g | |
LINTER_COMMAND="jsonlint" | |
counter=0 |
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
# Change the following to your desired values: | |
# __ACCOUNT_NUMBER__ | |
# __ECR_REGION__ | |
# __ECR_REPOSITORY_NAME__ | |
# __ECS_CONTAINER_NAME__ | |
version: 0.2 | |
phases: | |
install: | |
runtime-versions: |