This file contains hidden or 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 public.ecr.aws/amazonlinux/amazonlinux:2023 | |
RUN dnf install -y wget tar gzip make gcc | |
RUN wget http://download.redis.io/redis-stable.tar.gz && \ | |
tar -xvzf redis-stable.tar.gz && \ | |
cd redis-stable && \ | |
make && \ | |
cp src/redis-cli /usr/local/bin/ && \ | |
chmod 755 /usr/local/bin/redis-cli |
This file contains hidden or 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
# 0. Install git/python3/last pip version (requires 9.0.3 or later) | |
sudo yum install -y git python3 | |
curl -O https://bootstrap.pypa.io/get-pip.py | |
python3 get-pip.py --user | |
pip --version | |
# 1. Install GRC from pip | |
pip install git-remote-codecommit | |
# 2. Setup AWS service account credentials |
This file contains hidden or 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
# Manually install vscode server when the remote EC2 is off-network. | |
commit="f1e16e1e6214d7c44d078b1f0607b2388f29d729" # Version: 1.91.1 (Help > About) | |
mkdir -p /home/$USER/.vscode-server/bin/$commit | |
wget https://update.code.visualstudio.com/commit:$commit/server-linux-x64/stable | |
tar -xvf stable -C /home/$USER/.vscode-server/bin/$commit | |
# Optional - CLI | |
#wget https://update.code.visualstudio.com/commit:$commit/cli-linux-x64/stable -O vscode-cli-$commit.tar.gz |
This file contains hidden or 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
/** | |
* package.json : "type": "module" / "java-parser": "^2.3.0" | |
* tsconfig.json: "esModuleInterop": true / "target": "es2020" / "esModuleInterop": true | |
*/ | |
import { readFileSync } from 'fs'; | |
import { BaseJavaCstVisitorWithDefaults, ClassDeclarationCtx, ClassMemberDeclarationCtx, CstNode, EnumDeclarationCtx, MethodDeclarationCtx, ModularCompilationUnitCtx, OrdinaryCompilationUnitCtx, PackageDeclarationCtx, TypeDeclarationCtx, parse } from 'java-parser'; | |
import { Utils } from './utils'; | |
export enum ElementType { | |
PACKAGE = "package", |
This file contains hidden or 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
// Create a new VPC endpoint for Secrets Manager | |
const vpcEndpoint = vpc.addInterfaceEndpoint(`${id}SecretsManagerEndpoint`, { | |
service: ec2.InterfaceVpcEndpointAwsService.SECRETS_MANAGER, | |
subnets: {subnets: [...allSubnets]} as ec2.SubnetSelection, | |
securityGroups: [yourSecurityGroup], | |
}); | |
vpcEndpoint.applyRemovalPolicy(cdk.RemovalPolicy.DESTROY); | |
cdk.Tags.of(vpcEndpoint).add(`Name`, `endpoint-secretsmanager`); // Not fixed https://github.com/aws/aws-cdk/issues/19332 |
This file contains hidden or 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 SecretManager from "aws-sdk/clients/secretsmanager"; | |
import { AWSError } from 'aws-sdk/lib/error'; | |
const [region, accessKeyId, secretAccessKey, sessionToken] = [ | |
process.env.AWS_REGION, | |
process.env.AWS_ACCESS_KEY_ID || "", | |
process.env.AWS_SECRET_ACCESS_KEY || "", | |
process.env.AWS_SESSION_TOKEN || "" | |
]; | |
const client = new SecretManager({ |
This file contains hidden or 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
/** | |
* Test connection on any PostgreSQL-like database | |
*/ | |
const pg = require('pg'); | |
const username="XXX"; | |
const password="XXX"; | |
const hostname="XXX"; | |
const dbname="XXX"; | |
const port=5432; |
This file contains hidden or 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
# Last test on RHEL 6.11 (with 4 Gb, 2vCPU) | |
sudo yum update -y | |
sudo yum install -y python3 python-pip python3-devel | |
# Inscrease /tmp directory size (3.5 G is required to run "pip install autogluon") | |
sudo mount -o remount,size=5G,noexec,nosuid,nodev,noatime /tmp | |
df -h /tmp | |
# Install autogluon |
This file contains hidden or 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
sudo yum update | |
sudo yum install docker | |
sudo usermod -a -G docker ec2-user | |
newgrp docker | |
# Optional: docker-compose | |
wget https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) | |
sudo mv docker-compose-$(uname -s)-$(uname -m) /usr/local/bin/docker-compose | |
sudo chmod -v +x /usr/local/bin/docker-compose |
This file contains hidden or 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
# ibm_data_server_runtime_client_linuxx64_v11.5.tar.gz can be downloaded here: | |
# https://www.ibm.com/support/pages/node/6830885 | |
INSTALL_DIR="$HOME/data-server-runtime-client" && mkdir -p $INSTALL_DIR | |
tar -xvf ibm_data_server_runtime_client_linuxx64_v11.5.tar.gz -C $INSTALL_DIR | |
# (root) prevent error "The db2prereqcheck utility was unable to determine the Linux distribution level" | |
cp /etc/os-release /etc/lsb-release | |
yum install -y gcc gcc-g++ libxcrypt-compat |
NewerOlder