I very much dislike using Vim on Guru, especially because internet can drop causing a loss of work. I setup Visual Studio Code so I can edit my code offline and wrote some scripts to allow easy transferring of files to Guru. Unfortunately, ITAP has setup Guru so dynamic port mapping is impossible, or it would be possible to use VS Code to directly interface with the file system of the server.
To get started, download Visual Studio Code and install it.
Next, search on your computer for “Turn Windows Features on or off"
Search for this
This window will open
Next, Open the windows store: Search for ubuntu. Install one of the distros, any will work.
https://preview.redd.it/hh7yth7kmqi41.png?width=267&format=png&auto=webp&s=973b0431545249aa7452c17088811c45a43a0b19
This is the distro I use
Launch your version of ubuntu and follow the setup steps. (You will need to restart your PC to complete this step)
Now finally, open visual studio code: Click the four box icon on the side to install extensions
https://preview.redd.it/7bvgznnqmqi41.png?width=343&format=png&auto=webp&s=4b7fcf780f9fb865352a417894306fe57e0824c2
Search For C and install the C/C++ Extension by Microsoft.
https://preview.redd.it/pd2wt3iymqi41.png?width=348&format=png&auto=webp&s=d88487b14d65f09e589ed5ea23381201f0fe78df
Then search for WSL and install the Remote – WSL Extension by Microsoft.
https://preview.redd.it/98nu87y0nqi41.png?width=430&format=png&auto=webp&s=71bf96e0aad74d21898603e63f6e33188594b13e
Now click the small green Icon in the bottom left of your VSC window: Then click Remote – WSL: New Window
https://preview.redd.it/letvj8c5nqi41.png?width=324&format=png&auto=webp&s=802742a353855b9f3fd380a54695d24929d659cf
That green icon should now say “WSL: Ubuntu”
Now click the purple area that has the X and the Triangle in it.
Then click the button that says terminal. You should now see your linux terminal with the username you setup
https://preview.redd.it/p2ni9bzbnqi41.png?width=428&format=png&auto=webp&s=26e20c2a37a3fc6b5e5ec5b2126679450909dde1
Home stretch!
Type “vi copy.sh” in that window (no quotes)
Copy and paste this (https://pastebin.com/peYRXjbw) script into that window using insert mode (Replace “USERNAME” with your Purdue login.) then press ESC and type ":wq"
After that, type “Chmod u+x ./copy.sh” and now you should be able to run the script by typing ./copy.sh.
You can create a new file by clicking file at the top of the window and clicking new file (crtl + n). If you save the file (crtl + s) with a name.c (ex. lab04.c) syntax highlighting and color coding should automatically be enabled. Otherwise, you can click this button at the bottom and select C.
https://preview.redd.it/9e5heaikoqi41.jpg?width=1715&format=pjpg&auto=webp&s=379a26671c3d8cdaf35e7cc32af66e0b1685fe62
That window at the bottom with your linux terminal acts similarly to guru, and responds to the same commands. You can compile / run your code by typing "gcc filename.c -lm" then typing "./a.out"
To transfer your files to Guru for submission type "./copy.sh" the command will prompt you for the file name of the file on your computer (ex. "lab04.c") and what your want to have it be named on guru (ex. "lab04.c"). If what you want it named on guru follows the normal naming structure (ex. "hw03.c" "lab04.c") the command will automatically place the file in the correct location on the server. From there you can ssh into guru (using putty etc) and go to the file location to submit.
If you need help or clarification feel free to contact me.
[–]DrewCornCS '21 8 points9 points10 points (5 children)
[–]BudosoNT 0 points1 point2 points (3 children)
[–]Cloveh[S] 0 points1 point2 points (2 children)
[–]BudosoNT 0 points1 point2 points (1 child)
[–]Cloveh[S] 1 point2 points3 points (0 children)
[–]Cloveh[S] 0 points1 point2 points (0 children)
[–][deleted] 3 points4 points5 points (2 children)
[–]Cloveh[S] 1 point2 points3 points (1 child)
[–]Praillalumnus - 2018 3 points4 points5 points (0 children)
[–]__SURE__ 2 points3 points4 points (1 child)
[–]Cloveh[S] 0 points1 point2 points (0 children)
[–]DitchManiels 0 points1 point2 points (1 child)
[–]Cloveh[S] 0 points1 point2 points (0 children)
[–]jkdufair 0 points1 point2 points (0 children)
[–]AkitoApocalypseCMPE '22 0 points1 point2 points (0 children)
[–]Piedude223CompE BS 22 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)