- Varios
 - Viajes
 - Geek
 - Videos
 - FAQs


Envíos pendientes
 - Albumes (1)
 - Noticias (1)


Estadísticas
 - Usuarios (23)
 - Noticias (202)
 - Albumes (48)
 - Comentarios (151)



Suscripción via RSS 2.0
Home Albums About Ayuda
Friends Corner  | Geek News 
 
Geek News Enviar 

 
rabbitmqctl: Error unable to connect to node
Publicado el: 2013-01-17 15:22:47 por frommelmak
Editado por última vez: 2013-01-17 15:39:50 por frommelmak
 

If you are running rabbitmqctl with a different user than the one used by server, you will get an error like this:

rabbitmqctl status Status of node rabbit@foo
Error: unable to connect to node rabbit@foo: nodedown
- home dir: /root
- cookie hash: 0fWPcZtM431dRX003r6OAg==

This is because the cookie stored in your home directory  .erlang.cookie differs from the cookie used by the server instance.

The cookie file used by the server is inside the home dir used by the server. You can see the location of the home dir in the stdout of the rabbitmq server  during the startup. Something like:

home dir       : /opt/rabbitmq/var/lib/rabbitmq
cookie hash    : NNYm39bSA1i7yB+fQjTdiOJK


To solve the problem, just copy the .erlang.cookie in the home dir of the user you are using to execute the rabbitmqclt command line.

 

 

 

 Enviar comentario  
 
Couchdb: How to continue the replication processes after restart
Publicado el: 2012-08-30 12:58:45 por frommelmak
Editado por última vez: 2012-08-30 13:33:03 por frommelmak
 

As you probably know, the replication in couchdb is triggered by sending a JSON doc to the _replicate URL using a POST request. Something like that:

curl -X POST http://localhost:5984/_replicate  -d '{"source":"http://src_ip:5984/src_db", "target":"dst_db", "continuous":true}' -H 'Content-Type: application/json'


The problem using this approach is that the replication process  does not continue after a CouchDB restart. Since CouchDB 1.1.0, you can use the  _replicator database to ensure that the replication processes are triggered again after a service restart. Just fill up the _replicator database with a documment defining the replication process in the same way that you did using the _replicate API.

curl -X POST -d '{"source":"http://src_ip:5984/source_db", "target":"dst_db", "continuous":true}' -H 'Content-Type: application/json' http://localhost:5984/_replicator

Now you don't need to worry about the replication processes after a service restart.

more info: http://wiki.apache.org/couchdb/Replication

 Enviar comentario  
 
How to mount a ZFS drive in Linux
Publicado el: 2012-02-08 14:39:12 por frommelmak
Editado por última vez: 2012-02-08 18:46:45 por frommelmak
 

First: Plug the HDD into a SATA to USB adapter (obvious).

Then find the device:

sfdisk -l

In my casi the device was /dev/sdb1

Install zfs-fuse for your distro:

Debian:

apt-get install zfs-fuse

OpenSUSE:

zypper install zfs-fuse

Start the zfs fuse daemon:

/etc/init.d/zfs-fuse start

super8:~ # zpool import
  pool: mypool
    id: 16911161038176216381
 state: ONLINE
status: The pool was last accessed by another system.
action: The pool can be imported using its name or numeric identifier and
    the '-f' flag.
   see: http://www.sun.com/msg/ZFS-8000-EY
config:
    mypool                                      ONLINE
      disk/by-id/ata-ST3500418AS_5VM4KPXB-part2  ONLINE

Force the command using the -f flag and the pool identifier

super8:~ # zpool -f import 16911161038176216381

Verify that everithing look normal:

super8:~ # zpool list
NAME      SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
mypool   460G  2.97G   457G     0%  1.00x  ONLINE   -

And mount the filesystem in your desired mountpoint.

zfs set mountpoint=/mnt/zfs mypool

Thats all, you are done! Your disk is available at /mnt/zfs mountpoint

Do whatever you need to do and finaly umount the device with this command:

zfs umount mypool

 Enviar comentario  
 
How to convert your server into a video streaming server
Publicado el: 2012-01-30 19:15:34 por frommelmak
Editado por última vez: 2012-01-30 19:23:51 por frommelmak
 

Dependencies:

apt-get install vlc-nox


File to stream:

cvlc -v file.mp4 --sout '#standard{access=http,mux=asf,dst=0.0.0.0:8080}'


Authenticated Stream to Stream (without audio)

cvlc -v http://x.x.x.x:pppp/test --no-sout-audio --sout-http-user foo 
--sout-http-pwd foopass --sout '#standard{access=http,mux=asf,dst=0.0.0.0:8080}'

More options:

vlc -H


More info:
http://www.videolan.org/doc/streaming-howto/en/
http://www.videolan.org/doc/streaming-howto/en/ch04.html

 Enviar comentario  
 
How to migrate from LAMP to Nginx + PHP-FPM
Publicado el: 2011-11-03 14:26:49 por frommelmak
Editado por última vez: 2011-11-07 23:03:00 por frommelmak
 

This blog has been migrated from Apache2 + mod_php to Nginx + PHP-FPM. In this entry I'm going to explain the whole process (just for fun).

The easiest way is just install the precompiled packages from www.dotdeb.org  as explained here.
Unfortunatelly my blog isn't compatible with the latest PHP versions provided by dotdeb, so I've had to compile my own version of PHP-FPM.

Firts of all, we need to install Nginx:

apt-get install nginx

 Then I downloaded the source code of PHP 5.4.3 from http://www.php.net/releases/

cd /var/tmp
wget http://museum.php.net/php5/php-5.3.4.tar.gz
tar zxvf php-5.3.4.tar.gz
cd php-5.3.4
./configure --prefix=/opt/php-5.3.4 --enable-fpm --with-mcrypt --with-zlib --enable-mbstring --disable-pdo --with-mysql --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex
make all
make install

Now, the required PHP version, including the PHP-FPM service are installed here: /opt/php5-3.4

The easiest way to get the PHP-FPM service running is by using the init script and the config files contained in the php5-fpm dotdeb package.

wget http://packages.dotdeb.org/dists/squeeze/php5/binary-i386/php5-fpm_5.3.8-1~dotdeb.2_i386.deb
dpkg-deb -x php5-fpm_5.3.8-1~dotdeb.2_i386.deb /tmp/php5-fpm
cp /tmp/php5-fpm/etc/init.d/php5-fpm /etc/init.d/php5-fpm
cp -R /tmp/php5-fpm/etc/fpm /etc/php5/
ln -s /opt/php-5.3.4/sbin/php-fpm /usr/sbin/php5-fpm
 

Now you should copy your previous php.ini file into the correct place: Use phpinfo () to know  the correct path for the php.ini file:
 /opt/php-5.3.4/bin/php -i|grep php.ini

In this case, the PHP-FPM will look for php.ini here /opt/php-5.3.4/lib, so just drop your previous file here.

cp /etc/php5/apache2/php.ini /opt/php-5.3.4/lib

 Enviar comentario  
 
VPN using SSH
Publicado el: 2011-09-12 19:29:21 por frommelmak
Editado por última vez: 2011-09-13 15:05:26 por frommelmak
 

Las versiones "recientes" del servidor OpenSSH permiten montar una VPN utilizando una conexión SSH. Esto nos permite, por ejemplo, tener acceso a todos los puertos del servidor incluso en aquellos casos en los que sólo nos dan acceso al puerto de SSH.

Para montar una VPN utilizando el servidor SSH en Debian haremos lo siguiente...

Leer más (1755) palabras   Enviar comentario  
 
redis-cli basics
Publicado el: 2011-07-22 13:49:08 por frommelmak
Editado por última vez: 2011-09-21 13:19:29 por frommelmak
 

Redis es un servidor de datos Nosql (clave-valor) en memoria similar a memcached. Redis puede almacenar -además de cadenas de texto- estructuras más complejas como: hashes, lists, sets u sorted sets. Es capaz de realizar diferentes tipos de operaciones atómicas sobre estas estructuras de datos, disponer de persistencia (pese a trabajar en memoria), replicación, y otras características que estan haciendo que redis se utilice cada vez en mas proyectos.

En esta entrada, vamos a ver los 4 conceptos básicos que hay que tener en cuenta a la hora de trabajar con la línea de comandos de redis para la administración de este servicio.

Leer más (719) palabras   Enviar comentario  
 
How to use Gmail POP/SMTP services from unsecure clients
Publicado el: 2011-05-23 22:15:55 por frommelmak
Editado por última vez: 2011-06-02 17:35:09 por frommelmak
 

Sometimes you may need to send or retrieve email notifications using SMTP or POP Gmail services, but your client does not support SSL connections. In such cases you can use a SSL proxy tunnel  such as stunnel.

stunnel is available as a Debian package, and probably in other modern Linux distributions. It is also available as Win32 binary.

The installation in debian is as simple as type:

apt-get install stunnel

Since stunnel relies on OpenSSL libraries, the first thing is create a x509 cert.

cd /etc/ssl/certs

openssl req -new -x509 -days 3650 -nodes -out stunnel.pem -keyout stunnel.pem

Then you need to configure stunnel in order to forward all the traffic in the 110 (POP) and 25 (SMPT) to the Gmail 995 and 465 ports respectively.

/etc/stunnel/stunnel.conf

[pop3s]
accept  = server_ip_address:110
connect = pop.gmail.com:995

[ssmtp]

accept  = server_ip_address:25
connect = smtp.gmail.com:465

The server_ip_address could be the LAN interface IP address or the localhost, depending if the client program is running localy or in some other host in your LAN.

 Finaly, just start de service:

/etc/init.d/stunnel4 start

And test the service:

telnet server_ip_address 110
Trying ...
Connected to somehost.
Escape character is '^]'.
+OK Gpop ready for requests from xx.xx.xx.xx dewf14449283wbe.15
USER your_user@gmail.com
+OK send PASS
PASS your_gmail_pass
+OK Welcome.
LIST
+OK 2 messages (23782 bytes)
1 3124
2 2758

If you can connect with telnet, your client can do it too.

@oriolrius, thanks for telling me about this tool.

For more info visit: www.stunnel.org.

 Enviar comentario  
 
Building CouchDB from sources in RHEL6
Publicado el: 2011-04-18 19:00:48 por frommelmak
Editado por última vez: 2011-04-18 19:05:20 por frommelmak
 

Install Erlang from sources:

Prerequisites: unixODBC-devel-2.2.14-11.el6.i686.rpm

wget http://www.erlang.org/download/otp_src_R14B02.tar.gz
tar zxvf otp_src_R14B02.tar.gz
cd otp_src_R14B02 LANG=C; export LANG
./configure --prefix=/opt/erlang
make
make install

 

Install Mozilla SpiderMonkey from sources:

Prerequisties: libicu-devel-4.2.1-9.el6.i686.rpm, libicu-4.2.1-7.el6.i686.rpm

wget http://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz
tar zxvf js-1.7.0.tar.gz
cd js/src
mkdir /opt/js-devel
make BUILD_OPT=1 JS_DIST=/opt/js-devel -f Makefile.ref export

 

And finally install Couchdb from sources:

ERL='/opt/erlang/bin/erl' ; export ERL
ERLC='/opt/erlang/bin/erlc' ; export ERLC
wget http://apache.rediris.es//couchdb/1.0.2/apache-couchdb-1.0.2.tar.gz
tar zxvf apache-couchdb-1.0.2.tar.gz
cd apache-couchdb-1.0.2
./configure --prefix=/opt/couchdb \
--with-erlang=/opt/erlang/lib/erlang/usr/include/ \
--with-js-include=/opt/js-devel/include/js \
--with-js-lib=/opt/js-devel/lib
make
make install

 

 Enviar comentario  
 
Tareas frecuentes con LVM
Publicado el: 2011-02-15 17:25:01 por frommelmak
Editado por última vez: 2011-02-16 08:44:44 por frommelmak
 

Un par de apuntes rápidos sobre LVM:

Juntar varios discos o particiones en un único volumen lógico:

    pvcreate /dev/sdb /dev/sdc
    vgcreate -s 16M data /dev/sdb /dev/sdc

    vgdisplay

    lvcreate -l 25600 -n storage data
    mkfs.ext3 /dev/data/storage

Expandir en 100GB un LV y el filesystem que contiene.

    lvextend -L+100G /dev/mapper/loquesea
    umount /del/putno/de/montaje
    e2fsck -f /dev/mapper/loquesea
    resize2fs /dev/mapper/loquesea
    mount -a

 Enviar comentario  
 
 

Siguiente >> (Total 101)

Follow frommelmak on Twitter

No me rias de ti ! Login

Nombre:


Contraseña:



This site is powered by homesitemaker-v0.4.8 code. This code is distibuted under GNU/GPL license and are made by melmak from www.assl-site.net
All trademarks and copyrights on this page are owned by their respective owners.