This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
str_utilisation="$0 (doi|isbn) <value>" | |
if [ "$#" -ne 2 ];then | |
echo ${str_utilisation} | |
exit 1 | |
fi | |
if [ "$1" == "doi" ];then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Notes from here: http://www.webupd8.org/2010/01/how-to-create-deb-package-ubuntu-debian.html | |
This assumes you're using autotools to build your project. | |
1. sudo apt-get install build-essential autoconf automake autotools-dev dh-make debhelper devscripts fakeroot xutils lintian pbuilder | |
2. We want a source folder with the pattern: <package>-<version> | |
$ cd ginvoke | |
$ git archive --format=tar --prefix=ginvoke-$(date +'%Y%m%d')/ master | tar xvf - -C .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ [ tar ] tar xzf repo/archives/ocaml-base-compiler.4.11.1/4.11.1.tar.gz | |
+ [ ./configure ] ./configure -prefix /home/test/ocamlbuild-bundle/bootstrap | |
configure: Configuring OCaml version 4.11.1 | |
checking build system type... x86_64-pc-linux-gnu | |
checking host system type... x86_64-pc-linux-gnu | |
checking target system type... x86_64-pc-linux-gnu | |
checking for ld... ld | |
checking how to print strings... printf | |
checking for gcc... gcc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Converts vibrational frequencies from atomic units to cm-1 for diatomics.""" | |
import sys | |
from math import sqrt, pi | |
# Atomic masses obtained using | |
# import periodictable as pt | |
# for el in pt.elements: | |
# mass[el.symbol] = sorted([ (el[x].abundance,el[x].mass) for x in el.isotopes ])[-1][1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* http://stackoverflow.com/questions/33291754/eval-a-string-in-ocaml *) | |
#require "compiler-libs" (* Assuming you're using utop, if compiling then this is the package you need *) | |
let eval code = | |
let as_buf = Lexing.from_string code in | |
let parsed = !Toploop.parse_toplevel_phrase as_buf in | |
ignore (Toploop.execute_phrase true Format.std_formatter parsed) | |
eval "let () = print_endline \"hello\";;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Code found originally here on a post from t0n1 : | |
# http://hacktracking.blogspot.fr/2013/07/download-mega-files-from-command-line.html | |
# | |
url=$1 | |
enc_file=$2.enc | |
out_file=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ifort -S -O2 -xCORE-AVX2 slater_rules.irp.F90 -fcode-asm -fsource-asm -fverbose-asm -o test.s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Modifies a partition of a SLURM job | |
scontrol update jobid=$1 partition=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -z $0 ]] | |
then | |
echo $0 "<input.pdf> <output.pdf>" | |
exit -1 | |
fi | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$2 $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function timer_start { | |
timer=${timer:-$SECONDS} | |
} | |
function timer_stop { | |
timer_show=$(($SECONDS - $timer)) | |
unset timer | |
} | |
trap 'timer_start' DEBUG |
NewerOlder