cat original.xml | openssl smime -pk7out | openssl asn1parse
Wednesday, February 5, 2014
Extract asn1 from encrypted message using openssl
Tuesday, July 9, 2013
Pidgin Google Talk using Port 443
Monday, April 1, 2013
Windows Symbolic Links
Must not forget to setup my symbolic links...
http://technet.microsoft.com/en-us/library/cc753194%28WS.10%29.aspx
Tuesday, March 12, 2013
Debugging with Visual Studio Development Server fails: SocketException was unhandled
This is probably because for some reason the last time you run debug, VSDS didn't stop running.Message="Only one usage of each socket address (protocol/network address/port) is normally permitted"Source="System"ErrorCode=10048NativeErrorCode=10048StackTrace:at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)at System.Net.Sockets.Socket.Bind(EndPoint localEP)at Microsoft.VisualStudio.WebHost.Server.Start()at Microsoft.VisualStudio.WebServer.WebServerApp.Main(String[] args)
You can check which process is hung on the given port, and kill it with the following:
netstat -ano | findstr "5001"
Taskkill /F /PID
Tuesday, February 5, 2013
IMDB Searches
For future reference:
num_votes = min, max
sort = user_rating, desc
year = min, max
genres = sci_fi (action
adventure
animation
biography
comedy
crime
documentary
drama
family
fantasy
film_noir
history
horror
music
musical
mystery
romance
sci_fi
short
sport
thriller
war
western)
title_type = feature (movie)
Highest Rated Sci-Fi Feature Films Released No Later Than 2012 With At Least 20,000 Votes
http://www.imdb.com/search/title?num_votes=20000,&sort=user_rating,desc&year=,2012&genres=sci_fi&title_type=feature
Monday, February 4, 2013
localhost waits to load applet using chrome
O meu colega tinha um problema. Sempre que acedia à aplicação por localhost o browser chrome ficava pendurado (durante cerca de um minuto) nas páginas que utilizavam um componente java (applet).
Ligamos o debugger no java (control panel -> java -> advanced -> debugging -> enable tracing / enable logging / show applet life cycle exceptions) / Java Console -> Show Console)
A JVM considerava o componente como tendo expirado de validade e tentava fazer download novamente, mas como este estava por trás de autenticação integrada, e esta por alguma razão aparentemente falhava, demorava algum tempo até que a jvm se decidisse a carregar o componente com o ficheiro .jar em cache.
O workaround encontrado foi colocar a virtual folder onde o ficheiro se encontra com anonymous authentication.
Fica a pergunta se a jvm consegue fazer autenticação integrada (kerberos e/ou ntlm) e como configurar a mesma. Aparentemente pelos pedidos que eram efectuados (um dos pedidos era ao dc, e era este que ficava pendurado), seria possível realizar tal autenticação, no entanto no ambiente de qualidade as pastas referentes aos .jar também se encontram com anonymous authentication.
PS: da última vez que tive um problema semelhante também coloquei excepções no web server para permitir anonymous ao servir ficheiros com a extensão .jar, no entanto esta solução pode não ser aceitável onde os ficheiros .jar contenham regras de negócio.
Thursday, January 10, 2013
Monday, October 1, 2012
Sunday, May 6, 2012
UDP UPnP Ports Opening from SVCHOST.EXE NETSVCS (range 50k - 60k)
So, i noticed that one of my computers kept opening a UPnP rule on my firewall(if i kept UPnP on), but the other didn't. Searching with netstat -ano gave me the PID, which was svchost.exe netsvcs. Now, this doesn't say much since a lot of services run on svchost. Searching with the port number, or the services wouldn't give much results as the port was dynamic. After some more google persistance i found out the command to list each service that was running in each PID and the name of the services inside. tasklist /svc
Browser, EapHost, gpsvc, IKEEXT, iphlpsvc, LanmanServer, ProfSvc, Schedule, SENS, ShellHWDetection, Themes, Winmgmt, wuauserv
So now i got something similar to this, and by trial and error i eventually found out that, if i stoped IPHLPSVC, i would stop listening to the port. In the end, when i searched the net with IPHLPSVC i found someone with the same questions i had and with some precious tip that might save me time next time:http://forums.comodo.com/firewall-help-cis/svchostexe-port-57398-whats-going-on-here-t72975.0.html
http://processhacker.sourceforge.net/
This service is somehow responsible by the horrible teredo and other tunnels that appear in your ipconfig list since they invented IPv6. Somehow i suspected when i checked IKEEXT that this would have to do something to do with IPv6. But why did i have this open in one computer and not in the other?
Anyway, just to make sure, i reenabled the service, but nothing happened nevertheless. The UDP port will only get open when you actually attempt to do a IPv6 connection. It seems the UDP port will try to emulate IPv6 connections even if you're using IPv4. Something to try to understand in the future. For now i am happy that I didn't had a worm somewhere...PS: If you want you can set it off by using netsh interface teredo / set state disabled (set state default - to reenable)
Wednesday, March 7, 2012
github first time
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
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-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
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
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
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"
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
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
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
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?
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: