프로그램 사용/vi2016. 11. 4. 15:31

12.04 LTS에서 기본으로 vi가 연결되어 있는데

이래서 뜬금없이 X server 연결한다고 경고가 떴구나 싶은데..


$ alias

alias vi='vim -X' 


$ man vim

      -X          Don't connect to the X server.  Shortens startup time in a terminal, but the window title and

                   clipboard will not be used. 


도대체 왜 이걸 기본으로 해둔거지?

[링크 : http://stackoverflow.com/questions/12961680/why-does-vim-connect-to-x-by-default]

'프로그램 사용 > vi' 카테고리의 다른 글

vi ctrl-s / ctrl-q  (0) 2016.11.09
vim 버전별 옵션 차이  (0) 2016.11.08
vi 버전 차이?  (0) 2016.07.09
vi 문자열 치환  (0) 2015.08.04
vi 사각형 선택하기  (0) 2014.09.11
Posted by 구차니

으아 복잡해 -_-!!!

결론 : svn에서 복구 하려면 복사본 만들고 삭제해라!


cp -a ori back 

svn delete –force ori

svn revert ori

cp -a back ori 


[링크 : http://k44.kr/?p=2908]

Posted by 구차니

TextFX는 기본이었나? 기억이 안나네..

없으면 깔고 ㅋ


TextFX - TextFX Viz 에서

Visible / InVisible 관련 copy / delete를 하면된다.

그런데.. Copy Visible Selection을 하면 엔터가 죄다 날아가서 붙는지라

가장 편한건(?) 원본을 복사해서 접은 다음 Delete Invisible Selection을 해서 삭제하고


접혔던 부분은 공백으로 남아 버리니

편집 - 줄단위 편집 - 빈줄 제거 (공백 문자 포함)

해주는게 가장 안정적인 방법인 듯

[링크 : https://sourceforge.net/p/notepad-plus/discussion/331754/thread/54db02cc/]

'프로그램 사용 > notepad++' 카테고리의 다른 글

notepad++ ascii만 검색하기  (0) 2017.06.15
notepad++ 정규표현식을 이용한 아이피 추출  (0) 2017.02.09
notepad++ timestamp 찍기  (0) 2016.08.10
notepad++ 플러그인(ctags/vi)  (0) 2015.01.08
notepad2 와 notepad++  (16) 2008.12.30
Posted by 구차니
프로그램 사용/screen2016. 10. 22. 10:28

예전에 잠시 해보고 잊고 있었는데

다시 시도..


$ tty

/dev/pts/1


$ screen

$ tty

/dev/pts/6


ctrl-a,c

$ tty

/dev/pts/7


ctrl-a,n

window change


ctrl-a,d detach

[detached from 4014.pts-1.odroid_1]

// detach 시에는 다른 창을 만들어 두었더라도 전부 같이 떨어진다.


$ ps -ef | grep -i screen

odroid    4014     1  0 11:49 ?        00:00:00 SCREEN


$ screen -r

reattach


ctrl-a,? 도움말

                       Screen key bindings, page 1 of 2.


                       Command key:  ^A   Literal ^A:  a


  break       ^B b         license     ,            removebuf   =

  clear       C            lockscreen  ^X x         reset       Z

  colon       :            log         H            screen      ^C c

  copy        ^[ [         login       L            select      '

  detach      ^D d         meta        a            silence     _

  digraph     ^V           monitor     M            split       S

  displays    *            next        ^@ ^N sp n   suspend     ^Z z

  dumptermcap .            number      N            time        ^T t

  fit         F            only        Q            title       A

  flow        ^F f         other       ^A           vbell       ^G

  focus       ^I           pow_break   B            version     v

  hardcopy    h            pow_detach  D            width       W

  help        ?            prev        ^H ^P p ^?   windows     ^W w

  history     { }          quit        \            wrap        ^R r

  info        i            readbuf     <            writebuf    >

  kill        K k          redisplay   ^L l         xoff        ^S s

  lastmsg     ^M m         remove      X            xon         ^Q q


                  [Press Space for next page; Return to end.]


                       Screen key bindings, page 2 of 2.


^]   paste .

"    windowlist -b

-    select -

0    select 0

1    select 1

2    select 2

3    select 3

4    select 4

5    select 5

6    select 6

7    select 7

8    select 8

9    select 9

I    login on

O    login off

]    paste .

|    split -v

:kB: focus prev



                        [Press Space or Return to end.]  


한개 터미널에서 screen 실행중에 다른 터미널에서 확인한 결과

$ ps -ef | grep -i screen

odroid    4014     1  0 11:49 ?        00:00:00 SCREEN

odroid   17153  1554  0 11:57 pts/1    00:00:00 screen -r 


실수로 screen 안에서 screen -r 하니 이런 에러가 뜨네

$ screen -r

There is a screen on:

        4014.pts-1.odroid_1     (22/10/16 11:49:14)     (Attached)

There is no screen to be resumed. 


두개 터미널에서 detach 하니 이렇게 뜬다.

detach한 pts 번호가 뜨니 골라서 붙이면 된다.

물론 프로세스 정보 상으로는 tty가 ?로 뜸

$ screen -r

There are several suitable screens on:

        24631.pts-12.odroid_1   (22/10/16 12:02:24)     (Detached)

        4014.pts-1.odroid_1     (22/10/16 11:49:13)     (Detached)

Type "screen [-d] -r [pid.]tty.host" to resume one of them. 


$ ps -ef | grep -i screen

odroid    4014     1  0 11:49 ?        00:00:00 SCREEN

odroid   24631     1  0 12:02 ?        00:00:00 SCREEN


머랄까.. screen 프로그램이 중재자로

자신을 통해서 여러개의 pts를 오갈수 있는 컨셉?


[링크 : https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/]

2012/07/07 - [Linux] - ssh 를 통해 프로그램 실행후 로그아웃 해도 종료되지 않게 하기

2012/07/09 - [Linux/Ubuntu] - screen 유틸의 프로세스 구조(?)


Posted by 구차니

DISTCC_HOSTS는 왼쪽 부터 오른쪽 순서로 우선순위가 결정된다.

왼쪽이 가장 선호되는 호스트 이고, 가장 마지막이 선호도가 낮아진다.

그런 이유로 가장 마지막에 localhost를 넣어 주는게 좋다고 한다.


Host Specifications


A "host list" tells distcc which machines to use for compilation. In order, distcc looks in the $DISTCC_HOSTS environment variable, the user's $DISTCC_DIR/hosts file, and the system-wide host file. If no host list can be found, distcc emits a warning and compiles locally.

The host list is a simple whitespace separated list of host specifications. The simplest and most common form is a host names, such as


localhost red green blue

distcc prefers hosts towards the start of the list, so machines should be listed in descending order of speed. In particular, when only a single compilation can be run (such as from a configure script), the first machine listed is used (but see --randomize below). 


--randomize

Randomize the order of the host list before execution.


[링크 : https://linux.die.net/man/1/distcc]

'프로그램 사용 > distcc & ccache' 카테고리의 다른 글

rpi distcc with ccache 실패 ㅠㅠ  (0) 2021.04.30
rpi distcc 성공인데 실패  (0) 2021.04.28
distcc-pump 시도..  (0) 2016.10.18
distcc 를 DHCP 에서.. 2?  (0) 2016.10.18
distcc /etc/distcc/hosts와 DISTCC_HOSTS  (0) 2016.10.17
Posted by 구차니

돌아는 가는데.. 

왜 라즈베리만 돌고, odroid_1은 놀고 있지? 흐음...


$ cat /etc/distcc/hosts

# As described in the distcc manpage, this file can be used for a global

# list of available distcc hosts.

#

# The list from this file will only be used, if neither the

# environment variable DISTCC_HOSTS, nor the file $HOME/.distcc/hosts

# contains a valid list of hosts.

#

# Add a list of hostnames in one line, seperated by spaces, here.

#+zeroconf

odroid_1,cpp,lzo

odroid_2,cpp,lzo

raspberrypi,cpp,lzo 


위와 같이 cpp,lzo를 주고 make 하니 이런 경고가 발생하는데

$ make -j12 CC=distcc

distcc[7640] Warning: INCLUDE_SERVER_PORT not set - did you forget to run under 'distcc-pump'?

distcc[7640] (dcc_build_somewhere) Warning: failed to get includes from include server, preprocessing locally 


distcc-pump 를 실행해주면 자동으로 데몬처럼 작동하는데 죽이질 못하네?

$ distcc-pump --startup

export INCLUDE_SERVER_PID='7700'

export INCLUDE_SERVER_DIR='/tmp/distcc-pump.fyGaPI'

export INCLUDE_SERVER_PORT='/tmp/distcc-pump.fyGaPI/socket'

export PATH='/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games'



$ distcc-pump make -j12 CC="distcc gcc -std=gnu99"

__________Using distcc-pump from /usr/bin

__________Using 3 distcc servers in pump mode

  CHK     include/linux/version.h

  CHK     include/generated/kernelversion.h

  HOSTCC  scripts/basic/fixdep


...


  LD      arch/arm/vfp/vfp.o

  LD      arch/arm/vfp/built-in.o

__________Warning: 1 pump-mode compilation(s) failed on server, but succeeded locally.

__________Distcc-pump was demoted to plain mode.  See the Distcc Discrepancy Symptoms section in the include_server(1) man page.

__________Shutting down distcc-pump include server

 


셧다운 해줘도 안 죽어!!! 머지?

$ distcc-pump --help

Usage:

    pump COMMAND [ARG...]

or

    pump --startup

    pump --shutdown 


[링크 : https://lists.samba.org/archive/distcc/2012q4/004315.html]

[링크 : https://wiki.archlinux.org/index.php/Distcc]

'프로그램 사용 > distcc & ccache' 카테고리의 다른 글

rpi distcc 성공인데 실패  (0) 2021.04.28
distcc hosts 파일과 순서  (0) 2016.10.19
distcc 를 DHCP 에서.. 2?  (0) 2016.10.18
distcc /etc/distcc/hosts와 DISTCC_HOSTS  (0) 2016.10.17
distcc zeroconf 와 avahi  (0) 2016.10.17
Posted by 구차니

생각을 해보니..

distcc를 구동할때

/etc/default/distcc에서 설정된 값을 통해 listen할 ip를 설정하게 되는데


/etc/hosts에 의해 자기 자신의 이름을 resolve하게 되니

항상 127.0.0.1 밖에 설정이 안될거고


그런 이유로 samba를 통해서 resolve하게 하려고 했더니

/etc/hosts에서 삭제하고


/etc/rc?.d 에서 distcc가 rc.local 보다 일찍 수행되는 바람에

삼바가 구동되기 이전에 distcc 실행되서 자기 자신의 아이피를 resolve 할 수 없는 상황..


그러니까..

'hostname -I'를 이용해서 자기 아이피를 받아 올 수 있으면...

가능하려나?


이것저것 넣어 보는데 안됨 ㅠㅠ

$ vi /etc/init.d/distcc

 55 # construct access list

 56 ALLOW=""

 57 for net in $ALLOWEDNETS

 58 do

 59         ALLOW="$ALLOW --allow $net"

 60 done 


 66 if test -n "$LISTENER"; then

 67         DAEMON_ARGS="$DAEMON_ARGS --listen $LISTENER"

 68 fi

그냥.. distcc init 스크립트를 손봐야 하나?



일단은.. 이 정도로 만족 중.. 집에 가서 여러 대 놓고 해봐야지

$ cat /etc/default/distcc

ALLOWEDNETS=$(printf "%s/24" $(hostname -I))

LISTENER="$(hostname -I)" 


[링크 : http://stackoverflow.com/.../how-can-i-concatenate-string-variables-in-bash]


그래도 서비스로 자동 구동되는건 실패... ㅠㅠ

'프로그램 사용 > distcc & ccache' 카테고리의 다른 글

distcc hosts 파일과 순서  (0) 2016.10.19
distcc-pump 시도..  (0) 2016.10.18
distcc /etc/distcc/hosts와 DISTCC_HOSTS  (0) 2016.10.17
distcc zeroconf 와 avahi  (0) 2016.10.17
distcc 를 DHCP 에서..  (0) 2016.09.28
Posted by 구차니

export DISTCC_HOSTS도 좋지만

이렇게 파일로 박아 둘수도 있는데.. 얘가 wins resolve가 가능하려나?

$ cat /etc/distcc/hosts

# As described in the distcc manpage, this file can be used for a global

# list of available distcc hosts.

#

# The list from this file will only be used, if neither the

# environment variable DISTCC_HOSTS, nor the file $HOME/.distcc/hosts

# contains a valid list of hosts.

#

# Add a list of hostnames in one line, seperated by spaces, here.

#+zeroconf

odroid_1,cpp,lzo

odroid_2,cpp,lzo

raspberrypi,cpp,lzo 


$ distcc --show-hosts

odroid_1,cpp,lzo

odroid_2,cpp,lzo

raspberrypi,cpp,lzo 


pump mode 쓰려고 cpp만 넣었더니 lzo도 같이 넣어야 한다고 배짼다 -_-

$ distcc --show-hosts

distcc[6919] (dcc_get_protover_from_features) ERROR: pump mode (',cpp') requires compression (',lzo')

distcc[6919] (dcc_parse_options) ERROR: invalid host options: ,cpp

odroid_2,cpp

raspberrypi,cpp 



커널 빌드 해보니.. 영 되질 않네.. ㅠㅠ

distcc[3645] Warning: INCLUDE_SERVER_PORT not set - did you forget to run under 'distcc-pump'?

distcc[3645] (dcc_build_somewhere) Warning: failed to get includes from include server, preprocessing locally 


[링크 : https://linux.die.net/man/1/include_server]


음.. cpp,lzo 뺴고 하는데 시도는 하는데 받는 쪽에서 배째는 중 ㅠㅠ

distcc[4515] ERROR: nonblocking connect to 192.168.219.139:3632 failed: Connection refused 


'프로그램 사용 > distcc & ccache' 카테고리의 다른 글

distcc-pump 시도..  (0) 2016.10.18
distcc 를 DHCP 에서.. 2?  (0) 2016.10.18
distcc zeroconf 와 avahi  (0) 2016.10.17
distcc 를 DHCP 에서..  (0) 2016.09.28
distcc kernel compile 재시도..  (0) 2016.09.28
Posted by 구차니


+zeroconf

This option is only available if distcc was compiled with Avahi support enabled at configure time. When this special entry is present in the hosts list, distcc will use Avahi Zeroconf DNS Service Discovery (DNS-SD) to locate any available distccd servers on the local network. This avoids the need to explicitly list the host names or IP addresses of the distcc server machines. The distccd servers must have been started with the "--zeroconf" option to distccd. An important caveat is that in the current implementation, pump mode (",cpp") and compression (",lzo") will never be used for hosts located via zeroconf. 

[링크 : https://linux.die.net/man/1/distcc]


avahi 데몬이 있어야 zeroconf가 가능하대서 확인해보니 없.. 다?!

ubuntu 14.04 LTS for odroid

$ distcc -v

Using built-in specs.

COLLECT_GCC=/usr/bin/gcc-4.8.real

COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.8/lto-wrapper

Target: arm-linux-gnueabihf

Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf

Thread model: posix

gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.3) 


요건 라즈베리 jessie

음따!

$ distcc -v

Using built-in specs.

COLLECT_GCC=cc

COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper

Target: arm-linux-gnueabihf

Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf

Thread model: posix

gcc version 4.9.2 (Raspbian 4.9.2-10) 


고로.. zeroconf는 사용불가!


export DISTCC_HOSTS="+zeroconf"

[링크 : https://wiki.debian.org/Distcc]

'프로그램 사용 > distcc & ccache' 카테고리의 다른 글

distcc 를 DHCP 에서.. 2?  (0) 2016.10.18
distcc /etc/distcc/hosts와 DISTCC_HOSTS  (0) 2016.10.17
distcc 를 DHCP 에서..  (0) 2016.09.28
distcc kernel compile 재시도..  (0) 2016.09.28
distcc-pump error  (0) 2016.09.25
Posted by 구차니
프로그램 사용/bind2016. 10. 17. 18:57




A Address

CNAME Canonical Name

MX Mail eXchange

NS  NameServer

PTR PoinTeR record

SOA Start Of Authority



@     IN     SOA    <primary-name-server> <hostmaster-email> (

<serial-number>

<time-to-refresh>

<time-to-retry>

<time-to-expire>

<minimum-TTL> )


The @ symbol places the $ORIGIN directive

[링크 : https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-bind-zone.html]

[링크 : https://help.ubuntu.com/community/BIND9ServerHowto]


$ORIGIN example.com.     ; designates the start of this zone file in the namespace

$TTL 1h                  ; default expiration time of all resource records without their own TTL value

example.com.  IN  SOA   ns.example.com. username.example.com. ( 2007120710 1d 2h 4w 1h )

example.com.  IN  NS    ns                    ; ns.example.com is a nameserver for example.com

example.com.  IN  NS    ns.somewhere.example. ; ns.somewhere.example is a backup nameserver for example.com

example.com.  IN  MX    10 mail.example.com.  ; mail.example.com is the mailserver for example.com

@             IN  MX    20 mail2.example.com. ; equivalent to above line, "@" represents zone origin

@             IN  MX    50 mail3              ; equivalent to above line, but using a relative host name

example.com.  IN  A     192.0.2.1             ; IPv4 address for example.com

              IN  AAAA  2001:db8:10::1        ; IPv6 address for example.com

ns            IN  A     192.0.2.2             ; IPv4 address for ns.example.com

              IN  AAAA  2001:db8:10::2        ; IPv6 address for ns.example.com

www           IN  CNAME example.com.          ; www.example.com is an alias for example.com

wwwtest       IN  CNAME www                   ; wwwtest.example.com is another alias for www.example.com

mail          IN  A     192.0.2.3             ; IPv4 address for mail.example.com

mail2         IN  A     192.0.2.4             ; IPv4 address for mail2.example.com

mail3         IN  A     192.0.2.5             ; IPv4 address for mail3.example.com 

[링크 : https://en.wikipedia.org/wiki/Zone_file]

'프로그램 사용 > bind' 카테고리의 다른 글

bind 설치 및 설정  (0) 2016.10.17
nslookup / bind  (0) 2014.08.25
Posted by 구차니