Wednesday, March 7, 2012

github first time

GitHub is free for open-source projects, so let's try to make the excels / forms i've been using into a web project using VS2010.
Since i'm fairly new with VS2010 i went with the usual Web C# project. Installed Git Extensions and followed:

http://help.github.com/set-your-user-name-email-and-github-token/
http://help.github.com/create-a-repo/

Now i created a VS Project inside that directory and when i tried to push i got an error. "No supported authentication methods available"

So, it ends up you need to create a ppk file and configure putty to use it (if you installed github with putty = the default option).

Go ahead to Remotes -> PuTTY -> Generate or import key. Now, go to Conversions -> Import key. Browse to the .ssh folder, and find 'id_rsa' (it was named exactly that here, WITHOUT an extension). Select it, and press open. Enter the password for your key (this is the key that Git uses to communicate to the GitHub server, as it appears). Then, select Save Private Key, and save it somewhere (I did in the .ssh folder)

Now you have the option select the ppk file when the "No supported authentication methods available" arises, and it should work. (of course, you need the private key, silly!).

http://stackoverflow.com/questions/6138493/unable-to-push-to-repository-using-git-extensions

Wednesday, July 20, 2011

A sério, não custava muito pois não?

sc delete bblearn-collab
sc delete bblearn-exec
sc delete bblearn-tomcat
rd /s blackboard
C:\Windows\SysWOW64\inetsrv\appcmd delete site "BBLEARN"

DECLARE @jobId binary(16)
SELECT @jobId = job_id FROM msdb.dbo.sysjobs WHERE (name = N'aa_update_BBLEARN')
IF (@jobId IS NOT NULL)
BEGIN
EXEC msdb.dbo.sp_delete_job @jobId
END
SELECT @jobId = job_id FROM msdb.dbo.sysjobs WHERE (name = N'Fill missing Adaptive tool BBLEARN')
IF (@jobId IS NOT NULL)
BEGIN
EXEC msdb.dbo.sp_delete_job @jobId
END
DROP DATABASE BBLEARN;
DROP DATABASE BBLEARN_admin;
DROP DATABASE BBLEARN_cms;
DROP DATABASE BBLEARN_cms_doc;
DROP DATABASE BBLEARN_stats;
DROP LOGIN BBLEARN;
DROP LOGIN BBLEARN_admin;
DROP LOGIN BBLEARN_cms;
DROP LOGIN BBLEARN_report;
DROP LOGIN BBLEARN_stats;

Thursday, February 10, 2011

Sharepoint e forçar SSL

Quando se quer forçar SSL no sharepoint há que ter em conta o tipo de autenticação que temos implementada.


Se o Sharepoint se encontrar em Windows autentication, podemos aceder à consola de administração do IIS e dentro do tab de directory security seleccionar "require secure channel" ssl. É possível costumizar a resposta de erro 403.4 para redireccionar o cliente a fazer o pedido por https.
http://www.winserverkb.com/Uwe/Forum.aspx/windows-server-sbs/27476/How-to-force-SSL-on-a-SharePoint-site

Caso desejem colocar o sharepoint em forms authentication encontrei este link que mostra como colocar apenas partes do Sharepoint sob SSL (i.e. a página de login).
http://www.sharepointconfig.com/2010/03/enforcing-the-correct-protocol-for-partially-ssl-secured-sharepoint-sites/

Tuesday, November 23, 2010

Como actualizar o Windows/Linux por trás de um proxy com NTLM Authentication

Podem usar as actualizações do Windows/Linux por trás de um proxy com NTLM Authentication, usando um programinha chamado ntlmaps que corre em Python. Este programinha cria um segundo proxy local que é capaz de fazer autenticação no proxy que exige authenticação NTLM. A password pode ser introduzida de forma interactiva.

1 - Instalar o Python e ntlmaps.
2 - Configurar ntlmaps.
3 - Configurar o yum ou o windows para usar o proxy ntlmaps em vez do proxy que está configurado.

Passo 3:
Windows:
netsh winhttp set proxy proxy-server="http=localhost:5865;https=localhost:5865" bypass-list="*.foo.com"
Linux:
export http_proxy=http://localhost:5865
ou actualizar/adicionar a seguinte linha ao yum.conf
proxy=http://localhost:5865

Se com localhost nao estiver a funcionar usem o nome completo da máquina.

http://www.howtoforge.com/how-to-configure-isa-proxy-auth-setting-for-yum
http://technet.microsoft.com/en-us/library/cc731131(WS.10).aspx

Thursday, July 8, 2010

Passing a PARAMETER to a IN CLAUSE

Trying to pass a parameter to a "in clause" can be troublesome, because what you really want to do is to pass an array of an indefinite number of parameters and not a single parameter.

There are 2 solutions for this. Either you pass a table-value type, or you use a function to convert the nvarchar to a table.
Here is how such function might look like:
CREATE FUNCTION iter$simple_intlist_to_tbl (@list nvarchar(MAX))
RETURNS @tbl TABLE (number int NOT NULL) AS
BEGIN
DECLARE @pos int,
@nextpos int,
@valuelen int

SELECT @pos = 0, @nextpos = 1

WHILE @nextpos > 0
BEGIN
SELECT @nextpos = charindex(',', @list, @pos + 1)
SELECT @valuelen = CASE WHEN @nextpos > 0
THEN @nextpos
ELSE len(@list) + 1
END - @pos - 1
INSERT @tbl (number)
VALUES (convert(int, substring(@list, @pos + 1, @valuelen)))
SELECT @pos = @nextpos
END
RETURN
END


For more information about this error and credits for the code here check out:
http://www.sommarskog.se/arrays-in-sql.html

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.