Skip to content

Instantly share code, notes, and snippets.

View pditommaso's full-sized avatar
💭
Vita brevis, ars longa

Paolo Di Tommaso pditommaso

💭
Vita brevis, ars longa
View GitHub Profile
@pditommaso
pditommaso / copy-containers.sh
Created November 19, 2023 18:26
Copy all container images from one repo to another
#!/bin/bash
# Source and destination repositories
source_repo="quay.io/seqeralabs/nf-launcher"
dest_repo="public.ecr.aws/seqera-labs/tower/nf-launcher"
# List all images in the source repository
tags=$(skopeo list-tags docker://$source_repo | jq -r .Tags[])
# Loop through each image and perform the copy
@pditommaso
pditommaso / setupGithubRepo
Created October 26, 2021 15:19 — forked from stephenhardy/setupGithubRepo
Initial setup steps for a git and github project
-- Initial setup
mkdir <YOURPROJECT>
cd <YOURPROJECT>
git init
-- Link to GitHub hosted repos
git remote add origin <[email protected]:YOURACCOUNT/YOURREPO.git>
git pull origin master
@pditommaso
pditommaso / trap-error.sh
Created May 14, 2020 08:20
Bash snippet handling errors
set +e
trap 'catch' ERR
catch() {
echo "An error has occurred but we're going to eat it!! exit status $?"
}
echo "Before bad command"
badcommand
echo "After bad command"
@pditommaso
pditommaso / awsSecretToSmtpPassword.py
Last active February 9, 2020 16:42
Generate SMTP password from AWS secret key
#!/usr/bin/env python3
import hmac
import hashlib
import base64
import argparse
# Values that are required to calculate the signature. These values should
# never change.
DATE = "11111111"

Keybase proof

I hereby claim:

  • I am pditommaso on github.
  • I am pditommaso (https://keybase.io/pditommaso) on keybase.
  • I have a public key ASBO7OHqsrCmlRxzNCv0FrQ_SpYHa1a--FIRxM-Yuxz2ZAo

To claim this, I am signing this object:

@pditommaso
pditommaso / ignite_batch.sh
Created May 2, 2019 17:36 — forked from dtrudg/ignite_batch.sh
Nucleus nextflow ignite sbatch script
#!/bin/bash
#SBATCH --job-name=ignite-nf-wordcount
#SBATCH --output=nf_ignite_%j.log
# Create the ignite allocation across 4 32GB nodes
#SBATCH --partition=32GB
#SBATCH -N 4
# This creates a random cluster seed, so the ignite cluster can communicate
# with itself and not clash with other running ignite clusters on Nucleus.
@pditommaso
pditommaso / dump-server.groovy
Last active May 2, 2019 10:14
Minimal web server dumping request body to stdout
import com.sun.net.httpserver.HttpExchange
import com.sun.net.httpserver.HttpHandler
import com.sun.net.httpserver.HttpServer
import groovy.json.JsonOutput
class TowerMockServer implements HttpHandler {
private int count
@Override
@pditommaso
pditommaso / demo.nf
Last active April 21, 2019 09:32 — forked from egonw/demo.nf
Using Bioclipse in Nextflow.
#!/usr/bin/env nextflow
@Grab(group='net.bioclipse.bacting', module='managers-cdk', version='0.0.3')
import net.bioclipse.managers.CDKManager
params.str = "./data.tsv"
params.size = 5000
process splitWikidata {
input:
file str from Channel.fromPath(params.str)
@pditommaso
pditommaso / dgm.json
Created January 16, 2019 20:58 — forked from wololock/dgm.json
[
{
"name": "org.codehaus.groovy.runtime.dgm$0",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "org.codehaus.groovy.runtime.dgm$1",
@Grab(group = "org.reflections", module = "reflections", version = "0.9.11")
import groovy.json.JsonOutput
import org.codehaus.groovy.reflection.GeneratedMetaMethod
import org.reflections.Reflections
import org.reflections.util.ConfigurationBuilder
def reflections = new Reflections(new ConfigurationBuilder().build())
def json = reflections.getSubTypesOf(GeneratedMetaMethod).collect {