Linux2010. 3. 4. 10:54
로그인 쉘을 위해 실행되는
시스템 전역 초기화 파일인 /etc/profile을 수정하면 모든 사용자에게 적용이 될것으로 예상된다.

debian 도움말에는
/etc/bash.bashrc가 존재하고 이녀석은 login shell
/etc/profile은 interactive shell에 적용된다고 되어있다.

그런데 login shell과 per-interative-shell의 차이가 멀까?

$ man bash
OPTIONS
       In  addition to the single-character shell options documented in the description of the set builtin command, bash
       interprets the following options when it is invoked:

       -c string If the -c option is present, then commands are read from string.  If  there  are  arguments  after  the
                 string, they are assigned to the positional parameters, starting with $0.
       -i        If the -i option is present, the shell is interactive.
       -l        Make bash act as if it had been invoked as a login shell (see INVOCATION below).


INVOCATION
       A login shell is one whose first character of argument zero is a -, or one started with the --login option.

       An interactive shell is one started without non-option arguments and without the -c option whose  standard  input
       and  error  are both connected to terminals (as determined by isatty(3)), or one started with the -i option.  PS1
       is set and $- includes i if bash is interactive, allowing a shell script or a startup file to test this state.


FILES
       /bin/bash
              The bash executable
       /etc/profile
              The systemwide initialization file, executed for login shells
       ~/.bash_profile
              The personal initialization file, executed for login shells
       ~/.bashrc
              The individual per-interactive-shell startup file
       ~/.bash_logout
              The individual login shell cleanup file, executed when a login shell exits
       ~/.inputrc
              Individual readline initialization file

[링크 : http://linux.die.net/man/1/bash]
[링크 : http://www.lq.org/questions/linux-general-1/difference-between-normal-shell-and-login-shell-14983/]

FC6에서 내용확인
$ cat /etc/bashrc
 # /etc/bashrc

 # System wide functions and aliases
 # Environment stuff goes in /etc/profile

 # By default, we want this to get set.
 # Even for non-interactive, non-login shells.

$ cat /etc/profile
# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

아무튼, interactive shell은 stdin와 stderr(잉? 왜 stdout이 아니지?)이 둘다 연결된 셸로
우리가 일반적으로 사용하는 녀석으로 생각된다.
결론은 login shell보다는 interactive shell용 환경변수 파일에 alias 등을 지정하는게 좋을듯 하다.
Posted by 구차니
이번에 컴퓨터 박살나서 새로 구매했다가 설정한다고 똥줄좀 탔는데.
아무튼, 센트리노 1.7GHz 노트북에서 하다가, 듀얼 코어로 넘어왔는데.
우리 개발하는건 규모가 작은 편이라 티가 별로 안난다.

1분 컴파일 하던게 40초로 줄어봤자... 티가 나야 말이지 ㄱ-

아무튼!
커널 컴파일 하신다고 소장님 전에 알려드린 make -j 옵션을 확인하시고
make clean
make
실행!


예전 같으면 한 30분 걸리던 녀석..
3분만에 끝났나? ㄱ-



소장님 : "헉? 벌써 끝난거야? 이상한데.. 아닌거 같은데 먼가 찜찜해"
구차니 : 저도 그렇게 생각합니다만.. 빠른게 좋은거죠 ^^;



사족 : 한페이지 넘는 cc 들에 입이 쩍!
        (cc는 c compiler로 make 시에 컴파일을 위해 호출된다. 다르게 말하자면 동시에 20~30개가 넘는 녀석이 컴파일 중)
        bogomips 로만은 1200(1.7Ghz) 5400x2(E5400) 일단 기본 스펙만으로는 9배 차이난다.

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

직업병 - 안구인식  (0) 2010.03.17
오늘 일이 안되는건  (2) 2010.03.10
일하기 싫어서 미친짓!  (0) 2010.02.24
회사에 나갔다.  (8) 2010.02.21
아프다고 쉬어놓고 왜 일을 안해?!  (6) 2010.02.19
Posted by 구차니
기자야.. 제발 이미지 정도는 넣어주는 센스.. 안되겠니?

딱보니
Linux + KDE + Firefox + OpenOffice 조합인데
한글화가 잘되어 있고, 기본 로케일은 ko로 되어있는듯 하다.
(메뉴가 구버전의 Gnome 같았는데, KDE 제어판을 띄우는것 봐서는 Gnome 보다는 KDE로 생각된다.)

URL에 ko로 되어있다.
그리고 하단에 외형은 KDE 기반인것으로 생각이 된다.
특이한건 "주체" 라는 년단위. 역시 북한?!

아무리 봐도.. OpenOffice다. 몇가지 아이콘은 바뀌었지만, 글씨색 아이콘이 너무 닮았다.


근데.. 기자야.. 너무 하잖냐~
예전부터 리눅스가 windows 와 최대한 닮아가고 있다고 리눅스 사용자들이
침이 닳도록 이야기 했는데 콧방귀도 안뀌더니
"북한"에서 만든 사용환경은 윈도와 매우 유사하다니.. 에효..

[링크 : http://media.daum.net/digital/view.html?cateid=1048&newsid=20100303140424156&p=ned]
[링크 : http://ashen-rus.livejournal.com/4300.html]


사족 : windows 는 Microsoft 사의 Trademark 이고
         window는 아닌걸로 아는데.. 리플을 보고 있으니 답답.. 에효~
         (찾아보니 국내에서 window는 양지사에 상표로 등록되어 있다고 한다.)
Posted by 구차니
부제 : /sbin/ldconfig 와 /etc/ld.so.conf 그리고 LD_LIBRARY_PATH

python을 하는데 so 파일을 쓰도록 했음에도 불구하고
제대로 설치되지 않는 문제가 있었다.
일단 실행을 하려니 libpython2.6.so 을 찾을수 없다는 건데

./configure --enable-shared
make
make install
로 했음에도 불구하고 안된다.

# vi Makefile
 745 # Install everything
 746 install:         altinstall bininstall maninstall
 747
 748 # Install almost everything without disturbing previous versions
 749 altinstall:      altbininstall libinstall inclinstall libainstall \
 750                 sharedinstall oldsharedinstall

위에 내용으로 봐서는, make install 하면은 알아서 sharedinstall 까지 하므로 이상은 없다.

하지만
/sbin/ldconfig -p | grep python
으로 하면
구버전인 2.4만 나온다.

# /sbin/ldconfig -p | grep python
        libpython2.4.so.1.0 (libc6) => /usr/lib/libpython2.4.so.1.0
        libpython2.4.so (libc6) => /usr/lib/libpython2.4.so
        libboost_python.so.2 (libc6) => /usr/lib/libboost_python.so.2
        libboost_python.so (libc6) => /usr/lib/libboost_python.so

파일을 검색해보니
# find /usr -name "libpython*"
/usr/lib/libpython2.4.so
/usr/lib/python2.4/config/libpython2.4.a
/usr/lib/libpython2.4.so.1.0
/usr/lib/gnome-vfs-2.0/modules/libpythonmethod.so
/usr/local/lib/python2.6/config/libpython2.6.a
/usr/local/lib/libpython2.6.so.1.0
/usr/local/lib/libpython2.6.a
/usr/local/lib/libpython2.6.so

/usr/lib에 복사하지 않고
/usr/local/lib 에 복사가 된다.

그런 이유로, 강제로 /usr/local/lib를 참조하도록 해주어야 하는데
LD_LIBRARY_PATH 를 해주어도 반응이 없었다.(뭥미?!)

/etc/ld.so.config 파일을 열어보면(FC6 기준)
# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
이런 내용 뿐인데

마지막 줄에
/usr/local/lib/
를 추가해준다.

그리고
/sbin/ldconfig 를 해주고 나서, 다시
/sbin/ldconfig  -p | grep python
를 해주면

# /sbin/ldconfig -p | grep python
        libpython2.6.so.1.0 (libc6) => /usr/local/lib/libpython2.6.so.1.0
        libpython2.6.so (libc6) => /usr/local/lib/libpython2.6.so
        libpython2.4.so.1.0 (libc6) => /usr/lib/libpython2.4.so.1.0
        libpython2.4.so (libc6) => /usr/lib/libpython2.4.so
        libboost_python.so.2 (libc6) => /usr/lib/libboost_python.so.2
        libboost_python.so (libc6) => /usr/lib/libboost_python.so

추가가 된다.
그럼 all right~!


[링크 : http://linux.die.net/man/8/ldconfig]
[링크 : http://seungyeop.kr/blog/textyle/809]
Posted by 구차니
man page도 존재하지 않아서 확신은 못하겠지만

# python-config --help
Usage: /usr/local/bin/python-config [--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--help]

# python-config --prefix
/usr/local

# python-config --exec-prefix
/usr/local

# python-config --includes
-I/usr/local/include/python2.6 -I/usr/local/include/python2.6

# python-config --libs
-lpthread -ldl -lutil -lm -lpython2.6

# python-config --cflags
-I/usr/local/include/python2.6 -I/usr/local/include/python2.6 -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes

# python-config --ldflags
-L/usr/local/lib/python2.6/config -lpthread -ldl -lutil -lm -lpython2.6

-I -L 옵션이 나오는것 봐서는
이녀석을 통해서 gcc 컴파일시(python/c api) 사용할 옵션을 빼내주는 것으로 보인다.
아무래도 컴파일 시에 준 옵션 보다는 직접 파일을 검색하는 느낌이 강하게 든다.(바로바로 결과가 안나온다)

결과를 봐서는, ldflags 와 cflags 두개만 사용하면 될듯하다.

[링크 : http://hltbra.blogspot.com/2010/02/introducao-pythonc-api.html]
Posted by 구차니
하드웨어2010. 3. 3. 16:14
혹시 E5400 이라고 붙은 이유가..
bogomips로 5400이 나와서 그런건 아니겠지? ㄱ-

아무튼 단순 수치상으로 2개 프로세서니까, 10800MIPS가 되는걸려나?

# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Pentium(R) Dual-Core  CPU      E5400  @ 2.70GHz
stepping        : 10
cpu MHz         : 2700.095
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm
bogomips        : 5403.74

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Pentium(R) Dual-Core  CPU      E5400  @ 2.70GHz
stepping        : 10
cpu MHz         : 2700.095
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm
bogomips        : 5400.07


2009/11/12 - [하드웨어 관련] - BogoMIPS - cpu 성능 측정하는 방법중 하나


Pentium(R) Dual-Core  CPU      E5400  @ 2.70GHz
bogomips        : 5403.74

Intel(R) Pentium(R) D CPU 3.00GHz
bogomips        : 5988.40

Intel(R) Xeon(R) CPU           X3320  @ 2.50GHz
bogomips        : 6236.74

Intel(R) Pentium(R) 4 CPU 2.66GHz
bogomips    : 5319.93

Intel(R) Pentium(R) M processor 1.20GHz under Portable Ubuntu TRES (9.10)
bogomips    : 5872.02 / 5319.93 / 4246.73
bogomips    : 2510.02 (Speed Step to 600Mhz)

Intel XScale-PXA255 rev 6 (v5l)
BogoMIPS        : 396.56

STb7100 Reference board (SH4)
bogomips        : 262.14

STBx25xx (PPC)
bogomips        : 250.36


Posted by 구차니
Microsoft/Windows2010. 3. 3. 14:08
컴퓨터가 맛탱이가 가서 새로운 하드에 설치후,
기존 하드에서 내 문서를 복사하려는데 "엑세스가 거부되었습니다."
라는 오류가 발생을 했다. 이래저래 찾는데 영~ 안되다가 겨우겨우 컴치초탈님의 블로그에서
딱 필요한 ms 공식 링크를 발견했다.

그나저나.. Win7 시대에 WinXP 글이라니 ㅠ.ㅠ
Win7으로 가야하나? ㅋ

Step 1. 들어가지지 않는 폴더의 등록정보를 본다.
           그런데 아래와 같이 일반/공유 탭만 나온다면

Step 2. 폴더 옵션에서 "모든 사용자에게 동일한 폴더 공유 권한을 지정(권장)" 을 해제한뒤

Step 3. 다시 들어가보면 다음과 같이 "보안" 탭이 나타납니다.
           그리고 "고급(V)" 버튼을 눌러 들어가서

Step 4. "소유자" 탭에서 특정 계정(귀찮으면 Administrator나 Administrators)을 선택 후
           "하위 컨테이너와 개체의 소유자 바꾸기(R)"체크후 적용이나 확인을 누릅니다.

그러면 폴더를 열어서 읽고 쓸수 있습니다만,
특정 폴더의 경우 재귀적으로 되지 않아, 수작업으로 이러한 소유권을 추가로 가져와야 합니다.

[링크 : http://mycom.kr/329]
-> [링크 : http://support.microsoft.com/kb/810881/ko]
Posted by 구차니
Linux2010. 3. 2. 18:29
alias make='make -j'
를 해놨는데

gmake는 symbolic link로 make로 되어있다.

하지만 alias 특성상, 명령줄 치환을 하기 때문에
입력 당시 gmake가 비록 링크 추적으로 인해서 make가 실행되겠지만,
그렇다고 해서 make가 make -j로 치환되지는 않는다.

2010/03/02 - [프로그램 사용/gcc] - make, gmake
2010/02/26 - [Linux] - make를 더욱 빠르게 하기!


Posted by 구차니
make와 gmake는 유사하나
Fedora Core 6 에서는 실질적으로 symbolic link로 연결이 되어있다.

# ll /usr/bin/*make
lrwxrwxrwx 1 root root      4 Feb 16 13:23 /usr/bin/gmake -> make
-rwxr-xr-x 1 root root 162204 Jul 13  2006 /usr/bin/make

[링크 : http://linux.die.net/man/1/gmake]
[링크 : http://linux.die.net/man/1/make]

shenzhen{bzhu}$ gmake -version
GNU Make version 3.71, by Richard Stallman and Roland McGrath.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

shenzhen{bzhu}$ make -version
GNU Make 3.80
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

[링크 : http://www.unix.com/high-level-programming/29191-what-distinguish-between-gmake-make.html]

아무튼, 다르지만 실질적으로 같은 녀석이다.
Posted by 구차니
프로그램 사용/gcc2010. 3. 2. 17:34
gcc 옵션중에 헷갈리는게 있다.
-L과 -l이 그녀석인데, 비슷비슷해서 조금 헷갈린다.

아무튼 -L은 디렉토리(경로)를
-l은 특정 라이브러리 파일을 설정하는데 사용된다.

       -l library
           Search the library named library when linking.  (The second alternative with the library as a separate argu-
           ment is only for POSIX compliance and is not recommended.)

           It makes a difference where in the command you write this option; the linker searches and processes libraries
           and object files in the order they are specified.  Thus, foo.o -lz bar.o searches library z after file foo.o
           but before bar.o.  If bar.o refers to functions in z, those functions may not be loaded.

           The linker searches a standard list of directories for the library, which is actually a file named libli-
           brary.a.  The linker then uses this file as if it had been specified precisely by name.

           The directories searched include several standard system directories plus any that you specify with -L.

           Normally the files found this way are library files---archive files whose members are object files.  The
           linker handles an archive file by scanning through it for members which define symbols that have so far been
           referenced but not defined.  But if the file that is found is an ordinary object file, it is linked in the
           usual fashion.  The only difference between using an -l option and specifying a file name is that -l sur-
           rounds library with lib and .a and searches several directories.

       -Ldir
           Add directory dir to the list of directories to be searched for -l.

       LIBRARY_PATH
           The value of LIBRARY_PATH is a colon-separated list of directories, much like PATH.  When configured as a
           native compiler, GCC tries the directories thus specified when searching for special linker files, if it
           can’t find them using GCC_EXEC_PREFIX.  Linking using GCC also uses these directories when searching for
           ordinary libraries for the -l option (but directories specified with -L come first).

[링크 : http://linux.die.net/man/1/gcc]
Posted by 구차니