Home Open Source Classics

About

Open Source Classics is a directory and how-to guide for free and open source programs and resources useful to classicists, as well as a place for musings about the relationship of scholarship to free and open source principles. Continue the conversation at the Open Source Classics Forum and Technology Forum. Have a recommendation for an article? Interested in becoming a contributor? Email the editors.

Login

Open Source Classics
Welcome to the New Hephaistos Text!
Written by Administrator   
Friday, 06 March 2009 18:05
We are delighted to unveil the new Hephaistos Text, which we intend to become a central hub for the pursuit of open scholarship in the classics. Please take a look around, especially the Libanius Translation Project, which is a collaborative effort to translate the entirety of Libanius's corpus, beginning with the Declamations.

Please see the Mission Statement, too, which offers our vision of new directions for the field of classics, the humanities in general, and greater academic labor.

At this blog, Open Source Classics, we will begin anew postings on the implementation of open source philosophy and technology in our scholarship. We are currently looking for guest contributors, so feel free  to contact us with proposals for a posting or series of postings.

All of Hephaistos Text's information means little, though, without the vigorous exchange of ideas. We know well that there is no shortage of excitement (and criticism) of technology's relationship to scholarship. This conversation is very important and needs to be brought into the light, out of department hallways and graduate student happy hours. For this reason we have opened up Community Forums (yes, we know, the Latin plural is fora!), where there are forums dedicated to each project at Hephaistos Text. There is even a forum for the discussion of yet-to-be created Hephaistos Text projects. We encourage all who would like to post to create an account, though doing so in not necessary.

Thank you for reading and please stay tuned for more!

David Andrew Collier, Editor-in-Chief
Kyle P. Johnson, Editor-in-Chief
 
Customizing Terminal
Written by David Andrew Collier   
Saturday, 09 August 2008 08:02

We have already reviewed some basic terminal commands in my last post, but now I would like to talk about how to customize the terminal.  A very easy way to do this is to click on the Terminal window, and then Preferences.  Here you can do a number of things, like choose from pre-set "themes", or alter them to your own liking.


 

 

picture1

But why not use the terminal itself to set its environment to your liking? There are two important files that we can create which Bash (or our terminal shell) will run whenever it starts up:  .profile (or .bash_profile, .bash_login, whichever exists) and .bashrc. Actually, Bash will run one file or the other (either .profile or .bashrc), depending upon the situation.  But we will make this an inconsequential distinction by making one "call" the other.

Here is how my terminal screen appears at start-up:

picture4

 We see several differences from the normal terminal start-up screen.  First, there are various colors.  In addition to the 'Last Login' at the beginning, there are also 9 lines from Book 2 of the Aeneid, and a greeting.  I also have chosen to include some version information on Darwin and GNU Bash, as well as some last use and time info.  Finally, I have a custom prompt -- a green arrow symbol.  How did I accomplish all of this? Very easily, actually. Let's take a look at my .profile and .bashrc files.

The .profile reads like this:

#######Dave's Profile#######

####Call .bashrc####

source ~/.bashrc

###Welcome Screen###

echo -e "${COLOR_PURPLE}Ecce autem gemini a Tenedo tranquilla per alta
(horresco referens) immensis orbibus angues
incumbunt pelago pariterque ad litora tendunt;
pectora quorum inter fluctus arrecta iubaeque
sanguineae superant undas, pars cetera pontum
pone legit sinuatque immensa volumine terga.
fit sonitus spumante salo; iamque arva tenebant
ardentisque oculos suffecti sanguine et igni
sibila lambebant linguis vibrantibus ora.

Welcome to Darwin, Dave."
echo -e "${COLOR_GREEN}Kernel Information: "'uname -smr'
echo -e"${COLOR_RED}'bash --version'"
echo -e "${COLOR_YELLOW}Uptime: "'uptime'
echo -e"${COLOR_ORANGE}Server time is: "'date'${COLOR_NC}

(Followed by additional PATH modifications for MacPorts)

My .profile is fairly simple, and pertains almost exclusively to the welcome message.  Whenever my terminal opens a new bash shell, it processes this file according to its directions. First it calls the .bashrc file (where bulk of my custom settings will be found), and then it uses the echo command (with the -e option that handles escape characters) to produce my welcome message.  echo is a straighforward command that does just what it says: whatever <string> you enter after the command will be echoed back to the screen.  Let's have a look at my .bashrc file:

###.bashrc###

###COLOR SETTINGS###
export TERM=xterm-color
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1
alias ls='ls -G'
export COLOR_NC='\e[0m' # No Color
export COLOR_WHITE='\e[1;37m'
export COLOR_BLACK='\e[0;30m'
export COLOR_BLUE='\e[0;34m'
export COLOR_LIGHT_BLUE='\e[1;34m'
export COLOR_GREEN='\e[0;32m'
export COLOR_LIGHT_GREEN='\e[1;32m'
export COLOR_CYAN='\e[0;36m'
export COLOR_LIGHT_CYAN='\e[1;36m'
export COLOR_RED='\e[0;31m'
export COLOR_LIGHT_RED='\e[1;31m'
export COLOR_PURPLE='\e[0;35m'
export COLOR_LIGHT_PURPLE='\e[1;35m'
export COLOR_BROWN='\e[0;33m'
export COLOR_YELLOW='\e[1;33m'
export COLOR_GRAY='\e[0;30m'
export COLOR_LIGHT_GRAY='\e[0;37m'
alias colorslist="set | egrep 'COLOR_\w*'"  ##command to list all the colors

###Custom Prompt###
export PS1="\[${COLOR_GREEN}\]\w -> \[${COLOR_NC}\]"

###Navigation Aliases###
alias ..='cd ..'
alias ~='cd ~'
alias portup='sudo port selfupdate'
alias la='ls -a'
alias cleanup='sudo periodic daily weekly monthly'
alias lastclean='ls -al /var/log/*.out'

###New bookmark command###
### While in directory, type save <name> to save directory as name. ###
### Then can 'cd <name> at any time to switch to that directory.    ###
### type <show> to list all the 'bookmarks'.                        ###

if [ ! -f ~/.dirs ]; then  # if doesn't exist, create it
        touch ~/.dirs
fi

alias show='cat ~/.dirs'
save (){
        command sed "/!$/d" ~/.dirs > ~/.dirs1; \mv ~/.dirs1 ~/.dirs; echo "$@"=\"`pwd`\" >> ~/.dirs; source ~/.dirs ;
}
source ~/.dirs  # Initialization for the above 'save' facility: source the .dirs file
shopt -s cdable_vars # set the bash option so that no '$' is required when using the above facility

Perhaps the easiest way to review the .bashrc is to tackle the code section by section and to explain what everything is doing.

We can start with the colors script. I borrowed this section of code (along with some other ideas for my .bashrc file) from this blog.  You'll learn early on that the terminal and other UNIX issues are treated broadly in a number of blogs and how-tos online.  If you don't have the level of fluency to write your own scripts, you can always borrow from someone else.  You'll notice two commands in the colors script -- export and alias -- and both of these commands will return frequently when customizing your terminal.

export is a command used to set environment variables, and so is one of our main commands in the .bashrc file, we are using export to define UNIX colors (the difficult to remember sequence of numbers and letters) 

 
Resource: Perseus Digital Library
Written by David Andrew Collier   
Tuesday, 05 August 2008 12:12

Perseus Digital Library

http://www.perseus.tufts.edu/hopper/

Many Classicists already know of Perseus. Begun at Tufts University in Boston, Perseus is an online collection of Greek and Latin texts, as well as commentaries, dictionaries, inscriptions, and other primary sources. It is an excellent resource and can be a great way to work with a text and some standard commentaries with little hassle or running around a library.


There are the occasional drawbacks. Perseus often has server issues and be extremely slow and frustrating to deal with. Sometimes the word reference tools are way off. But a new java hopper interface and the ability to let users rate the accuracy of a dictionary reference have done wonders to remedy both of these problems. They have also recently provided their source code for download and implementation on your own server, though there is little documentation at this point to help.
 
Basic Terminal Commands
Written by David Andrew Collier   
Saturday, 26 July 2008 03:32

Before I continue my series "The Terminal and Classics," perhaps we should work on our fluency with the terminal environment. I know that many people have never used the terminal before, so here is a basic introduction.

 

Open the Terminal using Finder (Finder > Applications > Utilities > Terminal). A window should open with a basic prompt:

terminal


On my terminal window, the text in the window reads:

Last login: Sat Jul 26 15:01:41 on ttys003
Macintosh-3:~dave$

This tells us some basic information. First of all, it provides the last login time. For most situations, this is not that important -- though if you share your computer, you can see if someone else has used the terminal more recently than you.

The next line is the prompt. The default prompt on my MacBook Pro (with Intel and Leopard) is 'Macintosh-3:', and likely yours will be something similar. Finally, after the prompt, we see "~ dave$". This part is important, as it specifies our current directory. I am logged into my Mac as Dave, and so the default position for terminal is in the '/users/dave/' folder. The default user folder is noted by the tilde ~. Since I am logged in as Dave, the default prompt after the directory location is 'dave$'.

Don't know what a directory is? Think of a Finder window -- all the 'Folders' with files and other folders within them are known as 'directories' in your terminal. Let's take a look at the contents of '~'. From this point on, all commands will look like this.

Type ls -G and you should see something like this (n.b., capitalization of the G is important):


lsgcommand

 

As you can see, ls is the list command, and as we might expect from its name, it lists the contents of your current directory. By using the -G option, the terminal automatically colors the contents according to type. In the case of my terminal, we see that the directories are blue, and files remain the default white.

Let's try to change directories using the cd command:

 

cdcommand


You can see that I typed cd downloads and switched to my "Downloads" directory. The prompt then switches from "~ dave$:" to "downloads dave$:". This is confirmation of the successful switch. If I type ls -G again, I am given a very short list of files I have in my "Downloads" directory.

There are a few other convenient cd commands that are worth noting. At any time, you can type cd ~ and it will return you to your home directory. You can see below that after using this command, my prompt again says '~ dave$:'.


cdtildecommand


If you already know the location of a directory, it is easy to change directly to it by simply using cd and then typing the entire path. For example, if I want to find a picture that I know I have stored with my album cover art, then I can switch directly to that directory by typing cd pictures/album\ art/ (notice that if your folder name has a space, you need to insert a backslash character for the terminal to process it correctly). If the directory I want is somewhere outside of my parent directory (pictures/album art is nested beneath /users/dave/), then I can also change to that directory directly by putting a forward slash before the path: e.g. cd /applications/utitlities/. You'll see below that I switched directly to the utilities directory from the album art directory with this command:


cdjump


Another useful cd shortcut is the cd .. command, which will automatically take you back to the directory above the one you are currently in. For example, if I am in ~/pictures/album\ art/ and I type cd .. then I will arrive back in the pictures directory. If I do this one more time, then I return to the home ~ directory.


cddotdot


You can also use terminal to quickly open applications. If you need to open a picture quickly, but don't feel like using Finder, you can also use terminal. This is done by using the open command. Simply type the full path name after the command, e.g. open pictures/album\ art/janis.jpg.


janisexample2


Or, just like with cd, if your file or application is not beneath your current directory, you can begin with a forward slash: open /applications/textedit.app.


texteditexample


On the other hand, if you happen to already be in the directory where your file is located, you can simply type open <filename>.


janisexample


I'll stop here and leave you to explore some of these basic commands. More help with the terminal and other useful commands can be found at this online tutorial. In my next post, I'll show how to customize the appearance of your terminal and make it your own. The series will culminate in showing the power of the grep command to easily word search or produce concordances and will demonstrate how useful the terminal can be for a Classicist.

 
The Terminal & Classics, Part 1
Written by Kyle P. Johnson   
Thursday, 17 July 2008 14:53

Many people never venture to open their terminal on Mac OS X (under Applications/Utilities). This simple, black screen will perhaps remind people of DOS, and its text-based command line (as opposed to friendly icons and mouse-clicking) can make it a little intimidating. For Linux users, the terminal is an indispensable and a commonly-used tool. Our own Kyle Johnson here at Open Source Classics is about to change from Mac to Linux, and we will look forward to some posts on his experiences

 But what about the terminal in Mac? What does it do? What is it for? Can I break everything on my computer with it? In fact, this simple black screen is one of the most powerful tools available for a Mac user. The terminal is a key that leads directly to the backbone of OS X, the Darwin operating system. Darwin is the UNIX based operating system upon which OS X is built, and we are able to interface with Darwin through the terminal BASH shell (a shell is something that lets us interact with the operating system, and it is CLI (command line interface), as opposed to GUI).

 But enough technical terms. What can we use the terminal for? In truth, too many tasks to list here. In terminal one can copy, move, compress, decompress, and generate new files. We can run clean-up tasks and run Perl scripts. Perl scripts, in particular, are important because Perl is a language that is known for its ability to process texts. By creating a simple .pl file in the terminal and then running it, you can easily make a detailed concordance for a text (a truly invaluable tool for a Classicist).

Over the next several posts, I am going to talk more about how to use the Mac OS X terminal, and specifically how it can be useful for a Classicist.

 
«StartPrev123NextEnd»

Page 2 of 3