Showing posts with label developer. Show all posts
Showing posts with label developer. Show all posts

Friday, August 3, 2018

Content-Security-Policy: frame-ancestors *

Content-Security-Policy: frame-ancestors *
is the header line that permits you to use any html, content or object as iframe or frame or whatever in any other website. It comes from the source websate. BUT, all your iframes won't work in the browser with file:// and you will get crazy trying to check what it is happening in your local tests.

Quick-hotfix: in linux or mac you can use, from the local path of your html, the famous python -m SimpleHTTPServer and try it with http://localhost:8000/<uripath>

Thursday, April 21, 2016

git commit and the error: There was a problem with the editor 'vi'.

Error message:

error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.


Quick solution:

git config --global core.editor $(which vim)

Short-reason: If you are using vundler, or similar, you could find this error.
Issue: https://github.com/VundleVim/Vundle.vim/issues/167

Wednesday, February 18, 2015

supervisord in CentOS 7 (systemd version)

Hello,

Fast installation in CentOS 7 for this "helper" to the queues service in laravel or django framework. EPEL package too old so:
  1. yum install python-setuptools python-pip
  2. pip install supervisor
  3. mkdir -p /etc/supervisord
  4. echo_supervisord_conf > /etc/supervisor.d/supervisord.conf
  5. forked systemd init script  (thx to Jiangge Zhang) in /usr/lib/systemd/system/supervisord.service:


And: 
  1. systemctl enable supervisord
  2. systemctl start supervisord

User=nginx is useful to run this process as nginx user. You can change it but the user must be in the system.

Tuesday, January 27, 2015

Fast access to the history host table of Netcraft site from terminal

Fast and ugly but it works. Useful for detecting old IPs and system OS. Netcraft history host table from terminal:


Netcraft uses javascript so I chose casperjs for the scraper:

Monday, January 19, 2015

pyV8 RPM for CentOS 6

First RPM package for the project pyV8. You will save all the compiling process ;)
I used the last revision in the svn today (r586).

It depends of the boost library but i have RPMS for that in the repo ;)

There we go:

yum install python-pyV8

Loading mirror speeds from cached hostfile
 * base: mirror.trueinter.net
 * epel: mirror.uv.es
 * extras: mirror.trueinter.net
 * updates: mirror.trueinter.net
Resolviendo dependencias
--> Ejecutando prueba de transacción
---> Package python-pyV8.x86_64 0:1.0-preview_r586svn.el6 will be instalado
--> Procesando dependencias: libboost_python.so.1.55.0()(64bit) para el paquete: python-pyV8-1.0-preview_r586svn.el6.x86_64
--> Procesando dependencias: libboost_system.so.1.55.0()(64bit) para el paquete: python-pyV8-1.0-preview_r586svn.el6.x86_64
--> Procesando dependencias: libboost_thread.so.1.55.0()(64bit) para el paquete: python-pyV8-1.0-preview_r586svn.el6.x86_64
--> Ejecutando prueba de transacción
---> Package libboost_python1_55_0.x86_64 0:1.55.0-1 will be instalado
--> Procesando dependencias: boost-license1_55_0 para el paquete: libboost_python1_55_0-1.55.0-1.x86_64
---> Package libboost_system1_55_0.x86_64 0:1.55.0-1 will be instalado
---> Package libboost_thread1_55_0.x86_64 0:1.55.0-1 will be instalado
--> Ejecutando prueba de transacción
---> Package boost-license1_55_0.x86_64 0:1.55.0-1 will be instalado
--> Resolución de dependencias finalizada

Dependencias resueltas

======================================================================================================================
 Paquete                  Arquitectura
                                    Versión                      Repositorio                                    Tamaño
======================================================================================================================
Instalando:
 python-pyV8              x86_64    1.0-preview_r586svn.el6      enetres                                         10 M
Instalando para las dependencias:
 boost-license1_55_0      x86_64    1.55.0-1                     enetres                                         39 k
 libboost_python1_55_0    x86_64    1.55.0-1                     enetres                                        130 k
 libboost_system1_55_0    x86_64    1.55.0-1                     enetres                                         40 k
 libboost_thread1_55_0    x86_64    1.55.0-1                     enetres                                         62 k

Resumen de la transacción
======================================================================================================================
Instalar       5 Paquete(s)

Tamaño total: 11 M
Tamaño total de la descarga: 271 k
Tamaño instalado: 11 M
Está de acuerdo [s/N]:


As always, the pyV8 RPM package is in our repo: http://repo.enetres.net/

:)






Wednesday, September 24, 2014

Process monitor template with logger and email notifier (daemonized)

If you are looking for a template to write a fast copy-and-paste script (daemonized) for monitoring one process... you can get some ideas from this:



Thursday, July 31, 2014

Nodejs: your global modules don't work after installing

Another linux distribution enigma.

In the name of Tutatis, why f**** the node_modules directories are different in  npm and "distro" packages????. The error message is similar to:
Error: Cannot find module 'any_npm_module'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at repl:1:7
at REPLServer.self.eval (repl.js:110:21)
at repl.js:249:20
at REPLServer.self.eval (repl.js:122:7)
at Interface.<anonymous> (repl.js:239:12)
at Interface.emit (events.js:95:17)
Surprise!!!

CentOS, Fedora, Ubuntu, Debian and MacOSX-ports are using diferent path for the nodejs global modules. If you install the binary of "node" and "npm", and later, you choose to use npm to install some modules, your modules will be dissapeared.

Workarounds:
  1. Compile your own node/npm version (LOL!).
  2. Use local modules always (for command line scripts is very LOL!)
  3. Use NODE_PATH to point to the correct path:
    1. Standard profile: For only one user, you can use .profile, .bash_profile or .bashrc $HOME files (be careful if you are doing login, it uses only one kind of file so choose the correct one).
    2. Developer Eclipse: You can configure environment variables in the properties of the main js file of your project. So you could put NODE_PATH there. 
    3. Daemon/Service profile: Launch from init.d. You could create a correct init.d script with the NODE_PATH inside ;)
    4. Master of node global modules (one ring to bring them all):
      1. Linux: you need to create /etc/profile.d/nodejs.sh with the export NODE_PATH path there. (And restart)
      2. MacOSx: you need to create the crazy and non-existentz /etc/launchd.conf and write this line: setenv NODE_PATH /usr/local/lib/node_modules. And restart.
:) 



Wednesday, July 30, 2014

Glassfish 4: Updating Weld

Summary:

Updating Weld (http://delabassee.com/blog/?p=286):
1. Grab the Weld 2.0.5 OSGi bundle and copy it to the GF modules directory:
cp weld-osgi-bundle-2.0.5.Final.jar glassfish/modules/
2. Restart GlassFish:
glassfish/bin/asadmin restart-domain domain1
3. You check which version is now installed by issuing:
glassfish/bin/asadmin osgi lb | grep 'Weld OSGi'

Thursday, July 24, 2014

Ubuntu/Debian: nodejs package provides nodejs binary and not node binary

Crazy and f*%*%* linux distribution world

Error:
/usr/sbin/node: No such file or directory
Someone in Debian (and Ubuntu then) chose to eliminate "node" binary from nodejs package. Now the binary is "nodejs". So, for Eclipse, and some scripts, node does not work although nodejs package is installed!

Well.... the same guy has preferred to create a second package to solve that. The package is "nodejs-legacy".

So, please, poor Debian/Ubuntu user, you need to remember that when you install node:
apt-get install nodejs nodejs-legacy
It is the life.




Tuesday, April 22, 2014

Compiling Boost 1.55 in CentOS 6

Fast:
  1. EPEL repository
  2. Updated system
  3. yum groupinstall "Development tools"
  4. yum install boost*
  5. yum remove boost* (last two steps to get initial dependencies)
  6. yum install libicu libicu-devel zlib-devel zlib python-devel bzip2-devel texinfo
  7. Download tarball of boost_1_55 and extract
  8. /bootstrap.sh --with-icu
  9. ./b2 -d0 -a
:)