New paste Repaste Download
#!/bin/bash
FILE="$1"
shift
AUTHOR="Ryan A. Colyer"
YEAR="$(date "+%Y")"
LICENSE="// Created in $YEAR by $AUTHOR.\n// This work is released with CC0 into the public domain.\n// https://creativecommons.org/publicdomain/zero/1.0/"
OPENSCAD="$HOME/src/openscad-master/openscad"
# Increase the stack to increase OpenSCAD's recursion depth.
ulimit -s 65536
if [ "$FILE" == "" ]
then
  TEMPF=`mktemp --suffix=.scad`
  log_scad_mem "$OPENSCAD" "$TEMPF" >/dev/null 2>/dev/null &
  vim "$TEMPF"
  rm -f "$TEMPF"
  exit
fi
if [ ! -e "$FILE" ]
then
  echo -e "$LICENSE" >> "$FILE"
fi
log_scad_mem "$OPENSCAD" "$FILE" "$@" >/dev/null 2>/dev/null &
vim "$FILE"
Filename: masterscadvim. Size: 681b. View raw, , hex, or download this file.
#!/bin/bash
TEMPF="$(mktemp)"
/usr/bin/time -v -o "$TEMPF" -- "$@"
MAXMEMKB="$(grep "Maximum resident set size (kbytes)" "$TEMPF" |
          tr -cd [:digit:])"
MAXMEMMB="$(python3 -c "print(f'{$MAXMEMKB / 1024:0.3f}')")"
echo "$(date +"%F %H:%M:%S") $MAXMEMMB MB, $@, $(pwd)" |
  perl -ne "s^$HOME^~^g; print \$_;" >>~/.openscad_mem.log
rm -f "$TEMPF"
Filename: log_scad_mem. Size: 370b. View raw, , hex, or download this file.

This paste expires on 2024-12-24 00:51:15.678695. Pasted through web.