Skip to content

Instantly share code, notes, and snippets.

@SilasK
Last active February 14, 2023 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SilasK/fcfee200405196ae12588824591766ec to your computer and use it in GitHub Desktop.
Save SilasK/fcfee200405196ae12588824591766ec to your computer and use it in GitHub Desktop.
Here are some of the hack I use to make my life working on the command line a bit easier
# STARTUP SCREENS
# ===============================================================
# Defines the time screen delays a new message when one message
# is currently displayed. The default is 1 second.
# msgminwait 2
# Time a message is displayed if screen is not disturbed by
# other activity. The dafault is 5 seconds:
# msgwait 2
# Briefly show the version number of this starting
# screen session - but only for *one* second:
# msgwait 1
# version
# Welcome the user:
# echo "welcome :-)"
# echo "I love you today."
# Uncomment one/some following lines to automatically let
# SCREEN start some programs in the given window numbers:
# screen -t MAIL 0 mutt
# screen -t EDIT 1 vim
# screen -t GOOGLE 2 links http://www.google.com
# screen -t NEWS 3 slrn
# screen -t WWW 4 links http://www.math.fu-berlin.de/~guckes/
# screen 5
# screen 6
# Set the environment variable var to value string. If only var is specified,
# you'll be prompted to enter a value. If no parameters are specified,
# you'll be prompted for both variable and value. The environment is
# inherited by all subsequently forked shells.
# setenv PROMPT_COMMAND 'echo -n -e "\033k\033\134"'
# Don't you want to start programs which need a DISPLAY ?
# setenv DISPLAY ''
hardstatus alwayslastline
hardstatus string '%{WB}%H %{W}| %{Y}%l %{W}| %?%{w}%-w%?%{+b g}[%{W}%{r}%n%{W} %t%?{%u}%?%{-b g}]%{W}%?%+w%?%=%{G}| %{Y}%d-%m-%Y %c:%s '

Here are some of the hack I use to make my life working on the command line a bit easier

Use Aliases for often used commands

In .bashrc



# Use aliases for often used commands
## Slurm
alias sk='squeue -u $USER'
alias sr='screen -r'
alias jobstatus="sacct -P -bn -j"

##LSF

export LSB_BJOBS_FORMAT="jobid:7 job_name:35  stat:5 start_time:10 queue:7 run_time:5 runtimelimit " # min_req_proc effective_resreq"

alias bj=bjobs


# Display table 
# tsv file.tsv
alias tsv="column -t -s $'\t'"

# there is also tsv-utils

# get info about running job 
# sshow 2344464
alias sshow="scontrol show jobid"







# set mask so others of the same group can read and write your files:
umask g+rw,o-rwx


## Snakemake

lastlog () {

  ls $1.snakemake/log/*.log | tail -n1
}



I use a .screenrc to visually mark my screens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment