Skip to content

Latest commit

 

History

History
94 lines (94 loc) · 3.79 KB

IPM-OAM.org

File metadata and controls

94 lines (94 loc) · 3.79 KB

Introduction

The SMACK4 is recorded already. Why should you join then?

Practical tips in the working environment like setting up alias=es, personalizing your =ds9, and automatically checking if you are already following best-practices.

There, nano, vim, and emacs are introduced. Here, we’ll focus on vscode.

Reusing DS9 Commands

Visiting the preferences of ds9

Using astscript-fits-view and options including -g or --geometry

Using xrandr just to see the display resolution

Using alias to get astscript-fits-view to always use the same geometry

Common text editors (nano, vim, emacs)

Work in the command line without the need for graphics

Get to know your way around, since most supercomputers don’t provide GUI access

A nice companion would be tmux which helps immensely in commandline interface

Where to RTFM? (Read The “Fine” Manual).

$ info nano

$ info emacs

$ vimtutor

Learn how to open files, navigate, edit, save, and exit succesfully!

Using C-z and then $ fg to manage tasks in the terminal.

Visual Studio Code

Download link

Installing linters and extensions for bash and python.

Common shortcuts, and personalizing them.

C-p search for file

C-S-p run commands

C-TAB cycle through open files

C-` or C-j open terminal

Toggle formatting, linters, wordwrap, etc.

Bash Scripts

Start with a copyright

What are comments? Things that start with a pound sign (i.e. #)

File permissions and making scripts executable with $ chmod +x FILENAME

What happens if the file is not executable?

Why should you check the internals of an executable before running it?

Install the plugin on vscode

Turn on the -o all option for all warnings and notes

What is shebang ? #!/bin/bash

What happens if you don’t use it?

Checking file types with $ file FILENAME, demonstrate different shebangs and effect.

Stop the script when errors come up with $ set -e

Refactor

Replace short-options with long-options which describes what is happening better

Replace repetetive commands with either loops or functions

Show the $ info test page to show -f, -d, -h, and other options

Check if file exists before downloading

Use wget’s --input-file option, as well as --continue

Comment out the GUI commands, e.g. ds9

Common mistakes

A taste of GNU Make

Targets and recepies

Automating an entire pipeline

Introduce Maneage

Useful Links

  1. https://linuxconfig.org/bash-scripting-tutorial-for-beginners
  2. https://www.howtogeek.com/devops/using-shellcheck-to-find-and-fix-scripting-bugs/
  3. https://www.howtogeek.com/devops/bash-automation-scripting-basics-part-1/
  4. https://www.howtogeek.com/devops/bash-automation-and-scripting-basics-part-2/
  5. https://www.howtogeek.com/devops/bash-automation-and-scripting-basics-part-3/
  6. https://www.howtogeek.com/devops/bash-functions-and-local-variables/