#!/bin/sh
# Generated by niminst

set -e

if [ $# -eq 1 ] ; then
  if test -f bin/nim
  then
    echo "Nim build detected"
  else
    echo "Please build Nim before installing it"
    exit 1
  fi
  case $1 in
    "--help"|"-h"|"help"|"h")
      echo "Nim installation script"
      echo "Usage: [sudo] sh install.sh DIR"
      echo "Where DIR may be:"
      echo "  /usr/bin"
      echo "  /usr/local/bin"
      echo "  /opt"
      echo "  <some other dir> (treated similar to '/opt')"
      echo "To deinstall, use the command:"
      echo "sh deinstall.sh DIR"
      exit 1
      ;;
    "/usr/bin")
      bindir=/usr/bin
      configdir=/etc/nim
      libdir=/usr/lib/nim
      docdir=/usr/share/nim/doc
      datadir=/usr/share/nim/data
      nimbleDir="/opt/nimble/pkgs/compiler-1.6.0"
      ;;
    "/usr/local/bin")
      bindir=/usr/local/bin
      configdir=/etc/nim
      libdir=/usr/local/lib/nim
      docdir=/usr/local/share/nim/doc
      datadir=/usr/local/share/nim/data
      nimbleDir="/opt/nimble/pkgs/compiler-1.6.0"
      ;;
    "/opt")
      bindir="/opt/nim/bin"
      configdir="/opt/nim/config"
      libdir="/opt/nim/lib"
      docdir="/opt/nim/doc"
      datadir="/opt/nim/data"
      nimbleDir="/opt/nimble/pkgs/compiler-1.6.0"
      mkdir -p /opt/nim
      mkdir -p $bindir
      mkdir -p $configdir
      ;;
    *)
      bindir="$1/nim/bin"
      configdir="$1/nim/config"
      libdir="$1/nim/lib"
      docdir="$1/nim/doc"
      datadir="$1/nim/data"
      nimbleDir="$1/nim"
      mkdir -p $1/nim
      mkdir -p $bindir
      mkdir -p $configdir
      ;;
  esac

  mkdir -p $libdir
  mkdir -p $docdir
  mkdir -p $configdir
  mkdir -p $nimbleDir/
  echo "copying files..."
  mkdir -p $configdir/
  mkdir -p $libdir/
  mkdir -p $libdir/js
  mkdir -p $libdir/std/private
  mkdir -p $libdir/std
  mkdir -p $libdir/genode_cpp
  mkdir -p $libdir/system
  mkdir -p $libdir/system/mm
  mkdir -p $libdir/deprecated/pure
  mkdir -p $libdir/posix
  mkdir -p $libdir/wrappers
  mkdir -p $libdir/wrappers/linenoise
  mkdir -p $libdir/pure
  mkdir -p $libdir/pure/ioselects
  mkdir -p $libdir/pure/unidecode
  mkdir -p $libdir/pure/collections
  mkdir -p $libdir/pure/concurrency
  mkdir -p $libdir/pure/includes
  mkdir -p $libdir/packages/docutils
  mkdir -p $libdir/impure/nre/private
  mkdir -p $libdir/impure
  mkdir -p $libdir/genode
  mkdir -p $libdir/core
  mkdir -p $libdir/windows
  mkdir -p $libdir/arch/x86
  mkdir -p $libdir/experimental
  mkdir -p $nimbleDir/compiler
  mkdir -p $nimbleDir/compiler/ic
  mkdir -p $nimbleDir/compiler/nimfix
  mkdir -p $nimbleDir/compiler/plugins
  mkdir -p $nimbleDir/doc

  cp bin/nim $bindir/nim
  chmod 755 $bindir/nim
  cp config/nim.cfg $configdir/nim.cfg
  chmod 644 $configdir/nim.cfg
  cp config/nimdoc.cfg $configdir/nimdoc.cfg
  chmod 644 $configdir/nimdoc.cfg
  cp config/nimdoc.tex.cfg $configdir/nimdoc.tex.cfg
  chmod 644 $configdir/nimdoc.tex.cfg
  cp config/rename.rules.cfg $configdir/rename.rules.cfg
  chmod 644 $configdir/rename.rules.cfg
  cp config/config.nims $configdir/config.nims
  chmod 644 $configdir/config.nims
  cp lib/system_overview.rst $libdir/system_overview.rst
  chmod 644 $libdir/system_overview.rst
  cp lib/deps.txt $libdir/deps.txt
  chmod 644 $libdir/deps.txt
  cp lib/js/jsconsole.nim $libdir/js/jsconsole.nim
  chmod 644 $libdir/js/jsconsole.nim
  cp lib/js/asyncjs.nim $libdir/js/asyncjs.nim
  chmod 644 $libdir/js/asyncjs.nim
  cp lib/js/dom_extensions.nim $libdir/js/dom_extensions.nim
  chmod 644 $libdir/js/dom_extensions.nim
  cp lib/js/jsffi.nim $libdir/js/jsffi.nim
  chmod 644 $libdir/js/jsffi.nim
  cp lib/js/dom.nim $libdir/js/dom.nim
  chmod 644 $libdir/js/dom.nim
  cp lib/js/jscore.nim $libdir/js/jscore.nim
  chmod 644 $libdir/js/jscore.nim
  cp lib/js/jsre.nim $libdir/js/jsre.nim
  chmod 644 $libdir/js/jsre.nim
  cp lib/cycle.h $libdir/cycle.h
  chmod 644 $libdir/cycle.h
  cp lib/std/private/digitsutils.nim $libdir/std/private/digitsutils.nim
  chmod 644 $libdir/std/private/digitsutils.nim
  cp lib/std/private/dbutils.nim $libdir/std/private/dbutils.nim
  chmod 644 $libdir/std/private/dbutils.nim
  cp lib/std/private/since.nim $libdir/std/private/since.nim
  chmod 644 $libdir/std/private/since.nim
  cp lib/std/private/strimpl.nim $libdir/std/private/strimpl.nim
  chmod 644 $libdir/std/private/strimpl.nim
  cp lib/std/private/underscored_calls.nim $libdir/std/private/underscored_calls.nim
  chmod 644 $libdir/std/private/underscored_calls.nim
  cp lib/std/private/win_setenv.nim $libdir/std/private/win_setenv.nim
  chmod 644 $libdir/std/private/win_setenv.nim
  cp lib/std/private/gitutils.nim $libdir/std/private/gitutils.nim
  chmod 644 $libdir/std/private/gitutils.nim
  cp lib/std/private/bitops_utils.nim $libdir/std/private/bitops_utils.nim
  chmod 644 $libdir/std/private/bitops_utils.nim
  cp lib/std/private/miscdollars.nim $libdir/std/private/miscdollars.nim
  chmod 644 $libdir/std/private/miscdollars.nim
  cp lib/std/private/jsutils.nim $libdir/std/private/jsutils.nim
  chmod 644 $libdir/std/private/jsutils.nim
  cp lib/std/private/globs.nim $libdir/std/private/globs.nim
  chmod 644 $libdir/std/private/globs.nim
  cp lib/std/private/asciitables.nim $libdir/std/private/asciitables.nim
  chmod 644 $libdir/std/private/asciitables.nim
  cp lib/std/private/decode_helpers.nim $libdir/std/private/decode_helpers.nim
  chmod 644 $libdir/std/private/decode_helpers.nim
  cp lib/std/jsheaders.nim $libdir/std/jsheaders.nim
  chmod 644 $libdir/std/jsheaders.nim
  cp lib/std/sha1.nim $libdir/std/sha1.nim
  chmod 644 $libdir/std/sha1.nim
  cp lib/std/jsfetch.nim $libdir/std/jsfetch.nim
  chmod 644 $libdir/std/jsfetch.nim
  cp lib/std/enumerate.nim $libdir/std/enumerate.nim
  chmod 644 $libdir/std/enumerate.nim
  cp lib/std/effecttraits.nim $libdir/std/effecttraits.nim
  chmod 644 $libdir/std/effecttraits.nim
  cp lib/std/exitprocs.nim $libdir/std/exitprocs.nim
  chmod 644 $libdir/std/exitprocs.nim
  cp lib/std/sums.nim $libdir/std/sums.nim
  chmod 644 $libdir/std/sums.nim
  cp lib/std/time_t.nim $libdir/std/time_t.nim
  chmod 644 $libdir/std/time_t.nim
  cp lib/std/varints.nim $libdir/std/varints.nim
  chmod 644 $libdir/std/varints.nim
  cp lib/std/decls.nim $libdir/std/decls.nim
  chmod 644 $libdir/std/decls.nim
  cp lib/std/socketstreams.nim $libdir/std/socketstreams.nim
  chmod 644 $libdir/std/socketstreams.nim
  cp lib/std/enumutils.nim $libdir/std/enumutils.nim
  chmod 644 $libdir/std/enumutils.nim
  cp lib/std/importutils.nim $libdir/std/importutils.nim
  chmod 644 $libdir/std/importutils.nim
  cp lib/std/jsonutils.nim $libdir/std/jsonutils.nim
  chmod 644 $libdir/std/jsonutils.nim
  cp lib/std/tempfiles.nim $libdir/std/tempfiles.nim
  chmod 644 $libdir/std/tempfiles.nim
  cp lib/std/editdistance.nim $libdir/std/editdistance.nim
  chmod 644 $libdir/std/editdistance.nim
  cp lib/std/wrapnils.nim $libdir/std/wrapnils.nim
  chmod 644 $libdir/std/wrapnils.nim
  cp lib/std/stackframes.nim $libdir/std/stackframes.nim
  chmod 644 $libdir/std/stackframes.nim
  cp lib/std/sysrand.nim $libdir/std/sysrand.nim
  chmod 644 $libdir/std/sysrand.nim
  cp lib/std/jsformdata.nim $libdir/std/jsformdata.nim
  chmod 644 $libdir/std/jsformdata.nim
  cp lib/std/compilesettings.nim $libdir/std/compilesettings.nim
  chmod 644 $libdir/std/compilesettings.nim
  cp lib/std/genasts.nim $libdir/std/genasts.nim
  chmod 644 $libdir/std/genasts.nim
  cp lib/std/with.nim $libdir/std/with.nim
  chmod 644 $libdir/std/with.nim
  cp lib/std/setutils.nim $libdir/std/setutils.nim
  chmod 644 $libdir/std/setutils.nim
  cp lib/std/tasks.nim $libdir/std/tasks.nim
  chmod 644 $libdir/std/tasks.nim
  cp lib/std/strbasics.nim $libdir/std/strbasics.nim
  chmod 644 $libdir/std/strbasics.nim
  cp lib/std/logic.nim $libdir/std/logic.nim
  chmod 644 $libdir/std/logic.nim
  cp lib/std/packedsets.nim $libdir/std/packedsets.nim
  chmod 644 $libdir/std/packedsets.nim
  cp lib/std/monotimes.nim $libdir/std/monotimes.nim
  chmod 644 $libdir/std/monotimes.nim
  cp lib/std/jsbigints.nim $libdir/std/jsbigints.nim
  chmod 644 $libdir/std/jsbigints.nim
  cp lib/std/isolation.nim $libdir/std/isolation.nim
  chmod 644 $libdir/std/isolation.nim
  cp lib/std/vmutils.nim $libdir/std/vmutils.nim
  chmod 644 $libdir/std/vmutils.nim
  cp lib/std/wordwrap.nim $libdir/std/wordwrap.nim
  chmod 644 $libdir/std/wordwrap.nim
  cp lib/genode_cpp/threads.h $libdir/genode_cpp/threads.h
  chmod 644 $libdir/genode_cpp/threads.h
  cp lib/genode_cpp/syslocks.h $libdir/genode_cpp/syslocks.h
  chmod 644 $libdir/genode_cpp/syslocks.h
  cp lib/system/memalloc.nim $libdir/system/memalloc.nim
  chmod 644 $libdir/system/memalloc.nim
  cp lib/system/stacktraces.nim $libdir/system/stacktraces.nim
  chmod 644 $libdir/system/stacktraces.nim
  cp lib/system/arithmetics.nim $libdir/system/arithmetics.nim
  chmod 644 $libdir/system/arithmetics.nim
  cp lib/system/repr_impl.nim $libdir/system/repr_impl.nim
  chmod 644 $libdir/system/repr_impl.nim
  cp lib/system/atomics.nim $libdir/system/atomics.nim
  chmod 644 $libdir/system/atomics.nim
  cp lib/system/basic_types.nim $libdir/system/basic_types.nim
  chmod 644 $libdir/system/basic_types.nim
  cp lib/system/cellseqs_v2.nim $libdir/system/cellseqs_v2.nim
  chmod 644 $libdir/system/cellseqs_v2.nim
  cp lib/system/repr_v2.nim $libdir/system/repr_v2.nim
  chmod 644 $libdir/system/repr_v2.nim
  cp lib/system/excpt.nim $libdir/system/excpt.nim
  chmod 644 $libdir/system/excpt.nim
  cp lib/system/sysspawn.nim $libdir/system/sysspawn.nim
  chmod 644 $libdir/system/sysspawn.nim
  cp lib/system/iterators.nim $libdir/system/iterators.nim
  chmod 644 $libdir/system/iterators.nim
  cp lib/system/fatal.nim $libdir/system/fatal.nim
  chmod 644 $libdir/system/fatal.nim
  cp lib/system/memory.nim $libdir/system/memory.nim
  chmod 644 $libdir/system/memory.nim
  cp lib/system/cellseqs_v1.nim $libdir/system/cellseqs_v1.nim
  chmod 644 $libdir/system/cellseqs_v1.nim
  cp lib/system/arithm.nim $libdir/system/arithm.nim
  chmod 644 $libdir/system/arithm.nim
  cp lib/system/cgprocs.nim $libdir/system/cgprocs.nim
  chmod 644 $libdir/system/cgprocs.nim
  cp lib/system/seqs_v2.nim $libdir/system/seqs_v2.nim
  chmod 644 $libdir/system/seqs_v2.nim
  cp lib/system/coro_detection.nim $libdir/system/coro_detection.nim
  chmod 644 $libdir/system/coro_detection.nim
  cp lib/system/dollars.nim $libdir/system/dollars.nim
  chmod 644 $libdir/system/dollars.nim
  cp lib/system/strs_v2.nim $libdir/system/strs_v2.nim
  chmod 644 $libdir/system/strs_v2.nim
  cp lib/system/dragonbox.nim $libdir/system/dragonbox.nim
  chmod 644 $libdir/system/dragonbox.nim
  cp lib/system/assign.nim $libdir/system/assign.nim
  chmod 644 $libdir/system/assign.nim
  cp lib/system/sets.nim $libdir/system/sets.nim
  chmod 644 $libdir/system/sets.nim
  cp lib/system/mmdisp.nim $libdir/system/mmdisp.nim
  chmod 644 $libdir/system/mmdisp.nim
  cp lib/system/strmantle.nim $libdir/system/strmantle.nim
  chmod 644 $libdir/system/strmantle.nim
  cp lib/system/hti.nim $libdir/system/hti.nim
  chmod 644 $libdir/system/hti.nim
  cp lib/system/platforms.nim $libdir/system/platforms.nim
  chmod 644 $libdir/system/platforms.nim
  cp lib/system/timers.nim $libdir/system/timers.nim
  chmod 644 $libdir/system/timers.nim
  cp lib/system/gc2.nim $libdir/system/gc2.nim
  chmod 644 $libdir/system/gc2.nim
  cp lib/system/mm/none.nim $libdir/system/mm/none.nim
  chmod 644 $libdir/system/mm/none.nim
  cp lib/system/mm/malloc.nim $libdir/system/mm/malloc.nim
  chmod 644 $libdir/system/mm/malloc.nim
  cp lib/system/mm/boehm.nim $libdir/system/mm/boehm.nim
  chmod 644 $libdir/system/mm/boehm.nim
  cp lib/system/mm/go.nim $libdir/system/mm/go.nim
  chmod 644 $libdir/system/mm/go.nim
  cp lib/system/gc_ms.nim $libdir/system/gc_ms.nim
  chmod 644 $libdir/system/gc_ms.nim
  cp lib/system/cellsets.nim $libdir/system/cellsets.nim
  chmod 644 $libdir/system/cellsets.nim
  cp lib/system/assertions.nim $libdir/system/assertions.nim
  chmod 644 $libdir/system/assertions.nim
  cp lib/system/seqs_v2_reimpl.nim $libdir/system/seqs_v2_reimpl.nim
  chmod 644 $libdir/system/seqs_v2_reimpl.nim
  cp lib/system/profiler.nim $libdir/system/profiler.nim
  chmod 644 $libdir/system/profiler.nim
  cp lib/system/schubfach.nim $libdir/system/schubfach.nim
  chmod 644 $libdir/system/schubfach.nim
  cp lib/system/setops.nim $libdir/system/setops.nim
  chmod 644 $libdir/system/setops.nim
  cp lib/system/channels_builtin.nim $libdir/system/channels_builtin.nim
  chmod 644 $libdir/system/channels_builtin.nim
  cp lib/system/avltree.nim $libdir/system/avltree.nim
  chmod 644 $libdir/system/avltree.nim
  cp lib/system/memtracker.nim $libdir/system/memtracker.nim
  chmod 644 $libdir/system/memtracker.nim
  cp lib/system/ansi_c.nim $libdir/system/ansi_c.nim
  chmod 644 $libdir/system/ansi_c.nim
  cp lib/system/gc_interface.nim $libdir/system/gc_interface.nim
  chmod 644 $libdir/system/gc_interface.nim
  cp lib/system/formatfloat.nim $libdir/system/formatfloat.nim
  chmod 644 $libdir/system/formatfloat.nim
  cp lib/system/inclrtl.nim $libdir/system/inclrtl.nim
  chmod 644 $libdir/system/inclrtl.nim
  cp lib/system/iterators_1.nim $libdir/system/iterators_1.nim
  chmod 644 $libdir/system/iterators_1.nim
  cp lib/system/orc.nim $libdir/system/orc.nim
  chmod 644 $libdir/system/orc.nim
  cp lib/system/gc_common.nim $libdir/system/gc_common.nim
  chmod 644 $libdir/system/gc_common.nim
  cp lib/system/gc_hooks.nim $libdir/system/gc_hooks.nim
  chmod 644 $libdir/system/gc_hooks.nim
  cp lib/system/comparisons.nim $libdir/system/comparisons.nim
  chmod 644 $libdir/system/comparisons.nim
  cp lib/system/indexerrors.nim $libdir/system/indexerrors.nim
  chmod 644 $libdir/system/indexerrors.nim
  cp lib/system/repr.nim $libdir/system/repr.nim
  chmod 644 $libdir/system/repr.nim
  cp lib/system/dyncalls.nim $libdir/system/dyncalls.nim
  chmod 644 $libdir/system/dyncalls.nim
  cp lib/system/widestrs.nim $libdir/system/widestrs.nim
  chmod 644 $libdir/system/widestrs.nim
  cp lib/system/bitmasks.nim $libdir/system/bitmasks.nim
  chmod 644 $libdir/system/bitmasks.nim
  cp lib/system/exceptions.nim $libdir/system/exceptions.nim
  chmod 644 $libdir/system/exceptions.nim
  cp lib/system/io.nim $libdir/system/io.nim
  chmod 644 $libdir/system/io.nim
  cp lib/system/deepcopy.nim $libdir/system/deepcopy.nim
  chmod 644 $libdir/system/deepcopy.nim
  cp lib/system/jssys.nim $libdir/system/jssys.nim
  chmod 644 $libdir/system/jssys.nim
  cp lib/system/chcks.nim $libdir/system/chcks.nim
  chmod 644 $libdir/system/chcks.nim
  cp lib/system/integerops.nim $libdir/system/integerops.nim
  chmod 644 $libdir/system/integerops.nim
  cp lib/system/osalloc.nim $libdir/system/osalloc.nim
  chmod 644 $libdir/system/osalloc.nim
  cp lib/system/alloc.nim $libdir/system/alloc.nim
  chmod 644 $libdir/system/alloc.nim
  cp lib/system/embedded.nim $libdir/system/embedded.nim
  chmod 644 $libdir/system/embedded.nim
  cp lib/system/nimscript.nim $libdir/system/nimscript.nim
  chmod 644 $libdir/system/nimscript.nim
  cp lib/system/countbits_impl.nim $libdir/system/countbits_impl.nim
  chmod 644 $libdir/system/countbits_impl.nim
  cp lib/system/cyclebreaker.nim $libdir/system/cyclebreaker.nim
  chmod 644 $libdir/system/cyclebreaker.nim
  cp lib/system/gc_regions.nim $libdir/system/gc_regions.nim
  chmod 644 $libdir/system/gc_regions.nim
  cp lib/system/syslocks.nim $libdir/system/syslocks.nim
  chmod 644 $libdir/system/syslocks.nim
  cp lib/system/sysstr.nim $libdir/system/sysstr.nim
  chmod 644 $libdir/system/sysstr.nim
  cp lib/system/arc.nim $libdir/system/arc.nim
  chmod 644 $libdir/system/arc.nim
  cp lib/system/threads.nim $libdir/system/threads.nim
  chmod 644 $libdir/system/threads.nim
  cp lib/system/gc.nim $libdir/system/gc.nim
  chmod 644 $libdir/system/gc.nim
  cp lib/system/threadlocalstorage.nim $libdir/system/threadlocalstorage.nim
  chmod 644 $libdir/system/threadlocalstorage.nim
  cp lib/system/reprjs.nim $libdir/system/reprjs.nim
  chmod 644 $libdir/system/reprjs.nim
  cp lib/nimhcr.nim $libdir/nimhcr.nim
  chmod 644 $libdir/nimhcr.nim
  cp lib/nimrtl.nim $libdir/nimrtl.nim
  chmod 644 $libdir/nimrtl.nim
  cp lib/deprecated/pure/parseopt2.nim $libdir/deprecated/pure/parseopt2.nim
  chmod 644 $libdir/deprecated/pure/parseopt2.nim
  cp lib/deprecated/pure/securehash.nim $libdir/deprecated/pure/securehash.nim
  chmod 644 $libdir/deprecated/pure/securehash.nim
  cp lib/deprecated/pure/ospaths.nim $libdir/deprecated/pure/ospaths.nim
  chmod 644 $libdir/deprecated/pure/ospaths.nim
  cp lib/deprecated/pure/sharedstrings.nim $libdir/deprecated/pure/sharedstrings.nim
  chmod 644 $libdir/deprecated/pure/sharedstrings.nim
  cp lib/deprecated/pure/events.nim $libdir/deprecated/pure/events.nim
  chmod 644 $libdir/deprecated/pure/events.nim
  cp lib/deprecated/pure/LockFreeHash.nim $libdir/deprecated/pure/LockFreeHash.nim
  chmod 644 $libdir/deprecated/pure/LockFreeHash.nim
  cp lib/posix/posix_linux_amd64.nim $libdir/posix/posix_linux_amd64.nim
  chmod 644 $libdir/posix/posix_linux_amd64.nim
  cp lib/posix/posix_haiku.nim $libdir/posix/posix_haiku.nim
  chmod 644 $libdir/posix/posix_haiku.nim
  cp lib/posix/kqueue.nim $libdir/posix/kqueue.nim
  chmod 644 $libdir/posix/kqueue.nim
  cp lib/posix/posix_openbsd_amd64.nim $libdir/posix/posix_openbsd_amd64.nim
  chmod 644 $libdir/posix/posix_openbsd_amd64.nim
  cp lib/posix/posix_other.nim $libdir/posix/posix_other.nim
  chmod 644 $libdir/posix/posix_other.nim
  cp lib/posix/posix_linux_amd64_consts.nim $libdir/posix/posix_linux_amd64_consts.nim
  chmod 644 $libdir/posix/posix_linux_amd64_consts.nim
  cp lib/posix/posix_nintendoswitch.nim $libdir/posix/posix_nintendoswitch.nim
  chmod 644 $libdir/posix/posix_nintendoswitch.nim
  cp lib/posix/posix_macos_amd64.nim $libdir/posix/posix_macos_amd64.nim
  chmod 644 $libdir/posix/posix_macos_amd64.nim
  cp lib/posix/posix.nim $libdir/posix/posix.nim
  chmod 644 $libdir/posix/posix.nim
  cp lib/posix/inotify.nim $libdir/posix/inotify.nim
  chmod 644 $libdir/posix/inotify.nim
  cp lib/posix/termios.nim $libdir/posix/termios.nim
  chmod 644 $libdir/posix/termios.nim
  cp lib/posix/epoll.nim $libdir/posix/epoll.nim
  chmod 644 $libdir/posix/epoll.nim
  cp lib/posix/posix_nintendoswitch_consts.nim $libdir/posix/posix_nintendoswitch_consts.nim
  chmod 644 $libdir/posix/posix_nintendoswitch_consts.nim
  cp lib/posix/posix_other_consts.nim $libdir/posix/posix_other_consts.nim
  chmod 644 $libdir/posix/posix_other_consts.nim
  cp lib/posix/linux.nim $libdir/posix/linux.nim
  chmod 644 $libdir/posix/linux.nim
  cp lib/posix/posix_utils.nim $libdir/posix/posix_utils.nim
  chmod 644 $libdir/posix/posix_utils.nim
  cp lib/posix/posix_freertos_consts.nim $libdir/posix/posix_freertos_consts.nim
  chmod 644 $libdir/posix/posix_freertos_consts.nim
  cp lib/wrappers/postgres.nim $libdir/wrappers/postgres.nim
  chmod 644 $libdir/wrappers/postgres.nim
  cp lib/wrappers/linenoise/LICENSE.txt $libdir/wrappers/linenoise/LICENSE.txt
  chmod 644 $libdir/wrappers/linenoise/LICENSE.txt
  cp lib/wrappers/linenoise/linenoise.h $libdir/wrappers/linenoise/linenoise.h
  chmod 644 $libdir/wrappers/linenoise/linenoise.h
  cp lib/wrappers/linenoise/linenoise.nim $libdir/wrappers/linenoise/linenoise.nim
  chmod 644 $libdir/wrappers/linenoise/linenoise.nim
  cp lib/wrappers/linenoise/README.markdown $libdir/wrappers/linenoise/README.markdown
  chmod 644 $libdir/wrappers/linenoise/README.markdown
  cp lib/wrappers/linenoise/linenoise.c $libdir/wrappers/linenoise/linenoise.c
  chmod 644 $libdir/wrappers/linenoise/linenoise.c
  cp lib/wrappers/mysql.nim $libdir/wrappers/mysql.nim
  chmod 644 $libdir/wrappers/mysql.nim
  cp lib/wrappers/odbcsql.nim $libdir/wrappers/odbcsql.nim
  chmod 644 $libdir/wrappers/odbcsql.nim
  cp lib/wrappers/openssl.nim $libdir/wrappers/openssl.nim
  chmod 644 $libdir/wrappers/openssl.nim
  cp lib/wrappers/tinyc.nim $libdir/wrappers/tinyc.nim
  chmod 644 $libdir/wrappers/tinyc.nim
  cp lib/wrappers/pcre.nim $libdir/wrappers/pcre.nim
  chmod 644 $libdir/wrappers/pcre.nim
  cp lib/wrappers/sqlite3.nim $libdir/wrappers/sqlite3.nim
  chmod 644 $libdir/wrappers/sqlite3.nim
  cp lib/stdlib.nimble $libdir/stdlib.nimble
  chmod 644 $libdir/stdlib.nimble
  cp lib/nimbase.h $libdir/nimbase.h
  chmod 644 $libdir/nimbase.h
  cp lib/nimhcr.nim.cfg $libdir/nimhcr.nim.cfg
  chmod 644 $libdir/nimhcr.nim.cfg
  cp lib/pure/reservedmem.nim $libdir/pure/reservedmem.nim
  chmod 644 $libdir/pure/reservedmem.nim
  cp lib/pure/memfiles.nim $libdir/pure/memfiles.nim
  chmod 644 $libdir/pure/memfiles.nim
  cp lib/pure/streamwrapper.nim $libdir/pure/streamwrapper.nim
  chmod 644 $libdir/pure/streamwrapper.nim
  cp lib/pure/browsers.nim $libdir/pure/browsers.nim
  chmod 644 $libdir/pure/browsers.nim
  cp lib/pure/hashes.nim $libdir/pure/hashes.nim
  chmod 644 $libdir/pure/hashes.nim
  cp lib/pure/os.nim $libdir/pure/os.nim
  chmod 644 $libdir/pure/os.nim
  cp lib/pure/dynlib.nim $libdir/pure/dynlib.nim
  chmod 644 $libdir/pure/dynlib.nim
  cp lib/pure/asyncfutures.nim $libdir/pure/asyncfutures.nim
  chmod 644 $libdir/pure/asyncfutures.nim
  cp lib/pure/asyncmacro.nim $libdir/pure/asyncmacro.nim
  chmod 644 $libdir/pure/asyncmacro.nim
  cp lib/pure/ioselects/ioselectors_epoll.nim $libdir/pure/ioselects/ioselectors_epoll.nim
  chmod 644 $libdir/pure/ioselects/ioselectors_epoll.nim
  cp lib/pure/ioselects/ioselectors_select.nim $libdir/pure/ioselects/ioselectors_select.nim
  chmod 644 $libdir/pure/ioselects/ioselectors_select.nim
  cp lib/pure/ioselects/ioselectors_kqueue.nim $libdir/pure/ioselects/ioselectors_kqueue.nim
  chmod 644 $libdir/pure/ioselects/ioselectors_kqueue.nim
  cp lib/pure/ioselects/ioselectors_poll.nim $libdir/pure/ioselects/ioselectors_poll.nim
  chmod 644 $libdir/pure/ioselects/ioselectors_poll.nim
  cp lib/pure/base64.nim $libdir/pure/base64.nim
  chmod 644 $libdir/pure/base64.nim
  cp lib/pure/colors.nim $libdir/pure/colors.nim
  chmod 644 $libdir/pure/colors.nim
  cp lib/pure/rationals.nim $libdir/pure/rationals.nim
  chmod 644 $libdir/pure/rationals.nim
  cp lib/pure/ssl_config.nim $libdir/pure/ssl_config.nim
  chmod 644 $libdir/pure/ssl_config.nim
  cp lib/pure/unidecode/gen.py $libdir/pure/unidecode/gen.py
  chmod 644 $libdir/pure/unidecode/gen.py
  cp lib/pure/unidecode/unidecode.nim $libdir/pure/unidecode/unidecode.nim
  chmod 644 $libdir/pure/unidecode/unidecode.nim
  cp lib/pure/unidecode/unidecode.dat $libdir/pure/unidecode/unidecode.dat
  chmod 644 $libdir/pure/unidecode/unidecode.dat
  cp lib/pure/parsexml.nim $libdir/pure/parsexml.nim
  chmod 644 $libdir/pure/parsexml.nim
  cp lib/pure/strutils.nim $libdir/pure/strutils.nim
  chmod 644 $libdir/pure/strutils.nim
  cp lib/pure/strscans.nim $libdir/pure/strscans.nim
  chmod 644 $libdir/pure/strscans.nim
  cp lib/pure/sugar.nim $libdir/pure/sugar.nim
  chmod 644 $libdir/pure/sugar.nim
  cp lib/pure/typetraits.nim $libdir/pure/typetraits.nim
  chmod 644 $libdir/pure/typetraits.nim
  cp lib/pure/uri.nim $libdir/pure/uri.nim
  chmod 644 $libdir/pure/uri.nim
  cp lib/pure/segfaults.nim $libdir/pure/segfaults.nim
  chmod 644 $libdir/pure/segfaults.nim
  cp lib/pure/asyncftpclient.nim $libdir/pure/asyncftpclient.nim
  chmod 644 $libdir/pure/asyncftpclient.nim
  cp lib/pure/pegs.nim $libdir/pure/pegs.nim
  chmod 644 $libdir/pure/pegs.nim
  cp lib/pure/parseopt.nim $libdir/pure/parseopt.nim
  chmod 644 $libdir/pure/parseopt.nim
  cp lib/pure/json.nim $libdir/pure/json.nim
  chmod 644 $libdir/pure/json.nim
  cp lib/pure/nimprof.nim $libdir/pure/nimprof.nim
  chmod 644 $libdir/pure/nimprof.nim
  cp lib/pure/parsesql.nim $libdir/pure/parsesql.nim
  chmod 644 $libdir/pure/parsesql.nim
  cp lib/pure/marshal.nim $libdir/pure/marshal.nim
  chmod 644 $libdir/pure/marshal.nim
  cp lib/pure/db_common.nim $libdir/pure/db_common.nim
  chmod 644 $libdir/pure/db_common.nim
  cp lib/pure/options.nim $libdir/pure/options.nim
  chmod 644 $libdir/pure/options.nim
  cp lib/pure/ssl_certs.nim $libdir/pure/ssl_certs.nim
  chmod 644 $libdir/pure/ssl_certs.nim
  cp lib/pure/lenientops.nim $libdir/pure/lenientops.nim
  chmod 644 $libdir/pure/lenientops.nim
  cp lib/pure/cgi.nim $libdir/pure/cgi.nim
  chmod 644 $libdir/pure/cgi.nim
  cp lib/pure/selectors.nim $libdir/pure/selectors.nim
  chmod 644 $libdir/pure/selectors.nim
  cp lib/pure/complex.nim $libdir/pure/complex.nim
  chmod 644 $libdir/pure/complex.nim
  cp lib/pure/asyncstreams.nim $libdir/pure/asyncstreams.nim
  chmod 644 $libdir/pure/asyncstreams.nim
  cp lib/pure/punycode.nim $libdir/pure/punycode.nim
  chmod 644 $libdir/pure/punycode.nim
  cp lib/pure/math.nim $libdir/pure/math.nim
  chmod 644 $libdir/pure/math.nim
  cp lib/pure/strtabs.nim $libdir/pure/strtabs.nim
  chmod 644 $libdir/pure/strtabs.nim
  cp lib/pure/lexbase.nim $libdir/pure/lexbase.nim
  chmod 644 $libdir/pure/lexbase.nim
  cp lib/pure/cstrutils.nim $libdir/pure/cstrutils.nim
  chmod 644 $libdir/pure/cstrutils.nim
  cp lib/pure/md5.nim $libdir/pure/md5.nim
  chmod 644 $libdir/pure/md5.nim
  cp lib/pure/times.nim $libdir/pure/times.nim
  chmod 644 $libdir/pure/times.nim
  cp lib/pure/future.nim $libdir/pure/future.nim
  chmod 644 $libdir/pure/future.nim
  cp lib/pure/oswalkdir.nim $libdir/pure/oswalkdir.nim
  chmod 644 $libdir/pure/oswalkdir.nim
  cp lib/pure/encodings.nim $libdir/pure/encodings.nim
  chmod 644 $libdir/pure/encodings.nim
  cp lib/pure/oids.nim $libdir/pure/oids.nim
  chmod 644 $libdir/pure/oids.nim
  cp lib/pure/mimetypes.nim $libdir/pure/mimetypes.nim
  chmod 644 $libdir/pure/mimetypes.nim
  cp lib/pure/nimprof.nim.cfg $libdir/pure/nimprof.nim.cfg
  chmod 644 $libdir/pure/nimprof.nim.cfg
  cp lib/pure/collections/intsets.nim $libdir/pure/collections/intsets.nim
  chmod 644 $libdir/pure/collections/intsets.nim
  cp lib/pure/collections/rtarrays.nim $libdir/pure/collections/rtarrays.nim
  chmod 644 $libdir/pure/collections/rtarrays.nim
  cp lib/pure/collections/sharedlist.nim $libdir/pure/collections/sharedlist.nim
  chmod 644 $libdir/pure/collections/sharedlist.nim
  cp lib/pure/collections/hashcommon.nim $libdir/pure/collections/hashcommon.nim
  chmod 644 $libdir/pure/collections/hashcommon.nim
  cp lib/pure/collections/sets.nim $libdir/pure/collections/sets.nim
  chmod 644 $libdir/pure/collections/sets.nim
  cp lib/pure/collections/setimpl.nim $libdir/pure/collections/setimpl.nim
  chmod 644 $libdir/pure/collections/setimpl.nim
  cp lib/pure/collections/chains.nim $libdir/pure/collections/chains.nim
  chmod 644 $libdir/pure/collections/chains.nim
  cp lib/pure/collections/tableimpl.nim $libdir/pure/collections/tableimpl.nim
  chmod 644 $libdir/pure/collections/tableimpl.nim
  cp lib/pure/collections/sequtils.nim $libdir/pure/collections/sequtils.nim
  chmod 644 $libdir/pure/collections/sequtils.nim
  cp lib/pure/collections/sharedtables.nim $libdir/pure/collections/sharedtables.nim
  chmod 644 $libdir/pure/collections/sharedtables.nim
  cp lib/pure/collections/tables.nim $libdir/pure/collections/tables.nim
  chmod 644 $libdir/pure/collections/tables.nim
  cp lib/pure/collections/lists.nim $libdir/pure/collections/lists.nim
  chmod 644 $libdir/pure/collections/lists.nim
  cp lib/pure/collections/deques.nim $libdir/pure/collections/deques.nim
  chmod 644 $libdir/pure/collections/deques.nim
  cp lib/pure/collections/heapqueue.nim $libdir/pure/collections/heapqueue.nim
  chmod 644 $libdir/pure/collections/heapqueue.nim
  cp lib/pure/collections/critbits.nim $libdir/pure/collections/critbits.nim
  chmod 644 $libdir/pure/collections/critbits.nim
  cp lib/pure/osproc.nim $libdir/pure/osproc.nim
  chmod 644 $libdir/pure/osproc.nim
  cp lib/pure/endians.nim $libdir/pure/endians.nim
  chmod 644 $libdir/pure/endians.nim
  cp lib/pure/cookies.nim $libdir/pure/cookies.nim
  chmod 644 $libdir/pure/cookies.nim
  cp lib/pure/ropes.nim $libdir/pure/ropes.nim
  chmod 644 $libdir/pure/ropes.nim
  cp lib/pure/volatile.nim $libdir/pure/volatile.nim
  chmod 644 $libdir/pure/volatile.nim
  cp lib/pure/async.nim $libdir/pure/async.nim
  chmod 644 $libdir/pure/async.nim
  cp lib/pure/htmlgen.nim $libdir/pure/htmlgen.nim
  chmod 644 $libdir/pure/htmlgen.nim
  cp lib/pure/bitops.nim $libdir/pure/bitops.nim
  chmod 644 $libdir/pure/bitops.nim
  cp lib/pure/xmlparser.nim $libdir/pure/xmlparser.nim
  chmod 644 $libdir/pure/xmlparser.nim
  cp lib/pure/asynchttpserver.nim $libdir/pure/asynchttpserver.nim
  chmod 644 $libdir/pure/asynchttpserver.nim
  cp lib/pure/stats.nim $libdir/pure/stats.nim
  chmod 644 $libdir/pure/stats.nim
  cp lib/pure/prelude.nim $libdir/pure/prelude.nim
  chmod 644 $libdir/pure/prelude.nim
  cp lib/pure/algorithm.nim $libdir/pure/algorithm.nim
  chmod 644 $libdir/pure/algorithm.nim
  cp lib/pure/pathnorm.nim $libdir/pure/pathnorm.nim
  chmod 644 $libdir/pure/pathnorm.nim
  cp lib/pure/unicode.nim $libdir/pure/unicode.nim
  chmod 644 $libdir/pure/unicode.nim
  cp lib/pure/asyncnet.nim $libdir/pure/asyncnet.nim
  chmod 644 $libdir/pure/asyncnet.nim
  cp lib/pure/terminal.nim $libdir/pure/terminal.nim
  chmod 644 $libdir/pure/terminal.nim
  cp lib/pure/parsecfg.nim $libdir/pure/parsecfg.nim
  chmod 644 $libdir/pure/parsecfg.nim
  cp lib/pure/xmltree.nim $libdir/pure/xmltree.nim
  chmod 644 $libdir/pure/xmltree.nim
  cp lib/pure/unittest.nim $libdir/pure/unittest.nim
  chmod 644 $libdir/pure/unittest.nim
  cp lib/pure/nativesockets.nim $libdir/pure/nativesockets.nim
  chmod 644 $libdir/pure/nativesockets.nim
  cp lib/pure/random.nim $libdir/pure/random.nim
  chmod 644 $libdir/pure/random.nim
  cp lib/pure/distros.nim $libdir/pure/distros.nim
  chmod 644 $libdir/pure/distros.nim
  cp lib/pure/mersenne.nim $libdir/pure/mersenne.nim
  chmod 644 $libdir/pure/mersenne.nim
  cp lib/pure/strmisc.nim $libdir/pure/strmisc.nim
  chmod 644 $libdir/pure/strmisc.nim
  cp lib/pure/concurrency/atomics.nim $libdir/pure/concurrency/atomics.nim
  chmod 644 $libdir/pure/concurrency/atomics.nim
  cp lib/pure/concurrency/cpuload.nim $libdir/pure/concurrency/cpuload.nim
  chmod 644 $libdir/pure/concurrency/cpuload.nim
  cp lib/pure/concurrency/cpuinfo.nim $libdir/pure/concurrency/cpuinfo.nim
  chmod 644 $libdir/pure/concurrency/cpuinfo.nim
  cp lib/pure/concurrency/threadpool.nim $libdir/pure/concurrency/threadpool.nim
  chmod 644 $libdir/pure/concurrency/threadpool.nim
  cp lib/pure/concurrency/threadpool.nim.cfg $libdir/pure/concurrency/threadpool.nim.cfg
  chmod 644 $libdir/pure/concurrency/threadpool.nim.cfg
  cp lib/pure/httpcore.nim $libdir/pure/httpcore.nim
  chmod 644 $libdir/pure/httpcore.nim
  cp lib/pure/parseutils.nim $libdir/pure/parseutils.nim
  chmod 644 $libdir/pure/parseutils.nim
  cp lib/pure/htmlparser.nim $libdir/pure/htmlparser.nim
  chmod 644 $libdir/pure/htmlparser.nim
  cp lib/pure/asyncdispatch.nim.cfg $libdir/pure/asyncdispatch.nim.cfg
  chmod 644 $libdir/pure/asyncdispatch.nim.cfg
  cp lib/pure/parsejson.nim $libdir/pure/parsejson.nim
  chmod 644 $libdir/pure/parsejson.nim
  cp lib/pure/smtp.nim $libdir/pure/smtp.nim
  chmod 644 $libdir/pure/smtp.nim
  cp lib/pure/smtp.nim.cfg $libdir/pure/smtp.nim.cfg
  chmod 644 $libdir/pure/smtp.nim.cfg
  cp lib/pure/includes/osenv.nim $libdir/pure/includes/osenv.nim
  chmod 644 $libdir/pure/includes/osenv.nim
  cp lib/pure/includes/osseps.nim $libdir/pure/includes/osseps.nim
  chmod 644 $libdir/pure/includes/osseps.nim
  cp lib/pure/includes/oserr.nim $libdir/pure/includes/oserr.nim
  chmod 644 $libdir/pure/includes/oserr.nim
  cp lib/pure/includes/unicode_ranges.nim $libdir/pure/includes/unicode_ranges.nim
  chmod 644 $libdir/pure/includes/unicode_ranges.nim
  cp lib/pure/coro.nim $libdir/pure/coro.nim
  chmod 644 $libdir/pure/coro.nim
  cp lib/pure/asyncdispatch.nim $libdir/pure/asyncdispatch.nim
  chmod 644 $libdir/pure/asyncdispatch.nim
  cp lib/pure/fenv.nim $libdir/pure/fenv.nim
  chmod 644 $libdir/pure/fenv.nim
  cp lib/pure/parsecsv.nim $libdir/pure/parsecsv.nim
  chmod 644 $libdir/pure/parsecsv.nim
  cp lib/pure/strformat.nim $libdir/pure/strformat.nim
  chmod 644 $libdir/pure/strformat.nim
  cp lib/pure/coro.nimcfg $libdir/pure/coro.nimcfg
  chmod 644 $libdir/pure/coro.nimcfg
  cp lib/pure/streams.nim $libdir/pure/streams.nim
  chmod 644 $libdir/pure/streams.nim
  cp lib/pure/logging.nim $libdir/pure/logging.nim
  chmod 644 $libdir/pure/logging.nim
  cp lib/pure/net.nim $libdir/pure/net.nim
  chmod 644 $libdir/pure/net.nim
  cp lib/pure/asyncfile.nim $libdir/pure/asyncfile.nim
  chmod 644 $libdir/pure/asyncfile.nim
  cp lib/pure/nimtracker.nim $libdir/pure/nimtracker.nim
  chmod 644 $libdir/pure/nimtracker.nim
  cp lib/pure/httpclient.nim $libdir/pure/httpclient.nim
  chmod 644 $libdir/pure/httpclient.nim
  cp lib/packages/docutils/rstgen.nim $libdir/packages/docutils/rstgen.nim
  chmod 644 $libdir/packages/docutils/rstgen.nim
  cp lib/packages/docutils/highlite.nim $libdir/packages/docutils/highlite.nim
  chmod 644 $libdir/packages/docutils/highlite.nim
  cp lib/packages/docutils/rst.nim $libdir/packages/docutils/rst.nim
  chmod 644 $libdir/packages/docutils/rst.nim
  cp lib/packages/docutils/rstast.nim $libdir/packages/docutils/rstast.nim
  chmod 644 $libdir/packages/docutils/rstast.nim
  cp lib/packages/docutils/docutils.nimble.old $libdir/packages/docutils/docutils.nimble.old
  chmod 644 $libdir/packages/docutils/docutils.nimble.old
  cp lib/impure/nre/private/util.nim $libdir/impure/nre/private/util.nim
  chmod 644 $libdir/impure/nre/private/util.nim
  cp lib/impure/db_sqlite.nim $libdir/impure/db_sqlite.nim
  chmod 644 $libdir/impure/db_sqlite.nim
  cp lib/impure/nre.nim $libdir/impure/nre.nim
  chmod 644 $libdir/impure/nre.nim
  cp lib/impure/db_postgres.nim $libdir/impure/db_postgres.nim
  chmod 644 $libdir/impure/db_postgres.nim
  cp lib/impure/db_mysql.nim $libdir/impure/db_mysql.nim
  chmod 644 $libdir/impure/db_mysql.nim
  cp lib/impure/re.nim $libdir/impure/re.nim
  chmod 644 $libdir/impure/re.nim
  cp lib/impure/rdstdin.nim $libdir/impure/rdstdin.nim
  chmod 644 $libdir/impure/rdstdin.nim
  cp lib/impure/db_odbc.nim $libdir/impure/db_odbc.nim
  chmod 644 $libdir/impure/db_odbc.nim
  cp lib/nimrtl.nim.cfg $libdir/nimrtl.nim.cfg
  chmod 644 $libdir/nimrtl.nim.cfg
  cp lib/genode/alloc.nim $libdir/genode/alloc.nim
  chmod 644 $libdir/genode/alloc.nim
  cp lib/genode/env.nim $libdir/genode/env.nim
  chmod 644 $libdir/genode/env.nim
  cp lib/core/rlocks.nim $libdir/core/rlocks.nim
  chmod 644 $libdir/core/rlocks.nim
  cp lib/core/locks.nim $libdir/core/locks.nim
  chmod 644 $libdir/core/locks.nim
  cp lib/core/macrocache.nim $libdir/core/macrocache.nim
  chmod 644 $libdir/core/macrocache.nim
  cp lib/core/macros.nim $libdir/core/macros.nim
  chmod 644 $libdir/core/macros.nim
  cp lib/core/typeinfo.nim $libdir/core/typeinfo.nim
  chmod 644 $libdir/core/typeinfo.nim
  cp lib/core/hotcodereloading.nim $libdir/core/hotcodereloading.nim
  chmod 644 $libdir/core/hotcodereloading.nim
  cp lib/windows/registry.nim $libdir/windows/registry.nim
  chmod 644 $libdir/windows/registry.nim
  cp lib/windows/winlean.nim $libdir/windows/winlean.nim
  chmod 644 $libdir/windows/winlean.nim
  cp lib/arch/x86/i386.S $libdir/arch/x86/i386.S
  chmod 644 $libdir/arch/x86/i386.S
  cp lib/arch/x86/amd64.S $libdir/arch/x86/amd64.S
  chmod 644 $libdir/arch/x86/amd64.S
  cp lib/system.nim $libdir/system.nim
  chmod 644 $libdir/system.nim
  cp lib/experimental/diff.nim $libdir/experimental/diff.nim
  chmod 644 $libdir/experimental/diff.nim
  cp compiler/aliases.nim $nimbleDir/compiler/aliases.nim
  chmod 644 $nimbleDir/compiler/aliases.nim
  cp compiler/ast.nim $nimbleDir/compiler/ast.nim
  chmod 644 $nimbleDir/compiler/ast.nim
  cp compiler/astalgo.nim $nimbleDir/compiler/astalgo.nim
  chmod 644 $nimbleDir/compiler/astalgo.nim
  cp compiler/astmsgs.nim $nimbleDir/compiler/astmsgs.nim
  chmod 644 $nimbleDir/compiler/astmsgs.nim
  cp compiler/bitsets.nim $nimbleDir/compiler/bitsets.nim
  chmod 644 $nimbleDir/compiler/bitsets.nim
  cp compiler/btrees.nim $nimbleDir/compiler/btrees.nim
  chmod 644 $nimbleDir/compiler/btrees.nim
  cp compiler/ccgcalls.nim $nimbleDir/compiler/ccgcalls.nim
  chmod 644 $nimbleDir/compiler/ccgcalls.nim
  cp compiler/ccgexprs.nim $nimbleDir/compiler/ccgexprs.nim
  chmod 644 $nimbleDir/compiler/ccgexprs.nim
  cp compiler/ccgliterals.nim $nimbleDir/compiler/ccgliterals.nim
  chmod 644 $nimbleDir/compiler/ccgliterals.nim
  cp compiler/ccgmerge_unused.nim $nimbleDir/compiler/ccgmerge_unused.nim
  chmod 644 $nimbleDir/compiler/ccgmerge_unused.nim
  cp compiler/ccgreset.nim $nimbleDir/compiler/ccgreset.nim
  chmod 644 $nimbleDir/compiler/ccgreset.nim
  cp compiler/ccgstmts.nim $nimbleDir/compiler/ccgstmts.nim
  chmod 644 $nimbleDir/compiler/ccgstmts.nim
  cp compiler/ccgthreadvars.nim $nimbleDir/compiler/ccgthreadvars.nim
  chmod 644 $nimbleDir/compiler/ccgthreadvars.nim
  cp compiler/ccgtrav.nim $nimbleDir/compiler/ccgtrav.nim
  chmod 644 $nimbleDir/compiler/ccgtrav.nim
  cp compiler/ccgtypes.nim $nimbleDir/compiler/ccgtypes.nim
  chmod 644 $nimbleDir/compiler/ccgtypes.nim
  cp compiler/ccgutils.nim $nimbleDir/compiler/ccgutils.nim
  chmod 644 $nimbleDir/compiler/ccgutils.nim
  cp compiler/cgen.nim $nimbleDir/compiler/cgen.nim
  chmod 644 $nimbleDir/compiler/cgen.nim
  cp compiler/cgendata.nim $nimbleDir/compiler/cgendata.nim
  chmod 644 $nimbleDir/compiler/cgendata.nim
  cp compiler/cgmeth.nim $nimbleDir/compiler/cgmeth.nim
  chmod 644 $nimbleDir/compiler/cgmeth.nim
  cp compiler/closureiters.nim $nimbleDir/compiler/closureiters.nim
  chmod 644 $nimbleDir/compiler/closureiters.nim
  cp compiler/cmdlinehelper.nim $nimbleDir/compiler/cmdlinehelper.nim
  chmod 644 $nimbleDir/compiler/cmdlinehelper.nim
  cp compiler/commands.nim $nimbleDir/compiler/commands.nim
  chmod 644 $nimbleDir/compiler/commands.nim
  cp compiler/concepts.nim $nimbleDir/compiler/concepts.nim
  chmod 644 $nimbleDir/compiler/concepts.nim
  cp compiler/condsyms.nim $nimbleDir/compiler/condsyms.nim
  chmod 644 $nimbleDir/compiler/condsyms.nim
  cp compiler/debuginfo.nim $nimbleDir/compiler/debuginfo.nim
  chmod 644 $nimbleDir/compiler/debuginfo.nim
  cp compiler/debugutils.nim $nimbleDir/compiler/debugutils.nim
  chmod 644 $nimbleDir/compiler/debugutils.nim
  cp compiler/depends.nim $nimbleDir/compiler/depends.nim
  chmod 644 $nimbleDir/compiler/depends.nim
  cp compiler/dfa.nim $nimbleDir/compiler/dfa.nim
  chmod 644 $nimbleDir/compiler/dfa.nim
  cp compiler/docgen.nim $nimbleDir/compiler/docgen.nim
  chmod 644 $nimbleDir/compiler/docgen.nim
  cp compiler/docgen2.nim $nimbleDir/compiler/docgen2.nim
  chmod 644 $nimbleDir/compiler/docgen2.nim
  cp compiler/enumtostr.nim $nimbleDir/compiler/enumtostr.nim
  chmod 644 $nimbleDir/compiler/enumtostr.nim
  cp compiler/errorhandling.nim $nimbleDir/compiler/errorhandling.nim
  chmod 644 $nimbleDir/compiler/errorhandling.nim
  cp compiler/evalffi.nim $nimbleDir/compiler/evalffi.nim
  chmod 644 $nimbleDir/compiler/evalffi.nim
  cp compiler/evaltempl.nim $nimbleDir/compiler/evaltempl.nim
  chmod 644 $nimbleDir/compiler/evaltempl.nim
  cp compiler/extccomp.nim $nimbleDir/compiler/extccomp.nim
  chmod 644 $nimbleDir/compiler/extccomp.nim
  cp compiler/filter_tmpl.nim $nimbleDir/compiler/filter_tmpl.nim
  chmod 644 $nimbleDir/compiler/filter_tmpl.nim
  cp compiler/filters.nim $nimbleDir/compiler/filters.nim
  chmod 644 $nimbleDir/compiler/filters.nim
  cp compiler/gorgeimpl.nim $nimbleDir/compiler/gorgeimpl.nim
  chmod 644 $nimbleDir/compiler/gorgeimpl.nim
  cp compiler/guards.nim $nimbleDir/compiler/guards.nim
  chmod 644 $nimbleDir/compiler/guards.nim
  cp compiler/hlo.nim $nimbleDir/compiler/hlo.nim
  chmod 644 $nimbleDir/compiler/hlo.nim
  cp compiler/ic/bitabs.nim $nimbleDir/compiler/ic/bitabs.nim
  chmod 644 $nimbleDir/compiler/ic/bitabs.nim
  cp compiler/ic/ic.nim $nimbleDir/compiler/ic/ic.nim
  chmod 644 $nimbleDir/compiler/ic/ic.nim
  cp compiler/ic/replayer.nim $nimbleDir/compiler/ic/replayer.nim
  chmod 644 $nimbleDir/compiler/ic/replayer.nim
  cp compiler/ic/cbackend.nim $nimbleDir/compiler/ic/cbackend.nim
  chmod 644 $nimbleDir/compiler/ic/cbackend.nim
  cp compiler/ic/design.rst $nimbleDir/compiler/ic/design.rst
  chmod 644 $nimbleDir/compiler/ic/design.rst
  cp compiler/ic/dce.nim $nimbleDir/compiler/ic/dce.nim
  chmod 644 $nimbleDir/compiler/ic/dce.nim
  cp compiler/ic/integrity.nim $nimbleDir/compiler/ic/integrity.nim
  chmod 644 $nimbleDir/compiler/ic/integrity.nim
  cp compiler/ic/rodfiles.nim $nimbleDir/compiler/ic/rodfiles.nim
  chmod 644 $nimbleDir/compiler/ic/rodfiles.nim
  cp compiler/ic/packed_ast.nim $nimbleDir/compiler/ic/packed_ast.nim
  chmod 644 $nimbleDir/compiler/ic/packed_ast.nim
  cp compiler/ic/navigator.nim $nimbleDir/compiler/ic/navigator.nim
  chmod 644 $nimbleDir/compiler/ic/navigator.nim
  cp compiler/idents.nim $nimbleDir/compiler/idents.nim
  chmod 644 $nimbleDir/compiler/idents.nim
  cp compiler/importer.nim $nimbleDir/compiler/importer.nim
  chmod 644 $nimbleDir/compiler/importer.nim
  cp compiler/index.nim $nimbleDir/compiler/index.nim
  chmod 644 $nimbleDir/compiler/index.nim
  cp compiler/injectdestructors.nim $nimbleDir/compiler/injectdestructors.nim
  chmod 644 $nimbleDir/compiler/injectdestructors.nim
  cp compiler/installer.ini $nimbleDir/compiler/installer.ini
  chmod 644 $nimbleDir/compiler/installer.ini
  cp compiler/int128.nim $nimbleDir/compiler/int128.nim
  chmod 644 $nimbleDir/compiler/int128.nim
  cp compiler/isolation_check.nim $nimbleDir/compiler/isolation_check.nim
  chmod 644 $nimbleDir/compiler/isolation_check.nim
  cp compiler/jsgen.nim $nimbleDir/compiler/jsgen.nim
  chmod 644 $nimbleDir/compiler/jsgen.nim
  cp compiler/jstypes.nim $nimbleDir/compiler/jstypes.nim
  chmod 644 $nimbleDir/compiler/jstypes.nim
  cp compiler/lambdalifting.nim $nimbleDir/compiler/lambdalifting.nim
  chmod 644 $nimbleDir/compiler/lambdalifting.nim
  cp compiler/layouter.nim $nimbleDir/compiler/layouter.nim
  chmod 644 $nimbleDir/compiler/layouter.nim
  cp compiler/lexer.nim $nimbleDir/compiler/lexer.nim
  chmod 644 $nimbleDir/compiler/lexer.nim
  cp compiler/liftdestructors.nim $nimbleDir/compiler/liftdestructors.nim
  chmod 644 $nimbleDir/compiler/liftdestructors.nim
  cp compiler/liftlocals.nim $nimbleDir/compiler/liftlocals.nim
  chmod 644 $nimbleDir/compiler/liftlocals.nim
  cp compiler/lineinfos.nim $nimbleDir/compiler/lineinfos.nim
  chmod 644 $nimbleDir/compiler/lineinfos.nim
  cp compiler/linter.nim $nimbleDir/compiler/linter.nim
  chmod 644 $nimbleDir/compiler/linter.nim
  cp compiler/llstream.nim $nimbleDir/compiler/llstream.nim
  chmod 644 $nimbleDir/compiler/llstream.nim
  cp compiler/lookups.nim $nimbleDir/compiler/lookups.nim
  chmod 644 $nimbleDir/compiler/lookups.nim
  cp compiler/lowerings.nim $nimbleDir/compiler/lowerings.nim
  chmod 644 $nimbleDir/compiler/lowerings.nim
  cp compiler/macrocacheimpl.nim $nimbleDir/compiler/macrocacheimpl.nim
  chmod 644 $nimbleDir/compiler/macrocacheimpl.nim
  cp compiler/magicsys.nim $nimbleDir/compiler/magicsys.nim
  chmod 644 $nimbleDir/compiler/magicsys.nim
  cp compiler/main.nim $nimbleDir/compiler/main.nim
  chmod 644 $nimbleDir/compiler/main.nim
  cp compiler/mapping.txt $nimbleDir/compiler/mapping.txt
  chmod 644 $nimbleDir/compiler/mapping.txt
  cp compiler/modulegraphs.nim $nimbleDir/compiler/modulegraphs.nim
  chmod 644 $nimbleDir/compiler/modulegraphs.nim
  cp compiler/modulepaths.nim $nimbleDir/compiler/modulepaths.nim
  chmod 644 $nimbleDir/compiler/modulepaths.nim
  cp compiler/modules.nim $nimbleDir/compiler/modules.nim
  chmod 644 $nimbleDir/compiler/modules.nim
  cp compiler/msgs.nim $nimbleDir/compiler/msgs.nim
  chmod 644 $nimbleDir/compiler/msgs.nim
  cp compiler/ndi.nim $nimbleDir/compiler/ndi.nim
  chmod 644 $nimbleDir/compiler/ndi.nim
  cp compiler/nilcheck.nim $nimbleDir/compiler/nilcheck.nim
  chmod 644 $nimbleDir/compiler/nilcheck.nim
  cp compiler/nim.cfg $nimbleDir/compiler/nim.cfg
  chmod 644 $nimbleDir/compiler/nim.cfg
  cp compiler/nim.nim $nimbleDir/compiler/nim.nim
  chmod 644 $nimbleDir/compiler/nim.nim
  cp compiler/nimblecmd.nim $nimbleDir/compiler/nimblecmd.nim
  chmod 644 $nimbleDir/compiler/nimblecmd.nim
  cp compiler/nimconf.nim $nimbleDir/compiler/nimconf.nim
  chmod 644 $nimbleDir/compiler/nimconf.nim
  cp compiler/nimeval.nim $nimbleDir/compiler/nimeval.nim
  chmod 644 $nimbleDir/compiler/nimeval.nim
  cp compiler/nimfix/nimfix.nim $nimbleDir/compiler/nimfix/nimfix.nim
  chmod 644 $nimbleDir/compiler/nimfix/nimfix.nim
  cp compiler/nimfix/prettybase.nim $nimbleDir/compiler/nimfix/prettybase.nim
  chmod 644 $nimbleDir/compiler/nimfix/prettybase.nim
  cp compiler/nimfix/nimfix.nim.cfg $nimbleDir/compiler/nimfix/nimfix.nim.cfg
  chmod 644 $nimbleDir/compiler/nimfix/nimfix.nim.cfg
  cp compiler/nimlexbase.nim $nimbleDir/compiler/nimlexbase.nim
  chmod 644 $nimbleDir/compiler/nimlexbase.nim
  cp compiler/nimpaths.nim $nimbleDir/compiler/nimpaths.nim
  chmod 644 $nimbleDir/compiler/nimpaths.nim
  cp compiler/nimsets.nim $nimbleDir/compiler/nimsets.nim
  chmod 644 $nimbleDir/compiler/nimsets.nim
  cp compiler/nodejs.nim $nimbleDir/compiler/nodejs.nim
  chmod 644 $nimbleDir/compiler/nodejs.nim
  cp compiler/nversion.nim $nimbleDir/compiler/nversion.nim
  chmod 644 $nimbleDir/compiler/nversion.nim
  cp compiler/optimizer.nim $nimbleDir/compiler/optimizer.nim
  chmod 644 $nimbleDir/compiler/optimizer.nim
  cp compiler/options.nim $nimbleDir/compiler/options.nim
  chmod 644 $nimbleDir/compiler/options.nim
  cp compiler/packagehandling.nim $nimbleDir/compiler/packagehandling.nim
  chmod 644 $nimbleDir/compiler/packagehandling.nim
  cp compiler/parampatterns.nim $nimbleDir/compiler/parampatterns.nim
  chmod 644 $nimbleDir/compiler/parampatterns.nim
  cp compiler/parser.nim $nimbleDir/compiler/parser.nim
  chmod 644 $nimbleDir/compiler/parser.nim
  cp compiler/passaux.nim $nimbleDir/compiler/passaux.nim
  chmod 644 $nimbleDir/compiler/passaux.nim
  cp compiler/passes.nim $nimbleDir/compiler/passes.nim
  chmod 644 $nimbleDir/compiler/passes.nim
  cp compiler/pathutils.nim $nimbleDir/compiler/pathutils.nim
  chmod 644 $nimbleDir/compiler/pathutils.nim
  cp compiler/patterns.nim $nimbleDir/compiler/patterns.nim
  chmod 644 $nimbleDir/compiler/patterns.nim
  cp compiler/platform.nim $nimbleDir/compiler/platform.nim
  chmod 644 $nimbleDir/compiler/platform.nim
  cp compiler/plugins/itersgen.nim $nimbleDir/compiler/plugins/itersgen.nim
  chmod 644 $nimbleDir/compiler/plugins/itersgen.nim
  cp compiler/plugins/locals.nim $nimbleDir/compiler/plugins/locals.nim
  chmod 644 $nimbleDir/compiler/plugins/locals.nim
  cp compiler/plugins/active.nim $nimbleDir/compiler/plugins/active.nim
  chmod 644 $nimbleDir/compiler/plugins/active.nim
  cp compiler/pluginsupport.nim $nimbleDir/compiler/pluginsupport.nim
  chmod 644 $nimbleDir/compiler/pluginsupport.nim
  cp compiler/pragmas.nim $nimbleDir/compiler/pragmas.nim
  chmod 644 $nimbleDir/compiler/pragmas.nim
  cp compiler/prefixmatches.nim $nimbleDir/compiler/prefixmatches.nim
  chmod 644 $nimbleDir/compiler/prefixmatches.nim
  cp compiler/procfind.nim $nimbleDir/compiler/procfind.nim
  chmod 644 $nimbleDir/compiler/procfind.nim
  cp compiler/readme.md $nimbleDir/compiler/readme.md
  chmod 644 $nimbleDir/compiler/readme.md
  cp compiler/renderer.nim $nimbleDir/compiler/renderer.nim
  chmod 644 $nimbleDir/compiler/renderer.nim
  cp compiler/renderverbatim.nim $nimbleDir/compiler/renderverbatim.nim
  chmod 644 $nimbleDir/compiler/renderverbatim.nim
  cp compiler/reorder.nim $nimbleDir/compiler/reorder.nim
  chmod 644 $nimbleDir/compiler/reorder.nim
  cp compiler/rodutils.nim $nimbleDir/compiler/rodutils.nim
  chmod 644 $nimbleDir/compiler/rodutils.nim
  cp compiler/ropes.nim $nimbleDir/compiler/ropes.nim
  chmod 644 $nimbleDir/compiler/ropes.nim
  cp compiler/saturate.nim $nimbleDir/compiler/saturate.nim
  chmod 644 $nimbleDir/compiler/saturate.nim
  cp compiler/scriptconfig.nim $nimbleDir/compiler/scriptconfig.nim
  chmod 644 $nimbleDir/compiler/scriptconfig.nim
  cp compiler/sem.nim $nimbleDir/compiler/sem.nim
  chmod 644 $nimbleDir/compiler/sem.nim
  cp compiler/semcall.nim $nimbleDir/compiler/semcall.nim
  chmod 644 $nimbleDir/compiler/semcall.nim
  cp compiler/semdata.nim $nimbleDir/compiler/semdata.nim
  chmod 644 $nimbleDir/compiler/semdata.nim
  cp compiler/semexprs.nim $nimbleDir/compiler/semexprs.nim
  chmod 644 $nimbleDir/compiler/semexprs.nim
  cp compiler/semfields.nim $nimbleDir/compiler/semfields.nim
  chmod 644 $nimbleDir/compiler/semfields.nim
  cp compiler/semfold.nim $nimbleDir/compiler/semfold.nim
  chmod 644 $nimbleDir/compiler/semfold.nim
  cp compiler/semgnrc.nim $nimbleDir/compiler/semgnrc.nim
  chmod 644 $nimbleDir/compiler/semgnrc.nim
  cp compiler/seminst.nim $nimbleDir/compiler/seminst.nim
  chmod 644 $nimbleDir/compiler/seminst.nim
  cp compiler/semmacrosanity.nim $nimbleDir/compiler/semmacrosanity.nim
  chmod 644 $nimbleDir/compiler/semmacrosanity.nim
  cp compiler/semmagic.nim $nimbleDir/compiler/semmagic.nim
  chmod 644 $nimbleDir/compiler/semmagic.nim
  cp compiler/semobjconstr.nim $nimbleDir/compiler/semobjconstr.nim
  chmod 644 $nimbleDir/compiler/semobjconstr.nim
  cp compiler/semparallel.nim $nimbleDir/compiler/semparallel.nim
  chmod 644 $nimbleDir/compiler/semparallel.nim
  cp compiler/sempass2.nim $nimbleDir/compiler/sempass2.nim
  chmod 644 $nimbleDir/compiler/sempass2.nim
  cp compiler/semstmts.nim $nimbleDir/compiler/semstmts.nim
  chmod 644 $nimbleDir/compiler/semstmts.nim
  cp compiler/semtempl.nim $nimbleDir/compiler/semtempl.nim
  chmod 644 $nimbleDir/compiler/semtempl.nim
  cp compiler/semtypes.nim $nimbleDir/compiler/semtypes.nim
  chmod 644 $nimbleDir/compiler/semtypes.nim
  cp compiler/semtypinst.nim $nimbleDir/compiler/semtypinst.nim
  chmod 644 $nimbleDir/compiler/semtypinst.nim
  cp compiler/sighashes.nim $nimbleDir/compiler/sighashes.nim
  chmod 644 $nimbleDir/compiler/sighashes.nim
  cp compiler/sigmatch.nim $nimbleDir/compiler/sigmatch.nim
  chmod 644 $nimbleDir/compiler/sigmatch.nim
  cp compiler/sinkparameter_inference.nim $nimbleDir/compiler/sinkparameter_inference.nim
  chmod 644 $nimbleDir/compiler/sinkparameter_inference.nim
  cp compiler/sizealignoffsetimpl.nim $nimbleDir/compiler/sizealignoffsetimpl.nim
  chmod 644 $nimbleDir/compiler/sizealignoffsetimpl.nim
  cp compiler/sourcemap.nim $nimbleDir/compiler/sourcemap.nim
  chmod 644 $nimbleDir/compiler/sourcemap.nim
  cp compiler/spawn.nim $nimbleDir/compiler/spawn.nim
  chmod 644 $nimbleDir/compiler/spawn.nim
  cp compiler/strutils2.nim $nimbleDir/compiler/strutils2.nim
  chmod 644 $nimbleDir/compiler/strutils2.nim
  cp compiler/suggest.nim $nimbleDir/compiler/suggest.nim
  chmod 644 $nimbleDir/compiler/suggest.nim
  cp compiler/syntaxes.nim $nimbleDir/compiler/syntaxes.nim
  chmod 644 $nimbleDir/compiler/syntaxes.nim
  cp compiler/tccgen.nim $nimbleDir/compiler/tccgen.nim
  chmod 644 $nimbleDir/compiler/tccgen.nim
  cp compiler/transf.nim $nimbleDir/compiler/transf.nim
  chmod 644 $nimbleDir/compiler/transf.nim
  cp compiler/trees.nim $nimbleDir/compiler/trees.nim
  chmod 644 $nimbleDir/compiler/trees.nim
  cp compiler/treetab.nim $nimbleDir/compiler/treetab.nim
  chmod 644 $nimbleDir/compiler/treetab.nim
  cp compiler/typeallowed.nim $nimbleDir/compiler/typeallowed.nim
  chmod 644 $nimbleDir/compiler/typeallowed.nim
  cp compiler/types.nim $nimbleDir/compiler/types.nim
  chmod 644 $nimbleDir/compiler/types.nim
  cp compiler/typesrenderer.nim $nimbleDir/compiler/typesrenderer.nim
  chmod 644 $nimbleDir/compiler/typesrenderer.nim
  cp compiler/varpartitions.nim $nimbleDir/compiler/varpartitions.nim
  chmod 644 $nimbleDir/compiler/varpartitions.nim
  cp compiler/vm.nim $nimbleDir/compiler/vm.nim
  chmod 644 $nimbleDir/compiler/vm.nim
  cp compiler/vmconv.nim $nimbleDir/compiler/vmconv.nim
  chmod 644 $nimbleDir/compiler/vmconv.nim
  cp compiler/vmdef.nim $nimbleDir/compiler/vmdef.nim
  chmod 644 $nimbleDir/compiler/vmdef.nim
  cp compiler/vmdeps.nim $nimbleDir/compiler/vmdeps.nim
  chmod 644 $nimbleDir/compiler/vmdeps.nim
  cp compiler/vmgen.nim $nimbleDir/compiler/vmgen.nim
  chmod 644 $nimbleDir/compiler/vmgen.nim
  cp compiler/vmhooks.nim $nimbleDir/compiler/vmhooks.nim
  chmod 644 $nimbleDir/compiler/vmhooks.nim
  cp compiler/vmmarshal.nim $nimbleDir/compiler/vmmarshal.nim
  chmod 644 $nimbleDir/compiler/vmmarshal.nim
  cp compiler/vmops.nim $nimbleDir/compiler/vmops.nim
  chmod 644 $nimbleDir/compiler/vmops.nim
  cp compiler/vmprofiler.nim $nimbleDir/compiler/vmprofiler.nim
  chmod 644 $nimbleDir/compiler/vmprofiler.nim
  cp compiler/wordrecg.nim $nimbleDir/compiler/wordrecg.nim
  chmod 644 $nimbleDir/compiler/wordrecg.nim
  cp doc/basicopt.txt $nimbleDir/doc/basicopt.txt
  chmod 644 $nimbleDir/doc/basicopt.txt
  cp doc/advopt.txt $nimbleDir/doc/advopt.txt
  chmod 644 $nimbleDir/doc/advopt.txt
  cp doc/nimdoc.css $nimbleDir/doc/nimdoc.css
  chmod 644 $nimbleDir/doc/nimdoc.css
cp compiler.nimble $nimbleDir/compiler.nimble
chmod 644 $nimbleDir/compiler.nimble

  echo "installation successful"
else
  echo "Nim installation script"
  echo "Usage: [sudo] sh install.sh DIR"
  echo "Where DIR may be:"
  echo "  /usr/bin"
  echo "  /usr/local/bin"
  echo "  /opt"
  echo "  <some other dir> (treated similar to '/opt')"
  echo "To deinstall, use the command:"
  echo "sh deinstall.sh DIR"
  exit 1
fi


#!/bin/sh

if [ ! -d "$HOME/dotfiles" ]; then
	echo "Installing 20k-ultra dotifles"

	# TODO: Modify pacman.conf to uncomment multilib

	# Install minimal packages to get started
	sudo pacman -Syu -needed git base-devel

	# Install Paru
	git clone https://aur.archlinux.org/paru.git "$HOME/paru"
	cd paru
	makepkg -si
	cd $HOME

	# Clone dotfiles repo
	git clone --depth=1 <EMAIL>:20k-ultra/dotfiles.git "$HOME/dotfiles"

	# Run apply script
	./apply.sh

	echo "Done!"
else
	echo "dotfiles are already installed...run apply.sh to apply again"
fi


curl -XDELETE \
  "http://localhost:8080/v1/views/myorg/myproj/my_aggregate_view?rev=3"


DIR_LOCATION='/Users/bob/workspace/vmstats-turbinedb'

sudo chown root $DIR_LOCATION/daemon/com.sparcedge.vmstats.plist
sudo launchctl unload $DIR_LOCATION/daemon/com.sparcedge.vmstats.plist
sudo launchctl load $DIR_LOCATION/daemon/com.sparcedge.vmstats.plist
sudo launchctl start com.sparcedge.vmstats
sudo launchctl list | grep com.sparcedge.vmstats


<reponame>xundeenergie/xe-base-config<gh_stars>0
#export GDK_CORE_DEVICE_EVENTS=1
export NO_AT_BRIDGE=1


<reponame>LUMO666/Highway
#!/bin/sh
env="Highway"
scenario="highway-v0"
task="attack"
n_defenders=1
n_attackers=4

n_dummies=0
algo="rmappo"
exp="lwl_def_IDML_DCp0.5"
seed_max=1

echo "env is ${env}"
for seed in `seq ${seed_max}`
do

    CUDA_VISIBLE_DEVICES=0 python render/render_highway.py --env_name ${env} --algorithm_name ${algo} --experiment_name ${exp} --scenario_name ${scenario} --task_type ${task} --n_attackers ${n_attackers} --n_defenders ${n_defenders} --n_dummies ${n_dummies} --seed ${seed} --n_training_threads 1 --n_render_rollout_threads 1 --horizon 40 --use_render --use_wandb --other_agent_type "IDM" --model_dir "/home/liuwl/Highway/onpolicy/scripts/results/Highway/highway-v0/rmappo/lwl_def_IDML_DCp0.5/wandb/run-20210501_104050-3sfvzn8q/files"  --render_episodes 20 --npc_vehicles_type "onpolicy.envs.highway.highway_env.vehicle.controller_replay.MDPVehicle_IDMVehicle" --dummy_agent_type "vi" --save_gifs

done


#docker container rm seg_app
#docker container rm mongo
#docker image rm amezroui/seg_app
docker run -p 27017:27017 -e GRANT_SUDO=yes --user root --name mongo -d mongo:4.0.9-xenial
docker build -t amezroui/seg_app .
docker run -p 5000:5000 -e GRANT_SUDO=yes --user root --name seg_app -v /Users/anass/workspace/seg_app/deployment/flask:/app --link mongo:mongo_link amezroui/seg_app


<reponame>darrenluo1993/shell-learning
#!/bin/bash

my_arry=(a b "c","d" abc)
echo "-------FOR循环遍历输出数组--------"
for i in ${my_arry[@]};
do
  echo $i
done

echo "-------::::WHILE循环输出 使用 let i++ 自增:::::---------"
j=0
while [ $j -lt ${#my_arry[@]} ]
do
  echo ${my_arry[$j]}
  let j++
done

echo "--------:::WHILE循环输出 使用 let  "n++ "自增: 多了双引号，其实不用也可以:::---------"
n=0
while [ $n -lt ${#my_arry[@]} ]
do
  echo ${my_arry[$n]}
  let "n++"
done

echo "---------::::WHILE循环输出 使用 let m+=1 自增,这种写法其他编程中也常用::::----------"
m=0
while [ $m -lt ${#my_arry[@]} ]
do
  echo ${my_arry[$m]}
  let m+=1
done

echo "-------::WHILE循环输出 使用 a=$[$a+1] 自增,个人觉得这种写法比较麻烦::::----------"
a=0
while [ $a -lt ${#my_arry[@]} ]
do
 echo ${my_arry[$a]}
 a=$[$a+1]
done


<gh_stars>10-100
#!/bin/bash

func() { read -r distro setup; echo $distro $setup; }

export -f func

cat ../evaluation/usecases/shellcheck/temp_input.txt |
    func


<reponame>convectix/myb-build<filename>myb-extras/dynmotd.sh<gh_stars>0
#!/bin/sh
# $1 - size in bytes
conv2human()
{
	local lhal="B"
	local tmpmem="$1"
	local lval

	human_val=""

	for hval in "Kb" "Mb" "Gb"; do
		mem=$(( tmpmem / 1024 ))
		[ "${mem}" = "0" ] && break
		tmpmem=${mem}
		lval="${hval}"
	done

	human_val="${tmpmem} ${lval}"
}

# Calculate free memory
realmem=$( sysctl -n hw.realmem )
tmpmem=${realmem}
page_size=$( sysctl -n vm.stats.vm.v_page_size )
active_count=$( sysctl -n vm.stats.vm.v_active_count )
wire_count=$( sysctl -n vm.stats.vm.v_wire_count )
active_size=$(( page_size * active_count ))
wire_size=$(( page_size * wire_count ))
conv2human ${tmpmem}
TOTAL_MEM="${human_val}"
freemem=$(( realmem - active_size - wire_size ))
conv2human ${freemem}
FREE_MEM="${human_val}"

name=$( hostname )
os=$( sysctl -qn kern.ostype )
CPUName=$( sysctl -qn hw.model )
NCores=$( sysctl -qn hw.ncpu )

uplink_iface4=$( /sbin/route -n -4 get 0.0.0.0 2>/dev/null | /usr/bin/awk '/interface/{print $2}' )
uplink_iface6=$( /sbin/route -n -6 get ::0 2>/dev/null | /usr/bin/awk '/interface/{print $2}' )

if [ -n "${uplink_iface6}" ]; then
	ip6=$( /sbin/ifconfig ${uplink_iface6} | /usr/bin/awk '/inet6 *:*+/{print $2}' | /usr/bin/grep -v %${uplink_iface6}$ | /usr/bin/head -n1 )
else
	# route can not work in jail, looks at all
	ip6=$( /sbin/ifconfig | /usr/bin/awk '/inet6 *:*+/{print $2}' | /usr/bin/grep -v %${uplink_iface6}$ | /usr/bin/head -n1 )
fi

if [ -n "${uplink_iface4}" ]; then
	ip4=$( /sbin/ifconfig ${uplink_iface4} | /usr/bin/awk '/inet [0-9]+/{print $2}'| /usr/bin/head -n1 )
else
	# route can not work in jail, looks at all
	ip4=$( /sbin/ifconfig | /usr/bin/awk '/inet [0-9]+/{print $2}'| /usr/bin/head -n1 )
fi

disks=$( /sbin/sysctl -qn kern.disks )

active_zpool=$( timeout 2 /sbin/zpool get -Ho value name | xargs )

mem=$( echo $TOTAL_MEM' total / '$FREE_MEM' free' )
username=$( whoami )
if [ -e /var/lib/puppet/puppet.info ]; then
	puppetinfo=$( cat /var/lib/puppet/puppet.info )
fi
echo -e "
------------------: System Data :-------------------------------
Hostname:     \033[1;33m$name\033[0m ( ${ip4} ${ip6} )
Kernel:       $(uname -r) ($os)
Uptime:      $(uptime | sed 's/.*up ([^,]*), .*/1/')
CPU:          $CPUName ($NCores cores)
Memory(Mb):   $mem
Active Zpool: ${active_zpool}
------------------------: Logged as: [\033[0;32m$(whoami)\033[0m]  ------------------------------
"
#if Tx=$( /usr/local/bin/tmux ls 2> /dev/null ); then
#	echo -e "\033[0;31mTmux Sessions:\033[0m"
#	echo $Tx
#fi

/root/bin/checkiso.sh


<reponame>aparcar/action-openwrt-sdk
#!/bin/sh

set -ef

FEEDNAME="${FEED_NAME:-action}"
IGNORE_ERRORS="${IGNORE_ERRORS:-n m}"

cd /home/build/openwrt/

cp feeds.conf.default feeds.conf
echo "src-link $FEEDNAME $GITHUB_WORKSPACE/" >> feeds.conf

#shellcheck disable=SC2153
for EXTRA_FEED in $EXTRA_FEEDS; do
	echo "$EXTRA_FEED" | tr '|' ' ' >> feeds.conf
done

./scripts/feeds update -a
if [ -z "$PACKAGES" ]; then
	./scripts/feeds install -d y -p "$FEEDNAME" -a -f
else
	# shellcheck disable=SC2086
	./scripts/feeds install -d y -f $PACKAGES
fi

make defconfig
make \
	BUILD_LOG="$BUILD_LOG" \
	CONFIG_SIGNED_PACKAGES="$SIGNED_PACKAGES" \
	IGNORE_ERRORS="$IGNORE_ERRORS" \
	V="$V" \
	-j "$(nproc)"

mv bin/ "$GITHUB_WORKSPACE/"

if [ -d logs/ ]; then
	mv logs/ "$GITHUB_WORKSPACE/"
fi


<filename>environment/build.sh<gh_stars>1-10
#!/bin/bash

docker build -t "m3nin0/rep-lulc-executions:latest" .


<reponame>zesk/zesk<filename>bin/deprecated/0.8.0.sh<gh_stars>1-10
#!/bin/bash
zesk cannon zesk::add_hook 'zesk()->hook->add'
zesk cannon zesk::hooks 'zesk()->hook->register_class'
zesk cannon zesk::has_hook 'zesk()->hook->has'
zesk cannon zesk::hook_arguments 'zesk()->hook->call_arguments'
zesk cannon 'zesk::hook(' 'zesk()->hook->call('
zesk cannon 'zesk::hook_array(' 'zesk()->hook->call_arguments('

zesk cannon zesk::class_hierarchy 'zesk()->classes->hierarchy'
zesk cannon zesk\\Classes::class_hierarchy 'zesk()->classes->hierarchy'
zesk cannon zesk::register_class 'zesk()->classes->register'

zesk cannon zesk::version 'zesk\Version::release'

fix_manually() {
	local pattern message

	pattern=$1
	message=$2
	echo "Manual fix for $1 - $message"
	zdeopen $1
	echo -n "Hit enter when changes are all fixed ... "
	read
}
fix_manually 'zesk\\Classes' 'fix occurrances'
#zdeopen 'zesk\\Hooks'
zdeopen 'zesk\\Autoloader'
fix_manually 'Cache::path' 'Use "$zesk->paths->cache = newvalue" instead'
fix_manually 'zesk::data_path' 'Use "$zesk->paths->data = newvalue" instead'

# global deprecated -> zesk::deprecated
# global assert -> zesk::assert
# global assert_callback -> zesk::assert_callback
# global share_path is now zesk::paths::share
# global command_path is now zesk::paths::commands
# global document_cache is now zesk::paths::document_cache
# global uid_path is now zesk::paths::uid
# global zesk_command_path is now zesk::paths::zesk_commands
# global zesk::data_path is now zesk::paths::data
# global zesk::temporary_path is now zesk::paths::temporary
# global zesk::cache_path is now zesk::paths::cache
# Setting global Cache::path does not immediately affect cache path anymore
# Setting global zesk::data_path does not immediately affect cache path anymore
# Setting global document_cache does not immediately affect document_cache path anymore
# Setting global uid_path does not immediately affect uid_path path anymore
# global http_document_root no longer set
# global document_root no longer set
# global script_filename no longer set


<filename>scripts/training.sh
#! /usr/bin/bash

## reusme training
CUDA_VISIBLE_DEVICES=1 python train.py \
    --exp_config 'exp_1/ldf_train/lr=0.05_bn=32_eps=36-7*36_pse=src_half_psrc=0.5_ptgt=0.1_sche=cyc-0.75_lbsec=fuse-1-1-1_aug=w/config.yaml' \
    --resume

## training from scratch
CUDA_VISIBLE_DEVICES=0 python train.py \
    --exp_config 'config/ldf_train.yaml' \
    SEED 1218 \
    MODEL.WARMUP_PATH ""

## training from scratch for vgg backbone
CUDA_VISIBLE_DEVICES=3 python train.py \
    --exp_config 'config/ldf_vgg_train.yaml' \
    SEED 1218 \
    MODEL.WARMUP_PATH ""

## training from warmp ckpt
CUDA_VISIBLE_DEVICES=3 python train.py \
    --exp_config 'config/ldf_train.yaml' \
    MODEL.WARMUP_PATH <warmup_ckpt_path>


<gh_stars>1-10
#!/usr/bin/sh

mkdir build -p
cd build
#rm ./* -rf
cmake ..
make
cd ..


#!/usr/bin/env bash
readonly scriptDir="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd -P)"
cd "$scriptDir"
# Set up bash
source ./_top.inc.bash

# Usage
if [[ "$*" == *-h* ]]; then
  echo "
  Usage:

  This script will dump all the secrets in the specifiedEnv

  $(basename $0) (optional: specifiedEnv - defaults to $defaultEnv) (optional: singleVariable to dump)

  "
  exit 1
fi

readonly specifiedEnv="${1:-$defaultEnv}"
readonly singleVariable="${2:-}"

readonly roleName="$(basename "$(dirname "$scriptDir")")"

cd "$projectDir"

if [[ "" != "$singleVariable" ]]; then
  echo "
Dumping Single Vaulted Variable: $singleVariable
" 1>&2
  ANSIBLE_STDOUT_CALLBACK=minimal ansible localhost \
  -m import_role \
  -a name="$roleName" \
  --vault-id "${specifiedEnv}@vault-pass-"${specifiedEnv}.secret \
  -i "$projectDir/environment/$specifiedEnv" \
  --extra-vars "env_dir='$projectDir/environment/$specifiedEnv' single_variable=$singleVariable" \
  | grep -oP '(?<=msg": ").*?(?=")' \
  | perl -pe 's/\\n/\n/g'
  echo
  exit 0
fi

echo "
Dumping All Vaulted Variables:
"
ansible localhost \
  -m import_role \
  -a name="$roleName" \
  --vault-id "${specifiedEnv}@vault-pass-"${specifiedEnv}.secret \
  -i "$projectDir/environment/$specifiedEnv" \
  --extra-vars env_dir="$projectDir/environment/$specifiedEnv"
echo


<filename>release.sh
#!/bin/bash
# Author <NAME>
# Date 2017/11/19
# Shell script for release
# Copyright 2017 <NAME>
# This program is provided with MIT license. See "LICENSE.md".

# Required: The latest version.
VERSION='v1.0.0_alpha4'

# Output directory is created
OUTDIR="release"
mkdir -p ${OUTDIR}

touch *.cc *.rc
nmake | iconv -f cp932 -t utf-8
if [ $? != 0 ]; then exit 1; fi

TARGET="${OUTDIR}/release_${VERSION}"

rm -r ${TARGET}
mkdir -p ${TARGET}

mkdir -p ${TARGET}/data/
cp -r data/*.png ${TARGET}/data/

mkdir -p ${TARGET}/doc/
cp -r doc/*.png ${TARGET}/doc/

cp -r colors/ ${TARGET}/

cp -r *.md ${TARGET}/
cp *.exe ${TARGET}/

# Zip file is created.
zip -r ${TARGET}.zip ${TARGET}

exit 0


<gh_stars>1-10
#!/usr/bin/env bash

funcName=${1}
funcDir="api/${funcName}"

# if exists, exit
if [ -d "$funcDir" ]; then
  echo "$funcName already exists."
  exit 1;
fi

mkdir api/$funcName
cp ./sample/da_init.py.template api/$funcName/__init__.py
cp ./sample/da_function.json.template api/$funcName/function.json

echo "Created Function: $funcName"


<gh_stars>1-10
#!/bin/sh

#OTHURL="https://www.origin.com/en-de/store/free-games/on-the-house"
OTHURL="https://www.origin.com/deu/en-us/store/free-games/on-the-house"
OTHFILE="/tmp/oth"
OTHFILEOLD="${OTHFILE}-old"
#SEDEXPRESSION="s:.*
\(.*\)
.*:\1:g"
SEDEXPRESSION="s:.*\(.*\).*:\1:g"
MAILTEXTEND="Go to https://www.origin.com/en-de/store/free-games/on-the-house if you are interested."
MAILTO="<EMAIL>"
#MAILTO="<EMAIL>,<EMAIL>"

# check if we have already checked before (since restarting the server)
if [ -f ${OTHFILE} ]; then
    OTHFILEEXISTS=true
else
    OTHFILEEXISTS=false
fi

# if we have downloaded a file before, store it for later
if ${OTHFILEEXISTS}
then
    mv ${OTHFILE} ${OTHFILEOLD}
fi

# download the current file
#wget ${OTHURL} -O ${OTHFILE} -o /dev/null
curl ${OTHURL} -o ${OTHFILE}

# It seems that the name of the game is shown in a
 tag, so why not just get this out of the file to get the name…
NEWNAME=$(grep -i "origin-store-program-offer-title" ${OTHFILE} | sed "${SEDEXPRESSION}")

# If we have an old file, compare the name in the current file with the name in the old file.
if ${OTHFILEEXISTS}
then
    #OLDNAME=$(grep -i "
" ${OTHFILEOLD} | sed "${SEDEXPRESSION}")
    OLDNAME=$(grep -i "origin-store-program-offer-title" ${OTHFILEOLD} | sed "${SEDEXPRESSION}")

    # If both names are the same, send an email to someone.
    if [ ! "${OLDNAME}" = "${NEWNAME}" ]; then
        NEEDTOMAIL=true
        MAILTEXT="I found a new game in the Origin on-the-house program.\n\n\tOld game: ${OLDNAME}\n\tNew game: ${NEWNAME}\n"
    else
        NEEDTOMAIL=false
    fi
else
    # Ouch, there was no old file, send an email anyways.
    NEEDTOMAIL=true
    MAILTEXT="The current game in the Origin on-the-house program is:\n\n\t${NEWNAME}\n\nI don't have any recollection of the last game, because you probably restarted the server."
fi

# If we have something interesting to say, mail something to someone, somewhere.
if ${NEEDTOMAIL}
then
    COMPLETEMAILTEXT="${MAILTEXT}\n${MAILTEXTEND}"
    echo "${COMPLETEMAILTEXT}" #| mail -s "New game found in the Origin on-the-house program." ${MAILTO}
fi


# shellcheck shell=ksh

# Copyright 2022 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
# Provenance: https://raw.githubusercontent.com/rawiriblundell/dotfiles/master/.bashrc
# SPDX-License-Identifier: Apache-2.0

# Check if 'seq' is available, if not, provide a basic replacement function
if ! command -v seq >/dev/null 2>&1; then
  seq() {
    local first
    # If no parameters are given, print out usage
    if [[ -z "$*" ]]; then
      printf -- '%s\n' "Usage:"
      printf -- '\t%s\n'  "seq LAST" \
        "seq FIRST LAST" \
        "seq FIRST INCR LAST" \
        "Note: this is a step-in function, no args are supported."
      return 0
    fi

    # If only one number is given, we assume 1..n
    if [[ -z "${2}" ]]; then
      eval "printf -- '%d\\n' {1..$1}"
    # Otherwise, we act accordingly depending on how many parameters we get
    # This runs with a default increment of 1/-1 for two parameters
    elif [[ -z "${3}" ]]; then
      eval "printf -- '%d\\n' {$1..$2}"
    # and with three parameters we use the second as our increment
    elif [[ -n "${3}" ]]; then
      # First we test if the bash version is 4, if so, use native increment
      if (( BASH_VERSINFO >= 4 )); then
        eval "printf -- '%d\\n' {$1..$3..$2}"
      # Otherwise, use the manual approach
      else
        first="${1}"
        # Simply iterate through in ascending order
        if (( first < $3 )); then
          while (( first <= $3 )); do
            printf -- '%d\n' "${first}"
            first=$(( first + $2 ))
          done
        # or... undocumented feature: descending order!
        elif (( first > $3 )); then
          while (( first >= $3 )); do
            printf -- '%d\n' "${first}"
            first=$(( first - $2 ))
          done
        fi
      fi
    fi
  }
fi


<gh_stars>0
#!/bin/sh
cd /ashuffle/t/integration
exec go test -v ashuffle/integration


#!/bin/bash

enh='/path/track1'

for dir in linear_uniform circular linear_nonuniform ; do
    ls ${enh}/${dir} > ./tmp/track1_${dir}
    python track1_eval.py \
        --wav_list=./tmp/track1_${dir} \
        --pathe=${enh}/${dir} \
        --pathc=/data/wavs/dev/dev_simu_${dir}_track1/reverb_ref/ \
        --pathn=/data/wavs/dev/dev_simu_${dir}_track1/mix/ \
        --result_list=./result/track1_${dir}_result.csv
done


#!/usr/bin/env bash

curl "http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass/mnist.scale.bz2" -o "mnist.bz2"
bzip2 -d mnist.bz2


. /unixworks/virtualenvs/py27/bin/activate
STORE_PS1="$PS1"
export PYTHONPATH=[paths to all your python libraries, including blBase and blLib]
export PATH=[adjust as needed.  include the bl_tools bin dir]
export BL_CONFDIR=~/.bl_tools/conf
export BL_LOCAL_ENG=/unixworks/bl_tools/eng
export BL_ENG_BASE=[ENG ROLE BASE PATH INSIDE BL]
export BL_QA_BASE=[QA ROLE BASE PATH INSIDE BL]
export BL_LLE_BASE=[LLE ROLE BASE PATH INSIDE BL]
export BL_PROD_BASE=[PROD ROLE BASE PATH INSIDE BL]
export BL_APP_LLE_BASE=[APP LLE BASE PATH INSIDE BL]
export BL_APP_PROD_BASE=[APP PROD BASE PATH INSIDE BL]
export BL_ENG_TEMPLATE=[ENG ACL TEMPLATE NAME]
export BL_QA_TEMPLATE=[QA ACL TEMPLATE NAME]
export BL_LLE_TEMPLATE=[LLE ACL TEMPLATE NAME]
export BL_PROD_TEMPLATE=[PROD ACL TEMPLATE NAME]
export BL_ENG_ROLE=[ENG ROLE NAME]
export BL_QA_ROLE=[QA ROLE NAME]
export BL_LLE_ROLE=[LLE ROLE NAME]
export BL_PROD_ROLE=[PROD ROLE NAME]
export BL_APP_LLE_ROLE=[APP LLE ROLE NAME]
export BL_APP_PROD_ROLE=[APP PROD ROLE NAME]

if test -f ~/.bl_tools/blvars.sh
then
. ~/.bl_tools/blvars.sh
fi

function bl_pass {
    echo -n "Password: "
    read -s BL_PASS
    BL_PASS=`<PASSWORD> $BL "$BL_PASS"`
    export BL_PASS
    echo
}
export -f bl_pass

function getBlUser() {
    local CONF="$1"
    if test -z "$CONF" || test -z "$BL_CONF"
    then
        echo "getBlUser() requires BL_CONF env variable, or pass it as an argument."
        return 1
    fi
    if test -n "$BL_CONF"; then local CHKCONF="$BL_CONF"; fi
    if test -n "$CONF"; then local CHKCONF="$CONF"; fi
    grep blUser: "$BL_CONFDIR/$CHKCONF" | awk '{ print $2 }' | cut -f1 -d@
}
function isServiceAcct() {
    local USER="$1"
    if test -z "$USER"; then
        echo "USAGE: isServiceAccount USERNAME"
        return 1
    fi
    getent passwd "$USER" | grep -q "Type S,"
}
function error_out() {
    ERR="$1"
    MSG="$2"
    if test "$ERR" != 0
    then
            echo "ERROR: $MSG; EXITING ERR=$ERR"
            exit $ERR
    fi
}
function warn_out() {
    ERR="$1"
    MSG="$2"
    if test "$ERR" != 0
    then
        echo "WARNING: $MSG; ERR=$ERR"
    fi
}

function confPerm {
    local CONF=$1
    if ! test -O "$CONF"; then
        echo ERROR: $CONF is  not owned by `whoami`
        return 1
    fi

    local ACCESS=`stat $CONF | grep Access | grep Uid | awk -F/ '{ print $2 }' | cut -f1 -d\)`
    if echo $ACCESS | egrep -q "^....r" || echo $ACCESS | egrep -q "^.......r"
    then
        echo "ERROR: $CONF gives read access to group or all"
        return 1
    fi
    if echo $ACCESS | egrep -q "^.....w" || echo $ACCESS | egrep -q "^........w"
    then
        echo "ERROR: $CONF gives write access to group or all"
        return 1
    fi
    return 0
}
export -f confPerm

function bl_conf {
    local CONF=$1
    if test -n "$CONF" && ! ls $BL_CONFDIR | egrep "^${CONF}$" > /dev/null 2>&1
    then
        echo "Try again with valid role, or use no arguments to select"
        return 1
    fi
    if ! confPerm "$BL_CONFDIR/$CONF"
    then
        echo please fix permissions on $BL_CONFDIR/$CONF
        return 1
    fi

    if test -n "$CONF" &&  ls $BL_CONFDIR | egrep "^${CONF}$" > /dev/null 2>&1
    then
        true
    else
        echo "Choose one of:"
        ls $BL_CONFDIR | sed -e 's/^/    /'
        while ! ls $BL_CONFDIR | egrep "^${CONF}$" > /dev/null 2>&1
        do
            echo -n "CONF> "
            read CONF
            if [ "$CONF" = "exit" ]; then return; fi
        done
    fi
    myGroup=`cat "$BL_CONFDIR/$CONF" | egrep "^myGroup:" | sed -e 's/myGroup: //'`
    defaultMyGroup=`cat "$BL_CONFDIR/$CONF" | egrep "^defaultMyGroup:" | sed -e 's/^defaultMyGroup: //'`
    myRole=`cat "$BL_CONFDIR/$CONF" | grep blRole: | awk '{ print $2 }'`
    local base64Pass=`cat "$BL_CONFDIR/$CONF" | egrep blPass: | awk '{ print $2 }'`
    if test -n "$base64Pass"; then
        blUser=$(cat "$BL_CONFDIR/$CONF" | grep ^blUser: | awk '{ print $2 }' | cut -f1 -d@)
        if test -n "$blUser" && getent passwd $blUser | egrep -i ^$blUser | grep -q "Type S"
        then
                BL_PASS=$base64Pass
                export BL_PASS
        else
            echo blPass can only be stored for service accounts
            echo Please remediate $BL_CONFDIR/$CONF
        fi
    fi
    export myGroup
    export defaultMyGroup
    export myRole
    BL_CONF="$CONF"
    export BL_CONF
    echo BL_CONF SET is now set TO $BL_CONF, myGroup set TO $myGroup
    if test -z "$BL_PASS"; then
        echo "BL_PASS is not set.  please run bl_pass"
    fi
    PS1="$STORE_PS1($CONF:$myGroup \W) "
}
export -f bl_conf

function bl_mkconf {
    while echo -n "Profile Name - how to refer to this role when executing bl_conf - no whitespace: " &&  read profile_name
    do
        if ! echo $profile_name | egrep -q "\s" && echo $profile_name | grep -q "[a-zA-Z0-9]" && ! echo $profile_name | egrep -q "/"
        then
            break
        fi
    done
    while echo -n "Role Name: " && read role_name
    do
        if ! echo $role_name | egrep -q "\s" && echo $role_name | grep -q "[a-zA-Z0-9]"
        then
            break
        fi
    done

    while echo -n "User Name - like `echo $USER | tr a-z A-Z`@[AD DOMAIN HERE]: " &&  read user_name
    do
        if ! echo $user_name | egrep -q "\s" && echo $user_name | grep -q "[a-zA-Z0-9]"
        then
            break
        fi
    done

    FIRST=`getent passwd $USER | cut -f5 -d:|cut -f2 -d\ |tr A-Z a-z`
    LAST=`getent passwd $USER | cut -f5 -d:| awk '{ print $1 }' | sed -e 's/,//' | tr A-Z a-z`
    if test -n "$FIRST" || test -z "$LAST"
    then
        EXAMPLE_NAME="${FIRST}-${LAST}"
    else
        EXAMPLE_NAME="bender-rodriguez"
    fi

    while echo -n "Default Location - where your scripts and jobs will be kept - like /WorkAreas/$role_name/$USER-$EXAMPLE_NAME - whitespace discouraged: " &&  read group_name
    do
        if echo $group_name | grep -q "[a-zA-Z0-9]"
        then
            break
        fi
    done

    mkdir -p $BL_CONFDIR
    echo overwriting $BL_CONFDIR/$profile_name
    {
    echo \[Bladelogic\]
    echo blRole: $role_name
    echo blUser: $user_name
    echo passType: ADK_PASSWORD
    echo myGroup: $group_name
    echo defaultMyGroup: $group_name
    echo serverGroup: /Servers by Role/$role_name
    echo loginUrl: https://[BL UI SERVER]:10003/services/LoginService?wsdl
    echo roleUrl: https://[BL UI SERVER]:10003/services/AssumeRoleService?wsdl
    echo cliUrl:  https://[BL UI SERVER]:10003/services/CLITunnelService?wsdl
    } > "$BL_CONFDIR/$profile_name"
    chmod 600 "$BL_CONFDIR/$profile_name"
    chmod 700 "$BL_CONFDIR"
}
export -f bl_mkconf

function bl_chdir {
    local newGrp=
    if test "$1" == "--help"
    then
        echo USAGE: bl_chdir "/the new/path"
        echo USAGE: bl_chdir
        echo 'bl_chdir sets the "working directory" to search for bl scripts jobs and servers'
        echo 'by editing myGroup;  $myGroup will be edited in the current shell environment and myGroup will be updated in the conf file.'
        return 1
    elif test -z "$BL_CONF"; then
        echo "please run bl_conf to set the current profile"
        return 1
    elif echo "$1" | egrep -q "^\.\.$|^\.\./"
    then
        echo "Sorry, \"bl_chdir ..\" is not supported yet"
    elif test -n "$1" && ! echo $1 | egrep -q "^/"
    then
        if echo $1 | egrep -v "^\./"
        then
            newGrp="$myGroup/$1"
        else
            newGrp="$myGroup/${1:2:${#2}}"
        fi
    elif test -n "$1"
    then
       newGrp="$1"
       if test ${#newGrp} -gt 1 && test ${newGrp:${#newGrp}-1:1} = "/"
       then
          newGrp=${newGrp:0:${#newGrp}-1}
       fi
    fi
    if test -z "$newGrp"; then
        echo starting with profile "$BL_CONF" and \$myGroup=$myGroup
        echo -n "new value for myGroup[$defaultMyGroup]: "
        read newGrp
        if test -z "$newGrp";
        then
            newGrp="$defaultMyGroup"
        fi
    fi
    ## escape the baclslashes in $newGrp for the next operation
    cat "$BL_CONFDIR/$BL_CONF" | egrep -v "^myGroup:" > "$BL_CONFDIR/${BL_CONF}.tmp" && echo "myGroup: $newGrp" >> "$BL_CONFDIR/${BL_CONF}.tmp" && mv "$BL_CONFDIR/${BL_CONF}.tmp" "$BL_CONFDIR/${BL_CONF}"
    chmod 600 "$BL_CONFDIR/$BL_CONF"
    if [ $? = 0 ]; then
        bl_conf $BL_CONF
    else
        echo chdir failed
        return 1
    fi
    PS1="$STORE_PS1($BL_CONF:$myGroup \W) "
    return 0
}
export -f bl_chdir

function getBase() {
    local BL_BASE=
    if test -z "$myRole"; then
        echo "\$myRole is undefined.  please set ENV with bl_conf"
        return 1
    elif test $myRole = [ENG ROLE NAME]
    then
        BL_BASE=$BL_ENG_BASE
    elif test $myRole = [QA ROLE NAME]
    then
        BL_BASE=$BL_QA_BASE
    elif test $myRole = [NP ROLE NAME]
    then
        BL_BASE=$BL_LLE_BASE
    elif test $myRole = [PROD ROLE NAME]
    then
        BL_BASE=$BL_PROD_BASE
    else
        echo "\$myRole=\"$myRole\" is not set to a valid role.  please bl_conf to a valid role."
        return 1
    fi
    echo $BL_BASE
    return 0
}
function getSuffix() {
    ## env var $myGroup is like CWD for bladelogic scripts and jobs.
    ## getSuffix() gets the base BL group for the current role, subtracts that from the
    ## beginning of $myGroup, and returns the result
    local SUFFIX=
    local BASE="$(getBase)"
    ERR=$?
    if test $ERR != 0; then
        echo "getSuffix: getBase failed."
        return $ERR
    fi
    if test -z "$myGroup"; then
        echo "\$myGroup is undefined.  please set ENV with bl_conf."
        return 1
    fi
    SUFFIX="$(echo $myGroup | sed -e "s#$BASE/##")"
    if echo $SUFFIX | egrep -q ^/
    then
        echo SUFFIX=$SUFFIX
        echo "ERROR: getSuffix requires myGroup=\"$myGroup\" to be a subgroup of \"$BASE\", the BL group corresponding to the current BL role"
        return 1
    fi
    echo $SUFFIX
    return 0
}

function getPrefix() {
    ## like calling dirname on a file in CWD, then removing $BL_LOCAL_ENG from the result
    ## So if BL_LOCAL_ENG=/unixworks/bl_tools/eng,
    ## and we are in /unixworks/bl_tools/eng/some/script/dir,
    ## then getPrefix() will return some/script/dir

    if test "$(pwd)" == "$BL_LOCAL_ENG"
    then
        PREFIX=
    else
        PREFIX=`pwd | sed -e "s#^$BL_LOCAL_ENG/##"`
        if test "$PREFIX" = "`pwd`" && test "$PREFIX" != "$BL_LOCAL_ENG"
        then
            echo ERROR: getPrefix requires CWD to be located in BL_LOCAL_ENG=\"$BL_LOCAL_ENG\"
            echo
            echo RETURNING 1
            return 1
        fi
    fi
    echo $PREFIX
    return 0
}

#if test -d $BL_CONFDIR
#then
#    for conf in `ls $BL_CONFDIR`
#    do
#            GRP=`egrep "^myGroup:" $BL_CONFDIR/$conf | awk '{ print $2 }'`
#            GRPVAR=myGroup_$conf
#            export ${GRPVAR}=$GRP
#    done
#fi

function listify {
    LIST="$*"
    LIST=`echo $LIST | sed -e 's/ \+/,/g'`
    echo $LIST
}
function listify_f {
    FILE=$1
    listify `cat $FILE`
}
function spacify {
    LIST=$*
    LIST=`echo $LIST | sed -e 's/,/ /g'`
    echo $LIST
}
function spacify_f {
    F=$1
    LIST=`cat $F|egrep -v ^$|sed -e 's/^( \|    )\+//' -e 's/*( \|    )*$//'`
    echo $LIST
}
function sniqify { # do tr A-Z a-z | sort | uniq on file and replace
    FILE="$1"
    wc -l "$FILE"
    cat "$FILE" | tr A-Z a-z | sort | uniq|egrep -v "^$" > /tmp/file.$$
    mv /tmp/file.$$ "$FILE"
    wc -l "$FILE"
}
function pipeify {
    LIST="$*"
    LIST=`echo $LIST | sed -e 's/ \+/|/g'`
    echo $LIST
}

function bl_time_et_now_plus_minutes {
    SECONDS=$(($1 * 60))
    TZ=America/New_York date "+%Y-%m-%d %H:%M:%S" --date=@$(($(date +%s)+$SECONDS))
}
shopt -s checkwinsize

function bl_cpm_chgrp() {
    if test $# != 0;
    then
        echo USAGE: bl_cpm_chgrp
        echo if env is configured using bl_conf, and CWD is contained in BL_LOCAL_ENG=$BL_LOCAL_ENG,
        echo "(where the job definition folders are),"
        echo "then \$myGroup will be set to /WorkAreas/\$myRole/\$PREFIX,"
        echo "where PREFIX is the current subdirectory inside BL_LOCAL_ENG"
        echo "and \$myRole is the BL role set by the bl_conf command."
        return 1
    fi
    PREFIX=$(getPrefix)
    ERR=$?
    if test $ERR != 0; then
        echo "ERROR: before executing bl_cpm_chgrp again,"
        echo "ERROR: please make sure you have set your env with bl_conf,"
        echo "ERROR: and then cd into a job definition folder in BL_LOCAL_ENG=$BL_LOCAL_ENG"
        return $ERR
    else
        bl_chdir "/WorkAreas/$myRole/$PREFIX"
    fi
}
function bl_cpm_chdir() {
    # examine $myGroup and determine how this maps into the local filesystem under BL_LOCAL_ENG
    # then, cd BL_LOCAL_ENG/SUFFIX
    SUFFIX="$(getSuffix)"
    ERR=$?
    if test $ERR != 0; then
        echo "ERROR: bl_cpm_chdir: getSuffix failed."
        return 1
    fi
    cd "$BL_LOCAL_ENG/$SUFFIX"
}
XDG_CONFIG_DIRS=/unixworks/bl_tools/etc


<filename>migrate/migrate.sh
#!/usr/bin/env bash
#

if [[ -n "$DEBUG" ]]; then
  set -x
fi

set -o pipefail  # trace ERR through pipes
set -o errtrace  # trace ERR through 'time command' and other functions
set -o nounset   ## set -u : exit the script if you try to use an uninitialised variable
set -o errexit   ## set -e : exit the script if any statement returns a non-true return value

for letter in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z
  do
    aws s3 sync "s3://$letter.$BUCKET_BASE_1" "s3://$BUCKET_BASE_2"
done


#!/bin/sh

set -e

gunicorn app:app                             \
    --bind 0.0.0.0:8080                      \
    --worker-class aiohttp.GunicornWebWorker


#!/bin/bash

rouge='\e[1;31m'
vert='\e[1;33m'
bleu='\e[1;34m'
violet='\e[1;35m'
vert='\e[1;32m'
neutre='\e[0;m'

if [ "$UID" -eq "0" ]
then
    zenity --warning --height 80 --width 400 --title "EREUR" --text "Merci de lancez le script sans sudo : \n./maintenance.sh\nVous devrez entrer le mot de passe root par la suite."
    exit
fi

which notify-send > /dev/null
if [ $? = 1 ]
then
	sudo apt install -y libnotify-bin
fi

which zenity > /dev/null
if [ $? = 1 ]
then
	sudo apt install -y zenity
fi

zenity --question --no-wrap --height 40 --width 300 --title  "Maintenance d'Ubuntu" --text "Lancer la maintenance complète ?"

if [ $? == 0 ]
then
    echo ""
    echo -e -n "$vert [1/8]$rouge MISE A JOUR APT "
    for i in `seq 24 $COLUMNS`;
        do echo -n "."
    done
    echo -e " $neutre"
    notify-send -i system-software-update "Maintenance d'Ubuntu" "Mises à jour"
    sudo dpkg --configure -a
    sudo apt update
    sudo apt full-upgrade -y
    echo " "

    echo -e -n "$vert [2/8]$rouge MISE A JOUR DES PACKAGES PYTHON "
    for i in `seq 40 $COLUMNS`;
    do echo -n "."
    done
    which pipupgrade > /dev/null
	if [ $? = 1 ]
	then
		pip install pipupgrade
	fi
    echo -e " $neutre"
    # notify-send -i system-software-update "Maintenance d'Ubuntu" "Mise à jour des packages python"
    pipupgrade --self --yes
    pipupgrade --pip --yes
    echo " "

    echo -e -n "$vert [3/8]$rouge MISE A JOUR SNAPS ET FLATPAK "
    for i in `seq 37 $COLUMNS`;
        do echo -n "."
    done
    echo -e " $neutre"
    # notify-send -i system-software-update "Maintenance d'Ubuntu" "Mise à jour des snaps"
    sudo snap refresh
    flatpak update -y
    echo " "

    echo -e -n "$vert [4/8]$rouge AUTO-REMOVE "
        for i in `seq 20 $COLUMNS`;
        do echo -n "."
    done
    echo -e " $neutre"
    # notify-send -i system-software-update "Maintenance d'Ubuntu" "Auto-remove"
    sudo apt autoremove --purge -y
    echo " "

    echo -e -n "$vert [5/8]$rouge CLEAN "
        for i in `seq 14 $COLUMNS`;
        do echo -n "."
    done
    echo -e " $neutre"
    # notify-send -i system-software-update "Maintenance d'Ubuntu" "Clean"
    sudo apt autoclean
    echo " "

    echo -e -n "$vert [6/8]$rouge PURGE "
        for i in `seq 14 $COLUMNS`;
        do echo -n "."
    done
    echo -e " $neutre"
    # notify-send -i system-software-update "Maintenance d'Ubuntu" "Purge"

    sudo apt purge $(COLUMNS=200 dpkg -l | grep "^rc" | tr -s ' ' | cut -d ' ' -f 2) -y
    echo " "
    echo -e -n "$vert [7/8]$rouge RESOLUTION DES DEPENDANCES "
        for i in `seq 35 $COLUMNS`;
        do echo -n "."
    done
    echo -e " $neutre"
    # notify-send -i system-software-update "Maintenance d'Ubuntu" "Réparation des dépendances"
    sudo apt install -fy
    echo ""
    TRASH=$(date --date="2 week ago" "+%d %B")

    echo -e -n "$vert [8/8]$rouge FICHIERS ANTERIEURS AU $TRASH "
        for i in `seq 40 $COLUMNS`;
        do echo -n "."
    done
    echo -e " $neutre"
    # notify-send -i system-software-update "Maintenance d'Ubuntu" "Suppression des fichiers de la corbeille antérieurs au $TRASH"
    echo " "

    which trash-cli > /dev/null
    if [ $? = 1 ]
    then
        sudo apt install -y trash-cli
    fi

    for i in `seq 0 14`;
        do trash-list | grep $(date --date="$i day ago" "+%Y-%m-%d")
    done
    echo " "
    echo -e " $rouge"
    for i in `seq 15 60`;
        do trash-list | grep $(date --date="$i day ago" "+%Y-%m-%d")
    done
    echo -e " $neutre"

    zenity --question --height 40 --width 300 --title "Maintenance d'Ubuntu" --text "Voulez-vous supprimer les fichiers de la corbeille antérieurs au $TRASH ?"
    if [ $? == 0 ]
	then
	    trash-empty -f 14
	fi
    notify-send -i dialog-ok "Maintenance d'Ubuntu" "Terminée avec succès"

else
    notify-send -i dialog-close "Maintenance d'Ubuntu" "Annulé"
    exit
fi


#!/bin/sh
# Posts a JSON files to solr.
# try schema/vms.json

if [ -z "$2" ]
  then
    echo "usage: ./solr-post.sh {core} {file.json}"
    echo "  e.g. ./solr-post.sh schema/vms.json"
    exit -1
fi
. $(dirname $0)/params.sh

echo Posting file $f to $URL_BASE/$1
curl $URL_BASE/$1/update --data-binary @$2 -H 'Content-type:application/json'
echo

#send the commit command to make sure all the changes are flushed and visible
curl $URL_BASE/$1/update?commit=true
echo


<filename>bin/keyboard.sh
#!/bin/sh

/usr/bin/setxkbmap -option '' -option 'ctrl:swapcaps'


<gh_stars>100-1000
#!/bin/sh

if is_osx; then
  start () {
    readonly __memory_os_memsize=$(sysctl -n hw.memsize)
  }

  collect () {
    report $(vm_stat | awk -v total_memory=$__memory_os_memsize \
            'BEGIN { FS="   *"; pages=0 }
            /Pages (free|inactive|speculative)/ { pages+=$2 }
            END { printf "%.1f", 100 - (pages * 4096) / total_memory * 100.0 }')
  }
else
  collect () {
    report $(free | awk '/Mem:/ {
              printf "%.1f", 100 - $4 / ($3 + $4) * 100}')
  }
fi

docs () {
  echo "Percentage of used memory."
}


<filename>src/GUI.sh
#!/usr/bin/env python

from Tkinter import *
import tkFileDialog
from PIL import Image,ImageTk
import os
from dataAcq import target_download
import csv
from analysis_script import target_analysis
import display

class Data(Frame):
    def __init__(self,parent):
        Frame.__init__(self,parent)
        self.parent = parent
        self.index=0
        self.initUI()

        self.image_data = {'tam_cat_sample.csv':'FITS/TAM/',
                          'random_catalog_sample+1000.csv':'FITS/RandSample+1000/',
                          'random_catalog_sample+2000.csv':'FITS/RandSample+2000/',
                          'tycho_2mass_wise_XMATCH-POS.csv':'FITS/Full_Cat/'}
        self.num_data = {'tam_cat_sample.csv':'Results/TAM/',
                          'random_catalog_sample+1000.csv':'Results/RandSample+1000/',
                          'random_catalog_sample+2000.csv':'Results/RandSample+2000/',
                          'tycho_2mass_wise_XMATCH-POS.csv':'Results/Full_Cat/'}

    def initUI(self):

        self.parent.title('exocode GUI')
        self.pack(fill=BOTH,expand=1)
        self.frame = Frame(self,relief=RAISED,bd=1)
        self.frame.pack(expand=2,fill=BOTH)

        self.data = Frame(self.frame)
        self.data.pack(fill=BOTH,side=LEFT,expand=1)
        top = Frame(self.data,width=40)
        bot = Frame(self.data,height=90)
        top.pack()
        bot.pack(fill=Y)

        self.dwnld = StringVar()
        self.dwnld.set('Checking Download...\nSelect catalog to run')
        self.check = Label(top,textvariable=self.dwnld,anchor=N,justify=LEFT,width=17)
        self.check.pack(side=LEFT,fill=BOTH)
        scrollbar = Scrollbar(bot)
        self.listbox = Listbox(bot, yscrollcommand=scrollbar.set,height=13,width=16)
        scrollbar.pack(side=RIGHT,fill=Y)
        self.listbox.pack(side=LEFT,fill=BOTH)

        scrollbar.config(command=self.listbox.yview)

        csv_frame = Frame(self.frame,width=200,padx=5)
        csv_frame.pack(fill=BOTH,side=LEFT,expand=1)
        csv_title = Frame(csv_frame)
        csv_title.pack(fill=BOTH)
        csv_label = Label(csv_title,text='Data')
        csv_label.pack(fill=BOTH)
        self.csv_table = Frame(csv_frame)
        self.csv_table.pack(fill=BOTH)

        grid = Frame(self.csv_table,width = 210)
        grid.pack(side=LEFT)

        self.l0 = Listbox(grid, height=15,width=210,font=('FreeMono',10))
        self.l0.pack(side=LEFT,fill=BOTH)

        list_titles = ['Image Address','Target Index','Target Right Ascension',
                       'Target Declination','Survey','Band',
                       'Number of Central Blobs','Main Blob Center',
                       'Main Blob Radius','Main Blob Displacement',
                       'Percent Outside Diffraction','Threshold Value',
                       'Percent of Image White','Validation','Error']
        list_titles = [list_titles[0],
                       list_titles[6],list_titles[7],list_titles[8],
                       list_titles[9],list_titles[11],list_titles[12],list_titles[14]]

        list_header = ('Image Address                                     | Number of Central Blobs | Main Blob Center | Main Blob Radius | \
Main Blob Displacement | Threshold Value | Percent of Image White | Error        ')
        self.l0.insert(END,list_header)

        close_button = Button(self,text='Close',command=self.parent.destroy)
        close_button.pack(side=RIGHT,padx=5,pady=5)
        self.catalog = StringVar()
        self.catalog.set('Select Catalog')
        cat_button = Button(self,textvariable=self.catalog,command=self.update_catalog)
        cat_button.pack(side=RIGHT,padx=5,pady=5)

        self.current = StringVar()
        self.current_id = Label(self.data,textvariable=self.current)
        self.img_display = Button(self.csv_table.master,text='Display Next Index',command=self.data_display)
        self.download_button = Button(self.data,text='Click to Download',command=self.data_protocol)

        self.label1 = Label(self.csv_table.master, text="Jump to Index:")
        self.E1 = Entry(self.csv_table.master,width=5)
        self.images = Button(self.csv_table.master,text='Show Target Images',command=self.image_display)

    def update_catalog(self):
        self.download_button.destroy()
        self.listbox.delete(0, END)
        self.l0.delete(1,END)
        self.current.set('')
        self.index=0
        self.catalog_file = tkFileDialog.askopenfilename(initialdir='Catalogs/')
        self.data_container = self.image_data[self.catalog_file.split('/')[-1]]
        self.catalog.set('Catalog: '+self.data_container)

        with open(self.catalog_file,'rb') as f:
            self.num_lines = sum(1 for line in f)
        self.data_button = Button(self.csv_table.master,text='Display New Catalog Data',command=self.data_display)
        for i in range(0,self.num_lines):
            if os.path.isdir(self.data_container+'index-'+str(i)+'/'):
                self.listbox.insert(END,'index-'+str(i)+':   EXISTS')
                if i == self.num_lines-1:
                    self.dwnld.set('\nDownload Complete!')
                    self.check.config(fg='green')

                    self.data_button.pack(side=BOTTOM,fill=X)
            else:
                self.listbox.insert(END,'ERROR')
                self.listbox.insert(END,'MISSING index-'+str(i))

                self.download_button = Button(self.data,text='Click to Download',command=self.data_protocol)
		self.download_button.pack(padx=5,pady=5)

                self.dwnld.set('\nDownload Incomplete')
                self.check.config(fg='red')
                break

    def data_protocol(self):
        self.listbox.delete(0,END)
        self.dwnld.set('\nDownloading Now...')
        with open(self.catalog_file,'rb') as csvfile: #rand cat
            reader = csv.reader(csvfile)
            table = [[e for e in r] for r in reader]
        for i in range(self.num_lines):
            target_download(i,self.data_container,table)
            self.listbox.insert(END,'index-'+str(i)+':   EXISTS')
            if i == self.num_lines-1:
                self.dwnld.set('\nDownload Complete!')
                self.check.config(fg='green')
        self.download_button.destroy()
        self.data_button = Button(self.csv_table.master,text='Display New Catalog Data',command=self.data_display)
        self.data_button.pack(side=BOTTOM,fill=X)

    def data_display(self):
        self.data_button.destroy()
        self.l0.delete(1,END)
        full = target_analysis(self.index,self.data_container)[1:]
        full.sort(key=lambda x: x[0])

        max_len = {0:49, 1:12, 2:22, 3:18, 4:6, 5:9, 6:23, 7:16,
                   8:16, 9:22, 10:27, 11:15, 12:22, 13:10, 14:24}

        for row in range(len(full)):
            for column in range(len(full[row])):
                full[row][column] = str(full[row][column]) + ' '*(max_len[column]-len(str(full[row][column])))

        formatted = []
        for row in full:
            formatted.append(' | '.join([row[0],row[6],row[7],row[8],
                   row[9],row[11],row[12],row[14]]))

        for line in formatted:
            self.l0.insert(END,line)

        self.index+=1

        self.img_display.pack(padx=5,pady=5,side=LEFT)

        self.current.set('\nDisplaying\nIndex '+str(self.index-1))
	self.current_id.pack(padx=5,pady=5)

        self.label1.pack(side=LEFT,padx=5,pady=5)
        self.E1.pack(side=LEFT)
        self.E1.bind('<Return>',self.input_index)

        self.images.pack(side=RIGHT,padx=5,pady=5)

    def input_index(self,event):
        if int(self.E1.get()) in range(0,self.num_lines):
            self.index = int(self.E1.get())
            self.data_display()

    def image_display(self):
        pass
        new = Toplevel(self.parent)
        new.title('Images for Index '+str(self.index-1))
        results_dir = self.num_data[self.catalog_file.split('/')[-1]]
        image_dir = self.image_data[self.catalog_file.split('/')[-1]]
        img_window= Display(new,self.index-1,results_dir,image_dir)

class Display(Frame):

    def __init__(self,parent,index,results,images):
        Frame.__init__(self,parent)
        self.parent = parent
        self.index = index
        self.results = results
        self.fits = images
        self.pack(fill=BOTH)
        self.initUI()

    def initUI(self):
        frame = Frame(self,relief=RAISED,bd=1)
        frame.pack(expand=2,fill=BOTH)
        close_button = Button(self,text='Close',command=self.parent.destroy)

        out_file = self.results+'index_'+str(self.index)+'_images.png'
        display.display(self.index,self.fits,show=False,save=out_file)
        target_images = Image.open(out_file)
        background = ImageTk.PhotoImage(target_images)
        label=Label(frame,image=background)
        label.image=background

        label.pack(fill=BOTH)
        close_button.pack(side=RIGHT,padx=5,pady=5)

def main():
    root = Tk()
    root.geometry('2000x360')
    app = Data(root)
    root.mainloop()

if __name__ == '__main__':
    main()


rm -f TNSAgent/setup.py
sed 's/%%AGENT_SOURCE%%/city_agent/g' TNSAgent/setup.py.tmp  > TNSAgent/setup.py


<filename>pytorch/run.sh<gh_stars>0
#!/bin/bash
source activate pytorch
ldconfig # workaround for https://github.com/NVIDIA/nvidia-docker/issues/854
jupyter lab --ip 0.0.0.0 --no-browser --allow-root --NotebookApp.token='' --NotebookApp.password='' --NotebookApp.disable_check_xsrf=True