Skip to content

Instantly share code, notes, and snippets.

image: docker:19.03.10
services:
- docker:dind
variables:
REPOSITORY_URL: <REPOSITORY_URL>
TASK_DEFINITION_NAME: <Task_Definition>
CLUSTER_NAME: <CLUSTER_NAME>
SERVICE_NAME: <SERVICE_NAME>
@rwmotivation
rwmotivation / postgres-brew.md
Created June 27, 2022 15:55 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@rwmotivation
rwmotivation / aws_delete_ami_boto3.py
Created June 26, 2022 08:39 — forked from nirbhabbarat/aws_delete_ami_boto3.py
Delete/Deregister 30 days old AMI in AWS using boto3 and python
#!/usr/bin/env python
##### USE ON YOUR OWN RISK - THIS IS GOING TO DEREGISTER AMI OLDER THAN 30 DAYS
import boto3
from dateutil.parser import parse
import datetime
age = 30
aws_profile_name = 'prod'
def days_old(date):
get_date_obj = parse(date)
@rwmotivation
rwmotivation / batch-delete-gmail-emails.js
Created March 15, 2021 17:14 — forked from gene1wood/batch-delete-gmail-emails.js
A Google Apps Script script to bulk delete large amounts of email in Gmail while avoiding the error #793 which Gmail encounters normally
/*
This script, when used with Google Apps Scripts will delete 500 emails and
can be triggered to run every minute without user interaction enabling you
to bulk delete email in Gmail without getting the #793 error from Gmail.
Configure the search query in the code below to match the type of emails
you want to delete
Browser to https://script.google.com/.
Start a script and paste in the code below.
After you past it in, save it and click the little clock looking button.
Commands
------------
1. Build Docker Image
docker build -t test .
2. Run container /w image
docker run -d --publish 8888:5000 test
3. Login to ECR
aws ecr get-login-password --region REGIONHERE!!!! | docker login --username AWS --password-stdin ACCOUNTIDHERE!!!!.dkr.ecr.REGIONHERE!!!.amazonaws.com
@rwmotivation
rwmotivation / rvm-amazon-linux.bash
Created February 27, 2021 16:31 — forked from kainam00/rvm-amazon-linux.bash
Install RVM on Amazon Linux
#!/bin/bash
# Install prerequisites
yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel ruby-devel gcc-c++ jq git
# Import key
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
# Install RVM
curl -sSL https://get.rvm.io | bash -s stable --ruby
@rwmotivation
rwmotivation / web-servers.md
Created February 3, 2021 18:21 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@rwmotivation
rwmotivation / certrenew.sh
Created December 4, 2020 08:35 — forked from ntotten/certrenew.sh
Script to renew Let's Encrypt certificate and then replace certificate on OpenVPN server
#!/bin/bash
(
DOMAIN="vpn.example.com"
set -eu
certbot renew -q
/usr/local/openvpn_as/scripts/sacli stop
@rwmotivation
rwmotivation / linux-networking-tools.md
Created November 9, 2020 12:35 — forked from miglen/linux-networking-tools.md
Linux networking tools

List of Linux networking tools

netstat (ss)

Displays contents of /proc/net files. It works with the Linux Network Subsystem, it will tell you what the status of ports are ie. open, closed, waiting, masquerade connections. It will also display various other things. It has many different options. Netstat (Network Statistic) command display connection info, routing table information etc. To displays routing table information use option as -r.

Sample output:

Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)    
tcp4 0 0 127.0.0.1.62132 127.0.0.1.http ESTABLISHED
@rwmotivation
rwmotivation / ubuntu.sh
Created September 8, 2020 13:35
Ubuntu 20.04 Stuff
cd ~/Downloads
# Install curl to get GPG keys
sudo apt install -y curl
# Install deb apps
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
wget https://zoom.us/client/latest/zoom_amd64.deb
sudo apt install -y ./*.deb
# Install snap apps