'공부를 해보자/프로그래밍'에 해당되는 글 30건

  1. 2010.03.30 Lighttpd + FastCGI
  2. 2010.03.26 IPC:Message Queues
  3. 2010.03.05 JPEG EXIF
  4. 2010.02.09 HTTP server push
  5. 2010.02.09 Streaming media protocols
  6. 2009.03.24 Vi: Search and Replace
  7. 2009.03.23 Wotsit.org - 각종 파일 정보
  8. 2009.03.23 Mediainfo - 비디오/오디오 파일 분석툴
  9. 2009.02.04 리눅스 커널의 이해 (Embedded World)
  10. 2008.09.18 리눅스 하드디스크 추가 작업

Lighttpd + FastCGI

공부를 해보자/프로그래밍 2010. 3. 30. 11:34
FastCGI
 일반 CGI는 각 요청에 프로세스가 생성되고 요청을 처리한 후 종료되는 반면 FastCGI는 한 프로세스에서 여러 요청을 처리한다.

Lighttpd의 FastCGI
Configure파일(lighttpd.conf)
...
server.modules = (
"mod_cgi",
"mod_fastcgi",
"mod_auth",
...
)
...

참고 사이트




'공부를 해보자 > 프로그래밍' 카테고리의 다른 글

Broadcast IP  (0) 2010.04.22
[Link]정규표현식  (0) 2010.04.06
IPC:Message Queues  (0) 2010.03.26
JPEG EXIF  (0) 2010.03.05
HTTP server push  (0) 2010.02.09
:

IPC:Message Queues

공부를 해보자/프로그래밍 2010. 3. 26. 13:29

시지 큐를 사용하는 프로그램을 작성했는데, receive하는쪽에서 엉뚱한 메모리 값이 변경되는 현상이 발생했다. 디버깅 하다 보니 아래 부분이 문제 였던 것으로 보인다.

msgsnd(key_id, (void *)&mbuf, sizeof(msgbuf), IPC_NOWAIT);
아래 처럼 변경하니까 정상동작 되었다.

msgsnd(key_id, (void *)&mbuf, strlen(mbuf.mtext)+1, IPC_NOWAIT);

아래 문서의 예제에서 힌트를 얻었다.

출처: http://www.cs.cf.ac.uk/Dave/C/node25.html

IPC:Message Queues:<sys/msg.h>

The basic idea of a message queue is a simple one.

Two (or more) processes can exchange information via access to a common system message queue. The sending process places via some (OS) message-passing module a message onto a queue which can be read by another process (Figure 24.1). Each message is given an identification or type so that processes can select the appropriate message. Process must share a common key in order to gain access to the queue in the first place (subject to other permissions -- see below).

'공부를 해보자 > 프로그래밍' 카테고리의 다른 글

[Link]정규표현식  (0) 2010.04.06
Lighttpd + FastCGI  (0) 2010.03.30
JPEG EXIF  (0) 2010.03.05
HTTP server push  (0) 2010.02.09
Streaming media protocols  (0) 2010.02.09
:

JPEG EXIF

공부를 해보자/프로그래밍 2010. 3. 5. 08:26

'공부를 해보자 > 프로그래밍' 카테고리의 다른 글

Lighttpd + FastCGI  (0) 2010.03.30
IPC:Message Queues  (0) 2010.03.26
HTTP server push  (0) 2010.02.09
Streaming media protocols  (0) 2010.02.09
Vi: Search and Replace  (0) 2009.03.24
:

HTTP server push

공부를 해보자/프로그래밍 2010. 2. 9. 14:05
HTTP server push (also known as HTTP streaming) is a mechanism for sending data from a web server to a web browser. HTTP server push can be achieved through several mechanisms.

Generally the web server does not terminate a connection after response data has been served to a client. The web server leaves the connection open such that if an event is received, it can immediately be sent to one or multiple clients. Otherwise the data would have to be queued until the client's next request is received. Most web servers offer this functionality via CGI (e.g. NPH scripts on Apache).

Another mechanism is related to a special MIME type called multipart/x-mixed-replace, which was introduced by Netscape in 1995. Web browsers would interpret this as a document changing whenever the server felt like pushing a new version to the client.[1][2] It is still supported by Firefox, Opera and Safari today, but traditionally ignored by Microsoft.[3] It can be applied to HTML documents, but also for streaming images in webcam applications.

The WHATWG Web Applications 1.0 proposal[4] included a mechanism to push content to the client. On September 1, 2006, the Opera web browser implemented this new experimental technology in a feature called "Server-Sent Events."[5][6] It is now being standardized as part of HTML5.[7] Another related part of HTML5 is the Web Sockets API, which allows a web server and client to communicate over a full-duplex TCP connection.[8] Web Sockets are available on Google Chrome since 4.0.249.0[9], and there is a JavaScript library by Kaazing that emulates them

'공부를 해보자 > 프로그래밍' 카테고리의 다른 글

IPC:Message Queues  (0) 2010.03.26
JPEG EXIF  (0) 2010.03.05
Streaming media protocols  (0) 2010.02.09
Vi: Search and Replace  (0) 2009.03.24
Wotsit.org - 각종 파일 정보  (0) 2009.03.23
:

Streaming media protocols

공부를 해보자/프로그래밍 2010. 2. 9. 13:54

Streaming media protocols: HTTP, RTMP, PNM, RTSP, MMS, RTSPU, RTSPT, MMSU, MMST

RTSP protocol is the default protocol for streaming Windows Media. RTSP protocol is also used for streaming RealMedia/RealVideo/RealAudio, streaming QuickTime video (.mov, .mp4, .sdp streams).

MMS protocol is used for streaming Windows Media only.

  1. RTSP using UDP is called RTSPU
  2. RTSP using TCP is called RTSPT
  3. MMS using UDP is called MMSU
  4. MMS using TCP is called MMST
PNM protocol is used for RealMedia/RealVideo/RealAudio streaming only. RTMP protocol is used for Flash audio and video streams only. Media files can also be streamed through HTTP or other protocols.

The majority of streams are streamed through HTTP, RTSP, MMS and RTMP. PNM protocol is usually not used on the newest servers, but such streams are not very rare.

HTTP Streaming

HTTP streaming is a mechanism for sending data from a Web server to a Web browser in response to an event. HTTP Streaming is achieved through several common mechanisms.

In one such mechanism the web server does not terminate the response to the client after data has been served. This differs from the typical HTTP cycle in which the response is closed immediately following data transmission.

The web server leaves the response open such that if an event is received, it can immediately be sent to the client. Otherwise the data would have to be queued until the client's next request is made to the web server. The act of repeatedly queing and re-requesting information is known as a Polling mechanism.

Typical uses for HTTP Streaming include market data distribution (stock tickers), live chat/messaging systems, online betting and gaming, sport results, monitoring consoles and Sensor network monitoring.

HTTP protocol usually uses port 80 or 8080.

MMS - Microsoft Media Services

Microsoft's streaming server uses the Microsoft Media Services (MMS) protocol (also called NetShow Services) to transfer unicast data. MMS can be transported via UDP or TCP (MMSU and MMST protocols). If the Windows Media Player client cannot negotiate a good connection using MMS over UDP, it will resort to MMS over TCP. If that fails, the connection can be made using a modified version of HTTP (always over TCP). This is not as ideal for streaming as MMS over UDP, but ensures connectivity nonetheless.

The default protocol for streaming Windows Media is not MMS, but RTSP.

The default port for MMS is 1755.

RTSP - Real Time Streaming Protocol

The Real Time Streaming Protocol (RTSP), developed by the IETF and published in 1998 as RFC 2326, is a protocol for use in streaming media systems which allows a client to remotely control a streaming media server, issuing VCR-like commands such as "play" and "pause", and allowing time-based access to files on a server.

Some RTSP servers use RTP as the transport protocol for the actual audio/video data. Many RTSP servers use RealNetworks's proprietary RDT as the transport protocol.

RTSP can be transported via UDP or TCP (RTSPU and RTSPT protocols).

The default port for RTSP is 554.

PNM/PNA

The first version of RealAudio used a proprietary protocol called PNA or PNM to send streaming audio data. RealNetworks later switched to the IETF standardized Real Time Streaming Protocol (RTSP), but they use RTSP only to manage the connection.

The default port for PNM is 7070.

RTMP - Real Time Messaging Protocol

Real Time Messaging Protocol (RTMP) Is a proprietary protocol developed by Adobe Systems (formerly developed by Macromedia) that is primarily used with Macromedia Flash Media Server to stream audio and video over the internet to the Adobe Flash Player client.

The default connection port for RTMP is 1935.

'공부를 해보자 > 프로그래밍' 카테고리의 다른 글

JPEG EXIF  (0) 2010.03.05
HTTP server push  (0) 2010.02.09
Vi: Search and Replace  (0) 2009.03.24
Wotsit.org - 각종 파일 정보  (0) 2009.03.23
Mediainfo - 비디오/오디오 파일 분석툴  (0) 2009.03.23
:

Vi: Search and Replace

공부를 해보자/프로그래밍 2009. 3. 24. 15:22

Change to normal mode with <ESC>.

Search (Wraped around at end of file):

Search STRING forward : / STRING.
Search STRING backward: ? STRING.
Repeat search: n
Repeat search in opposite direction: N (SHIFT-n)

Replace: Same as with sed, Replace OLD with NEW:
First occurrence on current line: :s/OLD/NEW
Globally (all) on current line: :s/OLD/NEW/g
Between two lines #,#: :#,#s/OLD/NEW/g
Every occurrence in file: :%s/OLD/NEW/g

:

Wotsit.org - 각종 파일 정보

공부를 해보자/프로그래밍 2009. 3. 23. 13:20
Wotsit.org
사용자 삽입 이미지

각종 파일의 정보를 찾아 볼 수 있다.

Welcome to Wotsit.org

Welcome to Wotsit.org, the programmer's file and data format resource. This site contains information on hundreds of different file types, data types, hardware interface details and all sorts of other useful programming information; algorithms, source code, specifications, etc.



:

Mediainfo - 비디오/오디오 파일 분석툴

공부를 해보자/프로그래밍 2009. 3. 23. 13:11
http://mediainfo.sourceforge.net/ko

MediaInfo가 뭐죠?

MediaInfo는 비디오나 오디오 파일에 대한 태그 정보와 기술 정보를 제공해주는 무료 소프트웨어입니다.
(공개 소프트웨어: GPL 또는 LGPL 라이센스)

MediaInfo에서 어떤 정보를 얻을 수 있나요?

  • 일반: 제목, 작가, 디렉터, 앨범, 트랙 개수, 날짜, 재생 시간...
  • 비디오: 코덱, 종횡비, fps, 비트레이트...
  • 오디오: 코덱, 샘플레이트, 채널, 언어, 비트레이트...
  • 텍스트: 자막의 언어
  • 챕터: 챕터 개수, 챕터 리스트

MediaInfo는 어떤 포맷(컨테이너)을 지원하나요?

  • 비디오: MKV, OGM, AVI, DivX, WMV, 퀵타임, 리얼, MPEG-1, MPEG-2, MPEG-4, DVD (VOB)...
    (코덱: DivX, XviD, MSMPEG4, ASP, H.264, AVC...)
  • 오디오: OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF...
  • 자막: SRT, SSA, ASS, SAMI...

MediaInfo로 뭘 할 수 있나요?

  • 다양한 비디오와 오디오 파일을 읽을 수 있습니다
  • 정보를 보는 다른 방법 (텍스트, 시트, 트리, HTML...)
  • 각각의 뷰를 커스터마이즈할 수 있습니다
  • 텍스트, CSV, HTML...로 정보 내보내기
  • 그래픽 인터페이스, 커맨드 라인, DLL
  • MS-Windows 탐색기와 통합(드래그앤드롭, 컨텍스트 메뉴)
  • 국제화: 운영체제의 모든 버전에서 모든 언어 표시
  • 다국어 지원 가능 (지원자 필요)

'공부를 해보자 > 프로그래밍' 카테고리의 다른 글

Vi: Search and Replace  (0) 2009.03.24
Wotsit.org - 각종 파일 정보  (0) 2009.03.23
리눅스 커널의 이해 (Embedded World)  (0) 2009.02.04
리눅스 하드디스크 추가 작업  (0) 2008.09.18
Thread  (0) 2008.06.18
:

리눅스 커널의 이해 (Embedded World)

공부를 해보자/프로그래밍 2009. 2. 4. 08:55

'공부를 해보자 > 프로그래밍' 카테고리의 다른 글

Wotsit.org - 각종 파일 정보  (0) 2009.03.23
Mediainfo - 비디오/오디오 파일 분석툴  (0) 2009.03.23
리눅스 하드디스크 추가 작업  (0) 2008.09.18
Thread  (0) 2008.06.18
함수포인터  (0) 2008.06.18
:

리눅스 하드디스크 추가 작업

공부를 해보자/프로그래밍 2008. 9. 18. 09:32
* 파티션생성
* 파일시스템생성
* 마운트포인트생성

1. 서버에 하드 추가 후 OS 부팅시 하드가 올라오는지 확인한다.
2. vi /etc/fstab을 열어 ext2, ext3인지 판단..
3. fdisk로 파티션을 잡는다.
3-1. fdisk /dev/hdb (IDE 하드인 경우), fdisk /dev/sdb (SCSI 하드인 경우)
3-2. p로 기존 파티션이 잡혀있는지 확인한다.
3-3. d로 기존 파티션이 잡혀있으면 삭제후 p로 확인한다.
3-4. n으로 파티션 추가- > p(primary로) -> 1 -> 크기지정 default 1 입력(Full로 잡을시, 디폴트가 Full) -> 엔터
3-5. w로 쓴다.
4. format
ext3 : mke2fs -j /dev/hdb
ext2 : mkfs -t ext2 /dev/hdb
5. 마운트할 디렉토리 생성
/에서 mkdir /home2 등등
6. mount
ext3 : mount -t ext3 /dev/hdb /home2
ext2 : mount -t ext2 /dev/hdb /home2
7. fstab 수정 (vi /etc/fstab)
LABEL=/home /home ext3 defaults 1 2 (를 카피하여 페이스트 하여 아래와 같이 편집)
-> /dev/hdb /home2 ext3 defaults 1 2 (앞 두부분만 수정)
8. df -h로 마운트 확인
9. 재부팅후 이상없이 올라온후 마운트 되었는지 확인

'공부를 해보자 > 프로그래밍' 카테고리의 다른 글

Mediainfo - 비디오/오디오 파일 분석툴  (0) 2009.03.23
리눅스 커널의 이해 (Embedded World)  (0) 2009.02.04
Thread  (0) 2008.06.18
함수포인터  (0) 2008.06.18
파일/문자열 찾기  (0) 2008.06.11
: