Digital Art

I had made these long back!. “Digital Art” is published by Renee Khanorkar.

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Learning to Develop on Windows in a Mac Environment

I recently completed a web development boot camp. This is not an uncommon occurrence, nor is using a Windows machine to do it. In my case though, I was using a Windows machine in a Mac centric environment. All of the instructions for installing programs were done with the assumption that everyone would be using Mac. The instructors had, for the most, part done their work using Mac. Therefore, I was going to be mostly alone while performing my troubleshooting. That is why I decided to write about my experience, plus a suggestion from the instructors, so they can send the next Windows user somewhere to help them with issues. This is specifically written with General Assembly Web Development Immersive programs in mind.

My background has always been in Windows. I was working tech support before starting the boot camp, and this was almost entirely focused on Windows, with some Linux thrown into the mix. This work would sometimes require using the command line on both Windows and Linux, so I know my way around the file system. I am also a seasoned PC gamer, and have built six computers over the years, not to mention countless times replacing parts. With my extensive experience with troubleshooting, I was confident using Windows was going to be fine for me.

To start, I will talk about the applications I decided to use that will allow the use of Linux commands, then I will go into the applications needed for the course, and finally I will cover a few other issues that I ran into during the course. This information is going to require that you are using Windows 10, as some of the tasks we are going to go through can only be done on that OS.

First things first, you are going to want to get into the habit of running everything from the administrative command prompt. To do this, right click on the command prompt, hover on more, and choose run as administrator. The other option is to do a search from the start menu for cmd, hit CTRL SHIFT ENTER. You will be able to perform some tasks without doing this, but others will require administrative privileges.

Open Windows PowerShell, You need to enable the feature before installing any Linux distro.
From the start menu, type PowerShell, then right click on it, and run as administrator
From PowerShell, copy and paste the command
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

If you didn’t run as administrator, this command will fail, telling you that you the requested operation requires elevation.
This can also be done through Programs and Features in the Control Panel. Then click on the Turn Windows features on or off submenu. Then find Windows Subsystem for Linux and click the checkbox.
You will be required to restart your computer.

From the store do a search for Linux.
There should be a banner that will take you to the Linux apps.
Choose whichever distro you want, I chose Ubuntu.
Launch the app when the install is complete.
You will be asked to enter a username and password. That is all it takes to install Linux

As I said earlier, this is not a full Linux install, but this will allow you to run some Linux software on your Windows machine pretty seamlessly. You will also be able to run a handful of commands from the Windows command line by prefacing the command with WSL. For example, pwd is the Ubuntu command to show the current directory you are in, it is not a valid Windows command, but if you do wsl pwd it will show you the directory, from the Linux root.

While this is a great feature that can be extremely useful, I didn’t use it for much. This is due because Windows doesn’t support using Linux graphical applications from Windows, so there was a lot of moving through the file systems. There are things that you can do if you want to run Linux graphical applications. You can start by checking the links below. That being said, I would still install it, because it was helpful for a few things later on during the course.

This will allow you to use the default Windows command prompt for most of the work you will do in this course. It adds the common Linux commands (pwd, ls, touch, and others) as recognized Windows commands. PATH is an environmental variable that allows for the command prompt to open a program without typing out the whole path. For example, to open VS Code from the command prompt, you can just type -code- otherwise, you need to type out the complete path to the executable file. This will not be the last time that we see this verbiage, in fact we will manually add a few things later on. Finish the install with the defaults the rest of the way. If you had the command prompt open, you will need to close it for the new commands to be recognized.

WSL and Git for Windows were vital programs to have during this course. Next we are going to go over the installation of some of the programs that you will need to have for this course.

Installfest is the task that installs all of the applications that will be needed through the class. There is a command to run that will connect to the schools server that will install all the required programs, but the reason for this writing is again because this command is only useful for Mac users. You will want to follow the Linux link, this is because this is just a list of what you will need to install. From that list you will be able to download install files from the respective websites. There may be multiple programs that want to restart the computer, it is safe to wait until all have been installed and just do one restart. After all the programs are installed, you can go back to the default Installfest page to follow the GitHub setup and configuration steps.

In the dialog box, click Environmental Variables. This can be as a system variable, used for every user that logs onto the computer, or User variable, only for the logged on user. Find the Path and click edit. Click new, add C:\Program Files\MongoDB\Server\4.0\bin (be sure to change your version number to match if 4.0 is not the current version), then click OK. This setup is going to allow you quick commands to start and enter MongoDB.
As a service MongoDB should start automatically. If it doesn’t, from the command prompt, do net start mongodb. With the addition of the path, you can connect to the database with the command mongo.

Now that all of our major programs have been installed and some setup done, we are going to go over some of the other issues that I ran into during the 12 weeks, and how I got through them.

Throughout the course, there are going to be checkpoints to test your knowledge of the materials. These will generally be coding challenges that you have to run a test against. This caused some serious headaches for me. These tests are all written with Mac in mind, so there were a few issues run into. Firstly, Mac and Windows paths do not follow the same convention. This is where WSL is incredibly useful as the Mac path conventions follow the same standards as Linux. You will want to use the Linux BASH that you installed, and follow the instructions above on how to navigate to the Windows folders to perform your tests. That being said, another issue that I encountered was that even using WSL, the tests wouldn’t run for the first checkpoint we took. The best the instructors and I could figure out was that this had something to do with unexpected syntax problems. The only thing to do was write the code and hope for the best. This problem did not occur for any of the other checkpoints taken.

The final little problem I ran into was during the Python and Django part of the course. While working with Python, it is best practice to use a virtual environment. Install the package using pip install virtualenvwrapper-win. Then you will create the environment using mkvirtualenv envname. This will activate the environment automatically, but if you need to start the environment again, use workon envname.

Even though a lot of this information would be useful for any person getting started as a developer on a Windows machine, as I said before, the focus was on the specific course that I took. Following these instructions will hopefully keep you from getting behind as you are searching for solutions. There are also a few good links you may want to check out too. Good Luck.

Add a comment

Related posts:

Senses In the Movie of Babel

Babel is a multi-plot movie directed by Alejandro González Iñárritu in 2006. In this article, I aim to discuss the representation of each sense in the film and its effect in terms of the film. First…

Esqueci

eu escrevi um poema e não notei. “Esqueci” is published by Zé Otávio.

Mindset yang Setiap Engineer Perlu Sadari

Saya adalah seorang software engineer yang suka sekali membangun produk dengan teknologi perangkat lunak. Di saat yang sama, saya juga sedang membangun sebuah perusahaan, sehingga saya harus juga…