멀티 플랫폼 환경에서 ssh key 관리하기

January 8th, 2013 No comments

Social coding의 시대에 맞춰서 대부분의 오픈 소스 프로젝트들과 소스컨트롤들이 git으로 가고 있는 현 추세에 맞춰서 ssh키 관리하는 글을 하나쓸까한다. 현재 필자는 윈도우 머신 2대, 맥, 리눅스와 호스팅서버, VPS 모두 사용해야하는 상황인데 그렇다고 해서 키를 시스템별로 다 새로 만들어서 사용하는 것은 아니기에 이렇게 가이드 문서를 하나 만든다.

먼저 ssh키를 하나 생성하도록 하자. ssh키는 자신의 이메일 주소당 하나 있다고 생각하는 것이 맞는 것 같다. 필자의 경우에는 개인용 프로젝트에 사용하는 이메일 계정에 맞는 키 1개 그리고 회사에서 일할 때 쓰는 키 1개 이렇게 2개로 운영하고 있다.

0. 환경 전제
윈도우에서는 cygwin을 사용한다고 전제하자. 맥과 리눅스는 터미널을 사용한다고 하자.

1. 키 생성하기
먼저 자신의 키를 하나 만들어야 한다. 새 환경 중 아무데서나 다음의 키를 이용해서 키를 하나 만든다.

이러면 passphrase를 물어보는데 비밀번호를 잘 넣어주면 된다.
그러면 자신의 홈디렉토리의 .ssh 디렉토리안에 다음의 2개의 파일이 만들어진것을 볼 수 있을 것이다.
~/.ssh/mike3dk
~/.ssh/mike3dk.pub
.pub파일은 자신의 퍼블릭키이고 그냥 파일은 자신의 프라이빗키이다. 공개키는 여기저기 막 놓아두어도 상관없지만 private키는 잘 간수하는 것이 좋겠다. Github나 다른 Git관련 솔루션에서 내 계정과 연결할 때 쓰는 공개키가 바로 mike3dk.pub 이 파일이다.

2. 이 키를 이용해서 ssh 로그인해보기
이 키를 이용해서 다른 사이트에 로그인을 해보자.
ssh myid@remotehost.com
그러면 ssh 비밀번호를 물어보는데 그 키를 넣어주면 된다.

3. 이제 비밀번호 없이 그 사이트에 로그인을 하는 법을 해보자.
크게 2가지 방법이 있는데 하나는..

다른 하나는 ssh-copy-id 명령어를 사용하는 법이다.

4. 이 키를 이용해서 다른 시스템에서 사용하기
방금 만든키를 이용해서 다른 환경에서 사용하기 위해서 먼저 이 키페어를 다른 시스템으로 복사를 한다.

이 키를 이 시스템에서 쓰겠다고 하기 위해서는 먼저 ssh config파일을 만들어 줘야한다. 키가 설치가 안된 다른 환경으로 먼저 가서 config란 이름의 파일을 .ssh디렉토리 안에 만들고 다음의 내용을 추가해준다.

5. ssh-agent 띄우기

6. key chain 사용하기
keychain은 자동으로 ssh-agent를 관리해주는 키 관리자이다.
맥에는 키체인이 GUI버전의 키체인이 기본으로 깔려있다.
대부분의 시스템에는 기본으로 설치되어있지는 않으니 일단 각 환경에서 설치하는 법을 적어보면

6.1 Ubuntu
1. keychain package를 인스톨한다.

2. keychain이 읽는 파일들을 만들어줘야 한다. 이를 위해 keychain을 한번 실행하도록 하자

3. .bashrc 파일을 편집해서 다음의 2줄을 넣어준다.

그러면 ssh-agent를 한번에만 로딩하면서 키들은 캐쉬되어서 패스워드 안 넣어도 되는 시스템이 된다.

4. 현재 돌아가는 모든 ssh-agent를 죽일려면

6.2 Cygiwn
1. keychain을 인스톨 한다.
cygwin 설치할 때 쓰는 setup.exe을 실행시켜 보면 util 쪽에 keychain 이 있다. 이거 설치하도록 한다.

2. 나머지는 위와 동일하다.

Categories: Developer's Tool Tags:

Python + PySide로 개발하기 위한 빌드환경 구축

November 29th, 2012 No comments

최근에 크로스 플랫폼으로 UI를 가진 어플리케이션을 빨리 개발해야할 일이 생겨서 이것 저것 알아보다가 Python 2.7.3과 PySide 1.1.2로 개발하는 것이 좋겠다는 결론에 도달했다. 개발환경 구축을 위한 빌드오더는 다음과 같다.

Windows에서

1. 먼저 Python 사이트에서 다음 바이너리를 다운 받는다.
http://www.python.org/download/releases/2.7.3/
Windows x86 MSI Installer (32비트 버전이다)

2. 다운 받은 Python을 설치한다. 기본 설치디렉토리는 C:\Python27\이다.

3. PySide사이트에서 다음 바이너리를 받는다.
http://qt-project.org/wiki/PySide_Binaries_Windows
PySide-1.1.2-win32-py2.7.exe

4. 다운받은 PySide Binary를 설치한다. PySide가 C:\Python27\Lib\site-packages\PySide 디렉토리에 설치된다.

5. 제대로 설치되었는지 확인하기 위해서 Python 명령창을 띄운다음 다음의 명령어를 준다.

Mac에서 (Mountain Lion)

맥에서는 기본으로 Python이 딸려오기 때문에 좀 불편하다. 먼저 이것을 제거하고 homebrew로 다시 깔아주자.

1. 운영체제에 딸려온 Python 제거하기

2. Homebrew가 설치되었다는 가정하에, Homebrew를 이용해서 python이랑 pyside를 설치한다. Homebrew설치는 구글링해서 미리 해둘것

3. 위에서와 마찬가지로 제대로 설치되었는지 확인하기 위해서 Python 명령창을 띄운다음 다음의 명령어를 준다.

Categories: dev:game Tags:

새 터미널 git 환경설정

July 31st, 2012 No comments

새로 계정이 생겨서 git작업을 할 때에 주로 추가하는 명령을 모아봤다.

git config --global alias.st status
git config --global alias.ci 'commit -a'
git config --global alias.co checkout
git config --global color.ui auto

일단 이것먼저 하고 시작한다.

Categories: Developer's Tool Tags:

우분투에 Nginx 웹서버 설치하기

July 20th, 2012 No comments

우분투 12.04에 Nginx를 패키지 메니져를 이용해서 설치하는 법이다.
먼저 패키지 매니저를 업데이트 하고

apt-get update
apt-get upgrade --show-upgraded

nginx launchpad repository를 등록시키고

add-apt-repository ppa:nginx/stable

nginx를 설치한다.

apt-get install nginx

현재 설치된 버전을 확인하려면

kjune@mymachine ~/tmp $ nginx -v
nginx version: nginx/1.2.1

Categories: dev:web Tags:

My Software Project Tool Chain in 2011

July 11th, 2011 No comments

My selection of Tool chains in 2011:

    redmine: project management
    git: version control
    gitolite: central source repository
    dokuwiki: project logging
    refinerycms: web site
    hudson ci: continuous integation
Categories: Developer's Tool Tags:

Installing RefineryCMS on Dreamhost

July 11th, 2011 No comments

refineryCMS is a rails3 based CMS(contents management system).
In order to make refinerycms running on the dreamhost, I had to find a way to go around some of the pitfalls.

0. Create an shell user account and a domain with passenger enabled in dreamhost panel.

1. gem install refinerycms
=> This didn’t work in my case, so I had to go around..
gem install stall for a while and didn’t move. hope dreamhost fix it soon.


gem install bundler
Create a Gemfile with this:
source 'http://rubygems.org'
source 'http://rubygems.org'
gem 'refinerycms'
bundle

2. refinerycms myapp
=> This didn’t work either. It gives the sqlite3 error of such

Installing sqlite3 (1.3.3) with native extensions /usr/lib/ruby/1.8/rubygems/installer.rb:482:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/usr/bin/ruby1.8 extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... no
checking for sqlite3_initialize()... no

sqlite3-ruby only supports sqlite3 versions 3.6.16+, please upgrade!

Since I won’t be using sqlite3, I used the following command.
refinerycms myapp -d mysql -u mydbuser -p mydbpassword

3. However, it didn’t give you an option to set the host file. It will create a default rails app but it won’t go any further on database setup. Set up the the database by editing /config/database.yml file.
Set up database name, user name, user password and hostname.

4. Create mysql database in dreamhost way. Use dreamhost panel, create the databases.

5. Run the rake task
bundle exec rake -f "/home/w_starliz_web/www/Rakefile" db:create

6. Generate refinerycms

bundle exec rails generate refinerycms

7. db migration

bundle exec rake db:migrate RAILS_ENV=production

Now the app should be ready for passenger.

8. Open up the refinerycms in the web browser. It should show the refinerycms first login page. Create a user account and set up the site name.

That’s it! Now it will be all the same as the ordinary refineryCMS installation.

Categories: dev:web Tags:

Windows7에서 TortoiseSVN쓰다가 고용량 파일들 add할때 에러나는 문제 해결법

April 16th, 2011 No comments

간만에 프로젝트 정리하느라 TortoiseSVN으로 파일들 새 Repository에 옮기고 있는데, 바이너리 파일들 올리다 보니 에러가 자꾸난다.
에러내용은 대략..

Can’t move
…\\.svn\tmp\entries
to

…\\.svn\entries
The file or Directory is corrupted and unreadable.

증상은.. 일단 svn add도 하다가 중간에 튀고, 재부팅 하면 chkdsk가 도는 골때리는 상황 연출이다.
윈도우 index 서비스랑 상관이 있단다. index를 끄라는 이야기도 있다. 나는 아예 커지않고 쓰니까 이건 나랑 해당이 없는 일이고.

해결책은 windows hotfix깔란다.
http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=982927&kbln=en-us#step2
이메일을 넣으래서 넣었더니 그 쪽으로 다운로드 할 수 있는 링크가 날라오고 그 안에 암호도 들어있다.
다운 받으니 winzip으로 묶여있는 암호가 걸린 exe파일이 하나 오는데 풀어보니 Windows6.1-KB822927-x86.msu 들어있다. 2010-05-05 빌드이니 그 때 만든 것 같기도 하고.

아니면 Windows7 SP1안에 깔려있다고도 한다. 확인한바는 없지만..

레퍼런스
제대로 증상을 찝어낸 것 같은 링크…
http://social.technet.microsoft.com/Forums/en/w7itprogeneral/thread/df935a52-a0a9-4f67-ac82-bc39e0585148
http://www.seangw.com/wordpress/index.php/2011/01/tortoisesvn-error-adding-and-committing-corrupted-and-unreadable/

Categories: Developer's Tool Tags:

How to complete uninstall previous version of MySQL on Mac OS X

January 12th, 2011 No comments

Categories: Tech& Tip Tags:

Batch converting from euc-kr to utf8

January 5th, 2011 No comments

find ./ -type f -name “*.*” -exec recode -v euc-kr…utf-8 “{}” \;

Categories: Tech& Tip Tags:

Redmine Svn Pre-commit hook script

December 29th, 2010 No comments

Recently, I’m considering switching my development management system to redmine. In order to make a nice transition, I’d tested the following pre-commit hook script that connects the svn commit message to redmine issue number. It’s the same way as I used to do with the trac.

Thanks to Sam and the post, the transition was stressfree.

Here is the script to download.

Categories: Developer's Tool Tags:

Project Line Counter Addin for Visual Studio 2008 and later

December 15th, 2010 No comments

I have been a big fan of Oz Solomon’s PLC(Project Line Counter Add-In 2.21) since Visual Studio 6. However, I wasn’t able to use it under Visual Studio 2008 which is my main development environment because of the installer doesn’t support it.

I was looking for the alternatives but nothing really worked for me.

Today, I was reading through the comments of the Oz’s article on the Code Project and found out there was a way to use it in visual studio 2008 and later which is modifying the registry keys. Brilliantly work by keenedm.

I’ve attached the registry key for my further use and time saver for the others.

pls211_vs9.zip

Kudos to keenedm and Oz!!

Categories: Developer's Tool Tags:

Suppressing Visual Studio 2008 Warnings

October 28th, 2010 1 comment

Warning:

Solution:

  1. Open Project Settings.
  2. From the left menu, select C/C++->General and then find Detect 64-bit Portability Errors.
  3. Set the value to “No“.
  4. Now the warnings will be disappeared.

Warning:

Solution:

  1. Open Project Settings of your dll project. In here, this will be “tlib” project.
  2. From the left menu, select C/C++ -> Output Files and then find Program Database File.
  3. Change the value to “$(TargetDir)$(TargetName).pdb” from “$(IntDir)\vc90.pdb”.
  4. Rebuild the library and the warnings will be disappeared.
C/C++ -> Output Files
Program Database File
Categories: Developer's Tool Tags:

How to set up svn ignore in command line

September 16th, 2010 No comments

Often I ran into this, so here are the steps to set up the ignore files in command line or in a shell.

When adding new xcode project into svn repository: Let’s say the project name is “helloapple” and user name is “myuser”.

When editor opens up, add these lines

And finally, commit the changes

Xcode project & SVN: String to ignore

July 14th, 2010 No comments

When dealing with XCode project and SVN, ignore the following strings from the project.

  • /Build
  • /[ProjectName].xcodeproj/[myname].mode*
  • /[ProjectName].xcodeproj/[myname].pbxuser
  • /[ProjectName].xcodeproj/[myname].perspectivev3
Categories: dev:mobile, Tech& Tip Tags:

맥북 프로에 Bootcamp로 윈도우 7 설치하기

June 25th, 2010 No comments

다음은 2010년 6월 기준으로 맥북프로에 윈도우 7을 Bootcamp로 설치하는 법.

  1. 먼저 Mac OS X에서 Boot camp assistant를 실행한다. 파티션 크기를 잡아줘야 한다. 40G 정도 잡아줬다.
  2. Windows 7 설치 DVD를 넣고, 시스템을 다시 부팅한다. 그러면 윈도우 7 설치화면이 다시 뜨게 된다.
  3. 부팅할 때 맥으로 할 지 윈도우로 할지를 결정하기 위해서는 부팅 중에 Option 키를 누르고 있으면 선택할 수 있는 화면이 나온다.
  4. 잘못 들어간 DVD를 빼기 위해서는 부팅할 때 트랙패드의 마우스 버튼을 누르고 있으면 DVD가 자동으로 빠진다.
  5. 설치를 진행한다. 중간에 설치할 파티션을 찾는데, 부트 캠프에서 잡아준 파티션이 FAT32라고 설치가 안된다고 할 것이다. 이 때 그 파티션을 포맷해주면 NTFS로 바뀌면서 설치가 될 것이다.
  6. 설치를 마무리 한다. 몇 가지 드라이버들을 자동으로 잡지는 못한다. 현 시점에서 문제는 사운드가 안나온다. 그래픽 드라이버를 못 잡는다, 마우스 오른쪽 클릭이 안된다 등이다.
  7. 맥 살 때 받은 Mac OS X Install DVD를 넣는다. 그 중에서 윈도우용 Boot Camp를 설치한다. 이 버전이 Boot Camp 3.0이라고 한다.
  8. 애플 웹사이트에 가서 드라이버를 다운로드 받는다. http://support.apple.com/downloads 로 가서 bootcamp라고 친다.  그러면 몇 개의 업데이트가 나오는데 그 중에서 BootCamp 3.1.3 업데이트를 다운받아 설치한다. 그러면 사운드 드라이버, 그래픽 드라이버를 잡는다.
  9. 트랙패드에 관련해서는 부트 캠프의 제어판을 열어본다. 그러면 탭을 해서 클릭하기, 두 손가락으로 스크롤 하기, 마우스 오른쪽 클릭이 가능해진다.
  10. 이제 기능은 다 제대로 동작하는 데 불편한 점은 키배열이다. fn-ctrl-option-command 의 왼쪽 키배열은 fn-ctrl-window-alt 키로 바꾸면 편할 것 같고, 오른쪽 키배열 Command-option은 한영변환-마우스 오른쪽 으로 바꾸면 편할 것 같다. 그래서 찾다보니 키 배열을 바꿔주는 레지스트리 설저앞일 발견. 여기에 있다.
  11. 이제 남은 불편한 점은 Delete 키, Backspace 윗쪽에 있는 Eject키를 연결하면 딱 좋을 것 같다.
  12. 그 외에 trackpad 마우스 오른쪽 클릭이 매끄럽지 못한다던지의 문제가 아직 있다.

Trinigy Vision Engine 8

June 21st, 2010 No comments

My fellow developer has now joined the Korean branch of Trinigy.

They were running a cafe on naver.
http://cafe.naver.com/visionengine

Check their website:
http://www.trinigy.net/

They are offering 30 day evulation copy.

According to him, the engine price is a half of GameBryo.

Visual Studio 2008에서 프로젝트 무한 Rebuild시 문제 해결

June 19th, 2010 No comments

Visual Studio 2008에서 빌드를 하고 다시 빌드를 해도 프로젝트가 업데이트 되었다고 다시 빌드할 경우.

무한 빌드 반복이 되는 경우에는…….

솔루션 탐색기에서 *.h 파일 중에 실제 위치에 파일이 없는데 프로젝트 파일(vcproj)에 추가되었는지 확인할 것. 예전까지는 없어도 그냥 빌드가 되었는데, 이제부터는 무한 리빌드를 한다.

해결책은 : 솔루션에서 실제 위치에 없는 잘못 링크된 header 파일을 제거한다.

MS도 친절하게 header파일이 없다고 설명을 해주던가 하면 좋았을 것을 꼭 이런 식이다.

manifest 때문에 생긴 side-by-side 에러

June 19th, 2010 No comments

Visual Studio 2005로 되어있던 프로젝트를 Visual Studio 2008만 깔린 환경에서 컴파일을 하니 에러가 수두룩 하다. 먼저 VS2005로 만들어 졌던 프로젝트 dll들을 모두 2008로 다시 빌드했다. MSVCRT80D.dll의 의존성을 없애기 위해서

그래도 에러가 나서 depends로 좀 살펴보니 에러가 몇 개가 났는데, side-by-side 에러였다.
이건 manifest의 embed를 환경설정에서 바꿔줘서 해결했다.

Manifest Tool > Embed manifest 에서 기본으로 Yes로 되어있는데 이걸 No로 하고 다시 빌드

참 이런 문제는 짜증이 많이 난다.

English Bean: Online 3D Interactive English Learing Website

May 22nd, 2010 No comments

With SK Telecom in South Korea, worked on this web site to teach English online through a game.
The running demo can be found here.

Categories: Project Tags:

Samsung Mobile 3D UI

May 22nd, 2010 No comments

As a tech demo, built this 3D UI demo on a latest mobile 3D acceleration chip from Samsung. 3D Modeling and the scenario is made by “Digicube” and the code is all written in C and OpenGL ES.

Categories: Project Tags: , , , , , ,

Trac Installation on Dreamhost

May 17th, 2010 No comments

trac logo

  1. Install SVN through dreamhost web panel: “Goodies>Subversion”.
  2. Install Trac through dreamhost web panel: “Goodies> One-Click Installs”.
    1. Install more new website software – Advanced mode.
    2. Click Trac and hook up with svn repository just made.
  3. Add your user and authentification through Htaccess/WebDAV.
  4. In order to add Admin, log in to your shell account and type the following to add admin.
  5. Open the trac with your browser and log in as a admin account, change the settings as you wish.
  6. Change the trac.css, the default one is ugly, /path/to/trac/projects/htdocs/css/trac.css.
  7. Set up subversion hooks, this hook forces the users to write a ticket number against the trac. The hooks that I use can be found here. Need to edit “post-commit”, “pre-commit” file to match your path.
  8. Set the permission of /path/to/trac/db directory to 777.

Another Unity3D Project Contineous Integration: Hudson CI on Mac OSX

May 15th, 2010 No comments

Last week, I have automated the build system on windows by Cruise Control .net, unity3d and a couple of ftp tasks. However, there was a couple of problems in running ccnet as a windows service mode. While it was running great in command prompt, it gives errors in service mode. It wouldn’t be an issue if there is a dedeciated build windows server and nobody will mess with the command window. But unfortunately it wasn’t my case.

Now I turned my eyes to mac machine which I use it less frequently.
I spent a few hours to find a good solution for it and came up with this combination.

Hudson CI + Subversion + Unity mac + Hudson SCP plugin + Hudson post build script.

Here are the steps:

  1. Download hudson.war file from http://hudson-ci.org
  2. Place the war file into the directory of your choice. In my case, I made a special directory called “/_infra/” and place it in here. All CI related files will be stored under “/_infra/hudsonci/”.
  3. Though it will run great by running this command “java -jar hudson.war”, I want to run this more of a demon-style. There is another option of installing tomcat and place the war file under webapp but it is too much in my case. So the solution I used is this. Make this file “hundson.ci.plist” with the following information first. You can download it from here. Another trick I used here is that by explictly expressing the installation directy with “-DHUDSON=/_infra/hudsonci”, you can install the hudson in the designated directory instead of  “~./hudson”.
  4. Place the file in ~/Library/LaunchAgents/.
  5. Load this plist file as a service by running this command: “launchctl load -w ~/Library/LaunchAgents/hudson.ci.plist”
  6. Check hudson installation in http://localhost:8080

References:

[35.1] 템플릿에 담겨진 숨은 뜻은 무엇인가요?
[35.2] “class template”의 문법/구문은 무엇인가요?
[35.3] “function template”의 문법/구문은 무엇인가요?
[35.4] 어떻게 명시적으로 어떤 버전의 함수 템플릿이 호출되어야 할지를 선택할 수 있나요?
[35.5] “매게변수화된 형(Parameterized Type)”이란 무엇인가요?
[35.6] “범용성(Genericity)”란 무엇인가요?
[35.7] 내 템플릿 함수는 템플릿 형 T가 int혹은 std::string일때 특별한 동작을 하는데, T가 이렇게 형마다 다를 경우에 어떻게 이에 해당하는 코드를 작성할 수 있나요?
template so it uses the special code when T is one of those specific types?
[35.8] 응? foo나 bar를 사용하지 않는 템플릿 특수화의 예제를 보여주세요.
[35.9] 내 템플릿하무에 있는 대부분의 코드는 다 비슷해요; 소스 코드를 중복시키지 않으면서도 템플릿 특수화를 할 수 있는 특별한 방법이 있나요?
[35.10] 모든 이런 템플릿과 템플릿 특수화를 사용하면 프로그램을 느리게 할 것 같아요, 맞나요?

Successfully Built a Production Pipleline: SVN + Unity3D + CruiseControl.net + Publish To Web

May 8th, 2010 No comments

ccnet logo

As the number of the Unity3D web projects has increased, I was looking for a decent way of automating deployment.
I took some time to research and read some articles about it and finally get it all working.

The whole build pipeline was set up on Windows machine and SVN and TRAC has setup on Linux in a different machine.

Check these articles and I’m sure any one can do the same without too much of hassle.

A few notes:

  • Even though Unity doesn’t allow multiple instances when it’s running in editor, it does allows multiple instances when it’s running in batch mode
  • SVN is really poorly handing binary data such as the art assets. Maybe using Mercurial might be helpful and yet just don’t have a resource to look into it yet.
  • Combining with TDD tools like NUnit will be great and yet there was an unexpected error when handling GUIStyle with NUnit. Should look into more in a near future.

Azitro3D

April 19th, 2010 No comments

Azitro3D

Categories: Project Tags:

House Box

April 17th, 2010 No comments

Project Period: 2005

Designed and developed the house floor plan and viewing software while writing the Kz3D multipurpose 3D engine. Custom 3DS Max exporter,

Categories: Project Tags: ,