lunes, 16 de junio de 2014

Crear base de datos y usuario por comandos en SQL Server

La base de datos, login y usuario pueden ser creados con el SQL Server Management Studio con solo unos pocos clics. Sin embargo, yo prefiero usar comandos (SQLCMD), este es un ejemplo básico.


USE [master]
GO
-- Very basic DB creation
CREATE DATABASE [REDMINE]
GO
-- Creation of a login with SQL Server login/password authentication and no password expiration policy
CREATE LOGIN [REDMINE] WITH PASSWORD=N'redminepassword', DEFAULT_DATABASE=[REDMINE], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFFGO

-- User creation using previously created login authentication
 
USE [REDMINE]
GO
CREATE USER [REDMINE] FOR LOGIN [REDMINE]
GO
 
-- User permissions set via roles
 
EXEC sp_addrolemember N'db_datareader', N'REDMINE'GO
EXEC sp_addrolemember N'db_datawriter', N'REDMINE'GO

Y voilà!

viernes, 6 de junio de 2014

[Solucionado] Error Could not find a valid gem xxxx <>=0 in any repository bad response Proxy Authentication Required

Para los que intentan instalar algo con el comando

gem install xxxx

y les sale el error
Could not find a valid gem xxxx <>=0 in any repository bad response Proxy Authentication Required 
Por lo general es porque estas en un computador donde no eres el Administrador total del sistema y necesitas un usuario y clave para incresar. En mi caso, se solucionó de la siguiente forma:

1. Encuentre el proxy de conexión a internet: En Herramientas ->Conexion a Internet->Configuración LAN, o algo parecido. Alli aparece la dirección IP del proxy y el puerto para conectarse a internet.

2. Complete el comando de instalación así

gem install --http-proxy=http://user:password@host:port  programa

donde
user: usuario, password:clave del sistema, host: IP del proxy y Port: puerto Programa: programa a descargar con gem.

Y voilà!

miércoles, 4 de junio de 2014

Implementación Omniture o SiteCatalyst para scCheckout, Purchase, Carrito de Compra

prodView : El evento ocurre cuando el visitante VE en detalle un producto.

  •  scView : El evento ocurre cuando el visitante ve el carrito de compra. 
  •  scOpen : El evento ocurre cuando el visitante abre el carrito de compra por primera vez. 
  •  scAdd : El evento ocurre cuando un producto es añadido al carrito de compra. 
  • scRemove : El evento ocurre cuando un producto es removido del carrito de compra. 
  • scCheckout : El evento ocurre cuando el visitante hace clic en comprar (antes de verificar datos y confirmar compra) 
  •  purchase : El evento ocurre cuando el visitante confirma su compra (incluye cantidades, total de la compra).  

Las variables definidas por nosotros son (y dependen de su negocio):

  •  s.eVar25 Identificador de Compra Variable que debe contener el ID único de la compra.
  • s.events="event11" Product View (Custom) Evento que contiene que un producto fue visto (prodView) 
  •  s.events="event7" Precio Unitario Contiene precio unitario. 
  •  s.eVar17 ID del producto Guarda el ID del producto
  •  s.eVar37 Fecha Compra Guarda la fecha en que se realizó la compra


La sintaxis del s.products es asi




 El proceso de compra de un producto online se traquea así:

 Ver un producto (cuando una persona se interesa por un producto y quiere ver más detalles)

s.events=”prodView”
s.products=”;1234”

Carrito de Compra 

(scOpen, scView, scAdd, scRemove ->se usan cuando es posible comprar más de un producto distinto. Si solo hay un producto ofrecido, no hay nececidad de implementar esta parte)

s.events=”scOpen, scAdd”
s.products=”;1234”

Checkout (cuando se da clic en Comprar->se implementa para uno o varios productos comprados) s.events=”scCheckout”

 s.products=”;1234”
Purchase (cuando se confirma la compra, compra completada) 
s.events="purchase"
s.products=";1234” 

Ejemplo (completo) para implementar scCheckout (sobre un botón - función onClick)

 s.linkTrackVars="events,eVar17,products";
 s.linkTrackEvents="scCheckout";
 s.events="scCheckout";
 s.eVar17="102";
 s.products=";102";
 s.tl(this,"o","Checkout");

 Ejemplo para implementar scPurchase (sobre un botón - función onClick)

s.linkTrackVars="events, eVar17,evar37,eVar25,products,purchaseID"; s.linkTrackEvents="purchase,event7";
 s.eVar17=43;
s.eVar37="2014-05-09";
 s.events="purchase,event7";
s.products=";43;1;56000;
event7=56000";
s.purchaseID = "etc55680";
 s.tl(this,"o","purchase");

martes, 3 de junio de 2014

Instalando Ruby y RubyGems en Windows

Descargar e instalar Ruby

1. Descargar RubyInstaller de aquí. La página recomienda instalar la versión de Ruby 1.9.3.
2. Cuando se abra la ventana desplegable, despues de pasar por la selección de idioma, en la parte donde te da a escoger entre 3 opciones, selecciona la 2da y la 3ra. Lo que haces es definir los ejecutables de Ruby en mi propio destino, y que asocie los archivos .rb y rbw con Ruby.

3. Dale click en "Install"

Instalar DevKit

1. De la misma página (clic aquí), instalar DevKit (DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe). Seleccionar C:\ como la carpeta de instalación del paquete, haciendo click en "..." de su herramienta de compresión.

2. Escribir DevKit y crear la carpeta dentro de C:\
3. Hacer clic en OK y dejar que se extraigan los archivos.
4. Abrir una consola (escribir cmd en el menu de inicio) y escribir los siguientes comandos


> chdir C:\DevKit
> ruby dk.rb init
> ruby dk.rb install

Debe verse algo así:


Y voilà! Listo Ruby y RubyGems.


martes, 22 de abril de 2014

[Solucionado] Problemas iniciando Apache en Windows Error de Conexion Puerto 80

El error al iniciar XAMPP en Windows es:

Problem detected!
Port 80 in use by "Unable to open process" with PID 4!
Apache WILL NOT start without the configured ports free!
You need to uninstall/disable/reconfigure the blocking application
or reconfigure Apache and the Control Panel to listen on a different port

Aparentemente XAMPP nos indica que el proceso de ID 4 está usando el puerto 80, el configurado por defecto de Apache. Sin embargo, a veces no es tan sencillo como ir al Administrador de tareas y desactivar el proceso con ID 4. Voy a señalar varios caminos de solución, y al final, diré cuál fue el mio. 

La siguiente parte fue tomada del blog 

Parar los servicios de Microsoft Internet Informationi Service (ISS) 

Abrir la consola de Windows (cmd) y tipear para Windows Vista/7
net stop was /y
o para XP
net stop iisadmin /y

SERVICIOS DE REPORTE DE SQL SERVER

Cuando SQL Server es instalado (e inclusive cuando es desinstalado) los SSRS (los servicios de reporte) pueden quedar activos. Para parar estos servicios:
1. Abrir SQL Server Management Studio
2. Seleccionar SQL Server Services en el listado del panel en la izquierda.
3. Doble click en "Servicios de Reporte de SQL Server"
4. En la parte de arriba, oprimir "Parar"

SKYPE

A veces Skype puede usar el puerto 80 y bloquear Apache. Primero, vaya a Herramientas>Opciones>Avanzada> Conesxion y desabilite la opcion "Usar puerto 80 y 443 como alternativas para conexiones entrantes".
Luego, cierre Skype. 

Descubrir cuál servicio está usando el puerto 80

para esto, tipea en el cmd 
netstat -ao
Esto sacará una lista de los puertos que están siendo usados ylos procesos corresopndientes. Listará también el ID asociado a dichos procesos. Debe localizar el ID del proceso que esté usando 0.0.0.0:80 y activar el Administrador de tareas. Ubicar el ID del proceso (para visualizar el ID haga clic en Ver>seleccionar columnas y hacer click en ID. Luego, escoger el proceso asociado y matarlo.

Mi Problema


Ninguno de los anteriores en realidad solucionó mi problema. Me di cuenta entonces que todo era por el DROPBOX. Lo cerré y Voilà, solucionado. Grrrrr!! jdksajfis#$%%!!!

 Solucion definitiva: Cambiar los puertos usados por defecto en XAMPP

(tomado de aqui)

Los puertos por defecto de APACHE son 80 y 443. Esto puede ser facilmente modificado cambiando dos ficheros.
1. Ir a la carpeta de XAMPP (Ej. C:\Xampp\apache\Conf) y sustituir 
ServerName localhost:80 por ServerName localhost:8080
Listen 80 por Listen 8080.
2.  Ir a xampp\apache\conf\extra y sustituir
VirtualHost_default_:443 por VirtualHost_default_:4430
ServerName localhost:443 por ServerName localhost:4430
Listen 443 por Listen 4430 

Espero funcione para uds.

jueves, 3 de abril de 2014

CREATE DATABASE permission denied in database ‘master’. (Microsoft SQL Server, Error: 262)

I get CREATE DATABASE permission denied in database ‘master’ error when I try to create a new database in Windows Server.

This is what is going on:

When a user in the Administrators account runs SQL Server Management Studio, the User Account Control feature strips the membership token for that group and passes only the user account information to SQL Server. A message is returned that states that the account does not have rights to log in to SQL Server. To let members of the Windows Administrators group log in, you must explicitly add the account to the SQL Server logins.


To be more fair, this is the post that saved it for me :)

http://menononnet.wordpress.com/2011/03/07/create-database-permission-denied-in-database-master-microsoft-sql-server-error-262/

[Solucionado] SQL server setup media does not support the language en Windows 7 SQL Server Express

Al intentar instalar Windows Server 2012 Express, salía siempre una pop up window con el error

 SQL server setup media does not support the language of the OS or does not have ENU localized files. Use the matching language-specific SQL Server media or change the OS local through Control Panel

Esto es por tener un lenguaje especifico de una zona particular, en mi caso, el sistema esta configurado con Español (Colombia). Debemos dejarlo más general, con Español (España).

Entonces, solo es:

Inicio->Panel de Control-> Reloj, idioma y region-> Configuracion regional y de idioma

Sale una pantalla pop up y se elige el formato Espanol (Espana).

Aplicar, Aceptar.


Voila!

Ahora intentar instalar SQL Server nuevamente!

miércoles, 26 de marzo de 2014

Instalando dropbox en Ubuntu 13.10 , 64-bit laptop

Para descargar el fichero se pone el siguiente comando
32-bit:
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf -
64-bit:
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
y para instalarlo
 ~/.dropbox-dist/dropboxd

Al instalarlo por primera vez, debera seguir las instrucciones del wizard.

Voila!

jueves, 20 de marzo de 2014

Event tracking on my WebSite with Google Analytics

I needed to track an specific event on my website, and when I configured the conversions on GA, the results was null. I supposed there was a problem with the capture of that specific event in GA, because I noticed there were already a lot of visitors and a lot of interaction with that specific button but I haven't had any results.
Anyways, I went into the GA developers documentation, and here is what I found:

I needed to set the variables of the event inside the template (file) where I sited the google analytics tracking code, with these parameters:
ga('send', 'event', 'button', 'click', 'nav buttons', 4);
where
  • button is the category
  • click is the action
  • nav buttons is the label
  • 4 is the value
to be more specific (it could happen you have to buttons with the same type of interaction), then you can set the web page

ga('send', 'event', 'category', 'action', {'page': '/my-new-page'});
There are other things you can do, but this was good enough for me.

This is the link I used
https://developers.google.com/analytics/devguides/collection/analyticsjs/events




jueves, 6 de marzo de 2014

Instalando Xampp en Ubuntu 13.10

Ir a http://www.ubuntu-guia.com/2013/10/instalar-xampp-ubuntu-1404.html

Para que no se me pierda...!

miércoles, 5 de marzo de 2014

Installing Skype on Ubuntu 13.10

I recently upgraded my system from 13.04 to 13.10 and I lost plenty of stuff I have installed so patiently... So, I had to re-install them.

For Skype, all I did was finding the link to download the package and install it. Pretty simple, so here it goes:

wget -c skype.deb http://download.skype.com/linux/skype-ubuntu-precise_4.2.0.13-1_i386.deb -O skype.deb
sudo dpkg -i skype.deb 
sudo apt-get -f install
And voila! That was it. It should work for earlier versions of Ubuntu as well.
 

jueves, 27 de febrero de 2014

FreeFileSync in Ubuntu 13.10

I've been uninstalling and installing stuff lately and this program is one of those. I have to search every time the commands to install it cause I just can't remember, so, here I will safe it as long as this blog exists :)

sudo add-apt-repository ppa:freefilesync/ffs
sudo apt-get update
sudo apt-get install freefilesync

That's it :)

martes, 18 de febrero de 2014

How to reconfigure the graphic interface in Ubuntu 13.04

Trying to fix a problem with my touchpad, I screw up the graphic interface. I am not sure what I did to the core files of the system, but once I reboot the system, it didn't show anything at all... Black page with a blinky pointer on it. 
So, first, I had to reboot again and right before it goes to black again, press Ctrl+Alt+F2 (that would take you to the command console). Set the login and password. 

Make sure everything is on the lastest version, so type:
sudo apt-get update && sudo apt-get upgrade
After this, you have 2 options. The thing is that this version of Ubuntu comes with a display manager called lightdm. You could remove all the files and reinstall it, or install a new one (which is also very common) named gmd. I will explain both (although it is almost the same process).

Installing Gdm
1. I made sure Gdm wasn't installed before (or with damaged packages)
sudo apt-get remove gdm
sudo apt-get purge gmd
sudo apt-get install gmd 
2. I removed all the xserver.xorg also, to reinstall them again
sudo apt-get remove --purge xserver-xorg
sudo apt-get install xserver-xorg
 3. Reboot the system or start gdm
sudo reboot 
or
sudo start gdm 

Installing (or reinstalling) LightDm
1. Type in the console
sudo apt-get remove lightdm
sudo apt-get install lightdm
sudo dpkg-reconfigure lightdm
At this point, a window will show up to select one of the two display managers. Pick one of the two, and now reboot or start one of the two from the console.

That worked for me!

 

lunes, 17 de febrero de 2014

Troubleshoot with ttf-mscorefonts-installer in Ubuntu

This is problem occurred right after installing an update for Ubuntu 13.0, and basically it doesn't allow me to install any other package in the system. The output for it is:

The package ttf-mscorefonts-installer needs to be reinstalled but I can't find a package for it. 

This means that even when opening the console and typing

sudo apt-get-install ttf-mscorefonts-installer 

won't find anything at all.

The problem was that at some point of one of the automatic updates, the internet connection broke and some packages of the installation couldn't update properly. Or that is what happened in my case, so, what I did was to update the system again, with this simple commands:

sudo dpkg --configure -a
sudo apt-get update
sudo apt-get upgrade
Right after, another console will pop up and it will show this 

┌─────────────────┤ Configuring ttf-mscorefonts-installer ├─────────────────┐

So I had to press the OK highlighted button at the bottom. 

And that was it!