Linux2010. 2. 5. 16:34
말은 거창한데, ANSI 표준 방식으로
터미널에 글자색이나 배경색을 바꾸는 방법이다.

Table 34-1. Numbers Representing Colors in Escape Sequences

ColorForegroundBackground
black 30 40
red 31 41
green 32 42
yellow 33 43
blue 34 44
magenta 35 45
cyan 36 46
white 37 47

$ echo -e '\E[47;34m'"\033[1mE\033[0m"
흰색배경에 파란색 글씨로 m이라고 출력됨

[링크 : http://www.faqs.org/docs/abs/HTML/colorizing.html]
Posted by 구차니
Linux/Ubuntu2010. 2. 5. 10:03
FC6에서는 /etc/xinetd.d/tftp 라는 파일로 존재했다.

$ cat tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

하지만 우분투에서는 xinet 대신 inet을 사용하며,
경로역시 /etc/inetd.conf 로 변경되었다.

$ cat /etc/inetd.conf
#<off># netbios-ssn     stream  tcp     nowait  root    /usr/sbin/tcpd  /usr/sbin/smbd
tftp            dgram   udp     wait    nobody  /usr/sbin/tcpd  /usr/sbin/in.tftpd /srv/tftp

어쨌거나 저쨌거나, 위의 빨간색 굵게 칠해진 부분이 tftp 경로이다.
음.. 기본값이 다르군!
Posted by 구차니
Linux/Ubuntu2010. 2. 4. 21:20
우분투 데스크탑 버전만 쓰다보니, 여러 사용자의 권한을 생각해본적이 없다.
아무튼, 이런저런 이유로 인해 우분투에서 여러 사람이 쓰게 되었는데

역시나.. 초기추가하는 사용자는 기본적으로 sudo user로 추가가 된다.
간단하게 sudo 를 사용할수 있도록 하는 방법은 admin 그룹에 추가하는 것이다.

/etc/sudoers 에 WHEEL 이란건 먼지 좀 읽어봐야 할듯하다.

[링크 : http://zicman.egloos.com/2449683]
[링크 : http://wiki.kldp.org/wiki.php/sudo]

+
2019.10.28

아래의 명령을 이용하면 sudoer로 등록이 가능하다,.


Posted by 구차니
Linux2010. 2. 4. 20:58
sudo는 debian이던, fedora던 존재하지만,
아무튼, 일시적으로 root의 권한을 지니게하고 일반적으로 root의 행동은 log에 남지 않지만
sudo를 통해서 작업하면 로그로도 남기기 때문에 상대적으로 보안이 좀더 강화된다.

아무튼,
페도라에서는 su 로 root 쉘을 사용하지만
우분투에서는 sudo 로 일시적으로 상승시켜 명령을 실행한다.

물론 sudo -i 라는 명령을 이용해서 루트 쉘로 이동할수는 있다.
페도라의 su 명령어는 디렉토리가 변경되지 않는 반면,
우분투의 sudo -i 는 root의 홈 디렉토리(일반적으로 /root)로 이동한다.
sudo -isu - 와 동일한 느낌이다.

sudo -K | -L | -V | -h | -k | -l | -v
sudo [-HPSb] [-a auth_type] [-c class|-] [-p prompt] [-u username|#uid] {-e file [...] | -i | -s | command}

-i

The -i (simulate initial login) option runs the shell specified in the passwd(5) entry of the user that the command is being run as. The command name argument given to the shell begins with a - to tell the shell to run as a login shell. sudo attempts to change to that user's home directory before running the shell. It also initializes the environment, leaving TERM unchanged, setting HOME , SHELL , USER , LOGNAME , and PATH , and unsetting all other environment variables. Note that because the shell to use is determined before the sudoers file is parsed, a runas_default setting in sudoers will specify the user to run the shell as but will not affect which shell is actually run.

[링크 : http://linux.die.net/man/8/sudo]


기본 sudoers 파일 내용
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults    env_reset

# Uncomment to allow members of group sudo to not need a password
# %sudo ALL=NOPASSWD: ALL

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
 
[링크 : https://help.ubuntu.com/community/Sudoers]  

Posted by 구차니
Linux/Ubuntu2010. 2. 4. 17:24
우분투에서는 gnome 자동로그인을 지원한다.
설치중에 설정이 가능한데, 설정하지 않고 설치후에 변경하는 법은 다음과 같다.

Step 1. 로그인 화면을 실행한다.


Step 2. 로그인 화면 설정에서 "잠금 풀기"를 한다음 "자동으로 로그인" 에 유저를 선택한다.

'Linux > Ubuntu' 카테고리의 다른 글

tftp 설정경로  (0) 2010.02.05
sudo 사용가능하도록 설정하기  (0) 2010.02.04
ubuntu 9.10 에서 /dev/fb 만들기  (4) 2010.02.01
우분투에서 rpm 패키지 설치 2  (2) 2010.01.29
우분투에서 FC6에서 만든 LVM 마운트하기  (0) 2010.01.25
Posted by 구차니
Linux2010. 2. 4. 10:06
우분투에서는(Gnome)
/etc/hostname 파일을 수정하면 된다.
[링크 : http://servermaster.pe.kr/tt/24]

페도라에서는(Gnome)
/etc/sysconfig/network 파일을 수정하거나,
네트워크 설정의 DNS 탭에서 호스트명을 수정해주면 된다.


[링크 : http://www.superuser.co.kr/linux/hostname/page03.htm]
Posted by 구차니
Linux/Ubuntu2010. 2. 1. 16:31
우분투에서는 init 3 명령어로 Xwindow를 종료할수 없다.
정 안되면 magic key를 이용해서 다른 콘솔로 이동한다. ctrl-alt-f1
[링크 : http://simplism.kr/wordpress/?p=258]

grub2는 /boot/grub 와 /etc/default/grub 그리고 /etc/grub.d 로 나뉘는데,
수정은 /etc/default/grub를 한뒤, sudo update-grub로 설정을 변경해준다.
[링크 : http://www.simdoly.com/3935]

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" 라는 문구가 기본인데,
vga=791 를 추가해준다. 791의 의미는 1024x768에 16bit color의 framebuffer를 생성하라는 의미이다.
fbset 패키지를 설치해도 /dev/fb가 생성되지는 않는다.
[링크 : http://harrison3001.blogspot.com/2009/09/grub-2-graphical-boot-tips-to-set.html]
[링크 : https://wiki.ubuntu.com/FrameBuffer]


2010.02.22 추가
위의 내용은 ubuntu 9.10 Desktop Edition 에서 테스트 후 올려진 글입니다.
Posted by 구차니
Linux2010. 2. 1. 15:30

메모장이나 각종 텍스트 에디터에서 지원하는
"완전히 일치하는 단어" 검색은 grep 에서 -w 옵션을 사용하면 된다.

-w, --word-regexp
    Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.

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

[링크 : http://www.unix.com/unix-dummies-questions-answers/42144-find-exactly-word-grep-command.html]
Posted by 구차니
Linux/Ubuntu2010. 1. 29. 15:26
rpm 을 막상 설치하려니 에러가 발생한다.

morpheuz@ubuntu:/media/iso/host$ rpm -ivh --nodeps --ignorearch stlinux22-host-*.rpm
rpm: please use alien to install rpm packages on Debian, if you are really sure use --force-debian switch. See README.Debian for more details.

Fedora쪽 도움말에는 이러한 옵션이 안나오고, --help 에도 나오지 않는다.
[링크 : http://linux.die.net/man/8/rpm]

Ubuntu에 rpm 설치후 --help를 해보니
$ rpm --help
설치/업그레이드/삭제 옵션:
      --aid                         add suggested packages to transaction
      --allfiles                    특정 파일을 생략하기 위한 설정이 적용된 경우에도, 패키지 안의 모든 파일을
                                    설치합니다
      --allmatches                  <패키지> 이름과 일치하는 패키지는 모두 제거합니다 (<패키지>에 여러개의
                                    패키지를 동시에 지정할 경우에는 오류가 발생합니다)
      --badreloc                    relocate files in non-relocatable package
  -e, --erase=<패키지>+                패키지를 (제거) 삭제합니다
      --excludedocs                 패키지에 포함된 문서 파일을 설치하지 않습니다
      --excludepath=<경로>            <경로>로 시작되는 파일은 설치하지 않습니다
      --fileconflicts               detect file conflicts between packages
      --force                       --replacepkgs 와 --replacefiles 옵션을 동시에 사용합니다
      --force-debian                force installation of rpm on Debian system
아마도, 데비안용으로 추가된듯한 느낌이다.

2009/08/31 - [Linux/Ubuntu] - 우분투에서 rpm 설치하기 - install rpm package on ubuntu
Posted by 구차니
Linux2010. 1. 28. 19:43
ar은 *.a 파일에 들어있는 함수들의 목록을 얻어내고
ldd는 단순하게 실행파일이 링킹(linking)하고 있는 so들의 목록을 얻어내고
nm은 *.so 파일에 들어있는 함수들의 목록을 얻어낸다.

nm - list symbols from object files

Synopsis
nm [-a|--debug-syms] [-g|--extern-only] [-B] [-C|--demangle[=style]] [-D|--dynamic] [-S|--print-size] [-s|--print-armap] [-A|-o|--print-file-name][--special-syms] [-n|-v|--numeric-sort] [-p|--no-sort] [-r|--reverse-sort] [--size-sort] [-u|--undefined-only] [-t radix|--radix=radix] [-P|--portability] [--target=bfdname] [-fformat|--format=format] [--defined-only] [-l|--line-numbers] [--no-demangle] [-V|--version] [-X 32_64] [--help] [objfile...]

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

You can use
nm -Ca /lib/mylib.so.1
man nm for full

[링크 : http://www.linuxquestions.org/questions/linux-general-1/list-library-function-of-a-shared-library-.so-438693/]

+
2016.06.13

For the shared libs:
Code:
nm -D /lib/mylib.so.1


Posted by 구차니