Jan 28, 2015

[SOLVED] Odoo OpenERP QWebTemplateNotFound: External ID not found in the system

just a simple note :


1. remove your previous database (at first error installation)
2. apt-get install python-passlib
3. run installation again.


Read more ...

Dec 28, 2014

[SOLVED] ActiveRecord::StatementInvalid: Mysql2::Error: The used command is not allowed with this MySQL version

hi there...


i just want to share about

direct execution with ActiveRecord on Rails 4

its use effectively to load huge data, so  you need to bypass some needless functions.

sometimes you need to load maybe via CSV or load by SQL, but i recommend to use Local Copy in postgress of load local infile in mysql 

here is the solution 

put localinfile option on database.yml

default: &default
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: root
  password: root
  socket: /var/run/mysqld/mysqld.sock
  local_infile: true


refs:

Read more ...

Dec 27, 2014

Cisco CDR Hex2Ip mysql format

Hi all,

just my note about hex 2 ip conversion for Cisco UCM CDR log.



DELIMITER ;;

DROP FUNCTION IF EXISTS chex2ip;;
CREATE FUNCTION chex2ip (x INTEGER)
  RETURNS varchar(15)
  DETERMINISTIC NO SQL
  BEGIN
    DECLARE x1 varchar(2);
    DECLARE x2 varchar(2);
    DECLARE x3 varchar(2);
    DECLARE x4 varchar(2);
    DECLARE temp varchar(8);
    IF (x<0) THEN
       set temp = SUBSTR(CAST(HEX(x) AS CHAR),9,8);
    ELSE
       set temp = CAST(HEX(x) AS CHAR);
    END IF;
    set x1=substring(temp,1,2);
    set x2=substring(temp,3,2);
    set x3=substring(temp,5,2);
    set x4=substring(temp,7,2);
    RETURN concat(conv(x4,16,10),'.',conv(x3,16,10),'.',conv(x2,16,10),'.',conv(x1,16,10));
  END;;

DELIMITER ;




for other timestamp field, which is use unix, you can convert to mysql-format by :

SELECT from_unixtime(timestamp, '%Y %D %M %h:%i:%s')


here's some refs :

Cisco
Cisco CDR Header
Read more ...

Oct 10, 2014

install phpmyadmin for multi server multi port, phpmyadmin single signon


i want to use one server to manage some mysql server in some ip's

let start,.

pre-requisites

a. installed apache
b. installed php and its library for mysql connection

install phpmyadmin single signon

1. download phpmyadmin from sourceforge  extract it and put on your apache root document
2. edit your configuration file (copy from config.sample.inc.php , make it to be config.inc.php )

$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'signon'; //'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;


$cfg['Servers'][$i]['extension']     = 'mysqli';
$cfg['Servers'][$i]['auth_type']     = 'signon';
$cfg['Servers'][$i]['SignonSession'] = 'SignonSession';
$cfg['Servers'][$i]['SignonURL']     = 'signon.php';






3. download and copy this file to your extracted directory

4. reboot your apache

5. navigate to your serverUrl/phpmyadmin_folder_location



Read more ...

Aug 14, 2014

accessing oracle with instant client and toad.


on server (oracle server)

1. ensure that listener is running, "C:\app\Administrator\product\11.2.0\dbhome_1\BIN\lsnrctl status", it use "C:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora". the sample as below :  

# listener.ora Network Configuration File: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
    (SID_DESC =
      (SID_NAME = ORCL)
      (ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.42.128)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = C:\app\Administrator



my TNSNAME.ora

# tnsnames.ora Network Configuration File: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.42.128)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl.168.42.128)
    )
  )




2. check language on server with sqlplus

Enter user-name: sys as sysdba
Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> select userenv('LANGUAGE') from dual;

USERENV('LANGUAGE')
---------------------------------------------------
AMERICAN_AMERICA.AL32UTF8


3. ensure that your firewall on port 1521 is accessable from outside
4. unlock the user.
SQL> alter user hr identified by hr account unlock;

on client (instant client and toad)

1. download and install oracle instant client and toad. Ensure your architechture versions are same (toad 32 bit for instant client 32 bit, and so on, if you got error can not load dll, change to other version of instant client)
2. add to your system variable
"TNS_ADMIN"  value "C:\Users\Administrator\Desktop\instantclient-basic-win-x86-64-11.1.0.7.0\"
"NLS_LANG" value should same with your server language, there is "AMERICAN_AMERICA.AL32UTF8"
"Path" add value with ";C:\Users\Administrator\Desktop\instantclient-basic-win-x86-64-11.1.0.7.0\instantclient_11_1"
3. open your toad, add new connection with direct connection.

accessing oracle with instant client and toad.


Read more ...