Skip to content

Instantly share code, notes, and snippets.

View andersx's full-sized avatar

Anders Steen Christensen andersx

View GitHub Profile
@andersx
andersx / xyz2gif.sh
Created October 15, 2020 14:35
XYZ to GIF
#!/usr/bin/env bash
# mcgif.pml
# # load opt.xyz
# show sticks, all
# bg_color white
# color grey05, elem c
# preset.ball_and_stick(selection='all', mode=1)
# set ray_trace_mode, 1
# viewport 1024, 768
@andersx
andersx / gpr_md.py
Created September 22, 2020 06:35
GPR MD ASE example
#!/usr/bin/env python3
import sys
from copy import deepcopy
import numpy as np
import scipy.linalg
from scipy.linalg import norm
@andersx
andersx / oqml_md.py
Created September 22, 2020 06:34
OQML ASE MD example
#!/usr/bin/env python3
import sys
# sys.path.insert(0, "/home/andersx/dev/qml/gradient_kernel/build/lib.linux-x86_64-3.6")
from copy import deepcopy
import numpy as np
import scipy.linalg
@andersx
andersx / qorca.sh
Created July 24, 2020 09:10
ORCA alchemy script
#!/bin/bash
# get the filename without the extension
JOB=$1
SUBMIT=qsub.tmp
PWD=`pwd`
cat > $SUBMIT <<!EOF
#!/bin/bash
@andersx
andersx / toggle_speakers.sh
Created July 9, 2020 05:17
Toggle speakers/headphones for Creative Soundblasterx AE-5 on with amixer
#!/usr/bin/env bash
# Grep which device is Creative
AMIXEROUTPUT=$(aplay -l | grep -m1 Creative)
DEVICE=${AMIXEROUTPUT:5:1}
# Grep for connected headphones
OUTPUT=$(amixer -c $DEVICE sget "Output Select" | grep "Item0: 'Headphone'")
echo $AMIXEROUTPUT
@andersx
andersx / xyz2om2.py
Created June 14, 2020 15:54
XYZ to OM2
#!/usr/bin/env python2
import numpy as np
import sys
elements = dict()
elements["H"] = 1
elements["C"] = 6
elements["N"] = 7
elements["O"] = 8
elements["F"] = 9
@andersx
andersx / gist:13717e1c00589c09d5b4bcb19cfd7ef0
Created June 1, 2020 10:44
How to run Google Colab on a remote server via SSH forwarding
# On local machine:
jupyter serverextension enable --py jupyter_http_over_ws
jupyter notebook \
--no-browser \
--port=8765 \
--NotebookApp.allow_origin='https://colab.research.google.com' \
--NotebookApp.port_retries=0
# On remote machine (juicemachine)
jupyter serverextension enable --py jupyter_http_over_ws
@andersx
andersx / jmol_gif.sh
Created May 27, 2020 09:24
Jmol gifmaker
#!/usr/bin/env bash
jmol $1 -s /home/andersx/bin/gif.script --nodisplay
convert -delay 3 -loop 0 all*.jpg all.gif
rm all[0-9]*.jpg
@andersx
andersx / lol.pml
Created May 27, 2020 09:23
Settings for Pymol Gif-maker
# load opt.xyz
show sticks, all
bg_color white
color grey05, elem c
preset.ball_and_stick(selection='all', mode=1)
set ray_trace_mode, 1
viewport 1024, 768
set ray_trace_gain, 0.1;
set ray_shadow_decay_factor, 0.1;
@andersx
andersx / gif_pymol.sh
Created May 27, 2020 09:23
Pymol Gif-maker
#!/usr/bin/env bash
SCRIPT=/home/andersx/dev/pymol_gif/lol.pml
WORK_DIR=`pwd`
INPUT=$1
OUTPUT=${1%.xyz}.gif
cp $INPUT /tmp/
cd /tmp/