Skip to content

Instantly share code, notes, and snippets.

@budsonjelmont
budsonjelmont / fix_commit_history_because_you_commited_using_the_wrong_username_or_email.sh
Created June 9, 2025 13:31
Fix git commit history in your local because you committed with the wrong username or email
# Requires uvx https://docs.astral.sh/uv/guides/tools/#running-tools
# Run command below to fix the commits in your local, then force push
# to remote.
uvx git-filter-repo --commit-callback '
if commit.author_name != b"budsonjelmont" or commit.author_email != b"[email protected]":
commit.author_name = b"budsonjelmont"
commit.author_email = b"[email protected]"
commit.committer_name = b"budsonjelmont"
commit.committer_email = b"[email protected]"
'
@budsonjelmont
budsonjelmont / troubleshooting_docker_dns.sh
Created September 18, 2024 20:24
Minimal example for confirming that docker containers can DNS resolve other containers by name as well as external URLs. Based on the Docker networking tutorial here: https://docs.docker.com/engine/network/tutorials/standalone/
set -x
# Create resources
docker network create --driver bridge alpine-net
docker run -dit --name alpine1 --network alpine-net alpine ash
docker run -dit --name alpine2 --network alpine-net alpine ash
docker network inspect alpine-net
# Test connectivity
docker exec -t alpine1 ping -c 3 alpine2
@budsonjelmont
budsonjelmont / create_omics_annot_store_import_policy_and_role.py
Created March 29, 2024 20:49
Create a role that can import into Omics analytics stores
import boto3
import json
region = "us-east-1"
account_id = 666666666666
policy = {
"Version": "2012-10-17",
"Statement": [
{
@budsonjelmont
budsonjelmont / import_gnomad_vcfs_to_aws_omics_annot_store.py
Last active March 29, 2024 20:49
Batch import gnomAD VCFs into an Omics annotation store
import boto3
dataset = 'genomes'
semver = '2.1.1'
import_arn = 'arn:aws:iam::[account_id]:role/service-role/[role_name]'
annot_store_name='gnomad_grch37'
annot_store_version_name= dataset + '_v' + str(semver).replace('.','_')
base_s3_uri = 's3://gnomad-public-us-east-1/release/' + str(semver) + '/vcf/' + dataset
@budsonjelmont
budsonjelmont / gtf2bed.py
Last active October 15, 2019 19:37 — forked from davidliwei/gtf2bed.py
Converting Cufflinks predictions (.GTF) into .BED annotations
#!/usr/bin/env python3
'''
gtf2bed.py converts GTF file to BED file.
Usage: gtf2bed.py {OPTIONS} [.GTF file]
History
Nov.5th 2012:
1. Allow conversion from general GTF files (instead of only Cufflinks supports).
2. If multiple identical transcript_id exist, transcript_id will be appended a string like "_DUP#" to separate.
'''