├── README.md ├── dotfiles ├── README.md ├── bashrc.cs50 ├── emacs ├── gitconfig ├── profile.cs50 └── vimrc └── shared /README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | This repository contains files for configuring your CS50 development environment on the Thayer Computing systems. 4 | Specifically, it contains the following: 5 | 6 | * `README.md` - a file with these instructions, in 'Markdown' format. 7 | * `dotfiles` - a directory with 'dot' files for your home directory; see [dotfiles/README.md](dotfiles/README.md). 8 | * `shared` - a symbolic link to a shared directory of CS50 content provided by the instructor. 9 | 10 | ## Preparing your laptop 11 | 12 | You cannot connect to Thayer's Linux servers unless you are connected to the Dartmouth campus network; if you are off campus, connect your laptop to Dartmouth's [VPN](https://services.dartmouth.edu/TDClient/1806/Portal/KB/?CategoryID=13404). 13 | 14 | ## Preparing for Linux development 15 | 16 | 1. Open a Terminal window: 17 | 18 | * on **MacOS**, launch `Terminal` from the Utilities folder (inside the Applications folder) 19 | * on **Windows**, launch `Windows Command Prompt` 20 | 21 | 2. In that Terminal window, you will see a prompt, likely ending in `$`. After that prompt, type the following command but substitute your Dartmouth NetID: 22 | 23 | ```bash 24 | ssh d12345x@plank.thayer.dartmouth.edu 25 | ``` 26 | 27 | (The `ssh` command means 'secure shell', which opens a secure connection to server named `plank.thayer.dartmouth.edu` and launches the `bash` shell program under user id `d12345x`.) 28 | 29 | > If it reports "connection refused" or (after a long wait) "connection timed out", double-check that you are connected to Dartmouth's network or VPN. 30 | 31 | > If it asks you `Are you sure you want to continue connecting (yes/no/[fingerprint])?`, say yes. 32 | 33 | It will ask for your password; use your NetID password. 34 | It will pause briefly, warn you about your usage of disk space on the Thayer File System (ThayerFS), and then give you a command prompt; it will look something like this: 35 | 36 | ```bash 37 | $ ssh d12345x@plank.thayer.dartmouth.edu 38 | d12345x@plank.thayer.dartmouth.edu's password: 39 | << You are currently using 47.39M of your 5.00G home directory quota. >> 40 | d12345x@plank:~$ 41 | ``` 42 | 43 | > In the above example, `$` is the shell prompt on your laptop; if you are tempted to copy-paste the `ssh` command, don't copy that prompt! 44 | 45 | 3. You are now at *the command line*: the computer prints a prompt (`d12345x@plank:~$`) and waits for you to type a command. 46 | The prompt indicates you are user `d12345x`, logged into server named `plank`, and your *current working directory* is `~`, which is shorthand for your *home directory*. 47 | All of your files will live in your home directory (like a folder) or in subdirectories (like subfolders). 48 | Below, we do not show the prompt, just the commands you should type. 49 | 50 | 4. At the prompt, type the command `copy_skel` to install the standard Thayer-issue `bash` configuration files: 51 | 52 | ```bash 53 | copy_skel 54 | ``` 55 | 56 | This program installs (or overwrites) the files `.bashrc` and `.profile` in your home directory. 57 | **Important:** if you have used Thayer's Linux systems before, and have customized your copy of these configuration files, type `n` when the script asks to overwrite them; if you type `y` you will lose your customizations and begin with fresh Thayer-supplied default configuration. 58 | 59 | 5. Set up your GitHub account and provide GitHub a 'key' so your account on `plank` can access GitHub; follow these [instructions](https://github.com/CS50Spring2023/home/blob/main/logistics/github.md), and then return here. 60 | 61 | 6. Clone this repository into your home directory: 62 | 63 | 64 | ```bash 65 | git clone https://github.com/CS50Spring2023/cs50-dev.git 66 | ``` 67 | 68 | The result is a subdirectory named `cs50-dev` in which you should do all your development for this course. 69 | 70 | 7. The repository contains some necessary extensions to the bash configuration files; update your bash configuration to invoke them when you next log in: 71 | 72 | ```bash 73 | echo source ~/cs50-dev/dotfiles/bashrc.cs50 >> ~/.bashrc 74 | echo source ~/cs50-dev/dotfiles/profile.cs50 >> ~/.profile 75 | ``` 76 | 77 | These `echo` commands append a line to the bottom of each file. 78 | Within those files, the `source` command tells bash to read commands from the named file. 79 | 80 | 8. Copy our recommended files into your home directory: 81 | 82 | ```bash 83 | cp -i cs50-dev/dotfiles/emacs .emacs 84 | cp -i cs50-dev/dotfiles/vimrc .vimrc 85 | cp -i cs50-dev/dotfiles/gitconfig .gitconfig 86 | ``` 87 | 88 | **Important:** if you already had a Linux account on Thayer systems, and already had one or more of those dot files, `cp` will ask if you want to overwrite them; type `y` if you want to use our recommended file, and type `n` otherwise. 89 | You may want to compare our files to yours, and edit in our suggestions as you see fit. 90 | 91 | 9. (OPTIONAL) To pick a preferred editor, edit `~/cs50-dev/dotfiles/profile.cs50` to uncomment one line defining `EDITOR`. 92 | You can postpone this step until you've decided on your favorite editor. 93 | 94 | > You can read [about editors here](https://github.com/CS50Spring2023/home/blob/main/logistics/systems.md#editors). 95 | 96 | 10. Finally, log out of plank (use the `exit` command to exit bash), and log back in using the `ssh` command from above. 97 | 98 | ```bash 99 | exit 100 | ``` 101 | 102 | ## Developing your code 103 | 104 | Do all your work in the `c50-dev` folder. 105 | Thus, after login, use the `cd` command to change your *current directory* (aka *working directory*) to the `cs50-dev` subdirectory: 106 | 107 | ```bash 108 | d12345x@plank:~$ cd cs50-dev 109 | d12345x@plank:cs50-dev$ 110 | ``` 111 | 112 | Note how the prompt changed to reflect the new directory. 113 | From there, create or clone new git repositories for your coursework. 114 | 115 | 116 | ## More information 117 | 118 | Much more information about the systems we use in CS50, including links to many other resources, can be found on the [systems page](https://github.com/CS50Spring2023/home/blob/main/logistics/systems.md#cs50-systems) of the course website. 119 | -------------------------------------------------------------------------------- /dotfiles/README.md: -------------------------------------------------------------------------------- 1 | # 'dot' files 2 | 3 | The files in this folder are meant to be installed in your home directory (`~`) and are used by `bash`, `git`, `emacs`, `vim` and other tools when they start up. 4 | For instructions about their use, see the README in the parent directory. 5 | 6 | **Note:** we may occasionally provide enhancements or corrections to these files; we may instruct you to copy these changes to your home(`~`) copy of the corresponding file. 7 | -------------------------------------------------------------------------------- /dotfiles/bashrc.cs50: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------- 2 | # This file includes aliases required and recommended for CS50. 3 | # You should 'source' this file from your ~/.bashrc. 4 | # For more info type `man bash'. 5 | # -------------------------------------------------------------------- 6 | 7 | # aliases used for cs50 development 8 | alias mygcc='gcc -Wall -pedantic -std=c11 -ggdb' 9 | alias myvalgrind='valgrind --leak-check=full --show-leak-kinds=all' 10 | 11 | # aliases for safety 12 | alias rm='rm -i' 13 | alias cp='cp -i' 14 | alias mv='mv -i' 15 | 16 | # aliases for convenience 17 | alias ls='ls -F --color=auto' 18 | alias ll='ls -D --color=auto -lt' 19 | alias mkdir='mkdir -p' 20 | alias which='type -all' 21 | alias allme='pgrep -l -u $UID' 22 | 23 | # -------------------------------------------------------------------- 24 | -------------------------------------------------------------------------------- /dotfiles/emacs: -------------------------------------------------------------------------------- 1 | ; CS50 recommended .emacs file 2 | (global-set-key "\C-xg" 'goto-line) 3 | (global-set-key "\C-xc" 'compile) 4 | (setq compile-command "make -k ") 5 | (setq-default indent-tabs-mode nil) 6 | 7 | -------------------------------------------------------------------------------- /dotfiles/gitconfig: -------------------------------------------------------------------------------- 1 | # Default configuration information for 'git' 2 | # add your settings here. 3 | # uncomment one of the editor lines. Visual Studio Code may work but it will be slow. 4 | 5 | [core] 6 | # pager started by git when needed 7 | pager = less -R 8 | 9 | # proceed with default merge message, rather than asking 10 | mergeoptions = --no-edit 11 | 12 | # editor git uses when needed; uncomment to override EDITOR environment 13 | # editor = vim 14 | # editor = emacs -nw -q 15 | 16 | [push] 17 | default = simple 18 | 19 | -------------------------------------------------------------------------------- /dotfiles/profile.cs50: -------------------------------------------------------------------------------- 1 | # This file includes environment variables required and recommended for CS50. 2 | # You should 'source' this file from your ~/.bashrc. 3 | # For more info type `man bash'. 4 | # -------------------------------------------------------------------- 5 | 6 | # Use 'less' as a paginator (e.g., for man pages, git diffs). 7 | export PAGER="less -R" 8 | 9 | # Make less more verbose than usual. 10 | export LESS='-s -w -M' 11 | 12 | # What editor should we use? uncomment the one you prefer 13 | # export EDITOR='/usr/bin/emacs -nw -q' 14 | # export EDITOR=/usr/bin/vim 15 | 16 | # some tools look for this variable to pick an editor 17 | export VISUAL="$EDITOR" 18 | 19 | # set the locale to "C", so scripts behave consistently 20 | export LC_ALL=C 21 | 22 | # -------------------------------------------------------------------- 23 | # resource limits recommended for cs50 24 | 25 | # allow core dumps: Thayer granted our request to enable core dumps 26 | ulimit -c unlimited 27 | 28 | # Due to VSCode's popularity and its extension's heavy use of resources 29 | # we no longer recommend changing any other `ulimit` defaults even though 30 | # the following can protect against infinite loops with fork(), malloc(), etc. 31 | #ulimit -t 900 # maximum CPU time in seconds 32 | #ulimit -v 1000000 # maximum virtual memory in KBytes 33 | #ulimit -u 1000 # maximum number of processes 34 | -------------------------------------------------------------------------------- /dotfiles/vimrc: -------------------------------------------------------------------------------- 1 | " CS50 recommended .vimrc file 2 | 3 | set nocompatible " Use Vim settings instead of Vi. This must be first! 4 | set backspace=indent,eol,start " Allow backspacing over everything in insert mode 5 | set history=500 " Keep 500 lines of command line history 6 | set ruler " Show cursor position at all times 7 | set showcmd " Display incomplete commands 8 | set incsearch " Do incremental searching 9 | set visualbell " Flash screen instead of audio cue 10 | set wildmenu " Enable tab completion in vim 11 | set tabstop=2 " Set width and column size of TAB to 2 12 | set softtabstop=2 " as well as expanding TABS to spaces 13 | set expandtab " and setting the indent size to 14 | set shiftwidth=2 " a width of 2 also 15 | set number " Turn line numbering on 16 | 17 | " Command for printing date in the file you are editing 18 | map ;D !!date 19 | 20 | " In many terminal emulators the mouse works just fine. Thus, enable it. 21 | if has('mouse') 22 | set mouse=a 23 | endif 24 | 25 | " If terminal supports colors, turn syntax highlighting on. 26 | " Also, highlight the last used search pattern. 27 | if &t_Co > 2 || has("gui_running") 28 | syntax on 29 | set hlsearch 30 | endif 31 | 32 | if has("autocmd") 33 | " Turn off auto commenting 34 | autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o 35 | 36 | " Enable file type detection. Use the default filetype settings so that 37 | " mail gets 'tw' set to 72, 'cindent' is on in C files, etc.. Also, load 38 | " indent files to automatically do language-dependant indenting. 39 | filetype plugin indent on 40 | 41 | " Put these in an autocmd group so that we can delete them easily 42 | augroup vmrcEx 43 | au! 44 | 45 | " For all text files set 'textwidth' to 90 characters. 46 | autocmd FileType text setlocal textwidth=90 47 | 48 | autocmd BufReadPost * 49 | \ if line("'\"") > 1 && line("'\"") <= line("$") | 50 | \ exe "normal! g`\"" | 51 | \ endif 52 | 53 | augroup END 54 | else 55 | " Set autoindenting on if autocmd is not supported 56 | set autoindent 57 | endif 58 | -------------------------------------------------------------------------------- /shared: -------------------------------------------------------------------------------- 1 | /thayerfs/courses/23spring/cosc050/students_files --------------------------------------------------------------------------------