Skip to content

Instantly share code, notes, and snippets.

Anthony Scemama scemama

Block or report user

Report or block scemama

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:514d9066de33430bad2bfa9ad5e382e5
ifort -S -O2 -xCORE-AVX2 slater_rules.irp.F90 -fcode-asm -fsource-asm -fverbose-asm -o test.s
# Modifies a partition of a SLURM job
scontrol update jobid=$1 partition=$2
scemama /
Created Jun 20, 2016
Reduce size of a scanned pdf file
if [[ -z $0 ]]
echo $0 "<input.pdf> <output.pdf>"
exit -1
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$2 $1
scemama /
Created Oct 26, 2015
Evaluate 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\";;"
scemama /
Created Sep 23, 2015
Timer in the bash prompt
function timer_start {
function timer_stop {
timer_show=$(($SECONDS - $timer))
unset timer
trap 'timer_start' DEBUG
View Bash_guidelines.rst

`bash set -u # The script crashes if a variable is uninitialized set -e # The script crashes if the exit code of a command is not zero `

  • Use "$@" instead of $@
  • Use quotes around filenames
  • Use mkdir -p to create a full path
  • Use ``rm || true `` to avoid a non-zero exit
  • Use traps when using temporary files:
scemama /
Last active Sep 20, 2015 — forked from TApplencourt/
Gets a bibtex file from a DOI or an ISBN
str_utilisation="$0 (doi|isbn) <value>"
if [ "$#" -ne 2 ];then
echo ${str_utilisation}
exit 1
if [ "$1" == "doi" ];then
scemama /
Created Jun 30, 2015
Adjust turbo frequency manually
echo 1 > /sys/module/processor/parameters/ignore_ppc
for x in /sys/devices/system/cpu/cpu[0-3]/cpufreq/;do
echo 3601000 > $x/scaling_max_freq
scemama /
Created Jun 8, 2015
Download file from
# Code found originally here on a post from t0n1 :
scemama / cuthill_mckee.f
Created Apr 23, 2015
Reverse Cuthill-MacKee subroutine
View cuthill_mckee.f
subroutine cuthill_mckee(matrix,LDA,n,iorder)
implicit none
! Uses the Cuthill-McKee algorithm to reorder the columns and rows of the matrix
integer, intent(in) :: n,LDA
integer, intent(out) :: iorder(n)
double precision, intent(in) :: matrix(LDA,n)
integer :: i,j,k
You can’t perform that action at this time.