Skip to content

Instantly share code, notes, and snippets.

View robomfeinberg's full-sized avatar

Matthew Feinberg robomfeinberg

View GitHub Profile

Both things have been introduced recently, and let you access even private ec2 instances

  1. Without VPN
  2. No open SSH port
  3. Authentication / Authorization is fully delegated to IAM
# Assumes valid AWS Credentials in ENV
@sgtoj
sgtoj / copy_sm_secrets.py
Last active May 17, 2024 12:03
Python script to copy AWS SecretsManager Secrets
#!/usr/bin/env python3
import os
import sys
import boto3
from botocore.exceptions import ClientError
# -------------------------------------------------------------------- main ---
@xuannghia
xuannghia / Initial-Server-CentOS-7.md
Last active October 28, 2020 19:58
Initial Server CentOS 7 - with NGINX, PHP 7.2, MariaDB 10.2, PostgreSQL 10 ,phpMyAdmin 4.8, MongoDB, Redis, Python3.6, NodeJS 10.15.3

1. Add Repositories

EPEL repository

sudo yum install -y epel-release

SCLo Software collections Repository

yum -y install centos-release-scl-rh centos-release-scl

Remi repository

@siddharthkrish
siddharthkrish / version.sh
Created July 3, 2017 15:14
simple bash script to increment the version number of the format major.minor.build
#!/bin/bash
version="$1"
major=0
minor=0
build=0
# break down the version number into it's components
regex="([0-9]+).([0-9]+).([0-9]+)"
if [[ $version =~ $regex ]]; then
@martinapugliese
martinapugliese / boto_dynamodb_methods.py
Last active June 3, 2021 21:59
Some wrapper methods to deal with DynamoDB databases in Python, using boto3.
# Copyright (C) 2016 Martina Pugliese
from boto3 import resource
from boto3.dynamodb.conditions import Key
# The boto3 dynamoDB resource
dynamodb_resource = resource('dynamodb')
def get_table_metadata(table_name):
@natemccurdy
natemccurdy / node_classifier_backup.sh
Last active April 11, 2018 16:03
Puppet - Node Classifier Backup
#!/bin/bash
# GIST_URL: https://gist.github.com/natemccurdy/d1abe94f9688de9d7ea38bfd3b2e8d43
# Dumps the Node Classifier groups to a file. This file can be used to restore classification.
#
SCRIPTNAME="$(basename "$0")"
PATH="/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/opt/puppet/bin:$PATH"
PE_CERT=$(puppet agent --configprint hostcert)
PE_KEY=$(puppet agent --configprint hostprivkey)
PE_CA=$(puppet agent --configprint localcacert)
@vinovator
vinovator / checkDuplicates.py
Last active May 17, 2024 09:13
Python script to find duplicate files from a folder
# checkDuplicates.py
# Python 2.7.6
"""
Given a folder, walk through all files within the folder and subfolders
and get list of all files that are duplicates
The md5 checcksum for each file will determine the duplicates
"""
import os
@nikolazic
nikolazic / tar_magento_media_exclude.sh
Last active September 9, 2021 14:38
Tar Magento Media directory excluding cache files
tar -cvf ~/media-`date +%Y%m%d`.tar --exclude-vcs --exclude='*.htaccess' --exclude='*/cache/*' --exclude='*/cache' --exclude='*/.thumbs/*' --exclude='*/.thumbs' --exclude='*/tmp/*' --exclude='*/tmp' --exclude='*/js/*' --exclude='*/js' --exclude='*/css/*' --exclude='*/css' --exclude='*/captcha/*' --exclude='*/captcha' --exclude='*/css_secure/*' --exclude='*/css_secure' --exclude='*/customer/*' --exclude='*/customer' --exclude='*/dhl/*' --exclude='*/dhl' --exclude='*/downloadable/*' --exclude='*/downloadable' --exclude='*/xmlconnect/*' --exclude='*/xmlconnect' media