Skip to content

Instantly share code, notes, and snippets.

@bougui505
bougui505 / dock_gbsa_rescore.in
Created February 21, 2014 07:14
Template of dock6.4 for GBSA Hawkins rescore of docked molecules. Replace LIG with your mol2 file of docked ligands and REC by your mol2 file for the receptor
ligand_atom_file LIG
limit_max_ligands no
skip_molecule no
read_mol_solvation no
calculate_rmsd no
use_database_filter no
orient_ligand no
use_internal_energy no
flexible_ligand no
bump_filter no
@bougui505
bougui505 / replace_spaces.sh
Last active August 29, 2015 13:56
replace spaces in file name
find -name "* *" -type d | rename 's/ /_/g' # do the directories first
find -name "* *" -type f | rename 's/ /_/g'
@bougui505
bougui505 / findIncludegraphics.sh
Last active August 29, 2015 13:56
Finding graphics file names in tex file
egrep -o '\bincludegraphics([^}]*\})?' file.tex | egrep -o '\{.+\}' | sed 's/{\|}//g'
@bougui505
bougui505 / find_input.sh
Last active August 29, 2015 13:56
Finding input file names in tex file
egrep 'input{.*}' file.tex | grep -o '{.*}' | sed 's/{\|}//g'
@bougui505
bougui505 / git_diff.sh
Created February 25, 2014 10:11
git diff between a file (here SOM2.py) and a previous commit
git diff 14156a8430ebef7dfaf59d249dc1a5d864ebf71c -- SOM2.py
@bougui505
bougui505 / testtex.sh
Created February 25, 2014 13:44
Get header from tex file maintexfile and inlude tex file includefile and test the compilation with latexmk
#!/usr/bin/env sh
maintexfile=$1
includefile=$2
rootfilename=$(echo $includefile | cut -d. -f1)
(grep -B9999 'begin{document}' $maintexfile && echo " " && echo "\include{$rootfilename}" && echo "\\end{document}") > header.tex
latexmk -pdf -pvc header.tex
@bougui505
bougui505 / getTexHeader.sh
Last active August 29, 2015 13:56
Get Header from TeX/LaTeX file
#!/usr/bin/env sh
filename=$1
grep -B9999 'begin{document}' $filename && echo ' ' && echo '\end{document}'
@bougui505
bougui505 / .gitignore
Last active August 29, 2015 13:56
.gitignore for LaTeX directory
#To compile with:
# latexmk -outdir=outdir -pdf BOUVIER_Guillaume_dossier_MCF.tex
BOUVIER_Guillaume_audition_COMESP.pdf
outdir
.trash
*.swp
*.aux
*.bbl
*.blg
*.fdb_latexmk
@bougui505
bougui505 / gaussianMixture.py
Last active August 29, 2015 13:56
Fit mixture of Gaussian
from sklearn import mixture
%pylab
def fit_mixture(data, ncomp=2, doplot=False):
clf = mixture.GMM(n_components=ncomp, covariance_type='full')
clf.fit(data)
ml = clf.means_
wl = clf.weights_
cl = clf.covars_
ms = [m[0] for m in ml]
@bougui505
bougui505 / gists_pull.py
Last active September 6, 2016 08:22
Clone or update all a user's gists
#!/usr/bin/env python
# Clone or update all a user's gists
# curl -ks https://raw.github.com/gist/5466075/gist-backup.py | USER=fedir python
# USER=fedir python gist-backup.py
# From: http://stackoverflow.com/a/16233710/1679629
import json
import urllib
from subprocess import call
from urllib import urlopen