Skip to content

Instantly share code, notes, and snippets.

View pvilas's full-sized avatar
💭
Working on a financial webservice idea

Pere Vilas pvilas

💭
Working on a financial webservice idea
  • Cálida Ibiza, SA
  • Eivissa Ibiza (Spain)
View GitHub Profile
@pvilas
pvilas / entrada.jade
Created May 17, 2014 21:02
jade express nodejs mixin generate bootstrap forms
mixin entrada(tipo, nombre, ample, etiqueta)
case tipo
when 'checkbox'
div.form-group
div.col-sm-offset-2.col-sm-10
div.checkbox
label= etiqueta
if !bound
input(type="checkbox", name=nombre)
else
@pvilas
pvilas / ubuntu-install-node.sh
Last active August 29, 2015 14:02
Install node on ubuntu 12
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
# check node version
node -v
# check npm version
npm -v
# ifnpm is not installed try sudo apt-get install npm
@pvilas
pvilas / mac-install-node-oracle.sh
Last active August 29, 2015 14:02
install joeferner/node-oracle node oracle driver (MacOS version)
export OCI_HOME=/Users/pvilas/oracle/instantclient_11_2
export OCI_LIB_DIR=$OCI_HOME
export OCI_INCLUDE_DIR=$OCI_HOME/sdk/include
export OCI_VERSION=11
export NLS_LANG=AMERICAN_AMERICA.UTF8
echo variables seteadas
cd $OCI_LIB_DIR
echo ln -s libclntsh.dylib.11.1 libclntsh.dylib
echo ln -s libocci.dylib.11.1 libocci.dylib
echo links creados
@pvilas
pvilas / linux-install-node-oracle.sh
Created June 24, 2014 15:30
install joeferner/node-oracle node oracle driver on ubuntu
export OCI_HOME=<directory of Oracle instant client>
export OCI_LIB_DIR=$OCI_HOME
export OCI_INCLUDE_DIR=$OCI_HOME/sdk/include
export OCI_VERSION=<the instant client major version number> # Optional. Default is 11.
export NLS_LANG=AMERICAN_AMERICA.UTF8
cd $OCI_LIB_DIR
ln -s libclntsh.so.11.1 libclntsh.so
ln -s libocci.so.11.1 libocci.so
sudo apt-get install libaio1
# Replace /opt/instantclient_11_2/ with wherever you extracted the Basic Lite files to
@pvilas
pvilas / change-oracle-sequence.sql
Created June 25, 2014 17:36
change oracle sequence value without dropping and recreating it
select last_number from user_sequences where sequence_name='INCIDENCIASEG3370_SQ'
alter sequence INCIDENCIASEG3370_SQ increment by 1000;
select cNCIDENCIASEG3370_SQ.NEXTVAL from dual;
commit;
alter sequence INCIDENCIASEG3370_SQ increment by 1;
commit;
@pvilas
pvilas / ora-create-role.sql
Created July 2, 2014 10:36
oracle create role and user
create role programador;
GRANT CONNECT TO programador;
GRANT create session, alter session TO programador;
GRANT create procedure to programador;
GRANT execute any procedure to programador;
GRANT create table TO programador;
GRANT create sequence TO programador;
Grant create trigger to programador;
Grant create type to programador;
grant create view to programador;
@pvilas
pvilas / macos-firebird-variables.sh
Last active August 29, 2015 14:27
Variables on .bash_profile to use firebird tools on macos
# taken from http://www.firebirdsql.org/file/documentation/papers_presentations/html/paper-fb-macosx.html
# more info at http://www.firebirdsql.org/file/documentation/papers_presentations/Firebird_MacOSX.pdf
export FIREBIRD_HOME=/Library/Frameworks/Firebird.framework/Resources
export PATH=$PATH:$FIREBIRD_HOME/bin
@pvilas
pvilas / recover-firebird.sh
Created August 10, 2015 17:28
Recover a damaged firebird database
gfix -m -f -ignore Base.gdb
gbak -b -v -limbo -ignore Base.gdb Respaldo.gbk
gbak -c -r -v Respaldo.gbk Base.gdb
@pvilas
pvilas / iso3166.sql
Created August 18, 2015 18:01
ISO Country codes 3166 in sql
/*
# list taken from http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html
# this script generates
s=open('paisos.sql', 'r')
linia=s.readline()
while linia:
#print linia
descripcio=linia[0:47].strip().replace("\"", "").replace("\'", "")
#print descripcio
a2=linia[48:50].strip()
@pvilas
pvilas / telf.py
Created November 9, 2015 12:19
Interface amb telefonia
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'pvilas'
import telnetlib
import time
import StringIO
STX=chr(02) # start of text
ETX=chr(03) # end of text