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
from sqlalchemy import event | |
import os | |
import logging | |
import sqlalchemy | |
import boto3 | |
import base64 | |
import json | |
from botocore.exceptions import ClientError | |
logger = logging.getLogger() |
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/sh | |
# From - http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf | |
# config: /etc/sysconfig/redis |
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
docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container-name |
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
import * as AWS from "aws-sdk" | |
export const getAMIImageID = async(imageName: string): Promise<string | undefined> => { | |
AWS.config.update({ region: "us-west-2" }) | |
const ec2 = new AWS.EC2() | |
// see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/EC2.html#describeImages-property | |
const params = { | |
Filters: [ | |
{ |
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
/* eslint-disable @typescript-eslint/ban-ts-comment */ | |
// @ts-nocheck | |
// Ripped from https://github.com/koajs/koa/blob/master/test/helpers/context.js | |
// Solution courtesy of user @fl0w. See: https://github.com/koajs/koa/issues/999#issuecomment-309270599 | |
// I've disabled type checking in this file but you are free to add types if you wish | |
// if you want more comprehensive Koa Context object to test stuff like Cookies etc | |
// then use https://www.npmjs.com/package/@shopify/jest-koa-mocks (requires Jest) |
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
# Fedora | |
# If you need an international version of Slack, use this URL: | |
# e.g. Korean: | |
# https://slack.com/intl/ko-kr/downloads/instructions/fedora | |
wget -q https://slack.com/downloads/instructions/fedora -O - \ | |
| tr "\t\r\n'" ' "' \ | |
| grep -i -o '<a[^>]\+href[ ]*=[ \t]*"\(ht\|f\)tps\?:[^"]\+"' \ | |
| sed -e 's/^.*"\([^"]\+\)".*$/\1/g' \ |
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
version: '3' | |
services: | |
database: | |
image: 'mongo' | |
container_name: 'my-mongo-container' # give your contatner a name | |
environment: | |
- MONGO_INITDB_DATABASE=your-database-name # database name you want to make | |
- MONGO_INITDB_ROOT_USERNAME=my-container-root-username # set your container root username | |
- MONGO_INITDB_ROOT_PASSWORD=secret # set your contatner root password | |
volumes: |
Are you tired of having to run docker as root? Well look no further, the solution is here. The instructions below were tested on Ubuntu 20.04
First, if you haven't already, install and enable docker:
sudo apt update && sudo apt install docker.io --yes
sudo systemctl enable --now docker
Download latest docker compose (or replace latest
in url with desired version number):
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 | |
# CREDITS | |
# Author: Markus Geiger <mg@evolution515.net> | |
# Permission to copy and modify is granted under the Creative Commons Attribution 4.0 license | |
# Updated by Bluerayne: https://gist.github.com/blurayne/f63c5a8521c0eeab8e9afd8baa45c65e | |
# INSPIRED BY | |
# - https://serverfault.com/questions/144939/multi-select-menu-in-bash-script | |
# https://www.bughunter2k.de/blog/cursor-controlled-selectmenu-in-bash |