segunda-feira, 28 de março de 2011

How to disable centos net-snmp log





The centos snmp client logs all the snmp requisitions that the system receives.
Many times this is incovenient because that dirty the /var/log/messages with these kind of logs:
Mar 28 12:44:57 server1 snmpd[16808]: Connection from UDP: [172.25.3.53]:47306
Mar 28 12:44:57 server1 snmpd[16808]: Received SNMP packet(s) from UDP: [172.25.3.53]:47306
Mar 28 12:44:57 server1 snmpd[16808]: Connection from UDP: [172.25.3.53]:47306

To disable it, edit the "/etc/sysconfig/snmpd.options" file and add the following line:
.
.
.
OPTIONS="-Lf /dev/null -p /var/run/snmpd.pid -a"
.
.
.

Note: this file can already have the line 'OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"', note that the -Lsd option must be removed because it is what enables the log.

Restart the snmpd service:
/etc/init.d/snmpd restart


SORRY MY ENGLISH, I'M LEARNING YET!

Destivar log do net-snmp do centos





O cliente snmp do centos loga todas as requisições de snmp que recebe.
Muitas vezes isso é incoveniente pois suja o /var/log/messages com logs do seguinte tipo:

Mar 28 12:44:57 server1 snmpd[16808]: Connection from UDP: [172.25.3.53]:47306
Mar 28 12:44:57 server1 snmpd[16808]: Received SNMP packet(s) from UDP: [172.25.3.53]:47306
Mar 28 12:44:57 server1 snmpd[16808]: Connection from UDP: [172.25.3.53]:47306

Para desativa-lo, edite o arquivo "/etc/sysconfig/snmpd.options" e adicione a linha abaixo:
.
.
.
OPTIONS="-Lf /dev/null -p /var/run/snmpd.pid -a"
.
.
.

Nota: nesse aquivo pode já existir a linha 'OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"', note que a opção -Lsd deve ser retirada, pois é ela que habilita o log.

Reinicie o serviço snmpd:
/etc/init.d/snmpd restart

quarta-feira, 8 de dezembro de 2010

SNES C compiler - Download (C + SNES)



One day, surfing the Internet, I found a wonderful thing: someone develop for Windows a C compiler to SNES architecture! In other words, you can to write your games/programs in C language and compile them, the result of this compilation will be a SMC file that you can to play in your Super Nintendo emulator! Or else, if you have a SNES tape recorder (I think few will) you can to record the SMC file in the tape and to play your own game in your Super Nintendo!

I don't know the person or people name that created this compiler, the only reference I have is the site where I downloaded the compiler: http://obsolete.se.

Bear in mind: the compiler is an Windows executable, you can even to write the code in any operacional system, but when you to compile, you have to use a Windows computer (or to emulate Windows) to run the compiler.

Who is interested can to download the compiler in the site that I said or else to download from my google page: snesc download.

In other post I will teach how to use the compiler to do SNES games.


SORRY MY ENGLISH, I'M LEARNING YET!

Compilador C para SNES - Download (C + SNES



Um dia, navegando pela Internet, descobri algo maravilhoso: alguém desenvolveu para Windows um compilador C para a arquitetura SNES! Ou seja, você pode escrever seus jogos/programas na linguagem C e compila-los, o resultado dessa compilação será um arquivo SMC que você pode rodar no seu emulador de Super Nintendo! Ou então se tiver o gravador de fitas de SNES (acho que poucos terão) você pode gravar o SMC na fita e jogar no seu Super Nintendo o seu próprio jogo!

Não sei o nome dessa pessoa ou pessoas que criaram esse compilador, a única referência que tenho é o site que baixei o compilador: http://obsolete.se.

Lembre-se: é um executável para Windows, você até pode escrever o código em qualquer sistema operacional, mas quando for compilar, terá que utilizar um computador Windows (ou emular um) para executar o compilador.

Quem estiver interessado pode baixar o compilador na página que citei que baixei ou então direto da minha página google: snesc download.

Em outro post ensinarei como utilizar esse compilador para fazer jogos.

terça-feira, 7 de dezembro de 2010

dnscmd - script to insert and remove DNS records from your windows 2003 DNS server


== The problem ==

I needed to insert and remove MX records from the DNS server of my job. They are about 40 subdomains that contains MX, it's not an easy task to insert and remove these records manualy. With my friend's help, we made de script listed in this post.

== The solution ==

To use the script, set the variable "BASE" with the path to the base directory where the script is; configure the variable "DOMINIO" with the name of your domain; create a file called "subdominios.txt" in the same directory where the script is. Inside this file, list all the subdomains that you like to change, don't put ".aob.com", only the name of the subdomain. The file have to be like that:

dominio1
dominio2
dominio3

To execute the script, pass the following parameters:
parameter1 = add, to add records to the subdomains listed in subdominios.txt;
delete, to delete.
parameter2 = the name of the destination server of the added MXs.
Ex.1:
script.bat add email.aob.com
This example will add MX records to all subdomains in subdominios.txt with destination to email.aob.com.

Ex.2:
script.bat delete email.aob.com
This example will delete all MX records from the subdomains in subdominios.txt with destination to email.aob.com.


== The script code is listed bellow: ==

@echo off
set BASE=C:\scripts\atualizamx\
set DOMINIO=aob.com

rem add, delete
set comando=%1

rem antispam1,antispam2,...
set servidor=%2

cd %sBase%

if "%1"=="delete" goto delete
if "%1"=="add" goto add
goto fim

:add
FOR /F %%s IN (subdominios.txt) DO (
dnscmd /recordadd %DOMINIO% %%s MX 10 %servidor%
)
goto fim


:delete
FOR /F %%s IN (subdominios.txt) DO (
dnscmd /recorddelete %DOMINIO% %%s MX 10 %servidor% /f
)

:fim

@echo on




Sorry my english, I'm learning yet!

dnscmd - script para inserir e remover registros DNS no seu servidor de dns windows 2003


== O problema ==

Esses dias precisei inserir e remover registros MX no DNS do servidor do meu trabalho. São cerca de 40 subdomínios que contém MX, não é uma tarefa fácil inserir e remover esses registros manualmente. Com a ajuda de um colega, fizemos o script listado nesse post.


== A solução ==

Para utilizar o script, configure a variável "BASE" com o caminho da pasta base onde se encontra o script; configure a variável "DOMINIO" com o nome do seu domínio; crie um arquivo chamado subdominios.txt na mesma pasta onde se encontra o script, dentro desse arquivo liste todos os subdomínios que deseja alterar, não coloque ".aob.com", ou seja, o complemento do dominio, o arquivo deve ser da seguinte forma:

dominio1
dominio2
dominio3

Para rodar o script, passe os seguintes parametros:
parametro1 = add, para adicionar registros aos subdominios listados em subdominios.txt;
delete para fazer a remoção.
parametro2 = nome do servidor destino dos MX adicionados.
Ex.1:
script.bat add email.aob.com
Esse exemplo adicionará registros MX a todos subdomínios do arquivo subdominios.txt com destino em email.aob.com

Ex.2:
script.bat delete email.aob.com
Esse exemplo deletará todos os registros MX de todos subdomínios do arquivo subdominios.txt com destino em email.aob.com.



== O código do script segue abaixo: ==

@echo off
set BASE=C:\scripts\atualizamx\
set DOMINIO=aob.com

rem add, delete
set comando=%1

rem antispam1,antispam2,...
set servidor=%2

cd %sBase%

if "%1"=="delete" goto delete
if "%1"=="add" goto add
goto fim

:add
FOR /F %%s IN (subdominios.txt) DO (
dnscmd /recordadd %DOMINIO% %%s MX 10 %servidor%
)
goto fim


:delete
FOR /F %%s IN (subdominios.txt) DO (
dnscmd /recorddelete %DOMINIO% %%s MX 10 %servidor% /f
)

:fim

@echo on

quinta-feira, 2 de dezembro de 2010

dspace - centos installation


== Prerequisites ==
CentOS-5.5
wget

== Installing JDK ==

Downloading packages. Download from the site http://www.oracle.com/technetwork/java/javase/downloads/index.html, execute the .bin and create the environment variables bellow.

Environment variables (yum didn't do this automaticaly in my instalation)
vim /root/.bash_profile
export JAVA_HOME=/usr/src/jdk1.6.0_22/
export PATH=$PATH:$JAVA_HOME/bin

Also run the following lines
export JAVA_HOME=/usr/src/jdk1.6.0_22/
export PATH=$PATH:$JAVA_HOME/bin


== Installing apache maven ==

Download the packages from "http://maven.apache.org/download.html".
My decompression was done in /usr/src/apache-maven-3.0.1. THIS DIRECTORY CAN TO CHANGE depending the version that you are using, pay attention to the paths bellow, you may have to change them.
Download and decompress the packages:
wget http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.1-bin.tar.gz
tar -xzvf apache-maven-3.0.1-bin.tar.gz

Environment variables:
vim /root/.bash_profile
export PATH=$PATH:/usr/src/apache-maven-3.0.1/bin

Also run the following lines:
export PATH=$PATH:/usr/src/apache-maven-3.0.1/bin

Test your configuration
mvn --version


== Installing apache-ant ==

Installation directory
cd /usr/src

You can to download the package from "http://ant.apache.org/bindownload.cgi", however pay attention to the paths names, you may have to change them. I'm downloading the version 1.8.1
Download and decompress the packages in /usr/src:
wget http://mirror.pop-sc.rnp.br/apache//ant/binaries/apache-ant-1.8.1-bin.tar.gz
tar -xzvf apache-ant-1.8.1-bin.tar.gz

Environment variables:
vim /root/.bash_profile
export ANT_HOME=/usr/src/apache-ant-1.8.1/
export PATH=$PATH:$ANT_HOME/bin/

Also run the following lines:
export ANT_HOME=/usr/src/apache-ant-1.8.1/
export PATH=$PATH:$ANT_HOME/bin/

Check if the installation is correct running the following commando, its return must be what's in quotes:
ant -version
"Apache Ant version 1.8.1 compiled on April 30 2010"


== Installing the postgres data base==

Downloading the packages
yum install postgresql84-server postgresql84-libs postgresql84

Starting initial configuration of postgres:
su - postgres
initdb -E utf-8 /var/lib/pgsql/data
exit

Enabling TCP/IP connections by JDBC, just comment the line that has "listen_addresses"
vi /var/lib/pgsql/data/postgresql.conf
.
.
.
#listen_addresses = 'localhost'
.
.
.


Allowing local connections in postgres, add the line "host dspace...":
vi /var/lib/pgsql/data/pg_hba.conf
.
.
.
host dspace dspace 127.0.0.1 255.255.255.255 md5
.
.
.

Restart the service to commit the settings:
/etc/init.d/postgresql restart

Configuring postgres to startup automaticaly:
chkconfig postgresql on

== Installing tomcat ==

Installing the repository that has tomcat for yum:
cd /etc/yum.repos.d/
wget http://www.jpackage.org/jpackage50.repo

Downloading the packages:
yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps --skip-broken

Answer "yes" to the questions about GPG keys:
Importing GPG key 0xC431416D "JPackage Project (JPP Official Keys) " from http://www.jpackage.org/jpackage.asc
Is this ok [y/N]: y

Environment variables:
vim /root/.bash_profile
export TOMCAT_USER=tomcat

Also run the following lines:
export TOMCAT_USER=tomcat

Add the attribute URIEncoding into the server.xml file:
vi /etc/tomcat6/server.xml
.
.
.
<connector port="8080" protocol="HTTP/1.1" connectiontimeout="20000" redirectport="8443" uriencoding="UTF-8">
.
.
.

Remove the tomcat repository. If you want to keep it, jump this line.
rm -f /etc/yum.repos.d/jpackage50.repo

Configuring tomcat to startup automaticaly:
chkconfig tomcat6 on


== Installing perl ==

Downloading the packages
yum install perl

== Installing dspace ==

Download the sources from "http://sourceforge.net/projects/dspace/"
The files were decompressed in "/usr/src/".

Create a database for dspace
createuser -U postgres -d -A -P dspace ; createdb -U dspace -E UNICODE dspace

Execute the package installation command:
cd /usr/src/dspace-1.6.2/dspace
mvn package

Building the packages:
cd /usr/src/dspace-1.6.2/dspace/target/dspace-1.6.2-build.dir/
ant fresh_install

After the execution of the "ant" command, the "dspace" installation will be create in the root directory "/dspace".
Deploy the installation to tomcat:
cp -R /dspace/webapps/* /var/lib/tomcat6/webapps

Create an administrator user for the dspace. Bear in mind: it will ask an e-mail, this e-mail will be your login.
/dspace/bin/create-administrator

Restart the tomcat service
/etc/init.d/tomcat6 restart

Test the dspace installation:
http://YOUR_SERVER_ADDRESS:8080/jspui/

== Possibles errors ==

"Unable to locate the Javac Compiler in: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/tools.jar"
Do not use only the package "*openjdk*" from yum, it isn't complete. Install the JDK like I teach in "Installing JDK".

"WARNING: error instantiating 'org.apache.juli.ClassLoaderLogManager' referenced by java.util.logging.manager, class not found java.lang.ClassNotFoundException: org.apache.juli.ClassLoaderLogManager not found"
If you installed the JDK like I teached in "Installing JDK", complete the installation (only if necessary) with "yum" command. Some packages may be missing.
yum install java-1.6.0-openjdk.x86_64

"org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections."
This happens because the postgres connection. Check if the service is running or if the login and password are correct, as well the IP, selinux rules, firewall rules, etc...

"The program package-cleanup is found in the yum-utils package"
Resolve the dependencies:
yum install yum-utils


SORRY MY ENGLISH, I'M LEARNING YET!