Tuesday, June 30, 2009

How to check a file's encoding under Linux

Use the following command:

file $file_name

For example:

$ file cn.txt
cn.txt: UTF-8 Unicode text, with CRLF line terminators

Monday, June 29, 2009

How to add printer to your Fedora in School of Computing of NUS

Open the menu System -> Administration -> Printing



Press the New Printer button




And select "Windows Printer via SAMBA"
Input the smb address "nts27/pstsc-dx" ( if you are a student of SoC and the printer name "pstsc-dx" is the one in Level 1 of COM1)

Then press Forward button





You can directly use the "Generic" and click the Forward button.



Choose the "postscript printer" and press Forward
And then enter the name displayed on your computer of the printer, and press Forward button.
Click Apply button.

Sunday, June 28, 2009

How to: Install Flock with Adobe Flash Player on Fedora

FWD from:
http://fabdango.net/2009/05/how-to-install-flock-25-with-adobe-flash-player-10-on-fedora-11-leonidas-without-using-the-terminal/
And I add some additional information.


In the following tutorial I’ll show you how to install Flock, the social web browser, and how to enable Adobe Flash player on Fedora 11. The guide is Flock 2.5-Fedora 11-GNOME specific but it should basically work for any Mozilla-based web browser on any Linux distribution using any desktop environment. You can achieve this without even using the terminal or any command line.


1. First, you’ve to get Flock from its official download site. It’s a compressed file (.tar.bz2) containing the full application. It’s enough for running it but it’s not an installer. Save it anywhere you want. You can use the following command to decompress the compressed file:
tar -xjvf flock-2.0.3.en-GB.linux-i686.tar.bz2

2. Once you saved Flock, extract the file where you want the program to be located. I did it at /home/fabian/Software/flock

3. At this very moment you should be able to run Flock just by executing the /flock/flock-browser file, but you won’t have any shotcut to it and won’t be able to show flash content.

4. Next step is to get Adobe Flash Player from its official download page at Adobe.com. Select the .tar.gz file for Linux and save it in your computer. You can use the command as follows to decompress the file:
gzip -d install_flash_player_10_linux.tar.gz
tar -xvf install_flash_player_10_linux.tar

5. Open the file you’ve just download and extract the libflashplayer.so file to /flock/plugins/ for enabling the flash player. It also works if you extract it to /home/user/.flock/plugins

6. The previous step should be enough for making everything work fine, but truth is that Flock will crash. As soon as you load any flash content, the browser will close. This is because the libfreebl3.so library included by Mozilla doesn’t work properly. For solving this, you must go to the folder containing Flock (/folder-you-chose/flock/) and delete the libfreebl3.so file. This will foce the application to use the file included by Fedora, located at /lib/libfreebl3.so, so it won’t crash. This is enough for making Flock play flash content. Next steps will show you how to add nice shortcuts to your desktop.

7. Right flick the Applications menu at the GNOME panel. Select Edit menus. At Aplications -> Internet select New Item. Type: Aplication;
Name: Flock;
Location: /folder-you-chose/flock/flock-browser;
Comment: The social web browser (that’s optional, of course).
About the icon, I suggest this one.
Finally, click OK and you’re done, Flock will be at your applications menu. For creating shortcuts on the GNOME panels or desktop, just drag and drop the entry you’ve just created.

Create a repository in SVN of Linux

You can run the following command:
svnadmin create $repository-name

then the system will create a folder in your current directory named $repository-name.
Suppose the absolute path of the folder created above is,
e.g. /home/yourname/svn/test,
and the URL of the server is,
e.g. www.example.com

You can check out this repository using the command as follows:
svn co svn://www.example.com/home/yourname/svn/test
if you are on the same server, you can use the following command:
svn co file:///home/yourname/svn/test

Using svn + ssh with subclipse in eclipse

1.
get eclipse from:
http://www.eclipse.org/downloads/
(I used "Eclipse IDE for Java Developers (92MB)" of Galileo Packages (based on Eclipse 3.5) )

2.
Run eclipse, and select the menu "Help -> Install New Software"
Add this upgrade site:
http://subclipse.tigris.org/update_1.4.x
You can refer to : http://subclipse.tigris.org/
(You can directly use svn+ssh with subclipse 1.4, because the default JavaHL adapter doesn't support SSH and public key authentication. So we need to use another JavaHL adapter.)

3.
Choose the menu "Eclipse -> Preferences", then go to "Team -> SVN", and find the "SVN Interface" pulldown, and choose "SVNKit(Pure Java) SVNKit v1.2.3.5521" rather than "JavaHL(JNI)1.6.3(r38063)"



Finally, you can use svn+ssh with subclipse of eclipse.

PS: if you use eclipse under Linux, svn+ssh can work well after you install subclipse, that is, no need to configure Step 3 mentioned above.

Saturday, June 27, 2009

Installing Subversion (SVN) plugin for Eclipse

You can install subclipse which contains the SVN plugin:
http://subclipse.tigris.org/


In Eclipse, selecte the Help menu item, then "Install New Software"
Click on the "Available Software Sites" link.
Input "http://subclipse.tigris.org/update_1.6.x"

How to recover your files in eclipse after you delete the files

The eclipse have a version control system, and it can automatically backup some versions of your workspace.
After you delete some important files, you can just right click the project name in the "Package Explorer" and select "Restore from Local History", and you can find the versions before.