Skip to content

Instantly share code, notes, and snippets.

View nylander's full-sized avatar

Johan Nylander nylander

View GitHub Profile
@nylander
nylander / gist:162791ff4986abf86864a22896fddc14
Last active April 5, 2022 08:08
Fix error in python for installing nf-core on Ubuntu 20.04, python 3.8
Recently, I tried to upgrade [nf-core](https://nf-co.re/) on my Ubuntu Linux but the execution after installation failed with errors from a python module.
Upgrading the python library ["rich"](https://rich.readthedocs.io/en/stable/introduction.html) solved the issue.
Steps below:
```
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
@nylander
nylander / FortiClientVPN
Last active May 2, 2024 12:25
Start/stop script for FortiClient VPN on Linux
#!/usr/bin/env bash
# Start/stop FortiClient VPN
# Last modified: ons mar 15, 2023 03:47
# Sign: JN
# To disable starting forticlient after reboot:
# 1. Comment out the command (edit and add an `#` in front of the line) in file
# `/opt/forticlient/start-fortitray-launcher.sh`
# 2. `sudo systemctl disable forticlient-scheduler`
# After step 1 and 2 above, forticlient daemon will not start after reboot. To
@nylander
nylander / create_sample_sheet.pl
Created June 15, 2023 09:16
Create a sample sheet from NGI (SciLifeLab) sequencing delivery
#!/usr/bin/env perl
=pod
=encoding utf8
=head1 NAME
create_sample_sheet.pl - Create sample sheet from NGI delivery
@nylander
nylander / blast2fasta.sh
Created October 10, 2023 11:43
Convert blast output with sseq as last column to fasta
#! /bin/bash
# blast2fasta
# Parse output from blast where we have sseq as the last column.
# For example (argument to blastn): "-outfmt '6 qseqid sseq'".
# Reads from file, writes to stdout.
# By Johan Nylander
# 2023-Oct-10
# Usage: blast2fasta.sh file
file=$1
awk '{printf ">%s", $1; for(i=2;i<NF;i++) printf " %s", $i; printf "\n%s\n", $NF}' "$file"