2014년 7월 27일 일요일

ubuntu resize hdd in vmware with cfdisk

- Resize vmware hdd size.

- Create new partition using cfdisk: with fdisk error occur "no free sector available"
$ sudo cfdisk /dev/sda

new -> logical -> Size( in MB) : 89121.62
Type -> 8E
Write -> yes
Quit

- Reboot server:
$ sudo reboot
- Assuming you created partition /dev/sda6, let's now create the physical volume in that partition:
$ sudo pvcreate /dev/sda6

- Now let's extend the server's Volume Group to that physical volume.
$sudo vgdisplay
This will give you the info on your current Volume Group. Note down the entry next to "VG Name". That's your Volume Group name.

$ sudo vgextend EnterVolumeGroupNameHere /dev/sda6
 - Since we're (essentially) extending the main logical volume, let's get the name of that:
$ lvdisplay
and note down the entry next to "LV Name". This is your logical volume's name (e.g. /dev/srv/root), which you'll now extend to the newly added partition/physical volume.

- Extend the logical volume by X GBs:
$ lvextend -L +XG yourLogicalVolumePath
 Make sure you replace X above with the actual number of GBs you've added in your VM's settings. So if you increased your VM by 20GBs, the command becomes:
$ lvextend -L +20G yourLogicalVolumePath

- Finally, let's resize the file system to the new allocated space:
$ resize2fs yourLogicalVolumePath
(this may take some time depending on number of GBs added to the file system.

- Check the new file system sizes:
$ df -hT

2014년 7월 23일 수요일

mac java path

/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/java

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk

2014년 7월 22일 화요일

tomcat hello jar sample in eclipse.

Eclipse ant setting jdk
eclipse > Preference > Ant > Runtime > Global Entries
add External JARs -> jdk 6.0_45 tools.jar add


Project Setting 

web.xml

<web-app version="2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee" xsi:schemalocation="http:/java.sun.com/dtd/web-app_2_3.dtd">
  <servlet>
    <servlet-name>hello</servlet-name>
    <servlet-class>test.HelloServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>hello</servlet-name>
    <url-pattern>/hello</url-pattern>
  </servlet-mapping>
</web-app>


build.xml

<?xml version="1.0" encoding="UTF-8"?>
<project name="myWeb" default="build-jar" basedir=".">

<property name="tomcat-home" value="E:/dev/was/apache-tomcat-7.0.54" />
<property name="project-name" value="test" />

<path id="jar-project-classpath">
<fileset dir="lib" includes="*.jar" />
<fileset dir="${tomcat-home}/bin" includes="*.jar" />
<fileset dir="${tomcat-home}/lib" includes="*.jar" />
</path>

<target name="clean">
<delete dir="bin" />
<mkdir dir="bin" />
</target>

<target name="copy-non-java-files">
<copy todir="bin" includeemptydirs="false">
<fileset dir="src" excludes="**/*.java" />
</copy>
</target>

<target name="compile-jar-classes" depends="clean,copy-non-java-files">
<javac srcdir="src" destdir="bin" classpathref="jar-project-classpath" />
</target>
<target name="clean-jar">
<delete dir="build" />
<mkdir dir="build" />
</target>

<target name="jar">
<jar basedir="bin" destfile="build/${project-name}.jar">
<manifest>
<attribute name="Built-By" value="${builder}" />
<attribute name="Built-On" value="${build-info.current-date}" />
<attribute name="Built-At" value="${build-info.current-time}" />
</manifest>
</jar>
</target>
<target name="build-jar">
<antcall target="compile-jar-classes" />
<antcall target="clean-jar" />
<antcall target="jar" />
</target>

</project>

test.HelloServlet.java

package test;

import java.io.*;

import javax.servlet.http.*;
import javax.servlet.*;

public class HelloServlet extends HttpServlet {
  public void doGet (HttpServletRequest req,
                     HttpServletResponse res)
    throws ServletException, IOException
  {
    PrintWriter out = res.getWriter();

    out.println("Hello, world!");
    out.close();
  }
}

2014년 7월 14일 월요일

mac vm nat setting

Location  /Library/Preferences/VMware Fusion/vmnet8/nat.conf

Add incoming tcp

/Applications/VMware\ Fusion.app/Contents/Library 

Restart
vmnet-cli --stop
vmnet-cli --start

eclipse rcp dialog resize

  Dialog 안에 메소드를 만든다. private void autoResize(){     getShell().layout( true, true);     final Point newSize = getShell().computeSize...