Table of Contents
Install and Use Subversion (svn) and ViewVC on Ubuntu
Install Subversion with Web Access on Ubuntu
- To install subversion, open a terminal and run the following command:
sudo apt-get install subversion libapache2-svn
- To create a folder for the subversion repository in /svn, use
sudo svnadmin create /svn
- Edit the configuration file for the subversion webdav module.
sudo nano /etc/apache2/mods-enabled/dav_svn.conf
The Location element in the configuration file dictates the root directory where subversion will be acessible from, for instance: http://128.143.XX.XX/svn
In the file uncomment the following lines<Location /svn> DAV svn #The SVNPath line should be set to the same place #your created the repository with the svnadmin command. # Set this to the path to your repository SVNParentPath /svn # Uncomment the following 3 lines to enable Basic Authentication AuthType Basic AuthName “Subversion Repository” AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user ## add this line
- To create a user on the repository, use the following command:
sudo htpasswd -cm /etc/apache2/dav_svn.passwd <username>
Type in password when required. - If the password file exists, use the following command:
sudo htpasswd -m /etc/apache2/dav_svn.passwd <username>
Type in password when required. - Restart apache by running the following command:
sudo /etc/init.d/apache2 restart
- Now if you go in your browser to http://128.143.XX.XX/svn. Input username and password created when required.
Use SVN
- Create a repos using
$ svnadmin create /svn/repos1
on the server
- In the local computer, check out the repos1 by using
svn checkout http://128.143.XX.XX/svn/repos1
- Now add a new or update a file on the server
- Create a file
nano test.txt
- Add it to repos1
svn add test.txt
- Upload it to the sever to repos1
svn commit test.txt -m "Initial readme file"
Install ViewVC on Ubuntu
- In the terminal
sudo apt-get install viewvc
- Edit SVN configuration file
sudo nano /etc/apache2/mods-enabled/dav_svn.conf
Add the following line in the file
ScriptAlias /viewvc /usr/lib/cgi-bin/viewvc.cgi
at the end of the file
- Edit the file
/etc/viewvc/viewvc.conf
Change the root_parents to
root_parents = /svn : svn
- Restart apache by running the following command:
sudo /etc/init.d/apache2 restart
- Visit
http://128.143.XX.XX/viewvc/viewvc.cgi
Access control for ViewVC
By default, anyone can access ViewVC. To control access using the rules for svn. Open the svn configure file using
sudo nano /etc/apache2/mods-enabled/dav_svn.conf
and add the following at the end
<Location /viewvc> AuthType Basic AuthName "ViewSVN" AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user </Location>
Math Magics
1 x 8 + 1 = 9 12 x 8 + 2 = 98 123 x 8 + 3 = 987 1234 x 8 + 4 = 9876 12345 x 8 + 5 = 98765 123456 x 8 + 6 = 987654 1234567 x 8 + 7 = 9876543 12345678 x 8 + 8 = 98765432 123456789 x 8 + 9 = 987654321 0 x 9 + 1 = 1 1 x 9 + 2 = 11 12 x 9 + 3 = 111 123 x 9 + 4 = 1111 1234 x 9 + 5 = 11111 12345 x 9 + 6 = 111111 123456 x 9 + 7 = 1111111 1234567 x 9 + 8 = 11111111 12345678 x 9 + 9 = 111111111 123456789 x 9 +10 = 1111111111 9 x 9 + 7 = 88 98 x 9 + 6 = 888 987 x 9 + 5 = 8888 9876 x 9 + 4 = 88888 98765 x 9 + 3 = 888888 987654 x 9 + 2 = 8888888 9876543 x 9 + 1 = 88888888 98765432 x 9 + 0 = 888888888 1 x 1 = 1 11 x 11 = 121 111 x 111 = 12321 1111 x 1111 = 1234321 11111 x 11111 = 123454321 111111 x 111111 = 12345654321 1111111 x 1111111 = 1234567654321 11111111 x 11111111 = 123456787654321 111111111 x 111111111 = 12345678987654321
Install OpenBUGS
Steps
- Download OpenBUGS (Note only OpenBUS 2.2.0 works on unix machines) and upload it to dscratch. First upload it to AFS and then copy it to dscratch.
- Unzip the file on the cluster
- Create a file called linbugs with the following content and change permission using chmod 755 lingbugs
#!/bin/bash export LD_ASSUME_KERNEL=2.4.1 DIR=$(dirname $0) cd "$DIR" if [ \! -e "$DIR/temp" ] ; then mkdir "$DIR/temp" fi if [ -e bugs.so ] ; then ./cbugs "$DIR" "$DIR/temp" "/bugs.so" else ./cbugs "$DIR" "$DIR/temp" "/brugs.so" fi
- Create a file called Cbugs and compile it using
gcc -o cbugs CBugs.c -ldl -m32
. The file includes the following codes
/* GNU General Public Licence This small C program loads the bugs.so ELF shared library. Save it as a .c file and then compile it on Linux using gcc -o cbugs Cbugs.c -ldl */ #include <dlfcn.h> #include <stdio.h> #include <string.h> int main (int argc, char **argv) { void * handle; handle = dlopen("./bugs.so", RTLD_LAZY); if (handle) { dlclose(handle); } return 0; }
An example
- Start OpenBUGS by
./linbugs
in the OpenBUGS directory
- If OpenBUGS successfully run, you will see
OpenBUGS ClassicBUGS release 2.1.1 type 'modelQuit()' to quit Bugs>
- Then type in the following commands (those after >)
Bugs> modelCheck("Examples/Airmodel.txt") model is syntactically correct Bugs> modelData("Examples/Airdata.txt") data loaded Bugs> modelCompile() model compiled Bugs> modelInits("Examples/Airinits.txt") model is initialized Bugs> modelUpdate(100000) 100000 updates took 4 s Bugs> samplesSet("theta") monitor set Bugs> summarySet("theta") monitor set Bugs> modelUpdate(10000) 10000 updates took 0 s Bugs> samplesStats("theta") mean sd MC_error val2.5pc median val97.5pc start sample theta[1] -1.1 1.332 0.1092 -5.243 -0.7288 0.2504 101001 10000 theta[2] 0.05332 0.05231 0.004327 0.002579 0.03949 0.2046 101001 10000 Bugs> samplesCoda("*","output") CODA files written Bugs> modelQuit()
Useful links
Copy Tables from Excel to LyX
This is the way to copy tables from Excel to Lyx I found on the web.
- In LyX, insert a table with the same dimensions as the one in the excel.
- Place the mouse cursor in the top left cell of the table.
- From the menu of LyX, choose
Edit → Paste Special → Plain Text, Join Lines
.
Welcome!
After I moved to the University of Notre Dame for 4 months, I finally found some time to set my ND website up. This does not replace my old website at http://www.psychstat.org/us because it is mainly for the classes I teach. And, unfortunately, for obvious reasons, the class pages cannot be accessed publicly. I will give authorization to the students in my classes. For those who are not on the roster of the classes and are still interested in accessing the class pages, you may have to contact me first to get the authorization.
Note. Everything on this blog only reflects my personal view which may or may not be true and is not related to any organization or institute.