Skip to content

Instantly share code, notes, and snippets.

View elowy01's full-sized avatar

Ernesto Lowy elowy01

  • Biofidelity
  • Cambridge, UK
View GitHub Profile
import requests
import time
def retry(cooloff=5, exc_type=None):
if not exc_type:
exc_type = [requests.exceptions.ConnectionError]
def real_decorator(function):
def wrapper(*args, **kwargs):
while True:
// Environment variables:
C_INCLUDE_PATH=/opt/gdbm-1.8.3/include
export C_INCLUDE_PATH
/ Link path:
LIBRARY_PATH=/opt/gdbm-1.8.3/lib
export LIBRARY_PATH
// hello world
1) Horizon->Compute->Key Pairs->Import Key Pair
2) Go to terminal and enter:
ssh-keygen -t rsa -f embasycloudkey.pem
cat embasycloudkey.pem.pub (and copy and paste in Horizon in field Public Key)
3) Give name to key (for example: embassycloudkey)
4) Click on Import Key
# Create new instance:
1) Go to Compute-> Instances->Launch Instance
2) Fill Instance Name: 'test' and Click on Next
3) Select Boot Source-> Image
# Include path:
The list of directories for header files is often referred to as the include path, a
# Library path
List of directories for libraries as the library search path or link path.
# Modifying these search paths when compiling:
# Where 'gdbm' library is within /opt/gdbm-1.8.3/lib
$ gcc -Wall -I/opt/gdbm-1.8.3/include -L/opt/gdbm-1.8.3/lib dbmain.c -lgdbm
#Environment variables to control the Include:
C_INCLUDE_PATH (for c) and CPLUS_INCLUDE_PATH (for cpp)
###### Pytest fixtures
# Basic toy example:
import pytest
@pytest.fixture()
def before():
print('\nbefore each test')
def test_1(before):
#!/usr/bin/env nextflow
params.samplel = false
process test_sample {
when:
params.sample
script:
/*
Now, create a channel from paths in a file
Where params.list is:
/home/ec2-user/lib/bioinformatics_pipelines/file1.txt
/home/ec2-user/lib/bioinformatics_pipelines/file2.txt
*/
Channel.fromPath(params.list)
.splitText()
.set { value_list }
# Do OCR from a screenshot
1) screencapture -i /tmp/tesseract.png
(2a) brew install tesseract
2) tesseract file.png stdout|tr -d \\f > out.txt
1) You have 2 servers: Docker Registry and Docker Workstation
2) In Docker Registry:
Objective 1:
Set up the private registry:
# Create an htpasswd file containing the login credentials for the initial account.
mkdir -p ~/registry/auth
docker run --entrypoint htpasswd \
registry:2 -Bbn docker d0ck3rrU73z > ~/registry/auth/htpasswd
# Create a self-signed certificate for the registry. For common name,
# enter the hostname of the registry server, which is ip-10-0-1-101.
# Useful explanation on what is a module or a package in Python
https://realpython.com/python-modules-packages/
# Explanation on what is the layout of your projects:
https://realpython.com/python-application-layouts/
# Excellent article on using the main entry point in Python
https://realpython.com/python-main-function/
# Python naming convention