Skip to content

Instantly share code, notes, and snippets.

View delagoya's full-sized avatar

Angel Pizarro delagoya

View GitHub Profile
@delagoya
delagoya / resize.sh
Last active March 25, 2025 19:43
Resize the root AL2023 EBS volume
#!/bin/bash
# Specify the desired volume size in GiB as a command line argument. If not specified, default to 20 GiB.
SIZE=${1:-20}
# Get the ID of the environment host Amazon EC2 instance.
# IMDSv2 enabled
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"`
INSTANCEID=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/instance-id)
REGION=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed 's/\(.*\)[a-z]/\1/')
@delagoya
delagoya / nf-core-vscode-server.yaml
Last active March 24, 2025 15:41
Stand up an EC2 instances for Nextflow pipeline development
Description: Create a VS code-server instance with an Amazon CloudFront distribution for development of Nextflow pipelines. Version 4.0.0
Parameters:
VSCodeUser:
Type: String
Description: UserName for VS code-server
Default: developer
GitUserName:
Type: String
Description: Global Git user.name for repo commits
{
"jobDefinitionName": "dask-mnp-hello-world",
"type": "multinode",
"platformCapabilities": [
"EC2"
],
"nodeProperties": {
"numNodes": 3,
"mainNode": 0,
"nodeRangeProperties": [
@delagoya
delagoya / build_install_hello_mpi.sh
Created February 11, 2022 13:44
Download, build, install Hello World example from MPI tutorial
#!/bin/sh
cd /tmp
git clone https://github.com/mpitutorial/mpitutorial
cd mpitutorial/tutorials/mpi-hello-world/code
# grab the mpicc PATH locations
source /etc/profile.d/efa.sh
make all
cp mpi_hello_world /shared/mpi_hello_world
@delagoya
delagoya / 00_aws_batch_tes_map.md
Last active February 4, 2020 03:03
A mapping of the GA4GH Task Execution Service API schema to AWS Batch

Map of Task Execution Service (TES) to AWS

This document is an overview of how concepts from TES map to concepts in AWS Batch.

AWS Batch - Basic Concepts

AWS Batch ("Batch") has a few basic concepts that need to be understood before we can make a comparison to concepts in TES. Some relate directly to TES and others do not.

Job

@delagoya
delagoya / Dockerfile
Last active May 1, 2023 20:57
Dcokerfile for installing AWS CLI on top of rocker/r-base image.
FROM rocker/r-base
RUN apt-get update
# install python tools
RUN apt-get install -y python-dev python-pip
# install AWS CLI
RUN pip install -U awscli

Port 22 is BLOCKED! HALP!

The MCW auditorium wifi blocks the standard SSH network port, port 22. If you are to successfully connect to the EC2 instance from the MCW guest wifi, you will need to change the default port that the SSH service provides for connections. You will also need to allow network traffic to that port on the EC2 instance.

Step 1: the userdata script

The following Bash shell script will be used to add a port to the SSH service.

Amazon Web Services

Implementing a simple AWS Lambda function

In this lab, we will use the chalice Python serverless web application framework for AWS to create a REST API endpoint to reverse complement a DNA string using AWS Lambda and Amazon API Gateway.

# install chalice
$ pip install chalice
@delagoya
delagoya / test.avdl
Last active July 27, 2023 19:55
Avro IDL comments to Avrodoc example 2
@namespace("com.example")
/**
This is a comment for the whole protocol
*/
protocol Example {
/**
The comment applies to the `NoSpaces` record, but is not indented to the
@delagoya
delagoya / test.avdl
Created July 30, 2014 19:50
Exmaple Avro files for discussion Markdown comments
@namespace("com.example")
/**
This is a comment for the whole protocol
*/
protocol Example {
/**
This is a paragraph with a
multi-line comment and
no spaces in between.