카테고리 보관물: 미분류

OCS Inventory NG 설치

OCS Inventory 다운로드

OCS Inventory Agent 설치

ocs-1

압축 해지 후 OCS-NG-Windows-Agent-Setup.exe 실행

라이센스 허용 후 다음 이미지와 같은 폼이 날올때까지 Next

ocs-2

해당 폼을 에서 서버 URL(http://poseidon.toybox7.net/ocsinventory) 입력

Next

ocs-3

해당폼에서 TAG Value에 E-mail 입력, 설치 후 실행 체크

그 외 설치

http://www.ocsinventory-ng.org/en/ 에서 확인

KVM NFS 마운트

NFS Server 구축

  • kvm의 녹화 파일을 받아 줄 NFS 서버를 구축되어야 한다.
  • 이 곳 을  참조 하기 바람니다.

KVM에 접속

  • kvm 장비는 telnet 서비스를 제공 하고 있다. 알고 있는 KVM ip로 텔넷으로 접속을 한다.
  • root / <따로 제공 됨>

Mount

  • mount 명령 실행
    • # mount -t nfs –nolock <NFS Server>:/<Some dir> /opt/www/files
    • 해당 마운트 위치는 Hard disk가 마운트 되어 영상을 저장하는 곳이다.
  • 마운트 되면 KVM의 저장 프로세서는 /opt/www/files/record 폴더를 검사 하여 nfs 마운트 포인트면 저장을 자동으로 시작한다.

iStreamer 제시작

  • /etc/init.d/istreamer restart

사내 사설 클라우드 스로리지

클라우드 스로리지는 여러가지 있다. Dropbox, Google Driver, 네이버 nDriver등등… 이런 클라우드 스로리지는 정말 유용해서 개인 적으로나 프로젝트에 정말 유용하게 사용된다. 하지만 프로젝트를 진행 하면서 외부에서 서비스 되어지고 있는 클라우드 스토리지 사용은 뭔가 꺼림직한 기분은 떨칠 수 없다. 그래서 검색을 해 보았더니 여러가지 방법으로 개인 클라우드 스토리지를 구축할 수 있는 방법들이 있었다.

그 중 이미 장비를 가지고 있는 Synology NAS를 이용하여 쉽게 구축 할 수 있었다. 구축하고 나면

1. Client Program Download

2. 설치

다운받은 파일을 더블 클릭으로 설치 시작 된다.설치는 모두 다음 다음으로 설치를 마치시고

다음 설명은 설정 위저드 시작 화면 입니다.

cloud1

 

cloud2

 

접속 서버 정보 입니다. 회사 내에서만 접속 가능한 도메인 이니 걱정 마시고 사용하시기 바람니다.

  • 클라우드 서버 : cloud.toybox7.net
  • 계정 : 자신의 회사 E-mail ID
  • 비번 : 자신의 자리 전화번호 4자리
  • SSL 서버 부하를 줄이기 위해 SSL 데이타 전송 암호화는 체크 하지 마시기 바람니다.

cloud3

일반 설정을 할 수 있지만 고급 설정으로 설명 하겠습니다.

 

클라이드는 두개의 폴더를 준비 하고 있습니다. 개인 파일을 위해 ( home ) 폴더와 여러 사람이 함께 동기화 되는 공용 폴더 ( goference ) 입니다. 이 두개의 폴더를 자신의 PC에 폴더와 각각 매칭 시켜 동기화 할 수 있습니다. cloud5

 

설정이 모두 완료 되고 난 다음의 화면 입니다. CloudStation 폴더는 D:/CloudStationEschu와 goference는 D:\goference와 동기화 되었습니다.

 

cloud6

 

설치가 완료 되고 나면 폴더는 클라우드와 동기화 되며 클라우드 동기화 되는 폴더의 파일은 (공유 링크 생성)을 이용하여 서버에서 다운로드 할 수 있는 URL을 생성할 수 있습니다.

이 URL을 가지 사람은 서버에서 해당 파일을 다운로드 할 수 있습니다.

이제 부터는 대용량 파일을 메일에 첨부 하지 마시고 동기화 폴더에 복사 후 공유 링크만 생성해서 보내시기 바람니다. 

cloud7

 

[Tip] Create Audio Applications

  • Clicking Noises

    If there is a discontinuity in the audio, for example a jump from zero to half the maximum signal level in one sample, you will hear a clicking sound. These discontinuities are commonly caused by one of the following:

    • Discontinuity in Audio Data: either the sound file or waveform you are using has a discontinuity, or you’ve created a discontinuity with some sort of processing. For example, if you change volume suddenly, you may hear a click as the resulting waveform jumps from one value to another. The solution is usually to “ramp” your volume or other processing parameters so that the change is made gradually over several samples, rather than all at once. There are a number of ways to do this, the easiest of which is to just to change the value linearly over the course of, say, 20 to 100 samples. So instead of jumping from a gain coefficient of .1 to .2, you go from .1 to .101 to .102 to … to .198 to .199 to .2.
    • Dropouts: if your software and CPU are unable to provide audio data fast enough for the hardware, the hardware is forced to substitute zeros or other data to fill in the gaps. !PortAudio can detect these dropouts on some platforms, but it does not do so reliably on all platforms. Make sure you have ample CPU power for the processing you are trying to do, and make sure you follow the advice for your platform about latency and threading. Choosing a good buffer size can help a lot, both with keeping CPU usage down and improving reliability of playback. If you are unsure how to set the buffer size, try using paFramesPerBufferUnspecified, and !PortAudio will do it’s best to use an optimal (an possibly changing) buffer size.

  • Detecting Dropouts

    An effective way to detect dropouts is to record or play back 30 seconds to one minute of a low-frequency sine wave (about 100 Hz) and listen on a speaker. Any discontinuity in the sine wave will be readily apparent with a noticeable click in the audio. This has proven to be more effective than listening for dropouts in complex waveforms such as music or speech. The low frequency of the sine wave is fairly easy on the ears.

    Note that an extremely loud pop or click can be damaging not only to your speakers, but also your ears, so keep the volume low while you are writing new software!

  • Threading

    At the moment, the thread safety of PortAudio is technically unspecified and hence platform/implementation dependent.

    • Calls to open and close streams are definitely not thread safe on any platform. This means that if you plan to open and close streams from more than one thread, you will need to provide a locking mechanism to ensure that you don’t open or close streams in different threads at the same time.
    • In general, calls to ReadStream and WriteStream on different streams in different threads are probably safe. That means that if you are doing [wiki:TutorialDir/BlockingReadWrite Blocking I/O], one thread may read and write to one stream, and another thread may read and write to another.
  • Changing the Volume of Audio

    Audio data can easily be made louder or softer by multiplying each sample by a constant. For example, to make audio half as loud (which corresponds to about 6dB of gain reduction), simply multiply each sample by .5. Note that if you change this value abruptly, you might end up with Clicking Noises.

  • CPU Usage

    In many applications, it is important to keep the CPU usage to a minimum. Minimizing CPU usage may conflict with other objectives, such as minimizing latency, so it is up to you to decide which of these suggestions to use.

    Here are some tips for things that might improve CPU performance:

    • Use a high latency: Try using a large latency, which keeps lots of audio data buffered, so that the OS doesn’t need to constantly switch your audio app in and out of context. Of course, using too high a latency might cause cache misses, so you’ll have to experiment to see what’s best for your app.
    • Use a large buffer size: If you are using small buffer sizes, try something larger. Most platforms do well with something in the 128-1024 range, and powers of two usually work well. Often, using paFramesPerBufferUnspecified will result in both good CPU performance and low latency, though this depends on the platform.
    • Try platform specific flags: Some platforms offer special include files that offer platform specific features. For example, on Mac OS X, you can use the functions and constants in pa_mac_core.h to adjust sample-rate conversion settings and other things.
  • Audio Files

    Reading and writing audio from a file is one of the first things many people want to do with PortAudio. There are generally two considerations to keep in mind:

    • Don’t do I/O in the callback: Because the callback is a sensitive place in most operating systems, it is a good idea to pass the data to another thread for file I/O rather than doing file I/O in the callback. Even if the OS docs say it’s safe, doing I/O in the callback can cause unbounded delays which may cause [wiki:tips/ClickingNoises dropouts] in playback. If passing audio data between threads sounds hard to you, you’re right; it’s not easy. However, the task is made much easier by PortAudio’s [wiki:TutorialDir/BlockingReadWrite Blocking IO] interface. (Users of the older version of PortAudio, V18, may be able to take advantage of the PABLIO interface). Because the blocking interface takes care of transferring audio between threads for you, it is safe to do file I/O in the same thread as your blocking I/O calls.
  • Callbacks

    What is permissible in a PortAudio callback function?

    (This page is a summary of discussions from the mailing list.)

    Audio callbacks are often executed at a very high priority. In general the only things that should be happening in the callback routine are math and data movement. One should avoid:

    • memory allocation
    • file or device I/O
    • crossing language boundaries such as calling Java or Lua
    • calling graphics routines or other OS services

    If you need to gather input from MIDI, keyboards, a mouse or files then do that in a foreground thread and feed it into the audio callback via a command or data FIFO. If the audio callback needs to produce any output such as log files or graphics then that information should be put into an in-memory FIFO that is serviced by another foreground thread.

    • Avoid acquiring locks which could be held by lower priority threads. This can cause priority inversion. http://en.wikipedia.org/wiki/Priority_inversion
    • The execution time of your callback function must be guaranteed to be less than the callback framesPerBuffer duration. It could become time-unbounded due to acquiring locks (directly or inside OS API calls), waiting for something unbounded (like disk access or graphics card access) or performing computationally unbounded operations such as unbounded garbage collection sweeps, anything significant with time complexity over O(1) and variable working set size.

    The above two points are basic principles of real-time programming. Most of the rest of the advice we are giving derives from these two points. Very little third-party code you will encounter on a desktop OS can give you the above guarantees because desktop OSes are generally not real-time OSes. There is plenty of code out there which uses safe O(1) algorithms, bounded time incremental GC, special memory allocators, but you need to research these things and not assume you are using them (you probably aren’t) because simplicity and performance trump real-time operation for most desktop OS tasks.

    On some platforms (i.e. OS X) Apple has explicitly made stipulations about what you can and can’t do in the callback because it runs in a special real-time thread (they’re based on what I said above: basically, anything at the BSD level or higher is unsafe, some Mach stuff might be OK). On other platforms, if you set the latency high enough, you might be able to get a way with calling a lot of unkosher stuff — but if you start up Microsoft Office while you’re doing audio you may get a surprise. From a portability point of view, in principle, on a target OS the callback could run in a special IOProc, interrupt or some other context where regular OS calls are not even available.

    PortAudio often uses a very high priority thread for the audio callback — it’s usually not appropriate to make some calls on such a thread (forgetting real-time appropriateness) such as GUI drawing, because this will reduce the overall responsiveness of your machine and potentially starve out other tasks.

  • Transferring data to/from your application

    Transferring data between PortAudio and your application is typically accomplished using a ring buffer. A buffer is set up to hold approximately one-half second of audio data. During the callback function PortAudio reads data from or writes data to this buffer and keeps track of how much data has been read or written. A separate thread containing a timer “wakes up” at intervals of approximately 10 to 100 milliseconds and reads or writes this data from/to disk, performs graphics operations, memory allocation, etc. which involve calls to the operating system. The program pa_ringbuffer.c, available with the PortAudio source code, can be used for this purpose.

    If you are simply capturing audio and writing it to disk or reading audio from disk and playing it to a sound card or audio interface, the blocking interface is suitable. If you are also doing low-latency processing or monitoring then you should use the callback interface. In the callback, read or write your data from/to a ring buffer and then use another thread to perform the file I/O.

  • Regarding crossing language boundaries such as calling Java or Lua

    In general it should be avoided. But, in fact, Lua has a bounded time GC (except in rare circumstances involving huge tables, and that’s well documented) so, like the Supercollider language, it could be used in a PortAudio callback so long as you make sure it doesn’t violate the points I made above: i.e. avoid calling the OS level memory allocator, file I/O, or doing other things which violate the above in your Lua user functions. (Lua AV used to run audio processing in the callback). That said, running Lua in a PortAudio callback is definitely at the experimental end of the spectrum.

 

live555 컴파일

Live555 컴파일 하기

VS2010

  1. live555/win32config 수정하기
    • “TOOLS32 =C:\Program Files\Microsoft Visual Studio 10\VC”
    • “LINK_OPTS_0 = $(linkdebug) msvcrt.lib”
  2. Makefile 만들기
    • Run “Visual Studio 명령 프롬프트(2010)”
    • genWindowsMakefile 실행
  3. 컴파일 하기
    • cd liveMedia
    • nmake /B -f liveMedia.mak
    • cd ../groupsock
    • nmake /B -f groupsock.mak
    • cd ../UsageEnvironment
    • nmake /B -f UsageEnvironment.mak
    • cd ../BasicUsageEnvironment
    • nmake /B -f BasicUsageEnvironment.mak
    • cd ../testProgs
    • nmake /B -f testProgs.mak
    • cd ../mediaServer
    • nmake /B -f mediaServer.mak

 

Turnserver 빠른 설치

Turnserver 빠른 설치

# rpm -Uvh http://minerva.rsupport.com/rsupport/CentOS6/rsuprepo-1.4-1.noarch.rpm
# yum install turnserver

 설정 하기

/usr/bin/setup_turnserver.sh

 실행 하기

/etc/init.d/turnserver start

운용하기

설치에 대한 간편한 방법을 제공 하고 있으나 원천 기술에 대해서는 꼭 습득하기 바람니다.

  • Yum을 이용하여 의존성 있는 RPM들의 자동설치
  • turnserver.conf에 설정되는 항목들의 의미 (링크)
  • linux에서의 서비스 구동 및 확인
  • cron에 의한 서비스 상태 확인 ( /usr/bin/turnserver_mon.sh 가 rpm에 의해 자동 설치 되었고 cron에 의해 1분에 한번씩 서비스를 채크함)

SSH Tunnel

SSH 터널을 이용하기

고객사 사내안에서 노트북을 이용하여

  • 설치한 (Target Server)서버에서 접근 가능하다.
  • 설치한 (Target Server)서버는 외부에서 접근이 불가능하다.
  • (Target Server)서버에서 아웃 바인딩을 허용하지 않는다.
  • Rsupport 서버에 SSH 접근이 가능하다.

위의 조건을 만족할때 (Rsupport SSH 서버)—>(노트북)—->(Target Server)간의 터널을 만들어 Rsupport 사내에서 Target Server에 SSH가 가능하게 할 수 있다.

다음 스탭을 따라 한다.

  1. putty download
  2. putty 설정
  3. ssh_tunnel_1
  4. Tunnel 설정
  5. ssh_tunnel_2

Destination의 193.168.111.113은 Target Server의 IP로 설정을 한다.

Source port는 minerva.rsupport.com에서 Open 될 Port이다.

 

 

 

 

 

 

Build Simple Linux RPM Packages

Build Simple Linux RPM Packages

This article describes how to build simple RPM packages for Linux, with specific reference to the information needed for the RHCE EX300 certification exam.

Remember, the exams are hands-on, so it doesn’t matter which method you use to achieve the result, so long as the end product is correct.

Related articles.

Installation

Perform the following installation from a Yum repository.

# yum install rpmdevtools

Create a user to perform the builds.

# useradd rpmbuilder
# passwd rpmbuilder

Log in as this user to perform the subsequent actions.

# su - rpmbuilder
$

Create RPM Package

Create a directory tree for the package.

$ rpmdev-setuptree
$ ls
rpmbuild
$ cd rpmbuild
$ ls
BUILD  RPMS  SOURCES  SPECS  SRPMS
$

Create a test file in the package.

$ mkdir mytest-1.0
$ echo "echo \"This is a test\"" > mytest-1.0/mytest.sh
$ tar -czvf SOURCES/mytest-1.0.tar.gz mytest-1.0/
mytest-1.0/
mytest-1.0/mytest.sh
$

Create a spec file.

$ rpmdev-newspec SPECS/mytest.spec
Skeleton specfile (minimal) has been created to "SPECS/mytest.spec".
$

Edit the spec file. Any entries you are not planning to use should be commented out. The edited spec file for this RPM is shown below.

Name:           mytest
Version:        1.0
Release:        1%{?dist}
Summary:        A test script

Group:          Utilities
License:        GPL
URL:            http://oracle-base.com/articles/linux/linux-build-simple-rpm-packages.php
Source0:        mytest-1.0.tar.gz
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)


#BuildRequires: 
#Requires:      

%description
A test script inside a simple RPM package


%prep
%setup -q


%build


%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/opt/mytest
install mytest.sh $RPM_BUILD_ROOT/opt/mytest/mytest.sh


%clean
rm -rf $RPM_BUILD_ROOT


%files
%dir /opt/mytest
%defattr(-,root,root,-)
/opt/mytest/mytest.sh

%post
chmod 755 -R /opt/mytest

Be careful how you comment out the “%” macros. The following example shows how the comments work.

# Normal macro. Not commented out.
%configure

# Badly commented out macro.
#%configure

# Properly commented out macro.
#%%configure

Build the package.

$ rpmbuild -bb -v SPECS/mytest.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.naRMPW
+ umask 022
+ cd /home/rpmbuilder/rpmbuild/BUILD
+ cd /home/rpmbuilder/rpmbuild/BUILD
+ rm -rf mytest-1.0
+ /bin/tar -xf -
+ /bin/gzip -dc /home/rpmbuilder/rpmbuild/SOURCES/mytest-1.0.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd mytest-1.0
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.Ws3V7p
+ umask 022
+ cd /home/rpmbuilder/rpmbuild/BUILD
+ cd mytest-1.0
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.w8wSCT
+ umask 022
+ cd /home/rpmbuilder/rpmbuild/BUILD
+ cd mytest-1.0
+ rm -rf /home/rpmbuilder/rpmbuild/BUILDROOT/mytest-1.0-1.el6.x86_64
+ install -d /home/rpmbuilder/rpmbuild/BUILDROOT/mytest-1.0-1.el6.x86_64/opt/mytest
+ install mytest.sh /home/rpmbuilder/rpmbuild/BUILDROOT/mytest-1.0-1.el6.x86_64/opt/mytest/mytest.sh
+ /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip
+ /usr/lib/rpm/brp-strip-static-archive
+ /usr/lib/rpm/brp-strip-comment-note
Processing files: mytest-1.0-1.el6.noarch
Requires(interp): /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(post): /bin/sh
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/rpmbuilder/rpmbuild/BUILDROOT/mytest-1.0-1.el6.x86_64
Wrote: /home/rpmbuilder/rpmbuild/RPMS/noarch/mytest-1.0-1.el6.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.Rk3kLV
+ umask 022
+ cd /home/rpmbuilder/rpmbuild/BUILD
+ cd mytest-1.0
+ rm -rf /home/rpmbuilder/rpmbuild/BUILDROOT/mytest-1.0-1.el6.x86_64
+ exit 0
$

You can now see the completed RPM.

$ ls RPMS/noarch/*
RPMS/noarch/mytest-1.0-1.el6.noarch.rpm
$

Test It

You can now try installing the package as the “root” user.

# cd /home/rpmbuilder/rpmbuild/RPMS/noarch
# rpm -Uvh mytest-1.0-1.el6.noarch.rpm
Preparing...                ########################################### [100%]
   1:mytest                 ########################################### [100%]
#

We can see the file has been installed in the requested location.

# ls -al /opt/mytest/
total 12
drwxr-xr-x. 2 root root 4096 Jan 26 15:11 .
drwxr-xr-x. 4 root root 4096 Jan 26 15:11 ..
-rwxr-xr-x. 1 root root   22 Jan 26 15:02 mytest.sh
#

We can also run the script, as expected.

# /opt/mytest/mytest.sh
This is a test
#

For more information see:

Hope this helps. Regards Tim…

Suse linux의 개발환경 구축

▶ Firewall 정지
  • # SuSEfirewall2 stop
▶ Compile 환경 구성
  • g++ 설치
    • # zypper install gcc-c++
  • cmake 설치
    • # zypper ar http://ftp5.gwdg.de/pub/opensuse/repositories/home:/frispete:/database/openSUSE_11.1 Cmake-2.8
    • # zypper install cmake
  • subversion 설치
    • # zypper ar http://ftp5.gwdg.de/pub/opensuse/repositories/openSUSE:/Evergreen:/11.1/standard/ subversion-1.x
    • # zypper install subversion
  • openssl-devel 설치
    • # zypper install libopenssl-devel
  • libxml2-devel 설치
  • curl-devel 설치
  • rsup Source Download
  • asdf
▶ Utils 설치
  • # zypper install rzsz