Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View muammar's full-sized avatar
👋

Muammar El Khatib muammar

👋
View GitHub Profile
@muammar
muammar / download-mozilla-portable.sh
Created March 24, 2020 04:21 — forked from rubo77/download-mozilla-portable.sh
a script that downloads a certain Firefox or Thunderbird version and installs it in an extra folder to create an independent and portable App for Linux. source: http://portableapps.com/node/16344
#!/bin/sh
# Configure the following default variables according to your requirements
language="en-US" # e.g. "de" or "en-US"
if [ ! "$1" ]; then
# default if no argument is set:
version="73.0" # chose from http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/
application="firefox" # "thunderbird" or "firefox" but file extension, archive extraction, and binary
fi
@muammar
muammar / docker_codeserver
Created November 19, 2019 23:43
example with https docker code-server
docker run -it -p 0.0.0.0:8080:8080 -e PASSWORD=yourpassword \
-v /etc/letsencrypt/live/domain.dev/fullchain.pem:/home/coder/fullchain.pem \
-v /etc/letsencrypt/live/domain.dev/privkey.pem:/home/coder/privkey.pem \
-v /home/youruser:/home/coder/ \
codercom/code-server:v2 --cert /home/coder/fullchain.pem --cert-key /home/coder/privkey.pem --auth password
@muammar
muammar / water.cjson
Created October 18, 2019 01:01
Water CJSON file
'{"atoms": {"coords": {"3d": [1.276443828609874e-08, -0.08883141050708601, 0.0, -0.7910020167782186, 0.482665709407137, 0.0, 0.7910020040137803, 0.4826657010999494, 0.0]}, "elements": {"number": [8, 1, 1]}, "selected": [false, false, false]}, "basisSet": {"coefficients": [0.8317352088484886, 1.530807482917853, 2.477149091564172, 3.256280246194428, 2.792893633557702, 0.9549376962582186, -0.6179336976334064, -0.2757210088227513, 0.8142076427322074, 3.116945588875068, 2.401437248315969, 1.054360513315558, 0.2669561388578825, 0.2774319373130634, 0.2149354183262036, 0.3645711272092818, 0.4150514276558687, 0.1813806839302632, 0.2149354183262036, 0.3645711272092818, 0.4150514276558687, 0.1813806839302632], "exponents": [5484.671700000004, 825.2349500000006, 188.0469600000002, 52.96450000000004, 16.89757000000001, 5.799635300000005, 15.53961600000001, 3.599933600000003, 1.013761800000001, 15.53961600000001, 3.599933600000003, 1.013761800000001, 0.2700058000000002, 0.2700058000000002, 18.73113700000001, 2.825393700000
@muammar
muammar / bernoulli.log
Created October 15, 2019 17:56
outputs VAE
Train Epoch: 1 [0/60000 (0%)] Loss: 550.800720
Train Epoch: 1 [1280/60000 (2%)] Loss: 322.319275
Train Epoch: 1 [2560/60000 (4%)] Loss: 238.075073
Train Epoch: 1 [3840/60000 (6%)] Loss: 217.480133
Train Epoch: 1 [5120/60000 (9%)] Loss: 207.814041
Train Epoch: 1 [6400/60000 (11%)] Loss: 210.372253
Train Epoch: 1 [7680/60000 (13%)] Loss: 206.411575
Train Epoch: 1 [8960/60000 (15%)] Loss: 198.051208
Train Epoch: 1 [10240/60000 (17%)] Loss: 196.847122
Train Epoch: 1 [11520/60000 (19%)] Loss: 188.627213
@muammar
muammar / data.py
Created October 2, 2019 22:42 — forked from ghutchis/data.py
Normal Mode Conformer Generation using cclib and OpenBabel Python
element_symbols = [
"Xx", "H", "He", "Li", "Be", "B", "C", "N", "O", "F",
"Ne", "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K",
"Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu",
"Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y",
"Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In",
"Sn", "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr",
"Nd", "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm",
"Yb", "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au",
@muammar
muammar / error_parsl.md
Created October 1, 2019 20:43
Parsl error
[W 191001 13:41:13 managers:547] Job 5724 failed: ManagerLost - Msg: Caught Parsl Error:                                                                                                                           
    Traceback (most recent call last):                                                                                                                                                                             
      File "/global/homes/m/melkhati/.conda/envs/snowflake/lib/python3.7/site-packages/qcfractal/queue/parsl_adapter.py", line 17, in _get_future                                                                  
        return future.result()                                                                                                                                                                                     
      File "/global/homes/m/melkhati/.conda/envs/snowflake/lib/python3.7/concurrent/futures/_base.py", line 428, in result                                                  
@muammar
muammar / condalist.md
Last active August 9, 2019 17:30
Conda.
muammar@jedi ~ 
  % conda list                                                           !10029
# packages in environment at /home/muammar/anaconda3:
#
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0  
_libgcc_mutex             0.1                        main  
alabaster                 0.7.12                   py37_0  
anaconda                  2019.03                  py37_0  
@muammar
muammar / countingstuff
Created August 1, 2019 21:12
Counting
In [1]: stuff = ["a", "a", "c", "b", "b", "b"]
In [2]: counter = {}
In [3]: for element in stuff:
...: if element not in counter.keys():
...: counter[element] = 0
...: counter[element] += 1
...:
@muammar
muammar / MPIFileHandler.py
Created June 19, 2019 20:58
logging with mpi4py
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 14 16:17:38 2018
This handler is used to deal with logging with mpi4py in Python3.
@author: cheng
@reference:
https://cvw.cac.cornell.edu/python/logging
https://groups.google.com/forum/#!topic/mpi4py/SaNzc8bdj6U
@muammar
muammar / nist.py
Created February 28, 2019 18:24 — forked from mcs07/nist.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Download all UV-Vis spectra available from NIST Chemistry Webbook."""
import os
import re
import requests
from bs4 import BeautifulSoup