글쓴이 보관물: litcoder

[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"

PlantUML war file 설치

그동안 UML을 그려야할 필요가 있을때 StarUML을 써왔는데, Windows만 지원하는 software라는 한계도 있고 해서 얼마 전 부터는 우연히 알게된 PlantUML을 사용하고 있다. 이 software는 마치 LaTex 처럼 text로 UML을 그리기 위한 description을 작성하면 이를 기반해서 UML을 그려준다. 문법도 그다지 어렵지 않고 직관적이어서 사용하기도 쉬운 편이다.

작성한 text를 UML로 그리기 위한 client program들은 여러가지 형태가 지원되는데 보다 자세한 목록은 여기에서  확인할 수 있다. 내가 그동안 사용하던 것은 Chrome extension이었는데 class diagram들이 조금씩 복잡해 지면서  여러개의 file로 쪼갤 필요가 있게 되니 ‘!include‘ directive를 사용할 수 없는 문제가 있었다. 아마도 Chrome이 보안 문제로 extension의 local file 간접 access하는 것을 막은게 아닐까 싶다. 그래서 servlet으로 설치하는 방법을 사용하기로 했다. 이전에 Opengrok을 설치한 적이 있으니 설치 환경은 ubuntu 12.04와 tomcat이 이미 설치된 상태 이다.

  • 필요한 package들의 설치
    : PlantUML servlet을 돌리려면 graphviz package가 필요한데 이것이 설치되어 있지 않으면 다음과 같은 오류가 발생한다. 그리고 war file을 쉽게 deploy하기 위해 tomcat-admin package를 설치했다.
    SC_plantuml_dot_file_not_exists_err
sudo apt-get install tomcat6-admin graphviz
  • PlantUML war file을 download 받기
    PlantUML server release page에서 war file을 download 받는다.
  • Tomcat admin 설정
    : Tomcat admin으로 접속하려면 amdin 계정이 필요하니 만약 계정이 없다면 tomcat-users.xml file을 편집해서 계정을 추가해 준다. 이 파일에는 비밀번호를 평문으로 함께 기록해야 하기는 하지만, root와 tomcat외에는 read permission이 없으므로 다른 계정에 의해 이 파일이 읽히지는 않는다. 계정을 추가해준 이후에는 tomcat server를 재실행한다.

    sudo vi /var/lib/tomcat6/conf/tomcat-users.xml
 <!--
 NOTE: By default, no user is included in the "manager-gui" role required
 to operate the "/manager/html" web application. If you wish to use this a pp,
 you must define such a user - the username and password are arbitrary.
 -->
 <!--
 NOTE: The sample user and role entries below are wrapped in a comment
 and thus are ignored when reading this file. Do not forget to remove
 <!.. ..> that surrounds them.
 -->
 <role rolename="admin"/>
 <user username="admin" password="ADMIN_PASSWORD" roles="admin,manager,manager-gui"/>
 </tomcat-users>
  • Tomcat admin page로 부터 deploy: 모든 준비가 되었으니 tomcat admin page (http://SERVER:8080/manager/html) 에서 war file을 선택하고 deploy한다.
  • Service page 접속
    : Web browser에서 service page (http://SERVER:8080/plantuml)로 접속한다.

Mac용 AndroidStudio에서 새로운 프로젝트를 만들지 못하는 문제

Mac용 AndroidStudio v0.2.3을 설치하고 처음으로 ‘New Project’를 만드는데 마지막 단계에서 “Failed to import Gradle project:” error popup이 뜨면서 제대로 되지 않는다. 실제로는 project directory와 file들도 모두 생기는데 project가 등록되지 않는다. Error log로 봐서는 build와 관련이 있는 Gradle이 제대로 동작하지 못한 문제인것 같다.

Log는 “~/Library/Logs/AndroidStudioPreview/idea.log”에서 볼 수 있다.

Failed to import Gradle project: /Users/YOUR_ID/.gradle/wrapper/dists/gradle-1.6-bin/72srdo3a5eb3bic159kar72vok/gradle-1.6-bin.zip.lck (No such file or directory)

Android developer page에 Gradle의 import와 관련된 문제가 발생했을 때 Android SKD Manager를 띄워서 Extras 아래에 있는  ‘Android Support Repository’ 항목을 선택해주어야 한다는 내용이 니와 있어서 따라 했는데도 문제가 계속 생겼다.

Home directory에서 permission error가 나는게 이상해서 home directory의 permission을 보니 내 home directory에 owner가 write permission이 없다!! (읭?)

Home directory에 write permission을 줄까 하다가 mac의 보안정책 원래 그럴지도 모르니 그냥 message가 불평하는 대로 ~/.gradle directory를 만들어 주었더니 잘 돌아간다. lol

sudo mkdir ~/.gradle
sudo chown YOUR_ID:staff ~/.gradle