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
@filipsPL
filipsPL / README.md
Created June 6, 2020 06:44
rsync transfer data munin plugin - debian 10

rsync transfer data munin plugin - debian 10

For new installations the provided rsync_bytes plugin doesn't work. Here is rewrittend (and path-hardcoded) version which does work.

Please remember that the rsync logfile must be outside the /home directory, see here

Before use, install logtail.

@filipsPL
filipsPL / remove-sdf-fields.sh
Created April 22, 2020 14:08
Remove all fields from the sdf structural file with sed in bash
#!/bin/bash
cat input.sdf | sed '/M END/,/$$$$/{//!d}' > input-fields-removed.sdf
@filipsPL
filipsPL / README.md
Created April 21, 2020 08:46
Send form data (with files) using curl

Send form data (with files) using curl

Many recepies for sending data with curl via POST method didn't work for me. Eg, this was not working for me:

🔴

curl -F ‘data=@path/to/local/file’ UPLOAD_ADDRESS

(as advised for example here)

@filipsPL
filipsPL / check_and_connect_vpn.sh
Created April 16, 2020 07:22
Bash check if a VPN connection is active, if not - connect!
#!/bin/bash
vpnConnectionName="my vpn connection"
if nmcli c show --active | grep -q "$vpnConnectionName"; then
echo "$vpnConnectionName connection is up"
else
echo "$vpnConnectionName connection is down, let's connect"
nmcli con up id "$vpnConnectionName"
sleep 4s
@filipsPL
filipsPL / get-and-compile.sh
Created March 30, 2020 07:43
Debian/Ubuntu: update pymol repo and (re)compile
#!/bin/bash -e
# Single time - install packages, clone repos
# apt-get install git build-essential python3-dev libglew-dev \
# libpng-dev libfreetype6-dev libxml2-dev \
# libmsgpack-dev python3-pyqt5.qtopengl libglm-dev libnetcdf-dev
# git clone --depth=1 https://github.com/schrodinger/pymol-open-source.git
# git clone --depth=1 https://github.com/rcsb/mmtf-cpp.git
@filipsPL
filipsPL / dialog-show-cron.sh
Created January 10, 2020 08:55
How to use kdialog from cron-started jobs.
#!/bin/bash
export DISPLAY=:0
kdialog --title "Borg backup done $(date +"%A %x")" --passivepopup "<pre>$(cat /home/user/backup.log)</pre>" 10s
@filipsPL
filipsPL / tcx-polar2garmin.sh
Created December 29, 2019 19:39
Bash command line convert Polar tcx file to Garmin acceptable tcx file
#!/bin/bash
#see: https://forums.garmin.com/apps-software/mobile-apps-web/f/garmin-connect-web/83432/polar-flow-tcx-export-to-garmin-connect
cat polar.tcx | sed -e '/<Creator/,/<\/Creator>/d' -e '/<Author/,/<\/Author>/d' > garmin.tcx
@filipsPL
filipsPL / rdock-conda-install.sh
Created December 23, 2019 19:47
install rdock ubuntu under conda environment
# install miniconda, then:
# create new environment
conda create -n docking-rdock
# activate it!
conda activate docking-rdock
# add channels
@filipsPL
filipsPL / doWekaGridSearch.sh
Created October 17, 2019 14:43
A shell script for running grid search in weka from the command line.
#!/bin/bash
export CLASSPATH=/home/username/progs/weka-3-8-2/weka.jar
java weka.Run weka.classifiers.meta.GridSearch \
-t train.arff \
-d svm.model \
-c last \
-num-slots 2 \
-sample-size 67 \
@filipsPL
filipsPL / dock_gbsa_rescore.in
Last active September 26, 2019 10:56 — forked from bougui505/dock_gbsa_rescore.in
Template of dock6.9 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
conformer_search_type flex
write_fragment_libraries no
user_specified_anchor no
limit_max_anchors no
min_anchor_size 5
pruning_use_clustering yes
pruning_max_orients 1000
pruning_clustering_cutoff 100
pruning_conformer_score_cutoff 100.0
pruning_conformer_score_scaling_factor 1.0