Linux2010. 3. 17. 16:24
grep --color=auto 를 하면 자동으로 색상을 넣어주는데
검색 키워드를 "빨간색"으로 넣어주는 기능이 좀 마음에 든다.
그런데 가끔, 검색 내용뿐만 아니라 전체 내용에서 그 부분만 색상을 바꾸고 싶다면 어떻게 하면 되려나?
(일종의 터미널용 문법강조/신택스 하이라이트/syntax highlight)

grep 명령어에는 Before & After를 지원한다.
       -A NUM, --after-context=NUM
              Print NUM  lines  of  trailing  context  after  matching  lines.
              Places  a  line  containing  --  between  contiguous  groups  of
              matches.

       -B NUM, --before-context=NUM
              Print  NUM  lines  of  leading  context  before  matching lines.
              Places  a  line  containing  --  between  contiguous  groups  of
              matches.

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

검색어의 앞뒤로 조금더 출력해주느 기능인데, 검색어들 간에 거리가 적당하게 유지된다면
특정값을 넣어주면, 전체 문서에서 그 부분만 색상이 변해서 나오게 된다.

문서의 전체 길이를 재려면
"wc -l" 로 하면되고
       -l, --lines
              print the newline counts

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

파일이 아닐경우 pipe를 통해 넘겨주면 된다.

예를들어 grep의 manpage 에서 it만 강조하고 싶다면
# man grep | grep -A `man grep | wc -l` -B `man grep | wc -l` it
라고 입력하면 된다.

아래는 it의 빈도가 낮아서 a로 바꾸어서 검색해본 결과.
a에만 색상이 나오고 터미널 스크롤바는 길어지고 ㅋㅋ

음.. 깔끔한 방법은 없나?

Posted by 구차니
macosx
이걸 어떻게 읽어야 할까?


ma cos x
macos x
mac osx
mac os x

수학과 컴퓨터와 상표가 뒤석인 인지능력 OTL
[링크 : http://download.videolan.org/pub/videolan/vlc/0.8.6/]

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

퇴근일기 - 20100331  (4) 2010.04.01
비오는 사무실에서  (4) 2010.03.20
오늘 일이 안되는건  (2) 2010.03.10
직장일기 - 20100303  (0) 2010.03.03
일하기 싫어서 미친짓!  (0) 2010.02.24
Posted by 구차니
프로그램 사용/VLC2010. 3. 17. 14:38
build server는 Fedora Core6를 쓰고  glibc2.5를 사용한다.
그리고 target 역시 glibc2.5를 사용한다.


그런데.. vlc-1.0.5는 glibc2.5-2.8은 thread-safe 하지 않다고 거부한다 ㄱ-

아래와 같은 에러가 발생하는데
libtool: link: warning: library `/opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib/libdbus-1.la' was moved.
...
../src/.libs/libvlc.so: undefined reference to `__vasprintf_chk'
../src/.libs/libvlc.so: undefined reference to `__asprintf_chk'
collect2: ld returned 1 exit status
내가 사용하는 타켓의 경로도 아니고.
묘한 곳에서 묘한 녀석을 링킹하면서 에러를 발생한다.

간단한 해결책이라고 생각했던 녀석으로
위의 la 파일의 libdir 변수를 수정해도 libtool: link: warning 하나만 사라질뿐 여전히 컴파일은 되지 않는다.
# libdbus-1.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5.10 (1.1220.2.130 2004/09/19 12:13:49)
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# The name that we can dlopen(3).
dlname='libdbus-1.so.2'

# Names of this library.
library_names='libdbus-1.so.2.0.0 libdbus-1.so.2 libdbus-1.so'

# The name of the static archive.
old_library='libdbus-1.a'

# Libraries that this one depends upon.
dependency_libs='-lnsl'

# Version information for libdbus-1.
current=2
age=0
revision=0

# Is this an already installed library?
installed=yes

# Should we warn about portability when linking against -modules?
shouldnotlink=no

# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''

# Directory that this library needs to be installed in:
libdir='/usr/lib'

그리고 지뢰밭을 피하는 방법으로 자주 검색되던 아래의 글역시
결과적으로 모든 la 파일의 내용을 변경해주어야 하는 번거로움이 생긴다.

[링크 : http://www.metastatic.org/text/libtool.html]

그런데, 저 wasprintf 가 머하는 녀석인가 검색을 해봤더니
glibc2.8에서 지원하는 함수라고 한다. 현재 사용하는건 2.5 버전이니 당연히 저런 함수가 존재할리 없고
그런 이유로 glibc를 업그레이드 하기 전에는 딱히 방법이 없어 보인다.

[링크 : http://infomaru.com/?mid=os_linux_basic&listStyle=gallery&document_srl=6197]

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

x264 와 h264의 관계?  (0) 2010.04.15
VLC nightly build  (0) 2010.04.13
VLC GLIBC runtime error  (0) 2010.03.16
VLC 1.0.5 컴파일시 magic.h 오류  (0) 2010.03.10
x264 , libavcodec 다운로드  (0) 2010.02.24
Posted by 구차니
프로그램 사용/VLC2010. 3. 16. 15:53
glibc 2.5 에서 2.7 사이의 gettext()는 쓰레드에 안전하기 않기 때문에
VLC에서 상기버전의 glibc를 사용하고 있다면 실행시에 에러를 발생하고 실행을 하지 않는다.

vlc-1.0.5/src/misc/linux_specific.c 파일의 75라인부터 아래의 내용이 존재한다.
#ifdef __GLIBC__
# include 
# include 
#endif

void system_Init (libvlc_int_t *libvlc, int *argc, const char *argv[])
{
#ifdef __GLIBC__
    const char *glcv = gnu_get_libc_version ();

    /* gettext in glibc 2.5-2.7 is not thread-safe. LibVLC keeps crashing,
     * especially in sterror_r(). Even if we have NLS disabled, the calling
     * process might have called setlocale(). */
    if (strverscmp (glcv, "2.5") >= 0 && strverscmp (glcv, "2.8") < 0)
    {
        fputs ("LibVLC has detected an unusable buggy GNU/libc version.\n"
               "Please update to version 2.8 or newer.\n", stderr);
        fflush (stderr);
#ifndef DISABLE_BUGGY_GLIBC_CHECK
        abort ();
#endif
    }
#endif

그리고 vlc-1.0.5/configure.ac 의 532 라인에는 다음과 같은 내용이 존재한다.
dnl
dnl Buggy glibc prevention. Purposedly not cached.
dnl Ubuntu alone has 20 bug numbers for this...
dnl
AC_MSG_CHECKING(for buggy GNU/libc versions)
AC_PREPROC_IFELSE([
#include <limits.h>
#if defined (__GLIBC__) && (__GLIBC__ == 2) \
  && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
# error GNU/libc with dcgettext killer bug!
#endif
], [
  AC_MSG_RESULT([not present])
], [
  AC_MSG_RESULT([found])
  AS_IF([test "x${enable_nls}" != "xno" || test "x${enable_mozilla}" != "xno"], [
    AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
work-around for this. Check with your distribution vendor on how to update the
glibc run-time. Alternatively, build with --disable-nls --disable-mozilla and
be sure to not use LibVLC from other applications/wrappers.])
  ], [
    AC_DEFINE(DISABLE_BUGGY_GLIBC_CHECK, 1, [Disables runtime check for buggy glibc.])
  ])
])

위의 abort(); 를 주석처리 하거나
DISABLE_BUGGY_CLIBC_CHECK를 미리 선언하거나 하면 될꺼 같은데 어떻게 해야 하려나?
(아무튼 abort(); 를 주석처리 하면 실행은 된다.)

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

VLC nightly build  (0) 2010.04.13
VLC 크로스컴파일 - 멀고도 험하다 ㅠ.ㅠ  (0) 2010.03.17
VLC 1.0.5 컴파일시 magic.h 오류  (0) 2010.03.10
x264 , libavcodec 다운로드  (0) 2010.02.24
vlc-1.0.5 cross compile  (3) 2010.02.09
Posted by 구차니
유튜브의 이미지는 일반적으로


http://i3.ytimg.com/vi/r3jyCf_Id2o/default.jpg

이런식으로 default.jpg로 나온다.
하지만 default.jpg 대신 hqdefault.jpg 로 하면 큰 사진으로 받아오게 된다.


http://i3.ytimg.com/vi/r3jyCf_Id2o/hqdefault.jpg


default는 120x90
hqdefault는 480x360 해상도로 제공된다.

ytimg.com 은..
YouTube IMaGe 의 약자인가?!


2010.04.09 추가
굳이 i3 이런식으로 숫자가 없어도 불려온다.
범용으로 사용하기에는
i.ytimg.com/vi/[videoid]/default.jpg 혹은
i.ytimg.com/vi/[videoid]/hqdefault.jpg 이 적절해 보인다.

'프로그램 사용 > 유튜브(youtube)' 카테고리의 다른 글

youtube xml / RSS 주소  (0) 2010.04.09
youTube 경로로 VLC 플레이가 안됨  (0) 2010.04.01
3D 유튜브  (6) 2010.03.15
URL encode  (2) 2010.03.02
유튜브 파일 다운로드 하기(download youtube as file)  (6) 2010.02.26
Posted by 구차니
스테레오 카메라야 머.. 가격이 2배면 간단하게 구현가능한데
음.. 아무튼 어떻게 올리고 어떤 카테고리에 들어있는건진 모르겠지만
유튜브에서 셀로판지나 매직아이 보듯 3D로 볼수 있는 컨텐츠가 있었다.




[링크 : http://www.youtube.com/watch?v=SE-u3Ga_oOY&feature=channel]

여러가지 설정중에 Cross-eyed로 하면 매직아이 보듯 사파리눈 하듯 보면 보이는데
역시.. 자연스럽긴해도 눈아파 죽겠다 ㄱ-

제목이 "YouTube 3D Player Test ( yt3d:enable=true )" 이다.
[링크 : http://www.youtube.com/watch?v=89cGA4-yPRw&feature=related]
Posted by 구차니
분류가 모호한 글2010. 3. 15. 14:20
'국가 + 언어'의 혼합정보를 제공해주는 값이다.
지역정보라고 해야하려나, 국가정보라고 해야 하려나..

[링크 : http://coffeenix.net/doc/misc/locale.html]
[링크 : http://en.wikipedia.org/wiki/Locale]
[링크 : http://ko.wikipedia.org/wiki/로케일]

'분류가 모호한 글' 카테고리의 다른 글

티스토리 티에디션 - 2% 부족해  (4) 2010.05.11
1노트 = 1.85200 킬로미터  (2) 2010.04.16
amr codec  (0) 2010.01.13
AMR(Adaptive Multi-Rate) / SAMR  (0) 2010.01.06
고편평도 타이어  (2) 2010.01.04
Posted by 구차니
Linux2010. 3. 15. 14:00
MIME은 Multipurpose Internet Mail Extensions 의 약자로
원래 메일을 주고 받을때 파일의 종류를 알려주기 위해 사용한다.
[링크 : http://ko.wikipedia.org/wiki/MIME]

그런데 왜 리눅스에서 MIME을 쓰는지 궁금했는데 음.. 귀차니즘이.. OTL
아무튼, GDE(Gnome Desktop Environment)의 파일매니저인 natilus 에서 MIME으로
파일을 인지한다고 한다. MIME을 통해 실행할 프로그램의 연결도 한다.

The Nautilus file manager uses MIME types to identify the type of a file. The file manager needs to know the MIME type of a file to perform the following tasks:

  • Open the file in an appropriate application.

  • Display a string that describes the type of file.

  • Display an appropriate icon to represent the file.

  • Display a list of other applications that can open the file.

If you add a new application, you must ensure that other applications can recognize the files associated with the application. You must perform several tasks to enable other applications to detect the MIME type of the application files.


[링크 : http://docs.sun.com/app/docs/doc/817-5310/6mkpbn3tu?a=view]
[링크 : http://library.gnome.org/admin/system-admin-guide/stable/mimetypes-intro.html.ko]

FC6에서는
/usr/share/mime 하위에 카테고리 별로 존재한다.
$ ll /usr/share/mime
total 212
-rw-r--r-- 1 root root  2393 Feb 16 13:30 aliases
drwxr-xr-x 2 root root 12288 Feb 16 13:30 application
drwxr-xr-x 2 root root  4096 Feb 16 13:30 audio
-rw-r--r-- 1 root root 13774 Feb 16 13:30 globs
drwxr-xr-x 2 root root  4096 Feb 16 13:30 image
drwxr-xr-x 2 root root  4096 Feb 16 13:30 inode
-rw-r--r-- 1 root root 11904 Feb 16 13:30 magic
drwxr-xr-x 2 root root  4096 Feb 16 13:30 message
-rw-r--r-- 1 root root 50520 Feb 16 13:30 mime.cache
drwxr-xr-x 2 root root  4096 Feb 16 13:30 model
drwxr-xr-x 2 root root  4096 Feb 16 13:30 multipart
drwxr-xr-x 2 root root  4096 Feb 16 13:30 packages
-rw-r--r-- 1 root root  5680 Feb 16 13:30 subclasses
drwxr-xr-x 2 root root  4096 Feb 16 13:30 text
drwxr-xr-x 2 root root  4096 Feb 16 13:30 video
-rw-r--r-- 1 root root    56 Feb 16 13:30 XMLnamespaces


CUPS(samba, Common Unix Printing System)에서도 이러한 MIME을 사용하는데
/etc/cups/mime.types 파일에서 내용을 볼수있다.

xdg(X Desktop Group)
/etc/xdg 에서는
Gnome의 시작 프로그램 설정 및 메뉴에 관련된 파일이 존재한다.
[링크 : http://en.wikipedia.org/wiki/Freedesktop.org]

'Linux' 카테고리의 다른 글

mkfs에는 quick format 없나요?  (0) 2010.03.19
grep으로 원하는 문자열 색상 바꾸기?  (2) 2010.03.17
glibc는.. 설치시 매~~~우 주의를 요합니다 ㄱ-  (0) 2010.03.11
glibc 컴파일하기  (0) 2010.03.11
*.la 파일 - libtool  (0) 2010.03.09
Posted by 구차니
개소리 왈왈2010. 3. 15. 12:22
저번에 스킨을 뒤엎으면서
구글 애널틱스 코드가 빠진걸 저~~언혀 생각도 못하고 있었다.
머.. 많이 오면 좋고, 안오면 그만이지.. 하면서도

통계를 내는 재미도 쏠쏠했는데 흐음..
넣는것도 귀찮고.. 될대로 되라지...




귀찮아 ㄱ-



아무튼 블로그 스킨 바꾸면 해야할일
1. Google Syntax Highlight
2. Tag Cloud
3. Google Analytics


그나마 BBCode 안한게 다행인가? ㄱ-

'개소리 왈왈' 카테고리의 다른 글

나라를 지키고 왔습니다!  (6) 2010.03.23
친구야! 니가 이 패턴을 쓰다니!!  (4) 2010.03.18
달 (moon)  (5) 2010.03.08
소음공해 그리고 112 -> 120  (4) 2010.03.08
내가 192 라니!!!  (8) 2010.02.28
Posted by 구차니
회사일/STLinux2010. 3. 15. 11:32
STLinux2.3용 타겟에서 glibc 크로스 컴파일은 안되고
타겟보드에서 직접 컴파일을 시도했다.

음.. 일단 옵션은

./configure --disable-sanity-checks --without-selinux

두가지를 주고 했다.
--disable-sanity-checks 를 하지 않으면
*** On GNU/Linux systems the GNU C Library should not be installed into
*** /usr/local since this might make your system totally unusable.
*** We strongly advise to use a different prefix.  For details read the FAQ.
*** If you really mean to do this, run configure again using the extra
*** parameter `--disable-sanity-checks'.
이런 에러가 발생한다.

원래 sanity check는
Optional Features:
  --disable-sanity-checks really do not use threads (should not be used except
                          in special situations) [default=yes]
thread를 사용하지 않도록 하는 거라는데 음..
/usr/local에 설치하도록 강요하는게 왜 .. 이 옵션일까?




항상 그러하듯 OOM은 어쩔수 없는 ㄱ-
gcc   -nostdlib/-nostarfiles -r -o /ro-t/glibcbuild/libc_pic.vs \
         -Wl,-d -Wl,--whoce-archie /root/glibc/build/lib2_pic.a

# cd glibc/build
# sh4-linux-gcc   -nostdlib -nostartfiles -r -o libc_pic.os \
         -Wl,-d -Wl,--whole-archive libc_pic.a

'회사일 > STLinux' 카테고리의 다른 글

stlinux iso 다운로드  (0) 2011.11.24
VLC 와 pkg-config  (0) 2010.03.09
ffmpeg 크로스컴파일시 오류발생 (STLinux2.2)  (2) 2010.03.08
python 2.5.4 컴파일시 bzip 에러  (0) 2010.02.25
python2.4 on STLinux with google api(gdata)  (0) 2010.02.23
Posted by 구차니