PySvn in Ubuntu and Mac

Subversion, Ubuntu/Linux No Comments

My main intention of building Subversion 1.5.1 is for PySvn 1.6.0 because it needs at least subversion 1.5.0.
Download source package from: https://launchpad.net/ubuntu/+source/pysvn/1.6.0-1.

* Untar the pysvn_1.6.0.orig.tar.gz into pysvn_1.6.0 directory
* Move to the Source directory:

[html]
octalina@desktop:~$ cd pysvn_1.6.0/Source

* Make sure subversion is installed
* Create the makefile:

[html]
octalina@desktop:~$ python setup.py configure
Info: Found Python include in /usr/include/python2.5
Info: Found  PyCXX include in /home/octalina/pysvn-1.6.0/Import/pycxx-5.4.1
Info: Found   PyCXX Source in /home/octalina/pysvn-1.6.0/Import/pycxx-5.4.1/Src
Info: Found    SVN include in /usr/local/include/subversion-1
Info: Found    APR include in /usr/local/apr/include/apr-1
Info: Found    SVN library in /usr/local/lib
Info: Found    APR library in /usr/local/apr/lib
Info: Creating Makefile for Source
Info: Building against SVN 1.5.1
Info: Creating Makefile for Tests

* compile the source code:

[html]
make

* Install pysvn by copying the extension from pysvn_1.6.0/Source.pysvn to python site-specific directory. e.g. normally Python 2.5 will be installed in /usr/lib/Python2.5

[html]
mkdir python-libdir/site-packages/pysvn
cp pysvn/__init__.py python-libdir/site-packages/pysvn
cp pysvn/_pysvn*.so python-libdir/site-packages/pysvn

Test on pysvn installtion:

[html]
octalina@octalina-desktop:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysvn
>>>

Opening port 22 for incoming SSH

Ubuntu/Linux 3 Comments

For Ubuntu, the default incoming port 22 for SSH is not opened. By using http://www.canyouseeme.org/ I double check to confirm if my Ubuntu box ssh is opened or not and yes, it’s not open and in the response I get this ‘Connection refuse’ error.

I need to transfer a big junk of data from my old Ubuntu to new box. Instead of using the harddisk to transfer, I choose to use SSH and scp to copy the files since both of them in the same network. However, in my new box, the ‘connection refuse’ being returned by my old box whenever I try to ssh even my ping returns results.

So tried to install firestarter as some forum recommended, I still cant get my port 22 opened. At last when I see linuxquestions forum, tallmt stated by installing openssh-server, port 22 will be opened.

[html]sudo apt-get install openssh-server

and once the installation is done, ssh server need to be started:

[html]sudo /etc/init.d/ssh start

And now, I am waiting for the data being copied ;)

Getting iso image from CD

Mac OS, Ubuntu/Linux No Comments

After completed Frozen Throne, I wanted to play Warcraft III from my Mac. My friends gave me the Frozen Throne .iso image which enable me to run without cd. Although I have Warcraft installed in my Mac, I do not have the .iso image for Warcraft III. I am too lazy to insert and eject the cd too as I play it regularly. I can’t just keep the cd by myself as I am sharing it with my house mate. So time to learn to create cd image file (This should work the same way as Linux/Ubuntu).

So after I put in the cd, when I type ‘mount’ command, I will have this:

[html]
lindaoctalina$ mount
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local)
fdesc on /dev (fdesc, union)
map -hosts on /net (autofs, automounted)
map auto_home on /home (autofs, automounted)
/dev/disk1s1s2 on /Volumes/Warcraft III (hfs, local, nodev, nosuid, read-only, noowners)

The last line of the above code is for my Warcraft III cd drive. I need to ‘umount’ the cd before I can process the iso file. (Note: You might need to use root/sudo user)

[html]
lindaoctalina$ sudo umount /dev/disk1s1s2

Then start to create the iso image:

[html]
lindaoctalina$ dd if=/dev/disk1s1 of=warcraft3.iso bs=1k

The process of dd command is to copy the file to the harddisk, convert it and format the file. For the ‘if=/dev/disk1s1′ means that read from cd room instead of stdout and ‘of=warcraft3.iso’ means that copy to local harddisk with the name of warcraft3.iso. ‘bs’ is to specified the number of blocks per bytes (can have kB, MB, etc)

You need to wait for few minutes to let the image file being created, then you will get the following code:

[html]
687548+0 records in
687548+0 records out
704049152 bytes transferred in 540.453743 secs (1302700 bytes/sec)

After finish, remember to eject the cd. As it is not mounted, we need to do manually (in Mac can use disk utility to eject the disk). Use below code to eject manually from terminal:

[html]
eject /dev/disk1s1

Note: it works for any application that requires CD and not only Warcraft III and Starcraft.

Choosing correct version of java being used in Ubuntu/Linux

Ubuntu/Linux No Comments

When I tried to install Eclispe in Ubuntu, I used a wrong version of java. To configure java version to be used, in terminal, type this code:

sudo update-alternatives –config java –> it’s dash dash config

Output will be:

[html]
There are 4 alternatives which provide `java'.

  Selection    Alternative
-----------------------------------------------
          1    /usr/bin/gij-4.2
 +        2    /usr/lib/jvm/java-gcj/jre/bin/java
          3    /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
*         4    /usr/lib/jvm/java-6-sun/jre/bin/java

Press enter to keep the default[*], or type selection number:

Just put in your selection, and your java version will be changed after you at least log out and log in back to the system. :P