Version at: 26/03/2014, 21:48 vs. version at: 26/03/2014, 21:53
11#How to Prepare a Development Environment for Tatoeba Using a Pre-made Virtual Machine
22
33## Installing the VM
44* Grab the vm file [http://mirrors.bouah.net/pub/tatoeba/Tatovm/](http://mirrors.bouah.net/pub/tatoeba/Tatovm/)
55
66* Untar the file:
77
88 * On Windows:
99
1010 * Download both the vbox and the gz file
1111
1212 * Use [7zip](http://www.7-zip.org/) to extract Tatovm.vmdk file from the gz file (using the "Extract here" item from the right-click menu)
1313
1414 * On Linux: use file-roller or from the terminal, type:
1515 xz -d Tatovm.vmdk.xz
1616
1717### Using VirtualBox
1818
1919* Get and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
2020
2121* Load the VM files in VirtualBox:
2222
2323 From the GUI: **Machine -> Add**, then browse to the location of the .vbox file
2424
2525 From the command line: VBoxManage registervm /path/to/vm.vbox
2626
2727### Using Qemu
2828
2929* Get and install [qemu](http://en.wikibooks.org/wiki/QEMU/Installing_QEMU)
3030
3131* Run the following command: (tweak the -m flag for more ram)
3232
3333 qemu-system-i386 Downloads/Tatovm.vmdk -smp 4 -m 512 -enable-kvm -net nic -net user -redir tcp:8080::80 -redir tcp:4242::22 -redir tcp:8081::81
3434
3535## Accessing the VM
36* The default http port is 8080 and the default SSH port is 4242.
36* The default http port is **8080**, the default SSH port is **4242**, and the default webdav port is **8081**.
3737
3838* On Windows, you may want to download [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) as your SSH GUI.
3939
40* To SSH into the machine, use the username **tatoeba** and password **tatoeba**:
40* To SSH into the machine, use the username **tatoeba**, password **tatoeba**, and port **4242**:
4141
4242 ssh -p 4242 tatoeba@127.0.0.1
4343
4444* Now you can see the website running in your browser by pointing it to the following address:
4545
4646 127.0.0.1:8080
4747
4848* Steps such as installing packages require superuser privileges. Prefix these commands with sudo or run:
4949
5050 sudo su
5151
5252 Then type in the password **tatoeba** when prompted.
5353
5454 After performing your operation, execute "exit" to end superuser access.
5555
5656* The MySQL user is **root** and password is **tatoeba** in case you need to do operations directly on the table or import more data. Getting to a mysql shell or excuting a mysql script is as easy as:
5757
5858 mysql -u root -ptatoeba tatoeba
5959
6060 mysql -u root -ptatoeba tatoeba < script.sql
6161
6262##Performing Additional Configuration Steps
6363
6464* If you will be committing code, configure your user.name and user.email. (You can do this retroactively after your first commit, but it's better to do it beforehand.) For instance, if your username at GitHub is ghuser, and your e-mail address is address@example.com, you'll execute:
6565
6666 git config --global user.name "ghuser"
6767
6868 git config --global user.email address@example.com
6969
70* Your new directory /var/http/tatoeba should have the same directory structure as the old /var/http/tatoeba-bak. You can now delete /var/http/tatoeba-bak .
71
7270* You may find it useful at this point to back up your databases so that you can return them to their virgin state. Make a directory (for instance, /backup ; this may require root permission) and then execute a command such as this one:
7371
7472 mysqldump -u root -ptatoeba -A > /backup/all_dbs.sql
7573
7674## Customizing Your Installation
7775* There are three ways to access the codebase via your favorite editor in the comfort of your host computer:
7876
7977 * Mount a drive over SSH:
8078
8179 * On Windows: download NetDrive [www.netdrive.net] and use the aforementioned credentials and port
8280
8381 * On Linux: install SSHFS and then mount it using:
8482
8583 sshfs tatoeba@127.0.0.1:4242 /path/to/mountpoint
8684
8785 * Mount a drive over WebDAV:
8886
8987 * On Windows: use NetDrive. The user and password are **tatoeba**, and the port is **8081**.
9088
9189 * On Linux: use your favorite file manager with WebDAV support, or install cadaver and connect using the above credentials.
9290
9391 * Mount a shared file (slow and not recommended):
9492
9593 * Set up Guest additions [https://help.ubuntu.com/community/VirtualBox/GuestAdditions]
9694
9795 * In the GUI select Devices -> Shared Folders -> Add
9896
9997 * Browse to the folder you want to share from your host and select it
10098
10199 * Select the Make permanent option
102100
103101 * Now mount the shared file on the guest system:
104102
105103 mount -t vboxfs /media/sharefoldername /path/to/mountpoint
106104
107105* You can also install a graphical environment (GNOME or any other development environment) to work directly from the VM:
108106
109107 apt-get install task-gnome-desktop
110108
111109##Logging Into Tatoeba on the VM
112110
113111The users provided by default are:
114112
115113 admin
116114
117115 corpus_maintainer
118116
119117 advanced_contributor
120118
121119 contributor
122120
123121 inactive
124122
125123 spammer
126124
127125The default password for each user is '123456'.
128126
129127In addition, you can register new users.
diff view generated by jsdifflib

Version at: 26/03/2014, 21:48

#How to Prepare a Development Environment for Tatoeba Using a Pre-made Virtual Machine

## Installing the VM
* Grab the vm file [http://mirrors.bouah.net/pub/tatoeba/Tatovm/](http://mirrors.bouah.net/pub/tatoeba/Tatovm/)

* Untar the file:

   * On Windows: 

        * Download both the vbox and the gz file

        * Use [7zip](http://www.7-zip.org/) to extract Tatovm.vmdk file from the gz file (using the "Extract here" item from the right-click menu)

   * On Linux: use file-roller or from the terminal, type:
   xz -d Tatovm.vmdk.xz

### Using VirtualBox

* Get and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads)

* Load the VM files in VirtualBox:

  From the GUI: **Machine -> Add**, then browse to the location of the .vbox file

  From the command line: VBoxManage registervm /path/to/vm.vbox

### Using Qemu

* Get and install [qemu](http://en.wikibooks.org/wiki/QEMU/Installing_QEMU)

* Run the following command: (tweak the -m flag for more ram)

  qemu-system-i386 Downloads/Tatovm.vmdk -smp 4 -m 512 -enable-kvm -net nic -net user -redir tcp:8080::80 -redir tcp:4242::22 -redir tcp:8081::81

## Accessing the VM
* The default http port is 8080 and the default SSH port is 4242.

* On Windows, you may want to download [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) as your SSH GUI.

* To SSH into the machine, use the username **tatoeba** and password **tatoeba**:

   ssh -p 4242 tatoeba@127.0.0.1

* Now you can see the website running in your browser by pointing it to the following address:

   127.0.0.1:8080

* Steps such as installing packages require superuser privileges. Prefix these commands with sudo or run:

   sudo su

   Then type in the password **tatoeba** when prompted.

   After performing your operation, execute "exit" to end superuser access.

* The MySQL user is **root** and password is **tatoeba** in case you need to do operations directly on the table or import more data. Getting to a mysql shell or excuting a mysql script is as easy as:

  mysql -u root -ptatoeba tatoeba

  mysql -u root -ptatoeba tatoeba < script.sql

##Performing Additional Configuration Steps

* If you will be committing code, configure your user.name and user.email. (You can do this retroactively after your first commit, but it's better to do it beforehand.) For instance, if your username at GitHub is ghuser, and your e-mail address is address@example.com, you'll execute:

        git config --global user.name "ghuser"

        git config --global user.email address@example.com

* Your new directory /var/http/tatoeba should have the same directory structure as the old /var/http/tatoeba-bak. You can now delete /var/http/tatoeba-bak .

* You may find it useful at this point to back up your databases so that you can return them to their virgin state. Make a directory (for instance, /backup ; this may require root permission) and then execute a command such as this one:

    mysqldump -u root -ptatoeba -A > /backup/all_dbs.sql
 
## Customizing Your Installation
* There are three ways to access the codebase via your favorite editor in the comfort of your host computer:

   * Mount a drive over SSH:

       * On Windows: download NetDrive [www.netdrive.net] and use the aforementioned credentials and port

       * On Linux: install SSHFS and then mount it using:

       sshfs tatoeba@127.0.0.1:4242 /path/to/mountpoint

    * Mount a drive over WebDAV:

        * On Windows: use NetDrive. The user and password are **tatoeba**, and the port is **8081**.

        * On Linux: use your favorite file manager with WebDAV support, or install cadaver and connect using the above credentials.

    * Mount a shared file (slow and not recommended):

        * Set up Guest additions [https://help.ubuntu.com/community/VirtualBox/GuestAdditions]

        * In the GUI select Devices -> Shared Folders -> Add

        * Browse to the folder you want to share from your host and select it

        * Select the Make permanent option

        * Now mount the shared file on the guest system:

       mount -t vboxfs /media/sharefoldername /path/to/mountpoint

* You can also install a graphical environment (GNOME or any other development environment) to work directly from the VM:

  apt-get install task-gnome-desktop

##Logging Into Tatoeba on the VM

The users provided by default are:

    admin

    corpus_maintainer

    advanced_contributor

    contributor

    inactive

    spammer

The default password for each user is '123456'.

In addition, you can register new users.

version at: 26/03/2014, 21:53

#How to Prepare a Development Environment for Tatoeba Using a Pre-made Virtual Machine

## Installing the VM
* Grab the vm file [http://mirrors.bouah.net/pub/tatoeba/Tatovm/](http://mirrors.bouah.net/pub/tatoeba/Tatovm/)

* Untar the file:

   * On Windows: 

        * Download both the vbox and the gz file

        * Use [7zip](http://www.7-zip.org/) to extract Tatovm.vmdk file from the gz file (using the "Extract here" item from the right-click menu)

   * On Linux: use file-roller or from the terminal, type:
   xz -d Tatovm.vmdk.xz

### Using VirtualBox

* Get and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads)

* Load the VM files in VirtualBox:

  From the GUI: **Machine -> Add**, then browse to the location of the .vbox file

  From the command line: VBoxManage registervm /path/to/vm.vbox

### Using Qemu

* Get and install [qemu](http://en.wikibooks.org/wiki/QEMU/Installing_QEMU)

* Run the following command: (tweak the -m flag for more ram)

  qemu-system-i386 Downloads/Tatovm.vmdk -smp 4 -m 512 -enable-kvm -net nic -net user -redir tcp:8080::80 -redir tcp:4242::22 -redir tcp:8081::81

## Accessing the VM
* The default http port is **8080**, the default SSH port is **4242**, and the default webdav port is **8081**.

* On Windows, you may want to download [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) as your SSH GUI.

* To SSH into the machine, use the username **tatoeba**, password **tatoeba**, and port **4242**:

   ssh -p 4242 tatoeba@127.0.0.1

* Now you can see the website running in your browser by pointing it to the following address:

   127.0.0.1:8080

* Steps such as installing packages require superuser privileges. Prefix these commands with sudo or run:

   sudo su

   Then type in the password **tatoeba** when prompted.

   After performing your operation, execute "exit" to end superuser access.

* The MySQL user is **root** and password is **tatoeba** in case you need to do operations directly on the table or import more data. Getting to a mysql shell or excuting a mysql script is as easy as:

  mysql -u root -ptatoeba tatoeba

  mysql -u root -ptatoeba tatoeba < script.sql

##Performing Additional Configuration Steps

* If you will be committing code, configure your user.name and user.email. (You can do this retroactively after your first commit, but it's better to do it beforehand.) For instance, if your username at GitHub is ghuser, and your e-mail address is address@example.com, you'll execute:

        git config --global user.name "ghuser"

        git config --global user.email address@example.com

* You may find it useful at this point to back up your databases so that you can return them to their virgin state. Make a directory (for instance, /backup ; this may require root permission) and then execute a command such as this one:

    mysqldump -u root -ptatoeba -A > /backup/all_dbs.sql
 
## Customizing Your Installation
* There are three ways to access the codebase via your favorite editor in the comfort of your host computer:

   * Mount a drive over SSH:

       * On Windows: download NetDrive [www.netdrive.net] and use the aforementioned credentials and port

       * On Linux: install SSHFS and then mount it using:

       sshfs tatoeba@127.0.0.1:4242 /path/to/mountpoint

    * Mount a drive over WebDAV:

        * On Windows: use NetDrive. The user and password are **tatoeba**, and the port is **8081**.

        * On Linux: use your favorite file manager with WebDAV support, or install cadaver and connect using the above credentials.

    * Mount a shared file (slow and not recommended):

        * Set up Guest additions [https://help.ubuntu.com/community/VirtualBox/GuestAdditions]

        * In the GUI select Devices -> Shared Folders -> Add

        * Browse to the folder you want to share from your host and select it

        * Select the Make permanent option

        * Now mount the shared file on the guest system:

       mount -t vboxfs /media/sharefoldername /path/to/mountpoint

* You can also install a graphical environment (GNOME or any other development environment) to work directly from the VM:

  apt-get install task-gnome-desktop

##Logging Into Tatoeba on the VM

The users provided by default are:

    admin

    corpus_maintainer

    advanced_contributor

    contributor

    inactive

    spammer

The default password for each user is '123456'.

In addition, you can register new users.

Note

The lines in green are the lines that have been added in the new version. The lines in red are those that have been removed.