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 / 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 / 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
@muammar
muammar / cholesky_d.f
Created November 3, 2017 19:28 — forked from t-nissie/cholesky_d.f
Cholesky decomposition written in Fortran
! cholesky_d.f -*-f90-*-
! Using Cholesky decomposition, cholesky_d.f solve a linear equation Ax=b,
! where A is a n by n positive definite real symmetric matrix, x and b are
! real*8 vectors length n.
!
! Time-stamp: <2015-06-25 18:05:47 takeshi>
! Author: Takeshi NISHIMATSU
! Licence: GPLv3
!
! [1] A = G tG, where G is a lower triangular matrix and tG is transpose of G.
@muammar
muammar / gist:255d40e4a4f48337d8dcb688d6c2a164
Created August 24, 2016 18:16 — forked from mharsch/gist:5144208
transcode video streams using node.js Streams and avconv (aka ffmpeg)

The avconv utility can be made to work in 'the Unix way' by specifying stdin and/or stdout instead of filenames for the input and output respectively. See: http://libav.org/avconv.html#pipe

Example:

cat input.ts | avconv -i pipe:0 -f mp4 -movflags frag_keyframe pipe:1 | cat > output.mp4

Using node's require('child_process').spawn(), we can pipe streams of video data through avconv's stdin and stdout and thus Stream All The Things.

var fs = require('fs');
@muammar
muammar / sp
Created August 21, 2016 21:54 — forked from streetturtle/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/bin/bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@muammar
muammar / mtrack.conf
Created August 13, 2016 09:20 — forked from snarlysodboxer/mtrak.conf
A config for Macbook Pro trackpad in mtrak in Ubuntu. https://github.com/BlueDragonX/xf86-input-mtrack/
Section "InputClass"
MatchIsTouchpad "on"
Identifier "Touchpads"
Driver "mtrack"
# TrackpadDisable - Disables trackpad touch input. A value of 0 will enable the trackpad. A value of 1 will disable tapping and gestures but not movement. A value of 2 will disable all input. A value of 3 will also disable physical buttons. Integer. Default is 0.
# Sensitivity - Adjusts the sensitivity (movement speed) of the touchpad. This is a real number greater than or equal to zero. Default is 1. A value of 0 will disable pointer movement.
Option "Sensitivity" "0.65"
# FingerHigh - Defines the pressure at which a finger is detected as a touch. This is a percentage represented as an integer. Default is 5.
Option "FingerHigh" "12"
# FingerLow - Defines the pressure at which a finger is detected as a release. This is a percentage represented as an integer. Default is 5.
@muammar
muammar / colors.py
Created May 4, 2016 22:47 — forked from jossef/colors.py
python coloring for linux, based on this answer http://stackoverflow.com/a/26445590/3191896
def color(text, **user_styles):
styles = {
# styles
'reset': '\033[0m',
'bold': '\033[01m',
'disabled': '\033[02m',
'underline': '\033[04m',
'reverse': '\033[07m',
#pacman -S vicious
vicious = require("vicious")
-- {{{ Wibox
-- battery widget
batwidget = wibox.widget.textbox()
vicious.register(batwidget, vicious.widgets.bat, ' bat: $1 $2%<span color="#cccccc"> | </span>', 61, 'BAT0')