참으로 깔끔하게 잘 정리해놨네. Redhat 계열인 Fedora 나 CentOS 같은 경우는 /etc/DIR_COLORS 스크립트가 있지만, ubuntu 는 그런게 없네. 조금 특이한 방법이기는 하나, 아래와 같이 해서 잘 사용할 수 있다.

Lightbulb Howto: Add custom color to directory listings.

You ever fire up an xterm and perform an "ls" command? Sure you have! If so, did you ever wish that:
  • certain files would "stand out" with a custom color, and not the defaults?
  • you can add other filename extensions to the database with their own custom color as well?
Well, here's how...

NOTE: All commands to be entered in a terminal shell or changes made to a file are hilighted in red. You only need to cut/paste those items which are hilighted, the surrounding text is left for illustration purposes.

1. Edit the '.bashrc' file. You need to make a few small changes to the existing bash script.
  1. (optional) Backup the file. Copy your existing '.bashrc' file in case you wish to restore it at a latter time. For example,
    Code:
    skoal@morpheus:///tmp $ cd && cp .bashrc .bashrc~
    skoal@morpheus://~ $ ls .bashrc*
    .bashrc  .bashrc~
  2. Modify the file. Using your favorite text editor, open the file '~/.bashrc' and make the following changes hilighted in red (which should appear somewhere near the top of that file - line 17 if no prior alterations were made). You will basically be modifying one line and adding two more above it.
    Code:
    skoal@morpheus:///tmp $ gedit ~/.bashrc
    and make these changes in the file,
    Code:
    # enable color support of ls and also add handy aliases
    if [ "$TERM" != "dumb" ]; then
        [ -e "$HOME/.dircolors" ] && DIR_COLORS="$HOME/.dircolors"
        [ -e "$DIR_COLORS" ] || DIR_COLORS=""
        eval "`dircolors -b $DIR_COLORS`"
        alias ls='ls --color=auto'
        #alias dir='ls --color=auto --format=vertical'
        #alias vdir='ls --color=auto --format=long'
    fi
  3. (alternative to step 1.ii) Patch the file. Using the attched 'bashrc.patch' file, patch the current '~/.bashrc' file instead of cutting/pasting with an editor.
    Code:
    skoal@morpheus:///tmp $ bunzip2 bashrc.patch.bz2
    skoal@morpheus:///tmp $ cp bashrc.patch ~
    skoal@morpheus:///tmp $ cd && patch -p0 < bashrc.patch
    patching file .bashrc
    Hunk #1 succeeded at 19 (offset 5 lines).
2. Create the '.dircolors' file. The '.dircolors' file is created by using the 'dircolors' program. It will generate a default color scheme to be used with the "LS_COLORS" environment variable, which gives the colored output while using "ls".
Code:
skoal@morpheus:///tmp $ cd && dircolors -p > .dircolors
3. Edit the '.dircolors' file. Here is where you will be modifying/creating new color schemes to reflect your own unique style.

NOTE: Lines 34-41 within this file give you the color codes for three specific keys: attribute, text, and background. You can choose to use all three keys, or simply pick and choose only those keys you wish to apply. Look at some of the pre-defined ones you may already recognize as a good example to follow.
  1. Modify existing color schemes. For example, I can't stand big bold blue directory listings, so I change the bold attribute from "01" to "00" (none) but keep the blue color. It will lighten things up a bit.
    Code:
    FILE 00         # normal file
    DIR 00;34       # directory
    LINK 01;36      # symbolic link.
    or, change the "01" to an "07", making your debian packages really stand out!
    Code:
    .gz  01;31
    .bz2 01;31
    .deb 07;31
    .rpm 01;31
    .jar 01;31
    which will "reverse" the red (31) foreground color - basically making it black text inside a red box! Whoa! Ugly but effective, no?

  2. Create new color schemes. I like to program, yet for some reason, there are no default colors for well known language extensions. I like my c/c++ source to show up as green and my header files as yellow. Here's how I added these extensions to the bottom of that file:
    Code:
    # audio formats
    .ogg 01;35
    .mp3 01;35
    .wav 01;35
    
    # programming languages
    .c 00;32
    .cc 00;32
    .cpp 00;32
    .h 00;33
4. Source the '.bashrc' file. In order for your changes to take effect within the current shell, you need to source the '.bashrc' file.
Code:
skoal@morpheus:///tmp $ cd && . .bashrc
** END of Howto **

and, just to see your handy work, look at these two environmental variables:
Code:
skoal@morpheus://~ $ set | grep 'DIR_COLORS\|LS_COLORS'
DIR_COLORS=/home/skoal/.dircolors
LS_COLORS='no=00:fi=00:di=00;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:*.c=00;32:*.cc=00;32:*.cpp=00;32:*.h=00;33:'
NOTE: These color changes will be preserved upon each reboot or login. If you wish to revert to the original color scheme, just delete the file '.dircolors' in your $HOME directory (or, alternatively, restore your backup file made in step 1.i).
Code:
skoal@morpheus:///tmp $ rm -f ~/.dircolors
NOTE: I've only tested this with a plain 'ole vanilla stock 'xterm'. I do not use gnome-terminal, kterm(?), or any other variants but it should work equally well with them. I do not use any file managers of any sort, so without some MIME associated icon staring me in the face, these colors really help. Using 'dircolors' is old as dirt, and I'm surprised no one else hadn't mentioned this yet. Am I the only one who thinks CLI+color > [insert favorite File Manager here]? Surely, I'm not alone. Or am I...

\\//_

Last edited by skoal; June 13th, 2005 at 09:28 PM..
반응형
블로그 이미지

Good Joon

IT Professionalist Since 1999

,

<Iplanet 홈>/https-admserv/config/admpwd 파일을 열어보면
admin 의 ID 와 Password (SHA 인코딩된) 가 있음.

뒤의 Password 를 지워버리고, 다시 로그인 하면 됨.
로그인 할때, Password 는 비워놓고 하도록 함.

그리고 나서 패스워드 바꾸자.
반응형
블로그 이미지

Good Joon

IT Professionalist Since 1999

,
 DevOn-CI 의 hudson 플러그인에 간결하게 잘 나온 설명이 있어서 발췌한다.

Users
    사용자 계정을 관리합니다.
    한글 이름을 사용할 수 있습니다.
    비밀번호에는 한글을 사용할 수 없습니다



Groups
    계정을 그룹으로 묶어서 관리합니다.
    아래와 같은 양식으로 작성합니다.

    group = user1, user2, ...

Authz
    접근권한을 설정합니다. 다음과 같은 형태로 권한을 설정할 수 있습니다.
      - 단일 사용자                                   
      - [groups] 섹션에서 정의된 그룹 사용자         
      - 와일드크드 '&star;' 는 모든 사용자를 의미함 
      - 롤 앞에 '~' 를 붙이면 반전을 의미함        

    접근권한 설정은 다음 3가지로 할 수 있습니다.
      - 'r' 읽기    
      - 'rw' 읽기/쓰기
      - '' 권한없음 

    예) 아래와 같이 작성하면 다음의 접근권한 제어가 발생한다.
      - sysadmin 계정은 모든 경로에 읽기/쓰기 가능
      - sys 그룹은 모든 경로에 읽기/쓰기 가능
      - adm 그룹은 tags, branches, trunk 경로에 읽기/쓰기 가능
      - dev 그룹은 trunk 경로에만 읽기/쓰기 가능
      - 계정이 없는 사용자도 읽기는 가능

        [/]
        @sys = rw
        * = r
        
        [/tags]
        @sys = rw
        @adm = rw
        * = r
        
        [/branches]
        @sys = rw
        @adm = rw
        * = r
        
        [/trunk]
        @sys = rw
        @adm = rw
        @dev = rw
        * = r


심플하다.~

반응형
블로그 이미지

Good Joon

IT Professionalist Since 1999

,

SysinternalSuit 의 junction.exe 로 Symbolic Link 를 만들 수 있다.
단, NTFS 에서만 지원하고, Directory 만 Link 할 수 있다.

그리고 주의할 점은, Symbolic Link (Junction) 을 삭제 시에는 반드시
junction -d <junction> 으로 삭제해야 한다는 것이다.

반응형
블로그 이미지

Good Joon

IT Professionalist Since 1999

,

Tomcat 에 Application 별로 다른 포트를 할당하여 띄우려고 하는 경우, 간단히 Server 내에 Service 를 추가하는 방법이 있다. 인터넷에 도메인 네임 별로 호스트를 주는 방법은 많은데 요건 없어서 적어본다.

Tomcat 6 기준이지만, 이하 버전에서도 동일하게 작동할것이라 굳게 믿는다.

Tomcat 은 server.xml 구조가 기본적으로,
<Server>
<Listener [n]/>
<GlobalNamingResource>
</GlobalNamingResource>
<Service [n]>
<Connector [n]/>
<Engine>
<Realm [?]/>
<Host [n]>
<Context [n]>
<Resource [n]/>
</Context>
</Host>
</Engine>
</Service>
</Server>


위와 같은 구조로 server.xml 을 구성할 수 있다. [n] 은 복수개가 올 수 있다는 것이다.
그래서, Service 를 여러개 만들면, 다른 포트를 가질 수 있는 커넥터와 묶인 Host 를 만들 수 있다.

대충 이런구조가 될 수 있다.

<Server port="8005" shutdown="SHUTDOWN">

  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <Service name="Catalina">

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

    <Engine name="Catalina" defaultHost="localhost">

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="false"
            xmlValidation="false" xmlNamespaceAware="false">

      </Host>
    </Engine>
  </Service>

  <Service name="Hudson">
    <Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"/>
    <Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />

    <Engine name="Hudson" defaultHost="localhost">

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <Host name="localhost"  appBase="hudson_webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
      <Context displayName="hudson" docBase="/home/apps/hudson/war"
            path="" workDir="" />

      </Host>
    </Engine>
  </Service
>
</Server>



저러면 8080 으로 서비스 하는 host 와 8081 로 서비스하는 Host 가 각각 하나씩 뜨게 된다.
그런데 Tomcat Instance 는 하나라서 성능이 어떻게 될지는 장담하지 못한다는거~
실제 운영환경에서는 Tomcat 을 별도로 띄우는게 더 좋을듯 하다.

반응형
블로그 이미지

Good Joon

IT Professionalist Since 1999

,

오늘 이노무것 땜에 스트레스 좀 받았다. 조금만 로그를 자세히 봤었으면 좋았을것을..^^;;

디렉토리 기반으로 배포하도록 Context 를 server.xml 에 추가했는데 자꾸 아래와 같이 에러가 떨어지더라..

2010. 2. 10 오전 12:43:22 org.apache.catalina.core.AprLifecycleListener init
정보: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/local/jdk1.6.0_18/jre/lib/amd64/server:/usr/local/jdk1.6.0_18/jre/lib/amd64:/usr/local/jdk1.6.0_18/jre/../lib/amd64:/lib:/usr/lib:/usr/local/lib:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2010. 2. 10 오전 12:43:22 org.apache.tomcat.util.digester.SetPropertiesRule begin
경고: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'docbase' to '/home/was/sample/simple' did not find a matching property.
2010. 2. 10 오전 12:43:23 org.apache.coyote.http11.Http11Protocol init
정보: Initializing Coyote HTTP/1.1 on http-8080
2010. 2. 10 오전 12:43:23 org.apache.catalina.startup.Catalina load
정보: Initialization processed in 864 ms
2010. 2. 10 오전 12:43:23 org.apache.catalina.core.StandardService start
정보: Starting service Catalina
2010. 2. 10 오전 12:43:23 org.apache.catalina.core.StandardEngine start
정보: Starting Servlet Engine: Apache Tomcat/6.0.24
2010. 2. 10 오전 12:43:23 org.apache.catalina.core.StandardContext resourcesStart
심각: Error starting static Resources
java.lang.IllegalArgumentException: Document base /home/was/apache-tomcat-6.0.24/webapps/simple does not exist or is not a readable directory
        at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:142)
        at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4086)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4255)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)


처음에는, "왜자꾸 TOMCAT_HOME/webapps 에서 Context 를 로드하려고 하니 얘가.. docbase 도 세팅해줬는데.." 했건만, 결론은, server.xml 에 대소문자 하나때문에 일어난 일이었다..

<Context displayName="simple" docbase="/home/was/sample/simple"
      path="/simple" workDir="" reloadable="true"/>

저 docbase 가 잘못되었었다.. docbase 가 아니고 docBase 인데.. 이런 실수를..ㅜㅜ



반응형
블로그 이미지

Good Joon

IT Professionalist Since 1999

,
1. 백업

svnadmin dump %REPODIR% > %REPOBACKUP%

2. 복원

svnadmin load %REPODIR% < %REPOBACKUP%

반응형
블로그 이미지

Good Joon

IT Professionalist Since 1999

,

SVN 은 CVS 와 다르게, 기본 설정이, Anonymous 사용자에게 모든 권한이 주어진다.
아래 방법대로 계정을 추가하고, 인증 방식을 설정한다

1. 계정 추가하기

계정은 <CVS REPOSITORY>/conf/passwd 파일에 쓰면 된다.
 [users]
 # harry = harryssecre
 # sally = sallyssecre
user1 = password1
user2 = password2

와 같이, 계정 = 패스워드 방식으로 [users] 섹션에 선언하면 된다.

2. 인증 사용하도록 설정

위와같이 계정만 추가한다고 인증이 실행되는게 아니라, <CVS REPOSITORY>/conf/svnserve.conf 파일을 수정해줘야 한다

[general]
anon-access = none
auth-access = write
..
password-db = passwd
..
realm = Study Codes Repository for Joon
..


위와 같이 설정하도록 한다.
다 이해 갈 것이고, realm 은 인증 시에 사용자에게 보여질 인증 메세지 이다
보통, 현재 Repository 의 설명 정도를 넣어주면 되겠다.




반응형
블로그 이미지

Good Joon

IT Professionalist Since 1999

,
 First of all, there are good link collection page on the internet, so that you can refer to those linked pages for installation of CVS and CVS Server Daemon on each Linux Machines.

CASE 1 : Install CVS using apt-get and xInetd

1. Use apt-get to install CVS.
$ apt-get install cvs

2. Make an account for cvs repository management if possible.
$ useradd -m -G dev srcmanager
$ passwd srcmanager
$ su - srcmanager

3. make a directory for cvs repository and initialize it to serve as cvs repository
$ mkdir cvs_repository
$ chmod g+s cvs_repository
$ cvs -d :local:/home/srcmanager/cvs_repository init

4. Create a xinetd service file as follow and name it to "cvs_pserver". (do this under su privilege)
service cvspserver
{
        socket_type     = stream
        wait            = no
        user            = root
        group           = cvsuser
        env             = HOME=/home/srcmanager/cvs_repository
        server          = /usr/bin/cvs
        server_args     = -f --allow-root=/home/srcmanager/cvs_repository pserver
        disable         = no
}

5. restart xinetd
$ invoke-rc.d xinetd restart

6. check if cvspserver service port (2401) is listening well
$ netstat -an | grep 2401

반응형

'Software Development > Dev Tools' 카테고리의 다른 글

[SVN] 백업 및 복원  (1190) 2010.02.09
[SVN] 사용자 계정 추가 및 기본 인증 설정  (1196) 2010.02.09
[Trac] 권한 설정하기  (1906) 2009.10.16
[trac] 기본 에디터 대체 플러그인  (1198) 2009.10.14
[Trac] Ticket 삭제하려면..  (494) 2009.10.14
블로그 이미지

Good Joon

IT Professionalist Since 1999

,

Redhat 의 ntsysv 같은 툴을 원하면, ubuntu 에서는 rcconf 설치해서 사용하도록 한다.


그런데, 위의 rcconf 보다 좀더 기능이 있는것이 sysv-rc-conf 이다.
아래 처럼, Runlevel 별로 rc.d 의 config 설정이 가능하다
또한, 바로 서비스를 start / stop 할 수도 있다.






반응형
블로그 이미지

Good Joon

IT Professionalist Since 1999

,