2012-07-29

How to install MS Office 2010 on Ubuntu 12.04

This instruction may not applicable for 64 bit version of MS Office 2010. I have failed to install 64 bit version.
  1. Install PlayOnLinux via command line tool for the latest version.
    * Ubuntu Software Center may install older version of PlayOnLinux.
    wget -q "http://deb.playonlinux.com/public.gpg" -O- | sudo apt-key add -
    sudo wget http://deb.playonlinux.com/playonlinux_precise.list -O /etc/apt/sources.list.d/playonlinux.list
    sudo apt-get update
    sudo apt-get install playonlinux
    
  2. Install 7zip that is required by PlayOnLinux
    sudo apt-get install p7zip-full
    
  3. Run PlayOnLinux
    * It may install Microsoft fonts if you run it first.
  4. Click Install and Select Office>Microsoft Office 2010
  5. Click Install

    * It may download and install the proper version of wine to run MS Office 2010 if you don't have it.
  6. Select the mount point of MS Office 2010 CD-ROM and Click Next

    * It may download and install DotNet Framework, Visual C++ 2005 Runtime and others to run the office.
  7. Look for the installation window when you see the following window.
  8. Proceed the installation process

    * It may install some components for running office.
  9. Complete to install

2012-07-28

org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported or published.

WARNING in Eclipse : Classpath entry org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result.
  1. Open [Properties] of the project
  2. Select [Java Build Path]
  3. Select [Order and Export]
  4. Enable checkbox on [Maven Dependencies]
  5. Click [OK]
  6. Open [Windows>Show View>Other>Problems]
  7. Select the warning what you want to solve
  8. Press [Ctrl-1]
  9. Click [Finish] on Quick Fix window

2012-07-27

Chicago Zoological Society - Zoo Run Run for the Conservation Fund





How to resolve Loader Constraint Violation while running a Spring MVC Project on Tomcat 7

  • Loader Constraint Violation while running a Spring MVC Project on Tomcat 7

  • Error Message
    java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/WEB_002dINF/views/home_jsp, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type avax/el/ExpressionFactory; used in the signature

  • Cause
    Tomcat 7 uses el-api 2.2 and jsp-api 2.2.

  • Solution
    1. Open POM.XML file and Go to Dependencies page
    2. Select jsp-api : 2.1 > Click Properties > Change 2.1 to 2.2
    3. Save and run to check

2012-07-23

How to change the hostname in Linux

  1. See hostname
    hostname
    
    OR
    sysctl kernel.hostname
    
  2. Set the new hostname
    hostname NEW_HOSTNAME
    
    OR
    sysctl kernel.hostname=NEW_HOSTNAME
    
  3. Permanent change
    • on Ubuntu and any others based on Debian
      vi /etc/hostname
      
      replace OLD_HOSTNAME with NEW_HOSTNAME
      service hostname start
      
    • on CentOS and any others based on Redhat
      vi /etc/sysconfig/network
      
      replace HOSTNAME="OLD_HOSTNAME" with NEW_HOSTNAME
      /etc/rc.d/rc.sysinit
      

2012-07-15

How to deploy your project on Tomcat within Eclipse

Do you see the message [There are no resources that can be added or removed from the server.] when you select [Add and Remove...] on Tomcat server within Eclipse. If so, you need to add the Eclipse [Dynamic Web Module] facet.
  1. Go to [Properties] on your project.
  2. Check [Dynamic Web Module] at [Project Facets] page.
  3. Add your project on Tomcat and run.
  • Add [Maven Integration for Eclipse WTP] if you cannot find [Dynamic Web Module]

2012-07-14

How to install Eclipse Marketplace client

  1. Click [Help]->[Install New Software...]
  2. Select [Indigo Update Site] at [Work with:]
    If you cannot find it, click [Add...] and then input
    [Name] : Indigo Update Site
    [Location] : http://download.eclipse.org/releases/indigo
    
  3. Check [General Purpose Tools]->[Marketplace Client] and Install it.
  4. Restart Eclipse and See [Help]->[Eclipse Marketplace...]

2012-07-12

How to add SyntaxHighlighter to blog on Blogger.com

Visit SyntaxHighlighter homepage for more detailed information.
  1. Enter the setup page of your blog and then click [Template] > [Edit HTML]
  2. Copy the following code and paste it just above </head>
  3. <!--Core of SyntaxHighlighter-->
    <link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
    <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeEclipse.css' rel='stylesheet' type='text/css'/>
    
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/>
    
    <!--Support languages-->
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDiff.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js' type='text/javascript'/>
    <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/>
    
    <!--Activate SyntaxHighlighter-->
    <script language='javascript'>
     SyntaxHighlighter.config.bloggerMode = true;
     SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf';
     SyntaxHighlighter.all();
    </script>
    
  4. Write your code between <pre class="brush:[TYPE]"> and </pre> tags in HTML mode.
    [TYPE] can be one of language that can be found at shBrush[TYPE].js at the above code.
    <pre class='brush:html'>
    YOUR SOURCE CODE
    </pre>
    
  5. Expand the below for more themes
    Default <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
    Django
    <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDjango.css' rel='stylesheet' type='text/css'/>
    
    Eclipse
    <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeEclipse.css' rel='stylesheet' type='text/css'/>
    
    Emacs
    <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeEmacs.css' rel='stylesheet' type='text/css'/>
    
    FadeToGrey
    <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeFadeToGrey.css' rel='stylesheet' type='text/css'/>
    
    Midnight
    <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeMidnight.css' rel='stylesheet' type='text/css'/>
    
    RDark
    <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeRDark.css' rel='stylesheet' type='text/css'/>
    
  6. Visit here for more bundled brushes

2012-07-11

How to configure OCFS2

What is OCFS2? Visit this web site.
  1. Connect iSCSI
  2. iscsiadm -m discovery -p [IP_OF_NAS] -t st
    iscsiadm -m node -login
    

  3. Check if iSCSI is connected correctly
  4. fdisk -l
    
    Success if you can see [/dev/sdX]
    * X may be b, but it can be c, d or other if you have several attached HDDs.

  5. Generate Cluster
  6. /etc/ocfs2/cluster.conf
    
    • Configure Cluster Driver : /etc/init.d/o2cb configure
    • NM : Node Manager, cluster.conf - Track status of all installed nodes
    • HB : Heartbeat - Notify UP/DOWN status when a node join/drop into a cluster
    • TCP : Communicate inter-nodes
    • DLM : Distributed Lock Manager - Track status and owner of LOCK
    • CONFIGFS : Configuration File System mounted to User Space(/config)
    • DLMFS : User Space Interface for Kernel Space DLM

  7. Make partition
  8. fdisk /dev/sdX
    
    or
    cfdisk /dev/sdX
    

  9. Make filesystem(run once on a server)
  10. mkfs -t ocfs2 /dev/sdb1
    

  11. Mount filesystem(run on all servers)
  12. mount -t ocfs2 -o _netdev,nointr /dev/sdb1 /mnt/ocfs2
    

  13. Test read/write operation

How to install Tomcat and IIS

Summary
  1. Add isapi_redirect.dll on IIS
  2. Add [VirtualDirectory] and set [Enabled] on [HandlerMapping]
    Add [ISAPI Filters] on [Web Site] including the added VirtualDirectory
    Add [ISAPI and CGI Restrictions] on [Server]
    

  3. Configure Tomcat
  4. [isapi_redirect.properties] in [TOMCAT_HOME]/ISAPI
    [workers.properties] and [uriworkermap.properties] in [TOMCAT_HOME]/conf
    

How to install Tomcat and IIS
  1. Install JDK, Tomcat(ex, C:\ApacheTomcat), and place Tomcat connector into [TOMCAT_HOME]\ISAPI

  2. Configure IIS
    1. Add Tomcat into [SVR]-[ISAPI and CGI Restrictions]

    2. Add Tomcat into [SVR]-[Handler Mappings] and check Execute on [Edit Feature Permissions]



    3. [Add Virtual Directory], Its name will be used as [extension_uri] of Tomcat Connector


    4. Add ISAPI Filters


  3. Configure Tomcat
    1. Make sure the next 4 elements at [TOMCAT_HOME]/conf/Server.xml
      <Connector port="8080" protocol="HTTP/1.1“ connectionTimeout="20000” redirectPort="8443" />
      <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
      <Host name="localhost"  appBase="webapps” unpackWARs="true" autoDeploy="true“>
      <Context path=" " docBase="C:/Homepage/Tomcat" reloadable="false" />

  4. Configure Tomcat Connector
    1. Make a file [isapi_redirect.properties] with following contents in the folder [TOMCAT_HOME]/ISAPI
      extension_uri=/jakarta/isapi_redirect.dll
      log_file=[TOMCAT_HOME]\logs\isapi_redirect.log
      log_level=info
      worker_file=[TOMCAT_HOME]\conf\workers.properties
      worker_mount_file=[TOMCAT_HOME]\conf\uriworkermap.properties

    2. Make a file [workers.properties] with following contents in the folder [TOMCAT_HOME]/conf
      worker.list=worker1, worker2
      worker.worker1.host=localhost
      worker.worker1.port=8009
      worker.worker1.type=ajp13
      #worker.worker2.host=otherhost
      #worker.worker2.port=8009
      #worker.worker2.type=ajp13
      

    3. Make a file [uriworkermap.properties] with following contents in the folder [TOMCAT_HOME]/conf
      /*.jsp=worker1
      /fedex/*=worker1

How to install Android SDK in SpringSource Tool Suite on Linux Mint and Ubuntu


1.       Install Android SDK
a.       Download Android SDK
b.      Extract the file into any folder. I usually install applications into /opt when I don’t use a package manager.
c.       Run [/opt/android-sdk-linux/tools/android]

e.      Select APIs and Click [Install Packages…]
2.       Setup Eclipse
a.       Run Eclipse. I use SpringSource Tool Suite.
b.      Click [Help > Install New Software…]
c.       Input (https://dl-ssl.google.com/android/eclipse/) in an edit box labeled [Work with:]
d.      Click [Add…]
e.      Input (ADT plugin) in an edit box labeled [Name] and Click [OK]
f.        Click [Select All] and [Developer Tools] and [NDK Plugins] may be selected.
g.       Click [Next >]

How to install SpringSource Tool Suite on Linux Mint and Ubuntu

  1. Download SpringSource Tool Suite
  2. Extract the file into any folder. I usually install applications into /opt when I don’t use a package manager.
  3. Create a menu item
    sudo vi /usr/share/applications/STS.desktop
    
  4. Content
    [Desktop Entry]
    Name=SpringSource Tool Suite
    Comment=SpringSource Tool Suite
    Exec=/opt/springsource/sts-2.9.2.RELEASE/STS
    Icon=/opt/springsource/sts-2.9.2.RELEASE/icon.xpm
    StartupNotify=true
    Terminal=false
    Type=Application
    Categories=Development;IDE;Java;
    
  5. You can see [SpringSource Tool Suite] in [Menu > Programming]

How to install Korean on Linux Mint and Ubuntu

  1. Install Korean Language
    Run [Menu > Control Center > Language Support]
    Click [Install / Remove Languages...]
    Check [Korean]
    Click [Apply Changes]
    
  2. Install Korean IME
    Run [Menu> Synaptic Package Manager]
    Type "ibus-hangul" in [Quick filter] edit box
    Select [Mark for Installation] on [ibus-hangul]
    Click [Apply]
    But not yet run IBus
    
  3. Set up Korean IME
    Run [Menu > Control Center > Language Support]
    Select [ibus] on [Keyboard input method system]
    Click [Close]
    
  4. Show IME
    Run [IBus] on [Menu]
    Now you can see IBus icon on notification area of taskbar.
    Click [IBus > Preferences]
    Select [Input Method] tab page
    Check [Customized active input methods]
    Select [Select an input method > Korean > Korean]
    Click [+Add]
    Now you can type Korean.
    
* If you cannot change to Korean with ALT_RIGHT on Ubuntu, remove [ALT] for [HUD].