Sublime Text 2? The editor that developers, developers, developers like to use. At the very least, Sublime is a common text editor for the everyday programmer. How can you use Sublime on your terminal? If you’re any programmer, you’re maneuvering through the terminal left and right, all day everyday, so you need to have an easy way to use sublime from the terminal!
By default, for Mac OS X, you don’t have Sublime binded to a command on the terminal! Let’s do show you how to do that.
You can install the stable version of Sublime on their website.
Open a new terminal. First, we will bind the newly installed Sublime 2 (you can also do this for Sublime 3) as the subl command. We’re using a symbolic link from the binary within the Application to what we will make as globally accessible.
The symbolic link will create an accessible subl command to open sublime and use it to open files or folders.
We will open ~/.bash_profile with a text editor and make sure that this new sublime command will be ready whenever we open the terminal.
open -a TextEdit ~/.bash_profile
With .bash_profile, we will set the PATH variable to look inside the /usr/local/bin folder where we created the sublime link. Type the following if it is not in your ~/.bash_profile.
By exporting the path, ~/.bash_profile will refresh and export the folder for accessible binary commands whenever we open a new terminal.
Now save and exit. The first time we do this, we will not have access to the sublime command immediately. We first need to source, which means to reload the ~/.bash_profile in order to have access to our sublime command!
How to Use
Open a terminal and use any of the variations of the command:
Open a file
Open a folder
Open the current directory
Enjoy your new sublime command! Makes things much more convenient if you enjoy using sublime!
If you already have Django installed, it should show something like this:
If you don’t have Django, please follow the rest of these steps.
Step 1: Verify that you have Python on your computer
Django requires Python to work. Django can work with different versions of Python.
Make sure that your Python version is one of 2.7 or 3.2, 3.3, 3.4, 3.5 versions. Depending on the version of Django, you’ll need to make sure that you have a verified working Python version. As of May 20, 2015, version 1.8.2 is the stable release of Django.
Since Django comes along with a light SQLite database, you don’t need to worry about the database at this point.
Open your terminal and type:
If you already installed Python, something line this should show up:
If your computer doesn’t have Python, you should download it from:
Afterwards, change directory to the location get-pip.py, go to your terminal, and enter:
Step 3: Using pip to install Django
After you make sure you have pip installed on your computer, go to the terminal and enter:
sudo pip install Django
You will need to enter the password of your computer. You can also specify a specific version of Django to install. Since the stable release at the time of writing is 1.8.2, I’ll show the command to install that version:
sudo pip install Django==1.8.2
Section 2 : Start a project
Step 1: Create a project
Open your terminal, cd to your Desktop or the place where you want to put your project and enter the following command:
django-admin.py startproject blog
You will see a directory called blog appear on the Desktop. It contains all the framework file to help you generate your website.
In your terminal, cd to into the blog folder and enter:
python manage.py runserver
You will probably see:
Now, open a web browser. In the address file, enter the address that is showing in your terminal.
Cygwin provides the Linux feeling on Windows. With Cygwin, you can get a sizable Linux collection of GNU and Open Source tools including a terminal that supports POSIX interface on Windows.
Check whether your System type is 32 bit or 64 bit. If you have Windows 8 or 8.1, right click on This PC on your Desktop, then click on Properties. If you don’t have This PC on your Desktop, you can also use Windows’ search to look for “This PC“, then right click the icon, and click on Properties.
On the Properties of This PC, you can see the System Type underneath System category. For me, System type: 64-bit Operating System, x64-based processor. I have a 64 bit operating system.
Select the blue linked executable setup based on your system type of Step 1. Download will start automatically after clicking on one of the blue executable setup links.
Open the executable Cygwin setup file. Run the set-up as normal. Click on Next on the Cygwin Setup screen.
When choosing Installation Type, select Install from Internet (default). Click Next.
When choosing the Installation Directory, you can leave the root directory by default, which will be C:\cygwin64 (64 bit). Install for all users. Click Next.
The Local Package Directory contains the setup installation files for packages that you wish Cygwin to have. Underneath Select Local Package Directory, the default is the directory where you have the setup executable.
You can leave this by default.
For Setup your Internet Connection, use Direct Connection for your Internet Connection if you’re using wi-fi or ethernet. Click next.
Choose a Download Site. Select any of the download sites. Click Next.
You’ll now be at Cygwin Setup – Select Packages. From here, you can search for packages that you wish Cygwin to have. The ones that I recommend are:
gcc-core(Cfiles)-inside Devel category
make(makefiles)-inside Devel category
openssh(tousessh)-inside Net category
nano(text editor)-inside Editors category
For each of these packages, they belong to categories. Search for a package. Click on the + next to a category to expand the contents of the search. Click on the circle twirl with the arrows to select the most up-to-date version of that package. Package names are on the right with a short description of that package.
After selecting a version to install for all your packages, you can click the next button at the bottom right of the setup screen. At the Resolving Dependencies screen, make sure that the checkbox that says Select required packages (RECOMMENDED) is checked. Click Next. The download and installation of your desired packages will commence.
After you finish the download and installation, you can check Create an icon on Desktop. Click Finish. You’ll find a program called Cygwin64 Terminal on your desktop. Open the program. Cygwin is installed.
You can also add the Cygwin packages and POSIX interface for the Windows command prompt. In other words, you can make the command prompt act like the terminal in Linux.
Right click on “This PC” and click Properties if it’s on the Desktop. Also, you can use Windows’ search for “This PC” and right click, then click on Properties.
Click on Advanced System Settings in this Properties window.
In the System Properties that pops up, click on Environment Variables, which will be within the Advanced tab. Inside Environment Variables, look underneath the System variables section. Scroll through and look for the Variable with the name Path. Click on that line. Click on the Edit button underneath. For 64 bit, add a “;C:\cygwin64\bin;” to the end of the Variable value line. This allows the command prompt to work with Cygwin’s directory path to the Cygwin’s bin folder and utilize Cygwin’s packages and POSIX interface. Click OK for each of the three windows to save this setting.
Open a command prompt. You can use Windows’ search and search for command prompt or cmd. Click on command prompt, and a command prompt black box will open. You will have all the functionality of Cygwin within the command prompt. You can choose to use either Cygwin or a command prompt to use the linux tools or POSIX interface.