Skip to content

Instantly share code, notes, and snippets.

View markdavidburke's full-sized avatar
🎯
Focusing

Mark Burke markdavidburke

🎯
Focusing
View GitHub Profile
@virtualbeck
virtualbeck / ecr_copy.sh
Last active February 18, 2024 02:32
copy n number of tagged docker images from one aws ecr account to another
#!/bin/bash
set -e
################################# UPDATE THESE #################################
LAST_N_TAGS=10
SOURCE_REGION="us-west-1"
DESTINATION_REGION="us-east-1"
SOURCE_PROFILE="profile_1"
@ShvaykaD
ShvaykaD / upgrade-postgresql-service-centos-7.md
Created May 4, 2020 16:29
Upgrading PostgreSQL service from 9.x or 10.x to 11 version on CentOS 7
@kasuken
kasuken / profiles.json
Created June 23, 2019 12:22
Windows Terminal settings and files
{
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
{
#!/bin/bash
# IMPORTANT: Make sure your VM's network security rules allows access over TCP Port 80.
# This is required to pass the HTTP challenge.
# Download: curl -o setup.sh <raw URL of this gist>
# Enable execution: sudo chmod +x setup.sh
# Run: ./setup.sh -d "yourdomain.tld" -e "youremail@yourdomain.tld"
while getopts d:e: option
@Ray33
Ray33 / gist:ba189a729d81babc99d7cef0fb6fbcd8
Last active July 22, 2022 10:50 — forked from SamCyanide/gist:780afff4c3e1a9e105264c2a476e037c
Amazon Elastic Network Adapter (ENA) on CentOS 7
sudo su
yum --enablerepo=extras install epel-release
yum -y install patch dkms kernel-devel perl
yum update
#Required for kernel num 5:
yum --enablerepo=elrepo-kernel -y install kernel-ml-devel
reboot
@DRN88
DRN88 / send-aws-sns-sms.sh
Last active January 11, 2023 13:46
Send aws sns sms messages with bash. Zabbix
#!/bin/bash
#
# 1, Create AWS IAM user with a policy allowing only AWS SNS Publish command
# 2, Install awscli with 'yum -y install awscli' on zabbix server
# 3, Add /bin/bash shell for zabbix user: usermod -s /bin/bash zabbix
# 4, Deploy this script to: /etc/zabbix/send-aws-sns-sms.sh
# 5, Edit this script and define the required variables
# 6, Run the script manually to test
# 7, Use the script in Zabbix. Create a new Media Type -> Script
# Use zabbix documentation for the script parameter setup
@Nyr
Nyr / openvpn-useradd-bulk.sh
Last active October 2, 2023 03:50
Simple script for adding users in bulk to an openvpn-install setup
#!/bin/bash
# Fast way for adding lots of users to an openvpn-install setup
# See the main openvpn-install project here: https://github.com/Nyr/openvpn-install
# openvpn-useradd-bulk is NOT supported or maintained and could become obsolete or broken in the future
# Created to satisfy the requirements here: https://github.com/Nyr/openvpn-install/issues/435
if readlink /proc/$$/exe | grep -qs "dash"; then
echo "This script needs to be run with bash, not sh"
exit 1
@47ronin
47ronin / yt-dlp.sh
Last active April 7, 2024 06:28
Use yt-dlp to merge best video and best audio formats together into an MPEG-4 container, check for AV1/VP9, and transcode to H.264 if necessary. Usage: ./yt-dlp.sh <video_url>
#!/bin/bash
youtube_url="$1"
echo "Downloading video..."
video_info=$(yt-dlp -e -o "%(title)s" -- "$youtube_url")
sanitized_title=$(echo "$video_info" | sed 's/[^a-zA-Z0-9_.-]/_/g')
output_file="${sanitized_title}.mp4"
yt-dlp -o "temp.mp4" -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -- "$youtube_url"
@jabez007
jabez007 / Install-Barnyard.sh
Created February 12, 2018 15:02
A simple Bash script for install Snort and Barnyard on Cent OS 7 from source
!/bin/bash
# Set the internal field separator
IFS=$'\n'
##
# Install pre-reqs
##
yum install libtool autoconf git
@eldondevcg
eldondevcg / README.md
Last active November 18, 2020 10:31
Cross account bucket access for IAM roles

For: https://www.reddit.com/r/aws/comments/5jf7fb/permissions_for_lambda_accessing_s3_buckets_in/

This is a little tricky, because it requires several different moving parts, specifically,

  • the lambda task that you want to execute the copy must have IAM access to the bucket in the other account. This is not something that was obvious to me to begin with, although my use case was more complicated.
  • the bucket policy on the destination account must be set to permit your lambda function to write to that bucket. For my special use cases, I have to upload a new bucket policy daily to the receiving buckets. Alternatively, the destination accounts could probably give your a cross-account IAM role to upload the bucket policy yourself.
  • You will likely want to write your objects with the bucket-owner-full-control acl, http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html otherwise, the bucket owner may not be able to download them.