Wednesday, June 23, 2010

apache apxs perl "^M: bad interpreter: No such file or directory"

I am trying to compile or make something and get this stupid error that perl is not there, but i have checked and both perl and apxs file are there and have the right permissions.

Solution:
Your apxs file has come from a windows machine and is in dos format, therefore perl is unable to properly understand the commands you're sending it.

run:
dos2unix apxs

and you should be good to go.

How to compile a 32bit dynamic library on a 64bit linux

You can use -m32 or -m64 flag to tell the gcc compiler to compile in 32 or 64 bit.

Now, the trick is that configure and make will accept this flags, if you insert them in the CC variable like this:

./configure CC="gcc -m32"

or when with make

make CC="gcc -m32"

Hope this saves you some frustration i had gone through trying to compile it by hand.

Monday, April 12, 2010

Alps Pad da Dell ao editar texto faz saltar de linha

Existe um problema com os pad da Dell. Quando estão a editar texto se por acaso tocarem no "stick" ou apoiarem a mão no "pad" podem enviar um click no mouse o que vos vai fazer saltar de linha. Este processo pode não só ser bastante frustrante como introduzir erros no código/texto sem que nos apercebamos.

Uma maneira de resolver o assunto é fazer download dos últimos drivers alps no site da dell. Um icon será instalado no ambiente de trabalho. A partir daí podemos aceder à configuração e seleccionar "Desative o Touch Pad/Stick quando houver um dispositivo apontador USB". Se estiverem a editar texto sem rato podem sempre reduzir a sensibilidade ou desactivar o stick para que a frustração não volte a atacar o vosso dia.

Friday, April 9, 2010

Como resolver utilizadores orfãos no Sql Server

Depois de fazer restore a uma base de dados de outra instalação os utilizadores podem ficar orfãos (o nome é o mesmo mas o SID é diferente de instalação para instalação).

Eis como resolver o problema:

-- Quais os utilizadores orfãos?
sp_change_users_login @Action='Report';

-- O 'utilizador' username da base de dados é o utilizador 'username' no sql server:
sp_change_users_login @Action='update_one', @UserNamePattern='username',
@LoginName='username';

Wednesday, March 31, 2010

DTSX - Connection Credentials Management


When you create a DTSX the "Security/Protection Level" property will be set by default to "EncryptSensitiveWithUserKey". Why should you want to know this?

Well, this property means it will encrypt sensitive information with your user credentials. Another thing that is not so explicit about this setting is that all sensitive information will be bound to your machine. Now, this might not be a good idea since most of the time you will not develop in production environment.

In practical terms this means whenever you try to edit or run this dtsx in another machine errors will be raised when you try to read the credentials for the connection to the database.



Error loading mydtsx.dtsx: Failed to decrypt an encrypted XML node because the password was not specified or not correct. Package load will attempt to continue without the encrypted information.

Validation error. Data Flow mydtsx: Connection1 [1]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Connection1" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.

One of the ways to overcome this is to change the property to EncryptSensitiveWithPassword. This way you will be asked to set a password, that will be required to decrypt sensitive information when you run/edit it next time.

e.g. DTEXEC /FILE "C:\MyDTSX.dtsx" /MAXCONCURRENT "-1" /CHECKPOINTING OFF /REPORTING EW /DE MyPassword

TIP: You can set this commad line to run in the scheduled tasks. To set it to run as system account use: NT Authority\System

Friday, March 26, 2010

"Application popup: : "

"Application popup: : " Event ID: 26 can be anything. Basically means a nameless application has thrown a nameless error. After a while the worker application pool process w3wp.exe would throw other events on systems tab like:

"A process serving application pool 'AppPool11' terminated unexpectedly. The process id was '1932'. The process exit code was '0x1'."

"Application pool 'AppPool11' is being automatically disabled due to a series of failures in the process(es) serving that application pool."

"A process serving application pool 'AppPool11' suffered a fatal communication error with the World Wide Web Publishing Service. The process id was '3424'. The data field contains the error number. "

Just for the record, the server was a x64 windows server running among other things .net 1.1 web application.

To cut the story short, we were able to isolate the code that was throwing this error (a third party opensource dll called pdfsharp). The dll would work great as long it was saving/creating pdf, but as soon you tried the .Open command, either passing "stream" or "string to path" when called, the title blank application popup error was thrown only once on the system event viewer (until a reset on the worker was thrown by reseting the iis or killing the process) TIP: You can check the threads on a process with the sysinternals process explorer. In 32bit everything works fine (of course).

Interesting was that the request wouldn't catch that an error occured, meaning the thread would get stuck in the w3wp.exe worker. After a few hung threads (10?) the application pool would stop responding to requests and had to be terminated by the iis as shown.

Thank god we are working with 8 years old technologies, or our life would be pretty boring... not!

Wednesday, March 24, 2010

Process Explorer - Sysinternals

As ferramentas da sysinternals podem não ser novidade para ninguém. Não é por acaso que a empresa que conhecia melhor o Windows que a Microsoft tenha sido comprada pela... Microsoft! Mas nunca é demais realçar os básicos. Vocês vão querer instalar no windows xp o Process Explorer da Sysinternals (que entretanto pelo que percebi começou a ser distribuída com a versão base do windows vista/7).

As potencialidades deste software são imensas. Por exemplo, uma coisa que vocês sempre quiseram saber é a razão porque a vossa máquina está sempre a aceder ao disco... Como saber que programas estão naquele momento a ler/escrever do disco? Em vez de andar a matar processos e a tentar adivinhar basta listar os processos por I/O.

Façam download do programa em http://www.sysinternals.com
"View -> Select Columns -> Process Performance -> I/O Delta"

DICA: "Options -> Replace/Restore Task Manager" substitui o task manager por defeito.