manywaypark's Blog
개발, 검색, 함수

 http://www.samsung.com/sec/sppt/pcApplication.do?kind=usb
머가 이리 찾기가 어려운지... 사이트에서 검색하면 USB  memory만 엄청 나오고...
해당 모델로 찾아들어가면 드라이버 포함해서 엄청 무거은 kies 등 100메가 넘어가는 것들만 넘쳐나고,
링크는 제공안하고 자기 블로그에 파일을 업로드해놓는 개념상실 인간들도 많고...
 
 happy hackin'
problem:
원본 저장소는 svn이지만 git을 쓰고싶어서 git-svn을 사용하려 했는데
cygwin에 포함된 git-svn이 다음과같은 이상한 에러를 내면서 제대로 동작하지 않았다.

      0 [main] perl 4888 child_info_fork::abort: address space needed by 'cygsvn_client-1-0.dll' (0x13A0000) is already occupied


solution:
모든 cygwin process를 닫고 cmd에서 ash또는 dash에서 다음을 수행;
(exit all the cygwin processes and in the shell(ash or dash));

cd \cygwin\bin
$ ash
$ PATH=. rebaseall -v
......
foo/bar.dll new base = 1234, new size = 56
......


2013-04-10 윈도우 업데이트 실행 후에 동일 증상 나타났음 (아마도 root cause 인듯)

happy hackin'


1. shutdown config: /etc/default/virtualbox 파일에서 아래 내용 추가

......
SHUTDOWN_USERS="USER-ID1 USER-ID2"
SHUTDOWN=savestate


2. /etc/init.d/virtualbox-VMNAME 파일 생성:

3. startup script:

$ sudo update-rc.d virtualbox-VMNAME defaults


note: 그냥 참조에 있는 링크 정리한 것임. 2번의 스크립트를 살펴보면 1번에서 설정한 SHUTDOWN=savestate는 쓰지 않는 오류가 있다. 현재 내 상황에서는 별 상관 없으므로 그냥 쓴다.

refs:
 - How to Setup VirtualBox as a Service in Linux 

happy hackin' 

micro sd card 간단 속도 측정

tips & tricks 2012. 2. 4. 14:38 by manywaypark
얼마전에 구입한 삼성 micro sd 카드(class10, 32G)로 간단한 실험을 해보았다.

micro sd 카드를 USB(2.0?) adapter에 꽂았을 때:

~$ sudo hdparm -tT /dev/sda
/dev/sda:
 Timing cached reads:   1232 MB in  2.00 seconds = 616.46 MB/sec
 Timing buffered disk reads:  90 MB in  3.07 seconds =  29.36 MB/sec


micro sd 카드를 SD adapter에 꽂았을 때:

~$ sudo hdparm -tT /dev/sda
/dev/sda:
 Timing cached reads:   800 MB in  2.00 seconds = 400.17 MB/sec
 Timing buffered disk reads:   8 MB in  3.19 seconds =   2.50 MB/sec



happy hackin' 
문제:
lyx(tex)에서 셀이나 박스에 색상 넣었을 때 테이블, 박스 등 경계선이 제대로 안보인다.

해결:
\usepackage{color} 를  \usepackage{xcolor} 또는  \usepackage[xcdraw]{xcolor} 로 변경한다.
(없으면 추가)

refs: 
http://tex.stackexchange.com/questions/11769/box-border-lines-not-showing-properly-on-pdf 

happy hackin'
환경:

Mac OSX 10.6.8 (server)
Win7 SP1 desktop (client 1)
Win7 SP1 tablet (client 2)


문제:
현재 1.4.5 beta에서는 client 쪽 화면으로 넘어갔을 경우 modifier key들 중의 하나를 누르면 이 이상하게 눌려진 상태가 유지되면서 윈도우 메뉴나 단축키 메뉴가 수행되는 오류가 있다.

해결:
이미 issue tracker에 등록이되어 있고 패치도 나와 있었다.
http://synergy-foss.org/tracker/issues/3058

아래처럼 소스, 패치를 받은 후 적용, 컴파일 하면 된다.

$ svn checkout http://synergy-plus.googlecode.com/svn/branches/ synergy
$ cd synergy
$ wget http://synergy-foss.org/tracker/attachments/download/2953/stickykeys.patch
$ patch -p0 < stickykeys.patch
$ ./hm.sh conf -g1
$ ./hm.sh build
$ cd bin
$ synergys -c /path/to/conf


refs:
 - google keywords: synergy 1.4.5 mac server modifier key problem
 - http://synergy-foss.org/tracker/projects/synergy/wiki/Compiling

related:
 - Windows - 레지스트리에서 키보드 타입 변경 방법
 - shift + space 말고 한글 키 사용하게 소스 수정하는 방법

happy hackin'
1. 설치 미디어 준비
odd가 있는 장치에서 설치 디스크를 외장하드나 USB로 복사한다.
iso 이미지를 가지고 있다면 가상 드라이브로 마운트 한 후 복사한다.

2. 외장 미디어 부팅 가능하게 만들기
설치 디스크의 /boot/bootsect.exe를 다른 장소에 복사한 후
bootsect.exe /nt60 [외장 미디어 drive letter]

내 경우는  bootsect.exec:에 복사했고 외장 미디어는  F 드라이브로 잡혔으므로 다음과 같이 했다.
c:>bootsect.exe /nt60 F:
설치하고자하는 박스(아마 보통 놋북이겠지)를 재시작하고 BIOS 메뉴에 들어가서 USB/External HDD 부팅을 활성화하고 외장 매체로 부팅하면 윈도7 설치 화면이 뜬다. 끝!

note: 내 경우 P1620이라는 후지쯔의 노트북에 적용했는데  USB memory로 했을 때는 이상한 에러가 뜨면서 제대로 안됐고, 외장하드를 사용했을 경우는 정상적으로 설치가 되었다.
note2: bootsect.exe는 드라이브를 unmount한 후에 제대로 동작한다(MBR을 다시 쓰는 듯). 하여, 외장 매체에서 바로 자기 자신에게 적용할 수 없다. 마운트 해제가 안되기 때문에... 꼭 다른 곳에 복사한 후 실행해야만한다.
 
ref:
Bootsect Command-Line Options

happy hackin' 
delicious.com firefox extension data 파일에서 링크 정보 추출하기에 관해 설명한다.

opt in 어쩌구 하는 메시지는 가볍게 무시했었는데, 어느날 부터 서비스가 안되는 것이었다. Orz.
메시지 뿌려대기 시작할 때 무지무지 바빴는데, 바쁜게 끝났을 때는 메시지 무시하는 것이 버릇이 되어있었다.

서비스가 안되는 시점에 여러 검색을 해봤지만 뾰족한 방법이 없었다.
이상한 베타 블로그(http://deliciousengineering.blogspot.com/2011/09/welcome-to-delicious-beta-status-blog.html)에서 곧 조치를 취할거니 기다려 달라는 이야기만 있었다.

그래서 기다리는 중에 또 정신 없이 바빠졌다. 
시간이 좀 지나서 검색해보니 방법들이 있었다.
그런데 아래 링크대로 해봤지만 안됐다.
한시적인 서비스인 것도 있었고, dns 속여서 이전 서비스 접속하는 것도 안됐다.
http://www.avos.com/how-to-get-old-bookmarks-from-yahoo/
http://gabrielleabelle.livejournal.com/337468.html
https://www.delicious.com/settings/ws/import/bookmarks

욕이 나오기 시작했다.
한국 욕을 하면 못알아먹으니 영어로해야할것만 같은 생각도 두어번 들었다.

약간의 오기로 조금 뒤지기 시작했다.
의외로 간단히 firefox의 데이터 파일을 찾을 수 있었다.
C:\Documents and Settings\[UserId]\Application Data\Mozilla\Firefox\Profiles\rwiin5gt.default\ybookmarks.sqlite

혹시 모르니 데이터 파일 백업후 플러그인만 업글해보기로했다.
nsYDelLocalStore.js가 신나게 돌며 전부 삭제해버렸다. 미치기 직전이다.

ybookmarks.sqlite를 delicious.com의 import/export 에 쓰는 html(대충 보니 netscape 형식인듯)로 변환해서 해결하기로 방향을 정하고 다음과 같은 erlang 프로그램으로 모든 link들을 html 파일로 변경한 다음에 import 하니 해결되었다.

출력파일을 보면 제대로 동작해야할 것같은데 현재로서는 다음과 같은 문제가 있다:
  1. 한글이 모조리 없어지는 문제. 
  2. utf-8로 인코딩된 url이 delicious.com에서 redirect될 때 제대로 되지 않는 문제
    (%EC가 URL 내에 있다면, 실제 제목에 걸린 링크에서 redirect시키면서 %25EC로 된다).
일단 상기 문제는 delicious.com에 problem으로 등록했다.

%%%-------------------------------------------------------------------
%%% File    : to_html.erl
%%% Author  : M.W. Park <manywaypark@gmail.com>
%%% Description : converts delicious bookmark data file into html file for import.
%%%   1. install sqlite-erlang3(https://github.com/alexeyr/erlang-sqlite3).
%%%   2. copy ybookmarks.sqlite as delicious.db in current dir.
%%%   3. elrc to_html.erl
%%%   4. erl -noshell -pa [path/to/sqlite-erlang/ebin/] -run to_html doIt -run init stop
%%%   5. import output file(delicious.html) at http://export.delicious.com/settings/bookmarks/import
%%%
%%% Known Problems (for now) :
%%%   1. Hangul(Korean letters) is ignored by delicious (i registered ths issue).
%%%   2. UTF-8 encoded urls are not working (an odd 25 is added(%EC->%25EC) when delicious redirects it, so can't connect to the right url).
%%%
%%% Created : 2011-12-09 Friday by M.W. Park
%%%-------------------------------------------------------------------

-module(to_html).
-export([doIt/0]).

doIt() ->
    {ok,Output}=file:open("delicious.html",[write]),
    io:format(Output, "~s~n", [prefix()]),
    sqlite3:open(delicious), % open 'delicious.db'
    [{columns, _Columns}, {rows, Bookmarks}] = sqlite3:sql_exec(delicious, "select rowid,name,url,added_date,shared,description from bookmarks;"), % for all bookmarks
    lists:foreach(fun(Bookmark) ->
 %%io:format("row=~p~n", [Bookmark]),
 io:format(Output, "~s~n", [xmerl_ucs:to_utf8(bookmark(Bookmark))])
 end,
 Bookmarks),
    sqlite3:close(delicious),
    io:format(Output, "~s~n", [postfix()]),
    file:close(Output).

bookmark(Bookmark) ->
    {RowId, Name, Url, Date, Shared, Desc} = Bookmark,
    io_lib:format("<DT><A HREF=\"~s\" ADD_DATE=\"~ts\" PRIVATE=\"~p\" TAGS=\"~ts\">~ts</A>
<DD>~ts", [Url, re:replace(integer_to_list(Date), "000000$", "", [{return,list}]), if <<"true">> =:= Shared -> 0; true -> 1 end, get_tags(RowId), xmerl_ucs:from_utf8(Name), xmerl_ucs:from_utf8(Desc)]).

get_tags(RowId) ->
    Q = io_lib:format("select * from tags where rowid in (select tag_id from bookmarks_tags where bookmark_id=~p);", [RowId]),
    [{columns, _Columns}, {rows, Tags}] = sqlite3:sql_exec(delicious, Q),
    string:join(lists:map(fun({Tag}) -> xmerl_ucs:from_utf8(Tag) end, Tags), ",").

prefix() ->
    io_lib:format("<!DOCTYPE NETSCAPE-Bookmark-file-1>~n"
     "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=UTF-8\">~n"
     "<!-- This is an automatically generated file.~n"
     "It will be read and overwritten.~n"
     "Do Not Edit! -->~n"
     "<TITLE>Bookmarks</TITLE>~n"
     "<H1>Bookmarks</H1>~n"
     "<DL><p>", []).

postfix() ->
    io_lib:format("</DL><p>", []).

 happy hackin'

[Android] process is bad

tips & tricks 2011. 11. 4. 01:04 by manywaypark
멀쩡히 잘 돌던 앱이 이상해졌다.
Activity Manager가 process is bad라는 괴상한 에러를 내고 intent를 처리하지 못했다.
결론은 앱을 제거하고 리부팅하면 해결되는....
아... 돌겠다. Orz.

ref:
http://stackoverflow.com/questions/3253676/how-to-fix-process-is-bad-error-for-an-android-widget 
 
유틸이 있다.
xp:

tsshutdn

win7:

shutdown /r (for restart) | /s (for shutdown) /t sec.


 happy hackin' 
1 ··· 8 9 10 11 12 13 14 ··· 16 
분류 전체보기 (306)
잡담 (20)
함수형 언어 (65)
emacs (16)
java (18)
tips & tricks (154)
사랑 (1)
가사 (0)
독서 (4)
mobile (6)
비함수형 언어 (2)

공지사항

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

05-18 21:01