Skip to content

Instantly share code, notes, and snippets.

View MikletNg's full-sized avatar

Mighty Mike MikletNg

View GitHub Profile
@mmansoor
mmansoor / readme.md
Last active June 14, 2024 07:46
Export Metrics from CloudWatch to CSV

Export CloudWatch Metrics

This document outlines how to export CloudWatch Metrics to CSV.

Pre Reqs

  1. AWS CLI (Command Line Interface) from here
  2. jq is a lightweight and flexible command-line JSON processor from here

How to export

@npearce
npearce / install-docker.md
Last active May 21, 2025 14:32
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@shortjared
shortjared / list.txt
Last active June 26, 2025 12:00
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
Updated 2025-01-17 thanks to Yemster's comment.
This should work on any architecture of Amazon Linux 2.
(_Although not tested , should also work for Amazon Linux 2023_).
**Prereq**
- visit https://johnvansickle.com/ffmpeg/ to grab the link to the relevant tarball for your specific server architecture.
- Use `uname -a` to find out your arch if unknown
### TL;DR
@Kartones
Kartones / postgres-cheatsheet.md
Last active July 6, 2025 07:16
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@homam
homam / AWS_S3_File_Upload.js
Created January 27, 2014 10:08
How to upload files to AWS S3 with NodeJS SDK
var AWS = require('aws-sdk'),
fs = require('fs');
// For dev purposes only
AWS.config.update({ accessKeyId: '...', secretAccessKey: '...' });
// Read in the file, convert it to base64, store to S3
fs.readFile('del.txt', function (err, data) {
if (err) { throw err; }
package de.zh32.slp;
import com.google.gson.Gson;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;