Convertir .pem to .p12

cat GeoTrust_Global_CA.pem RapidsslinterCA.crt > turootycabundle.cer

openssl pkcs12 -export -in tucertificado.crt -inkey privado.pem -out tunuevocertificadoenp12.p12 -name tomcat -CAfile turootycabundle.cer -caname root -chain

Publicado en Shell | Deja un comentario

Recuperando Savage2

Despues de sufrir un poco por que no podia jugar savage por fin encontre los archivos que me faltaban.

Error: update 2.1.1.0

Linux 64 bits:

Bajar Savage2 version 2.1.0.8:
http://www.moddb.com/games/savage-2-a-tortured-soul/downloads/savage-2-a-tortured-soul-v2108-linux-64-bit

Bajar parche de actualización a Savage 2.1.1.0
http://snotch.in-igloo.net/tonpatch/Linux64bit/savage2.bin
chmod +x savage2.bin

Bajar Libreria libk2.so
http://snotch.in-igloo.net/tonpatch/Linux64bit/libk2.so
chmod 777 libk2.so

bajar game.so
http://snotch.in-igloo.net/tonpatch/Linux64bit/game/game.so
pegar en directorio game/game.so
chmod 777 game/game.so

Actualizar el path
./savage2_update.bin –update-runpath

Corre el juego
./savage2.bin

y listo funciona!!!!

Publicado en Shell | Deja un comentario

nagios

Dependencias
1-.sudo apt-get install -y apache2 libapache2-mod-php5 build-essential libgd2-xpm-dev libssl-dev apache2-utils libssl-dev xinetd

Grupos
2-.sudo groupadd -g 9000 nagios && sudo groupadd -g 9001 nagcmd && sudo useradd -u 9000 -g nagios -G nagcmd -d /usr/local/nagios -c ‘Nagios Admin’ nagios && adduser www-data nagcmd

Descargando
3-.cd /tmp/ && wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.5.1.tar.gz && sudo mv nagios-3.5.1.tar.gz /opt/ && cd /opt/

Descomprimiento
4-.tar xzf nagios-3.5.1.tar.gz && cd /opt/nagios

instalando
5-.sudo ./configure –-prefix=/usr/local/nagios -–with-nagios-user=nagios –-with-nagios-group=nagios –-with-command-user=nagios –-with-command-group=nagcmd && sudo make all && sudo make install && sudo make install-init && sudo make install-config && sudo make install-commandmode && sudo mkdir /etc/httpd && sudo mkdir /etc/httpd/conf.d && sudo make install-webconf

Creando usuario para la consola web
6-.sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin && chown nagios:nagcmd /usr/local/nagios/etc/htpasswd.users

Inicio de nagios en el boot
7-.sudo chmod +x /etc/init.d/nagios && sudo update-rc.d nagios defaults

Enable CGI-bin
8-.sudo a2enmod cgi && sudo service apache2 restart

Instalando Nagios Plugin
Al instalar el plugin podrás monitoriar los procesos de tu localhost.
9-.cd /tmp && wget http://nagios-plugins.org/download/nagios-plugins-2.0.tar.gz && sudo mv nagios-plugins-2.0.tar.gz /opt/ && cd /opt && sudo tar xzf nagios-plugins-2.0.tar.gz && cd /opt/nagios-plugins-2.0/ && sudo ./configure –with-nagios-user=nagios –with-nagios-group=nagios –with-openssl=/usr/bin/openssl –enable-perl-modules –enable-libtap && sudo make && sudo make install

##########################
##Pendiente de verificar##
##########################

Installation on the Host Node

First, you’ll need to install the NRPE plugin on the Nagios host node. This is the host that runs the web server and that you’ve already set up Nagios on. (If you haven’t already set up Nagios, this tutorial will help you, and you should do that first.)

To install the host side of NRPE, issue

apt-get install nagios-nrpe-plugin

fuente: http://www.cslu.ogi.edu/~zak/debianclusters/Nagios_NRPE_Addon_Installation_and_Configuration

##################################
## Instalar en el server remoto ##
##################################

On Nagios Monitoring Server
Now login into your Nagios Monitoring Server. Here you will need to do following things:
Install the check_nrpe plugin.
Create a Nagios command definition using the check_nrpe plugin.
Create Nagios host and add service definitions for monitoring the remote Linux host.
Step 1: Install NRPE Plugin
Go to the nagios download directory and download latest NRPE Plugin with wget command.

1
2
[root@tecmint]# cd /root/nagios
[root@tecmint]# wget http://garr.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz

Unpack the NRPE source code tarball.

1
2
3
4
5
6
[root@tecmint]# tar xzf nrpe-2.15.tar.gz
[root@tecmint]# cd nrpe-2.15
Compile and install the NRPE addon.
[root@tecmint]# ./configure
[root@tecmint]# make all
[root@tecmint]# make install-daemon

Step 2: Verify NRPE Daemon Remotely
Make sure that the check_nrpe plugin can communicate with the NRPE daemon on the remote Linux host. Add the IP address in the command below with the IP address of your Remote Linux host.

1
[root@tecmint]# /usr/local/nagios/libexec/check_nrpe -H <remote_linux_ip_address>

You will get a string back that shows you what version of NRPE is installed on the remote host, like this:

1
NRPE v2.15

If your receive a plugin time-out error, then check the following things.
Make sure your firewall isn’t blocking the communication between the remote host and the monitoring host.
Make sure that the NRPE daemon is installed correctly under xinetd.
Make sure that the remote Linux host firewall rules blocking the monitoring server from communicating to the NRPE daemon.

#######################################
## Instalar en el host server nagios ##
#######################################

Adding Remote Linux Host to Nagios Monitoring Server
To add a remote host you need to create a two new files “hosts.cfg” and “services.cfg” under “/usr/local/nagios/etc/” location.

1
2
3
[root@tecmint]# cd /usr/local/nagios/etc/
[root@tecmint]# touch hosts.cfg
[root@tecmint]# touch services.cfg

Now add these two files to main Nagios configuration file. Open nagios.cfg file with any editor.

1
[root@tecmint]# vi /usr/local/nagios/etc/nagios.cfg

Now add the two newly created files as shown below.
# You can specify individual object config files as shown below:

1
2
cfg_file=/usr/local/nagios/etc/hosts.cfg
cfg_file=/usr/local/nagios/etc/services.cfg

Now open hosts.cfg file and add the default host template name and define remote hosts as shown below. Make sure to replace host_name, alias and address with your remote host server details.

1
[root@tecmint]# vi /usr/local/nagios/etc/hosts.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
## Default Linux Host Template ##
define host{
name                            linux-box               ; Name of this template
use                             generic-host            ; Inherit default values
check_period                    24x7        
check_interval                  5      
retry_interval                  1      
max_check_attempts              10      
check_command                   check-host-alive
notification_period             24x7    
notification_interval           30      
notification_options            d,r    
contact_groups                  admins  
register                        0                       ; DONT REGISTER THIS - ITS A TEMPLATE
}

## Default
define host{
use                             linux-box               ; Inherit default values from a template
host_name                       tecmint             ; The name we're giving to this server
alias                           CentOS 6                ; A longer name for the server
address                         5.175.142.66            ; IP address of Remote Linux host
}
Next open services.cfg file add the following services to be monitored.
[root@tecmint]# vi /usr/local/nagios/etc/services.cfg
define service{
        use                     generic-service
        host_name               tecmint
        service_description     CPU Load
        check_command           check_nrpe!check_load
        }

define service{
        use                     generic-service
        host_name               tecmint
        service_description     Total Processes
        check_command           check_nrpe!check_total_procs
        }

define service{
        use                     generic-service
        host_name               tecmint
        service_description     Current Users
        check_command           check_nrpe!check_users
        }

define service{
        use                     generic-service
        host_name               tecmint
        service_description     SSH Monitoring
        check_command           check_nrpe!check_ssh
        }

define service{
        use                     generic-service
        host_name               tecmint
        service_description     FTP Monitoring
        check_command           check_nrpe!check_ftp
        }

Now NRPE command definition needs to be created in commands.cfg file.

1
[root@tecmint]# vi /usr/local/nagios/etc/objects/commands.cfg

Add the following NRPE command definition at the bottom of the file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
###############################################################################
# NRPE CHECK COMMAND
#
# Command to use NRPE to check remote host systems
###############################################################################

define command{
        command_name check_nrpe
        command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
        }
Finally, verify Nagios Configuration files for any errors.
[root@tecmint]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Total Warnings: 0
Total Errors:   0

Restart Nagios:

1
[root@tecmint]# service nagios restart

That’s it. Now go to Nagios Monitoring Web interface at “http://Your-server-IP-address/nagios” or “http://FQDN/nagios” and Provide the username “nagiosadmin” and password. Check that the Remote Linux Host was added and is being monitored.
Nagios Remote Host Monitoring
Nagios Remote Host Monitoring

Fuente:http://www.tecmint.com/how-to-add-linux-host-to-nagios-monitoring-server/

Instalando plugin NRPE
10-.cd /tmp/ && wget http://superb-dca3.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz && sudo mv nrpe-2.15.tar.gz /opt/ && cd /opt/ && sudo tar xzf nrpe-2.15.tar.gz && cd nrpe-2.15/ && sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/libssl.so && sudo ./configure –with-ssl=/usr/bin/openssl –with-ssl-lib=/usr/lib && sudo make all && sudo make install && sudo make install-plugin && sudo make install-daemon && sudo make install-daemon-config && sudo make install-xinetd

Edite el archivo /etc/xinetd.d/nrpe y agregue la dirección IP del servidor nagios en la directiva only_from. only_from = 127.0.0.1

Agregue la siguiente entrada para el demonio NRPE en el fichero /etc/services
nrpe 5666/tcp # NRPE

Reinicie el servicio xinetd

Publicado en Debian, Seguridad | 22 comentarios

Install RVM

1-.$ \curl -sSL https://get.rvm.io | bash -s stable
2-.$ source ~/.rvm/scripts/rvm

Publicado en Shell | 27 comentarios

Glassfish como un servicio

nano /etc/init.d/glassfish

Pegar esto asumiento que glassfish esta en /usr/glassfishv3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
#
# glassfish init script for Linux
# Simplest possible case -- no password file, one default domain
# it would be simple to add such options

GLASSFISH_HOME=${GLASSFISH_HOME:-"/opt/glassfishv3/glassfish"}

case "$1" in
start)
    $GLASSFISH_HOME/bin/asadmin start-domain >/dev/null
    ;;
stop)
    $GLASSFISH_HOME/bin/asadmin stop-domain >/dev/null
    ;;
restart)
    $GLASSFISH_HOME/bin/asadmin restart-domain >/dev/null
    ;;
\*)
    echo "usage: $0 (start|stop|restart|help)"
esac

Y listo!!!

Ahora como lo usamos:

service glassfish start | stop | restart

fuente: https://blogs.oracle.com/foo/entry/how_to_run_glassfish_v3

Publicado en Glassfish | 36 comentarios

Instalar Glassfish debian 7

Descargar GlassFish Multilingue el .zip desde:

cd /tmp/

https://glassfish.java.net/es/downloads/3.0.1-final.html

o

http://download.java.net/glassfish/3.0.1/release/glassfish-3.0.1-ml.zip

Creando el directorio de instalación:

cp /tmp/glassfish-3.0.1-ml.zip /usr/

cd /usr

unzip glassfish-3.0.1-ml.zip

Agregamos Variables:

1
export GLASSFISH_HOME=/usr/glassfishv3/glassfish
 && export PATH=$JAVA_HOME/bin:$GLASSFISH_HOME/bin:$PATH

Y listo ya esta instalado!!!

Si instalaste 64bits nesecitas la compatibilidad con updatetools 32bits
sudo apt-get install ia32-libs
sudo ln -s /lib/i386-linux-gnu /usr/lib32

Ahora a correrlo:

/usr/glassfishv3/glassfish/bin/startserv

Si todo funciona agregarlo como servicio:

nano /etc/init.d/glassfish

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
#
# glassfish init script for Linux
# Simplest possible case -- no password file, one default domain
# it would be simple to add such options

GLASSFISH_HOME=${GLASSFISH_HOME:-"/usr/glassfishv3/glassfish"}

case "$1" in
start)
    $GLASSFISH_HOME/bin/asadmin start-domain >/dev/null
    ;;
stop)
    $GLASSFISH_HOME/bin/asadmin stop-domain >/dev/null
    ;;
restart)
    $GLASSFISH_HOME/bin/asadmin restart-domain >/dev/null
    ;;
\*)
status)
if [ -z ${alreadyRunning} ]
then
/bin/echo "Glassfish not running."
else
/bin/echo "Glassfish is running."
fi
exit $?
;;

And I changed the line

echo "usage: $0 (start|stop|restart|help)"

to

echo "usage: $0 (start|stop|restart|status|help)"
esac

Agregar:
sudo cp the-script /etc/init.d/glassfish
sudo update-rc.d glassfish defaults

UNDO:

sudo rm /etc/init.d/glassfish
sudo update-rc.d glassfish remove

Publicado en Glassfish | 24 comentarios

Installar Java 8 JDK Debian 7, CentOS

Actualizando:

apt-get update

Descargando java 8 JDK

1
cd /opt/

64Bits

1
2
3
sudo wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-x64.tar.gz"

tar -zxvf jdk-8u25-linux-x64.tar.gz

32 Bits

1
2
3
sudo wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-i586.tar.gz"

tar -zxvf jdk-8u25-linux-i586.tar.gz

Preparando el Directorio de instalación e Instalando:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# cd /opt/jdk1.8.0_25/
sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_25/bin/java 2
sudo update-alternatives --config java


There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*  1           /opt/jdk1.8.0/bin/java
 + 2           /opt/jdk1.7.0_55/bin/java
   3           /opt/jdk1.8.0_25/bin/java

Enter to keep the current selection[+], or type selection number: 3

sudo update-alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_25/bin/jar 2
sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_25/bin/javac 2
sudo update-alternatives --set jar /opt/jdk1.8.0_25/bin/jar
sudo update-alternatives --set javac /opt/jdk1.8.0_25/bin/javac

Variables:

1
2
3
export JAVA_HOME=/opt/jdk1.8.0_25
export JRE_HOME=/opt/jdk1.8.0_25/jre
export PATH=$PATH:/opt/jdk1.8.0_25/bin:/opt/jdk1.8.0_25/jre/bin

Agrega esto es si ya extrajiste glassfish en su directorio:

1
export GLASSFISH_HOME=/usr/glassfishv3/glassfish
 && export PATH=$JAVA_HOME/bin:$GLASSFISH_HOME/bin:$PATH
Publicado en Glassfish | 20 comentarios

32 bits o 64 bits?

getconf LONG_BIT

o

lscpu

Publicado en Debian | 23 comentarios

wineserver not found!

Solución wineserver not found!

sudo ln -s /usr/lib/i386-linux-gnu/wine/bin/wineserver /usr/local/bin/wineserver

Publicado en Shell | 19 comentarios

Nautilus auto play

sudo aptitude install mpg321 vorbis-tools

Publicado en Modo Usuario | 29 comentarios