2012년 11월 30일 금요일

How KimsQ Rb imports external libraries

KimsQ Rb version 1.2.0 && layout==default && theme==style01 && jquery CDN switch ON
/layout/default/_lib/01.js, 02.js, 03.js, abc.css, bcd.css, cde.css

http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js
http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/jquery-ui.min.js
/_core/css/sys.css
/layouts/default/_main.css
/_core/css/bar.css
/_core/js/sys.js
/layouts/default/_main.js
/layouts/default/main.css
/layouts/default/main.js
/pages/_main.css
/pages/_main.js
/layouts/default/_theme/style01/theme.css
/layouts/default/_lib/cde.css
/layouts/default/_lib/03.js
/layouts/default/_lib/02.js
/layouts/default/_lib/01.js
/layouts/default/_lib/bcd.css
/layouts/default/_lib/abc.css


Source


<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/jquery-ui.min.js"></script>
<link type="text/css" rel="stylesheet" charset="utf-8" href="/_core/css/sys.css?nFlag=201212">
<link type="text/css" rel="stylesheet" charset="utf-8" href="/layouts/default/_main.css?nFlag=201212">
<link type="text/css" rel="stylesheet" charset="utf-8" href="/_core/css/bar.css?nFlag=201212">
<script type="text/javascript">
//<![CDATA[
... 생략 (Skip)
//]]>
</script>
<script type="text/javascript" charset="utf-8" src="/_core/js/sys.js?nFlag=201212"></script>
<script type="text/javascript" charset="utf-8" src="/layouts/default/_main.js?nFlag=201212"></script>
<link type="text/css" rel="stylesheet" charset="utf-8" href="/layouts/default/main.css?nFlag=201212">
<script type="text/javascript" charset="utf-8" src="/layouts/default/main.js?nFlag=201212">
<link type="text/css" rel="stylesheet" charset="utf-8" href="/pages/_main.css?nFlag=201212">
<script type="text/javascript" charset="utf-8" src="/pages/_main.js?nFlag=201212"></script>
<link type="text/css" rel="stylesheet" charset="utf-8" href="/layouts/default/_theme/style01/theme.css?nFlag=201212">
<link type="text/css" rel="stylesheet" charset="utf-8" href="/layouts/default/_lib/cde.css?nFlag=201212">
<script type="text/javascript" charset="utf-8" src="/layouts/default/_lib/03.js?nFlag=201212"></script>
<script type="text/javascript" charset="utf-8" src="/layouts/default/_lib/02.js?nFlag=201212"></script>
<script type="text/javascript" charset="utf-8" src="/layouts/default/_lib/01.js?nFlag=201212"></script>
<link type="text/css" rel="stylesheet" charset="utf-8" href="/layouts/default/_lib/bcd.css?nFlag=201212">
<link type="text/css" rel="stylesheet" charset="utf-8" href="/layouts/default/_lib/abc.css?nFlag=201212">


Composing .Xmodmap

Show my current key mappings (what X window recognize when I push a key on my keyboard)

$ xmodmap -pke


How to change my key mappings with ~/.Xmodmap file

$ cat ~/.Xmodmap

!keycode 100 = Henkan_Mode NoSymbol Henkan_Mode
!keycode 108 = Alt_R Meta_R Alt_R Meta_R
keycode 100 = Delete NoSymbol Delete
keycode 108 = Hangul NoSymbol Hangul


! lines are comments which were original key mappings.

I'm using a Happy Hacking Professional 2 keyboard with IBus input method in xfce4 on Debian. I wanted to use the unknown key next to HHKB logo as Delete and also wanted to switch input languages (Korean/English) without being disturbed by Alt_R action when I use GUI applications.


After re-running X, it works great!

2012년 11월 28일 수요일

diff: tips of Linux/Unix files/dirs comparing tool

usage: diff [options] file1 file2 [dir1 dir2]
       colordiff [options] file1 file2 [dir1 dir2]

Useful options

-s, --report-identical-files
    report when two files are the same (there is no output when same as default)
    파일이 완전히 같을 경우, 같다고 출력해준다. (기본적으로 아무 출력도 안 한다.)

-b, --ignore-space-change
    ignore changes in the amount of white space
    빈 칸 부분이 다른 경우 무시한다.

-r, --recursive
    recursively compare any subdirectories found
    하위 디렉토리도 비교한다.

Analysis of a result

$diff oldfile newfile
5c5
< this line 5 of oldfile is different from
> this line 5 of newfile.
7d6
< this line 7 of oldfile only appears in oldfile, does not appear in newfile.
21a22
> this line 22 of newfile is a missing line at line 21 of oldfile


#1[cda]#2
#1 is a line number of oldfile
#2 is a line number of newfile
'c' means 'change' to sync
'd' means 'delete' the line #1 of oldfile to sync
'a' means 'add' the line #2 of newfile after the line #1 of oldfile to sync

< means a line of oldfile
> means a line of newfile

colordiff

colordiff is a wrapper for diff, it shows the same output as diff but with colored syntax highlighting, so highly recommended.

2012년 11월 26일 월요일

(not done) KimsQ Rb: Goods and Bads

KimsQ Rb  1.2.x 버전에 대한 얘기이며, 2.0에 대해서는 차후 분석하여 정리할 예정이다. 하지만 2.0에서 핵심모듈과 확장모듈 부족, 안정성 등 아직 해결 안 된 부분이 많기 때문에 다시 킴스큐를 사용할 지는 현시점에서는(2015.04.21) 모르겠다.

킴스큐 Rb (이하 킴스큐)가 세계적인 CMS로 발전함을 목적으로 할 경우, 현재 가진 장점과 단점을 정리해 보았음.

Goods

  1. Expandability: 미리 짜여진 킴스큐의 코드는 깔끔하며, 논리적 흐름(logic flow)의 구조는 잘 짜여 있다. 사이트 전체에 영향을 미치는 요소는 레이아웃으로, 그 아래 각 기능이나 기능의 모음은 모듈로 구성 되어 있는데 마치 안드로이드에 앱을 설치하듯이 사용이 쉽고, 개발에 있어서는 그 짜임새가 매우 유연하다. 리눅스가 그렇듯 개발자에게는 마음 껏 뛰어놀 수 있는 커다란 운동장을 만난 느낌이다.
  2. Service performance: 한 페이지에 대한 응답 시간이 워드프레스에 비해 10배가 넘게 빠르다는 건 0.1~0.2초 차이지만 큰 의미를 갖는다. 동시에 수백수천 가지 요청이 몰려드는 서비스에서 속도라는 장점은 엄청난 비용을 줄여주며, 이런 점이 고객에게는 킴스큐라는 단 하나의 선택지만을 갖게 할 수도 있다. 하지만 여러 단점들로 인해 아직까지 킴스큐로 만든 대형 사이트가 나오지 않는 것이 사실이고, 그 단점들은 반드시 해결하지 않으면 속도라는 장점이 빛을 발할 기회는 오지 않을 것이다. (트래픽이 커지면 게시물을 단일 테이블에 저장하기 때문에 데이터베이스의 성능이 떨어진다는 얘기가 있다. 워드프레스 같은 경우, 튜닝을 하면 대형사이트를 구축해도 타협할 만한 성능이 나오며, 수많은 테마와 플러그인 등 다른 장점들 역시 막강하다.)

Bads

  1. Name: 제작사는 듣기 싫은 소리겠지만, 이름부터가 사실 단점이라고 볼 수 있다. KimsQ Rb? 너무 길다. fb.com이 thefacebook.com일 때가 있었다. 냅스터를 만든 사람의 조언으로 facebook.com으로 줄였는데, 지금은 아예 fb.com도 함께 사용하고 있다. 널리 퍼지기 위해서는 귀에 쏙 들어오는 쉽고 간결한 이름이어야 한다. wordpress, 여기서 word와 press를 모르는 사람은 별로 없다. 그리고 영어구사자의 관점에서 wordpress라는 단어는 facebook과 마찬가지로 굉장히 발음하기 쉽다. 물론 작명에 있어 원 창시자의 아이덴터티가 들어가는 것은 나쁘지 않고, 알다시피 외국의 경우 만든 사람 이름을 그대로 사용하는 경우도 많다. 혹은 어떤 제품이나 서비스 자체가 그 분야에서 굉장히 뛰어나면 그 이름은 특이할수록 강한 매력을 가질 수도 있다. 하지만 발음하기 어렵고 도대체 어떤 것도 연상하기 힘든 KimsQ Rb라는 이름은 킴스큐가 그런 궤도에 오르기 전까지는 분명한 방해요소다.
  2. Naming in code: 사용자에게 보이는 UI 부분에 용어와 시스템 내에서 사용 되는 변수 이름과 그 차이와 오역이 너무 많다. 테마라는 한 의미에 대해 skin과 theme을 섞어서 사용하는 등 처음 접하는 개발자에게는 코드를 자연스레 따라가기가 결코 쉽지 않다. 구조에서 받은 깔끔함이 변수명에서 반감 된다.
  3. English: 아직 영어를 선택 가능한 기본 언어로 지원하지 않는 것은 반드시 채워할 부분이다. 기본 언어가 한글 하나 뿐이며, 영어로 된 참고 문서는 전무하다. 4번과 관련 있는 문제. 다음을 보자.
  4. Multilingual sites: 한 사이트에 여러 언어를 적용할 수 있다는 것은 장점이 되어야 하지만 현재 킴스큐의 다중언어 지원에 대한 구조와 메카니즘은 정리가 덜 되어 있다. 5가지 다른 언어를 지원하는 사이트를 만드려면 같은 내용의 서버 스크립트가 5개 필요하다. 페이지에 보이는 내용(텍스트 등의 컨텐트)을 기본적으로 하드코딩하도록 되어 있기 때문이다. 한 가지 언어를 추가하려면 텍스트를 가진 사이트 전체 로직파일(PHP)들의 복사본을 추가해야 한다. 이후 로직을 수정하려면 추가된 모든 PHP 파일을 수정해야 한다. 속도를 위해 이런 구조를 유지한다고 하는데 어느 정도 타협이 필요한 것 같다. 물론 대부분의 경우 한 가지 언어로 사이트를 만드니까 타협하지 않아도 지대한 영향은 없을지도 모르지만, 대형 글로벌 서비스 사이트의 경우 킴스큐를 사용할 팀은 거의 없을 것이다.


2012년 11월 24일 토요일

Installing xfce theme icons cursor

Themes (or Window decorations)
Copy the theme dir into ~/.themes/
(system wide: /usr/local/share/themes/ or /usr/share/themes/)

Cursors
Copy the cursor dir into ~/.icons/
(system wide: /usr/share/icons/)

Icons
Copy the icon dir into ~/.icons/
(system wide: /usr/local/share/icons/ or /usr/share/icons/)


2012년 11월 23일 금요일

KimsQ Rb 개작 허용 모듈들의 폴더명

  • 시스템 = admin
  • 회원관리 = member
  • 게시판 = bbs
  • 댓글 = comment
  • 첨부화일 = upload
  • 팝업 = popup
  • 파일매니저 = filemanager
  • DB매니저 = dbmanager
  • 모바일 = mobile
  • 도메인 = domain
  • 접속통계 = counter
  • 통합검색 = search
  • 위젯 = widget
  • 태그 = tag
  • 트랙백 = trackback


개발하는 사람은 모듈명보다 실제 폴더명으로 기억을 하는데 킴스큐 홈페이지에 함께 나와있지 않아서 직접 작성함.
Let's go!

2012년 11월 22일 목요일

Switch two screens with xorg.conf tweak

I have a monitor on the left and TV - as a monitor - on the right and I was happy with unintended dual monitor by installing nvidia-glx package. Four workspaces of Xfce at first 'were' like 1920x1200 (monitor) + 1920x1080 (TV) so eventually 3840x1200 for each. A couple of days ago I don't know why but I thought maybe I don't need the TV screen, so I ran Xfce menu -> Settings -> Screen and tested the screen setting by disabling and enabling each screen, ... it was a beginning of a disaster.

Workspaces were not 3840x1200 anymore, it became 1920x1200 on TV. It looked like Xfce doesn't involve my monitor screen in its workspaces and I couldn't move application windows from a monitor to TV or vice versa. In advance, panels and desktop icons of Xfce moved TV, (they were on the monitor screen) two screen were switched! I couldn't roll back with Xfce menu -> Settings -> Screen so embarrassed.

Now I think I could tweak some of xml files like displays.xml or xfce4-desktop.xml in ~/.config/xfce4/xfconf/xfce-perchannel-xml/ directory (I'm using Xfce 4.8) but I didn't know at that time and my trials with xrandr command created by arandr in ~/.bashrc didn't make me satisfied because the screens were blinked once again after log in Xfce session. They say put the xrandr command in a gdm script of /etc/gdm/ but couldn't make it.

I googled more & solved the problem with /etc/X11/xorg.conf tweak. (There was no xorg.conf in /etc/X11 by default any more and I welcomed it but I had to create xorg.conf to solve this problem.)

I tried with NVIDIA X server settings in Xfce menu -> Settings but it didn't work because the xorg.conf created by that NVIDIA program was using two more "Device" sections for my one GeForce GT 630 card and Xfce seniors say Xfce doesn't support that. So I deleted the nvidia Device sections and modified the first section of xorg.conf, "ServerLayout" section like below by an advice of the following link.


Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" RightOf "Screen1"
        Screen      1  "Screen1" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection


http://forum.xfce.org/viewtopic.php?id=6495

It worked perfectly! The screens are switched with Xfce panels and icons as it was before and expanded workspaces through two monitor screens came back.

Setting up NVIDIA GeForce GT 630

Though I upgraded my Debian from stable release to sid (unstable), a screen resolution was 1600x1200 instead of 1920x1200 which is maximum of my monitor. It looks like a default driver for my graphics card doesn't work good enough.

I downloaded the recent driver from official NVIDIA site and tried to install it but failed because I needed to get a properly configured kernel header.

Googling... and I found what I needed was not a driver from NVIDIA but nvidia-glx package.

$sudo apt-get install nvidia-glx

Slam dunk!

source.list for sid

Debian Linux is released as three versions, stable, testing, unstable. every release has a code-name but unstable is always called as sid, in which has most recently packaged utilities with cutting edge features.

oh... too long, I don't have to explain everything about Debian here.


For sid, I can have only two lines in /etc/apt/source.list file.


deb http://ftp.kr.debian.org/debian/ sid main contrib non-free
deb-src http://ftp.kr.debian.org/debian/ sid main contrib non-free

The source contains the most recent updates including security updates. It's cool.

Start linuxing again

It has been long ... I've started linuxing with redhat 5 and 6.2, and found my favorite distribution, Debian that I dug how to manage packages with apt, compile a Linux kernel, set X window and fluxbox and code bash script.

I didn't linux for years and tried to play with Ubuntu afterwords, was surprised a lot by its support drivers and easy installation and took a rest for years again with sticking Windows XP and 7.

Recently I wanted to develop core of one CMS but did not want to install it on Windows, so I set it up on Debian which I installed for the first time for last 10 years. New Debian sid (unstable) looks very nice with Gnome2 even though I changed it to xfce. The apt-get is still so powerful package management tool, I love it.

I tried to update a kernel and wow, I found Linux kernel version became 3.2! I heard Linus & thugs did it (2.6 for 15 years and finally 3.0) to celebrate 20th birthday of Linux. Applause.

Anyway, I set my new boat afloat, yeah!


Xubuntu: Installing a Printer (Canon G3060 PIXMA)

$ sudo apt install system-config-printer Download the proper driver for linux from Canon website. Turn on the printer and set up its WiFi. C...