Skip to content

Instantly share code, notes, and snippets.

View filipsPL's full-sized avatar
💭
🚀 travelling to Mars and back

filips filipsPL

💭
🚀 travelling to Mars and back
View GitHub Profile
@<TRIPOS>MOLECULE
pary/165D/ligand.pdb
57 54 0 0 0
SMALL
GASTEIGER
@<TRIPOS>ATOM
1 RH -2.4540 0.1530 21.4230 Rh 19 RHD19 0.0000
2 N1 -0.6230 -0.6450 20.7690 N.3 19 RHD19 0.0000
3 N2 -3.4790 -1.1210 20.1210 N.3 19 RHD19 0.0000
@filipsPL
filipsPL / split_ligand.py
Last active November 12, 2015 12:35
split molecule file to separate components and save to multiple files.
### split molecule file to separate components and save to multiple files.
import pybel
from openbabel import *
mol = pybel.readfile('mol2', 'ligand.mol2').next()
separated = mol.OBMol.Separate()
def writeOut( theConformer, outputPath ):
myConversion = OBConversion()
gua
OpenBabel11131516582D
7 7 0 0 0 0 0 0 0 0999 V2000
-0.3090 -0.9511 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-1.3090 -0.9511 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.8968 -1.7601 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-1.6180 -0.0000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-0.8090 0.5878 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-0.0000 -0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
#!/bin/bash
rrdtool create airq.rrd --step 3600 \
DS:pm10:GAUGE:1800:0:500 \
DS:pm25:GAUGE:1800:0:500 \
RRA:AVERAGE:0.5:1:144 \
RRA:AVERAGE:0.5:3:336 \
RRA:AVERAGE:0.5:144:367 \
RRA:AVERAGE:0.5:1008:250 \
#!/bin/bash
DATA=`date`
DIR=/usr/local/bin/rrd/pi/rrd/
OUTDIR=/var/www/pi/sysinfo/img/
BAZA=$DIR/temperatura.rrd
var=cisnienie
@filipsPL
filipsPL / screen-loop.sh
Created May 5, 2016 08:02
Loop over all screen sessions
#!/bin/bash
for ses in `screen -r | grep "(Detached)"| cut -f 2`; do screen -r "$ses"; done
@filipsPL
filipsPL / maketoc.py
Created September 27, 2017 13:02
Super simple TOC generator from a ready HTML file.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from re import sub
fname = "FAQ.html"
header="<h4>"
outfile = "FAQ+TOC.html"
#-----------------------------------------#
@filipsPL
filipsPL / list_big_files.sh
Created December 15, 2017 08:37
List files bigger than the given size and optionally compress them
#!/bin/bash
### list files bigger than the given size
### and optionally compress them
filesize=100M # files bigger than this will be listed; default is 100M
for f in `find . -type f -size +$filesize`
do
@filipsPL
filipsPL / python+tee.py
Created November 7, 2018 20:29
Function which: 1) runs the command 2) for the specified time (duration) and 3) pipes output to the file AND to screen (live).
import time
from time import strftime
import subprocess
def runForDuration(cmdline, duration, logFile):
teeCommand = ['tee', '-a', logFile ] # quick and dirty hack to get log to file
try:
p1 = subprocess.Popen(cmdline, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
p2 = subprocess.Popen(teeCommand, stdin=p1.stdout)
@filipsPL
filipsPL / autoweka_process.sh
Created February 28, 2019 12:06
Quick and dirty way of processing log files from autoweka to extract the best classifier found by the system. Results may still need some tuning before supplying to weka experimenter, but in many cases it works out of the box.
#!/bin/bash
# direcotry with log files from autoweka
autowekadir="./"
# weka.classifiers.meta.FilteredClassifier -F "weka.filters.supervised.attribute.AttributeSelection -E \"$eval\" -S \"$selection\"" -S 1 -W $classifier
# best classifier: weka.classifiers.lazy.IBk
# arguments: [-K, 4, -F]
# attribute search: weka.attributeSelection.GreedyStepwise
# attribute search arguments: [-B, -R]