가장 많이 본 글

2013년 4월 27일 토요일

Firestarter fails to open system log 문제 해결 방법

<우분투 11.04 ~ 13.04 버전의 문제로서 이전 또는 이후 버전에서는 맞지 않을 수도 있음>

우분투 11.04 부터 rsyslog 의 설정이 변경되어 파이어스타터의 이벤트 메세지 로깅이
불가하게 되었다.이는 rsyslog conf 파일을 수정함으로서 해결할 수 있다.


문제 발생 환경

OS: Xubuntu 13.04 Desktop 64bit
CPU: Intel G1610
RAM: 4GB
HDD: 200GB

문제 해결 방법

터미널 에뮬레이션 또는 터미널에서 
gksudo <text editor> /etc/rsyslog.d/50-default.conf 을 입력한 후 

예) gedit 일 경우 gksudo gedit /etc/rsyslog.d/50-default.conf
      mousepad 일 경우 gksudo mousepad /etc/rsyslog.d/50-default.conf
      leafpad 일 경우 gksudo leafpad /etc/rsyslog.d/50-default.conf

      기타 에디터의 경우는 상단의 사용예시를 참고하여 맞는 프로그램명을 써 넣으면 된다.

다음 구절을 찾아 변경하면 된다.

#*.=info;*.=notice;*.=warn;\
# auth,authpriv.none;\
# cron,daemon.none;\
# mail,news.none -/var/log/messages

구절의 # 처리 (주석처리) 를 모두 제거한다.

*.=info;*.=notice;*.=warn;\
        auth,authpriv.none;\
        cron,daemon.none;\
        mail,news.none -/var/log/messages

그 후 저장한 후 다음 명령어를 입력하거나 시스템을 재부팅한다.

sudo service rsyslog restart


원문: https://bugs.launchpad.net/ubuntu/+source/firestarter/+bug/776361

2013년 4월 8일 월요일

root 권한으로 GUI 어플리케이션 실행하기

gksudo 를 터미널에 치면 된다. 으이구 간단!



주분투 12.10 에서.. 아마도 다 될듯 ㅋ

srcds 팁 (계속 작성 중)

<맵 설정파일>

srcds 를 사용하는 대부분의 게임 전용 서버에서 지정된 맵에 한정되는
 .cfg 파일 즉 설정 파일을지정할 수 있다는 것을 알았다.

우선 해당 전용서버 프로그램 폴더에 있는 'maps' 폴더안에 'cfg' 폴더를 만든다.

그리고 해당 맵에 설정할 <맵이름>.cfg (예: cp_orange_x_7.cfg) 파일에 설정 변수들을
집어넣고 파일을 저장하면 서버가 해당 맵을 불러들일 때 마다 계속 설정파일을 읽어들이게
 된다.

또한 server.cfg 에 있는 설정들을 override 할 수 있어서 server.cfg 와 다른 설정을
해야하는 맵이면 아주 간편하게 설정을 할 수 있는 장점이 있다.

-참고-
http://forums.alliedmods.net/showthread.php?t=62087 - allied modders 포럼 게시글





오늘 배운 리눅스 팁

프로그램 깨끗이 지우기
http://stackoverflow.com/questions/10853004/removing-mysql-5-5-completely

LAMP 설치법
http://www.howtoforge.com/ubuntu_lamp_for_newbies

프로그램 깨끗이 지우기를 응용하면 LAMP를 잘못설정하여서 고생할 때 유용하다!
(씨발 삽질...)

2013년 4월 5일 금요일

hlstatsx


Install Instructions

설치 길라잡이

Introduction!

길라잡이!

Greetings!

반갑습니다!

I have updated the wiki to make it alot more clear on installing HLX:CE on both Windows and Linux systems. Before we start please check the requirements page to make sure that HLX:CE will run on your set up.
저는 HLX:CE 를 리눅스와 윈도우 시스템에서 더 확실한 설치 정보를 제공하기 위해 이 위키를 업데이트하게 되었습니다.
This has been tested on Windows 7 & Debian Linux, if there is a work around that is needed please post it on the forums here. And i will update the wiki to match the needed changes.
이 위키는 데비안 리눅스와 윈도우7에서 시험했음을 먼저 밝힙니다. 만약  도움이 필요하시면 
포럼에 방문해주시기 바랍니다. 또한 저는 수정이 필요한 변화사항에 대해 위키를 업데이트 할 것입니다. 

HLX:CE Set Up

HLX:CE is divided into a few parts. All parts are equally important to HLX:CE as a whole and will be explained below.

HLX:CE 는 몇가지 부분으로 나뉘어져 있습니다. 아래에 설명된 모든 부분은 HLX:CE 에 있어 확실히
중요한 부분입니다.

Step 1 - Download HLX:CE

The latest version of HLX:CE can always be found here].

HLX:CE의 최신버전은 이 곳에서 접하실 수 있습니다.

Step 2 - Uploading the Files

The zip or tar file you have first needs to be decompressed on windows you can right click on the file and extract. For Linux you can type the following

다운받은 Zip 또는 Tar 파일은 압축을 해제해 줄 필요가 있습니다. 오른쪽 클릭을 이용하여 파일을 압축해제 해주세요. 리눅스는 아래의 절차를 따라주세요. 
tar -zxvf HLXCE-1.X.X-FULL.tar.gz
Replacing the X's with the current version.

X 로 표기되어 있는 부분은 현재 다운받으신 버전의 숫자로 변경하여 입력해 주세요. 
After you unzip the file you are going to see the following folders

압축해제한 압축파일에는 다음과 같은 폴더를 볼 수 있습니다.
  • amxmodx
  • heatmaps
  • scripts
  • sourcemod
  • sql*
  • web*
You will need to upload the web folder to your website. To check this go to http:yoursite/stats/

여러분은 web 폴더를 여러분의 웹 사이트에 업로드 해야합니다. 업로드가 정상적으로 수행되었는지 확인하고 싶으면 여러분의 웹사이트 주소와 하위 디렉토리인 /stats 를 입력하세요.
If you are running Sourcemod on your servers then you need to go into the Sourcemod folder and add the plugin to your server. The same go's for AMXMod.

만약에 Sourcemod (소스모드) 를 사용하고 있다면 여러분은 sourcemod 폴더와 플러그인을 여러분의
서버에 추가해야 합니다. AMXMod도 마찬가지 입니다.
For the SQL folder you only need to upload the install.sql file, this does not have to be in the public folder but does need to be accessed from the command line SSH
The last folder you need to have upload is the scripts folder, most of the time you are going to want the scripts AKA:Damon folder on the same server as the database, in 90% of cases this is going to be the website. For this folder it is extra important that people can not access this from the website. IE do not put it in the folder where you can see it in your browser. This is for security reasons.

Step 3 - Configuring the Website and daemon.

On the web server open the config.php with a text editor and fill out the needed data.
// DB_NAME - The name of the database
define("DB_NAME", "hlstatsx");

// DB_USER - The username to connect to the database as
define("DB_USER", "hlxuser");

// DB_PASS - The password for DB_USER
define("DB_PASS", "hlxpassword");

// DB_ADDR - The address of the database server, in host:port format.
//           (You might also try setting this to e.g. ":/tmp/mysql.sock" to
//           use a Unix domain socket, if your mysqld is on the same box as
//           your web server.)
define("DB_ADDR", "localhost");
Exit and save the file.The website part is done… for now!
For the deamon it is just another text file. Open the hlstats.conf file in the scripts folder with a text editor. Now fill the following.
# DBHost - Database server "address" or "address:port". Address can be an IP or
#          a hostname. The default MySQL port is 3306 (tcp).
DBHost ""

# DBUsername - User to connect to the database as.
DBUsername ""

# DBPassword - Password for the database user.
DBPassword ""

# DBName - Name of the database to use.
DBName ""
!!!!! NOTE !!!!! Read the rest of the daemon config and adjust Cpanel setting only if you can not get the daemon on to run with out it.

Step 4-Setting up SQL

Now we need to import the database,For this i am going to be showing the command line way for linux and windows, Thre are many GUI tools such as phpMy Admin and Navicat But because those require extra setup i will not be covering them. If you are running Cpanel you can also use this to import your DB instructions for that are here
Go to the folder where you uploaded install.sql and use the following command line to import the sql tables and config into your sql database:
mysql -uhlxuser -phlxpassword hlstatsx < install.sql
A few seconds / minutes will pass and the SQL database will be filled with the required tables.

Step 5-Running the daemon

Because this differs so much from windows and Linux i am going to split this up covering both.

Linux

We need to make the following files executable:
  • hlstats-awards.pl
  • hlstats.pl
  • hlstats-resolve.pl
  • run_hlstats
To do this we type the following
chmod +x hlstats-awards.pl hlstats.pl hlstats-resolve.pl run_hlstats
Once we make the files executable we going to want to test that every thing is working. Type the following.
cd path/to/scripts/folder
./run_hlstats start
You should now see on your screen something like this.
HLstatsX:CE daemon control
http://www.hlxce.com
---------------------------
Attempting to start HLstatsX:CE daemon on port 27500...
Daemon successfully started on port 27500
If you see any errors here STOP and go back. Make sure you did not make a typo in your config files, also check the log folder inside the scripts folder there should be an log file with detailed errors.
After you have tested all that we now need to run the files every so offtion to make sure that every thing runs smooth. For this we are going to use cron jobs.
Before we get to the jobs them self lets lay out when we want the files to be run.
  • run_hlstat - We want to run this about every 5 mins to make sure the daemon has not crashed
  • hlstats-awards.pl - This needs to be run once a day other wise you will have no awards, This is also the script that translate ip's to locations and the general maintenance of the DB
Now that we have that setup we can enter our cron jobs. type the following then copy the code to fit your file locations.
crontab -e

*/5 * * * * cd /home/user/scripts/ && ./run_hlstats start >/dev/null 2>&1
15 00 * * * cd /home/user/scripts/ && ./hlstats-awards.pl >/dev/null 2>&1
After you have done that you are set as far as all the scripts go.
While we are here there are some extras that will help you that only work in Linux as of this writing.
In the scripts folder there is a folder called GeoLiteCity in there you can make the file install_binary.sh executable then run it. This will update the file HLX:CE uses to get the location of an ip address.
If there are any errors in the log file and it's not working, yet you have no idea what it means. Post it at the hlstatsx forums! Someone is bound to help you there!!

Windows

First install ActivePerl
  • Run the ActivePerl installer accepting the defaults.
  • Launch the Perl Package Manager from the Start Menu
  • Install the additional Perl extensions <tt>DBD-mysql</tt> and <tt>Geo-IP-PurePerl</tt> by choosing the '''View All Packages button''' and then searching for the modules. Right click on the module and choose '''Install <package name>'''.
  • Now check the "Run marked actions", and confirm the installation.
  • You will receive a confirmation that the packages have been installed. This completes the setup for ActivePerl
After you have installed perl you need to run it as a service thanks to psychonic this is made easy go [http://wiki.hlxce.com/wiki/HLXCEServ here] to set that up. You are done now with the daemon :D

Step 6-Configure HLX:CE

Next in line would be enabling and using all we've done above and wrap it up into running stats:
  1. Website:
    1. <Go to the website URL (http://ip/stats http://yoursite/stats/).
    2. Login as admin on the website (login url on bottom of page)
    3. *Username: admin
    4. *Password: 123456
    5. Go to '''Admin Users'''.
    6. *Make yourself a new user.
    7. *Give it admin privileges.
    8. *Delete the old admin user.
    9. Go to '''HLstatsX:CE Settings''' and edit the settings to your liking</div>
    10. Go to '''Games''' and select the game you want the stats page to facilitate. You can do this by setting the dropdown menu for that particular game to '''show''' and all other games to hide.
    11. Setting the above to the game you wish to host will unlock the '''Game Settings''' for that game. Click on this and then click on '''Quick-Add Server'''. Fill in all those required fields and hit the save button. This server will now be displayed on the main page as well.

Step 7-Configure Gameserver (server.cfg)

  1. <div class="li">Logaddress.</div>
    1. In order for the gameserver to send it's logs to the statsserver you need to enable logging and add a logaddress.
    2. This is usually done in the config file of the server (server.cfg) by adding '''log on''' and '''logaddress_add ip:port'''.
    3. Since our statsserver is hosted on the machine with IP <ip> and port 27500, we add the following lines to our server.cfg file: '''log on''' and '''logaddress_add ip:27500''' or for goldsrc games '''logaddress_add ip 27500'''.
  1. Gold src games
    1. cs
    2. hl1mp
    3. tf classic
    4. dod
  1. Rcon & Plugin
    1. The HlstatsX daemon communicates with the gameserver via rcon. Next to that it uses the hlstatsx plugin “talk” to the users via specific commands.
    2. Make sure that the rcon_password set on the server is the same password as used in the '''Game Settings''' on the website.
    3. To check if the plugin is correctly loaded (with sourcemod) type '''sm plugins list''' and look for hlstatsx in the list.
    4. Now join the server, wait for some players and see if the spam will start ingame
'''Note: For more information regarding ingame commands, please type 'help' in to the main chat window (defaultkey “y”) and read the windows contents!'''


십중팔구 여러분은 scripts 폴더를 여러분의 웹 사이트 기능을 하는 디렉토리에 업로드 할 것입니다.
이는 보안상의 이유로 자제해야 하는 행동입니다. 왜냐하면 이 스크립트들은 사용자가 접근하지 못하도록
차단하는 것이 보안상 적합한 행동이기 때문입니다.

http://support.hostgator.com/articles/cpanel/how-to-import-your-mysql-database
Mysql 에서 DB나 구절을 추가할 때 사용하는 명령어나 기법에 대한 가이드