Sutff about my job and comments about personal activities. Take a look to the first idea.

Thursday, September 13, 2012

squid proxy gateway based downloaded object

#  TAG: tcp_outgoing_address
#       Allows you to map requests to different outgoing IP addresses
#       based on the username or sourceaddress of the user making
#       the request.
#
#       tcp_outgoing_address ipaddr [[!]aclname] ...
#
#       Example where requests from 10.0.0.0/24 will be forwareded
#       with source address 10.1.0.1, 10.0.2.0/24 forwarded with
#       source address 10.1.0.2 and the rest will be forwarded with
#       source address 10.1.0.3.
#
#       acl normal_service_net src 10.0.0.0/255.255.255.0
#       acl good_service_net src 10.0.1.0/255.255.255.0
#       tcp_outgoing_address 10.0.0.1 normal_service_net
#       tcp_outgoing_address 10.0.0.2 good_service_net
#       tcp_outgoing_address 10.0.0.3 
 
Reference here 

Tuesday, June 05, 2012

PDFs: imagemagick & poppler

I was looking for a way to extract images from pdfs to know the resolution of each embeded image.
poppler has a tool named "pdfimages" to extract images from the pdf, usage:

pdfimages -j file.pdf img

Then, use tools from imagemagick to read characteristics of the images, usage:
display img.jpg
identify -verbose img.jpg
imagemagick let create a pdf file from jpg images, usage:
convert imageA.jpg imageB.jpg file.pdf pdf

Saturday, April 14, 2012

wmic for Linux

Compiling WMIC for Linux (Without Installing Samba)

http://semafour.wordpress.com/2010/02/17/compiling-wmic-for-linux-without-installing-samba/

http://www.edcint.co.nz/checkwmiplus/

Tunning remote desktop

I just found a way to set default connection setting for clients...
Using Group Policies Editor, gpedit.msc

\Computer Configuration\Administrative Templates\Windows Components\Terminal Services\Printer Redirection
"Do not allow client printer redirection". Set it to Enable

PD. google "disable remote printers using group policies"

Monday, September 19, 2011

firebird setup of microsip in linux

First, you have to backup youcurrent databases in windows

gbak.exe -t -user SYSDBA -password xxxx "c:\Microsip datos\MyCompany.fdb" "c:\Microsip datos\Respaldos\MyCompany.fbk"
gbak.exe -t -user SYSDBA -password xxxx "c:\Microsip datos\System\Config.fdb" "c:\Microsip datos\Respaldos\Config.fbk"
gbak.exe -t -user SYSDBA -password xxxx "c:\Microsip datos\System\Metadatos.fdb" "c:\Microsip datos\Respaldos\Metadatos.fbk"

The security2.fdb should be copied when firebird is not running, so the firebird service should be stopped before copying from windows, and services must be stopped too before copying into linux.

Then, directories must be created in "data" directory of firebird
mkdir /var/lib/firebird/2.5/data/System
mkdir /var/lib/firebird/2.5/data/Respaldos
mkdir /var/lib/firebird/2.5/data/Exportación
Copy the backups into /tmp and restore them on these directories
/usr/bin/gbak -t -c -user SYSDBA -pass xxxx -rep /tmp/MyCompany.fbk /var/lib/firebird/2.5/data/MyCompany.fdb
/usr/bin/gbak -t -c -user SYSDBA -pass xxxx -rep /tmp/Config.fbk /var/lib/firebird/2.5/data/System/Config.fdb
/usr/bin/gbak -t -c -user SYSDBA -pass xxxx -rep /tmp/Metadatos.fbk /var/lib/firebird/2.5/data/System/Metadatos.fdb
All files should be "firebird" owner
chown -R firebird.firebird /var/lib/firebird/2.5/data/

Microsip config is:
"Conexion", "Abrir conexion"
Servidor: 172.16.1.1
Carpeta de datos: /var/lib/firebird/2.5/data/
To test access with isql, try
/usr/bin/isql-fb
> CONNECT localhost:/var/lib/firebird/2.5/data/MyCompany.fdb
> user 'SYSDBA' password 'xxxx';
> show tables;
> quit;

I read this link to understand how to do it and then write this tutorial.