Skip to content

Instantly share code, notes, and snippets.

View moselhy's full-sized avatar
🏠
Working from home

Mohamed Moselhy moselhy

🏠
Working from home
View GitHub Profile
@moselhy
moselhy / pdb_to_png.py
Created November 23, 2017 18:18 — forked from bougui505/pdb_to_png.py
Create a png image from a pdb using pymol
#!/usr/bin/env python
# -*- coding: UTF8 -*-
"""
author: Guillaume Bouvier
email: guillaume.bouvier@ens-cachan.org
creation date: 2014 04 29
license: GNU GPL
Please feel free to use and modify this, but keep the above information.
Thanks!
"""
#!/usr/bin/env python
import sys
import os
if len(sys.argv) != 4:
print("Usage: {} (string)filename.fastq (string)readID (int)numreads".format(sys.argv[0]))
sys.exit(1)
filepath = sys.argv[1]
#!/usr/bin/python
## BY: MOHAMED HESHAM MOSELHY
## OUTPUT A LIST OF TRAJECTORY FILES THAT START AT starttime AND ENDS WITH endtime
## Assumes that all the trajectory files correspond to checkpoint files with the same prefix
## For example: 1.trr or 2.###trr (where ### is anything or nothing) correspond to 1.cpt and 2.cpt, respectively
## Usage: filterTrj.py starttime endtime [outputfile - optional]
## Time units for start and end times are in picoseconds
## outputfile will be overridden if it exists
@moselhy
moselhy / buyback.py
Created April 15, 2019 03:20
Given a list of ISBN's (through stdin, line-separated), get the highest-offering school and buyback price for each one
# Author: Mohamed Moselhy
# April 14 2019
import requests
from bs4 import BeautifulSoup
import urllib3
from progress.bar import Bar
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
@moselhy
moselhy / patch-func-for-arm.sh
Created October 29, 2023 15:08
Patch Azure Functions Core Tools @ 4 to support ARM until https://github.com/Azure/azure-functions-python-worker/issues/915 is closed
#!/bin/bash
brew install python@3.10 azure-functions-core-tools@4 jq
# Core tool installation path if installed with Homebrew
directory="/opt/homebrew/Cellar/azure-functions-core-tools@4"
# Use 'find' to locate directories starting with '4.' and sort by modification time
latest_directory=$(find "$directory" -type d -name "4.*" | sort -n | tail -1)
python_worker_dir=$latest_directory/workers/python