카테고리 보관물: Tools & Tips

[Tip] Eclipse가 시작되지 않을 때

뭔가 잘못되어서 eclipse를 실행도중에 끈 것 같은데 그 후 부터는 eclipse가 시작되지 않는 문제가 생겨서 이리 저리 검색하다가 Stackoverflow에서 이 thread를 찾았다. 실제로 내 <WORKSPACE> 경로에 있는 .metadata/.log를 보니 다음과 같은 오류 메세지가 보이고 있었다.

[WORKSPACE/.metadata/.log]

!ENTRY org.eclipse.core.jobs 4 2 2014-07-11 09:08:36.054
!MESSAGE An internal error occurred during: "Workbench early startup".
!STACK 0
java.lang.NullPointerException
at org.eclipse.core.internal.runtime.InternalPlatform.getLog(InternalPlatform.java:354)
at org.eclipse.core.runtime.Plugin.getLog(Plugin.java:291)
at org.eclipse.ui.internal.WorkbenchPlugin.log(WorkbenchPlugin.java:809)
at org.eclipse.ui.internal.EarlyStartupRunnable.handleException(EarlyStartupRunnable.java:81)
at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:75)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:44)
at org.eclipse.ui.internal.Workbench$54.run(Workbench.java:2412)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
...

.metadata 아래에서 다음 경로의 .snap과 workbench.xmi file을 삭제하고 다시 eclipse를 시작해 본다.

rm .metadata/.plugins/org.eclipse.core.resources/.snap .metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi

Virtual Box에 ext4 partition을 직접 mount

Windows용 Virtual Box에서 vdi file이 아닌 HDD의 특정한 영역을 ext4로 직접 mount하는 방법에 대한 설명이다. 오래전에 해본거라 실제로 속도 향상이 있었는지는 기억이 나지 않는다..

HDD를 format하지 않으면 windows의 탐색기에서는 표시되지 않지만 Disk Manager에서는 연결된 모든 HDD가 보인다. Virtual Box를 설치한 directory에 보면 vboxmanage.exe라는 실행 파일이 있는데 이것을 이용하면, vdmk file을 생성하고 물리적인 HDD를 virtual box에 mapping할 수 있다.

vboxmanage.exe은 VirtualBox 4.2.10 현재 admin 권한이 있는 CLI로만 동작하기 때문에, Admin 권한으로 명령창을 열고 Virtual Box의 설치 경로로 가서 vboxmanage.exe를 실행시킨다.

c:\Program Files\Oracle\VirtualBox> vboxmanage internalcommands createrawvmdk -filename "C:\Users\<USER>\VirtualBox VMs\vmdks\extdata1.vmdk" -rawdisk \\.\PhysicalDrive1

-rawdisk의 parameter인 ‘PhysicalDrive’뒤의 숫자는 windows Disk Manager에 나오는 Disk 0, Disk 1 …에 나오는 숫자와 일치한다.

이제 Virtual Box에서 설정을 열고 storage에 지금 생성한 vmdk file을 추가한다.

Add the vmdk from Settings -> Storage -> SATA

Booting을 하고 linux에서 fdisk -l 명령어로 확인해 보면 새로운 HDD가 인식된 것이 보인다. fdisk로 새로운 partition을 만들고 ext4 fs를 만든다음 fstab을 수정해서 linux에서 새로운 partition이 인식되도록 해주면 된다.

[Tip] Ubuntu 12.04 Eclipse tooltip 색상변경

Ubuntu(12.04)에서 eclipse를 설치하고 사용하다보면 tooltip이 어두운 배경색에 검은색 글씨로 되어 있어서 잘 안 보인다. 화면 밝기를 밝게하면 불가능 한 건 아니지만, class member를 쉽게 보여주기는 context menu를 실눈 뜨고 한 참 동안 쳐다보는게 여간 불편한게 아니다. 분명 internet 어딘가에는 나와 같은 불편을 겪는 사람이 있을텐데라고 생각하면서도 어떤 keyword로 검색해야 하는지 몰라서 여러 번 실패하고 나서야 드디어 찾았다.

How to change tooltip background color in Unity?

최근에 추가된 몇 개의 solution들은 시험해 보지는 못했으나, 아래의 script는 효과가 있었다.

#/bin/sh
# Tooltip fix
# A script to fix themes files in Ubuntu 11.10
#  to have readable tooltips in applications such
#  as eclipse.
# The script edits the gtk.css, settings.ini and gtkrc files
# Author: Victor Pillac
# http://victorpillac.wordpress.com

#if [ $EUID -ne 0 ]; then
#  echo "This script must be run as root" 1>&2
#  exit 1
#fi  

path=/usr/share/themes
theme=Ambiance

if [ $# = 1 ]; then
  theme=$1
fi

echo "Fixing tooltips for theme $theme"
echo " (you can select a different theme by passing its name as argument)"
sed -i 's/tooltip_bg_color #000000/tooltip_bg_color #f5f5b5/g' $path/$theme/gtk-3.0/gtk.css
sed -i 's/tooltip_fg_color #ffffff/tooltip_fg_color #000000/g' $path/$theme/gtk-3.0/gtk.css
sed -i 's/tooltip_bg_color:#000000/tooltip_bg_color:#f5f5b5/g' $path/$theme/gtk-3.0/settings.ini
sed -i 's/tooltip_fg_color:#ffffff/tooltip_fg_color:#000000/g' $path/$theme/gtk-3.0/settings.ini
sed -i 's/tooltip_bg_color:#000000/tooltip_bg_color:#f5f5b5/g' $path/$theme/gtk-2.0/gtkrc
sed -i 's/tooltip_fg_color:#ffffff/tooltip_fg_color:#000000/g' $path/$theme/gtk-2.0/gtkrc
echo "Done"