Skip to content
May 22, 2010

Transfer blog option

Today I used the transfer blog option of wordpress. Wow it works great. I have two accounts and I transferd a whole blog to another user without any problem.

This means that the wordpress database is organized and clean, that they really have a unique id for each blog and this id doesn’t depends on a name or something fool. They only change the relationship between the owner id and the blog id and it’s ready. Well I think maybe it works like that

March 3, 2008

how to save my data when a program freeze

Sometimes a program freezes when it has a bug or something strange happens, the problem is if you haven’t save your info, what you can do?

I found a page that suggest some commands to save in a file the info that still is in the RAM. http://www.kriptopolis.org/como-recuperar-datos-memoria-ram

If it happens you don’t have to open again your application ’cause it maybe will erase the info that still is in the RAM.

If you linux you can run this commands:

sudo cat /dev/mem | strings > theFile

the command strings is used to save only ASCII chars.

then if you remember the last things you wrote you can search it with a grep

In the case we know the PID we can use:

sudo gcore -o theFile_coredump pid


								
January 2, 2008

Why a RSA private key can be encrypted with a password?

Cause it’s more secure, if someone else steals the key he can’t know the key. If I’m a Certificate Authority it’s a good idea to have my private key encrypted.

I had a problem with matrixssl, because the code crashed when it reads my private key, I found it cause I was using an encrypted private key and the example code thar reads the certificate and private key doesn’t receive a password. When I debuged I found that my private key wasn’t in the expected ASN.1 format, so I thought it was a incomatibility version bettwen matrixssl 1.8.3 and openssl 0.9.8 because I found in their changes history some bug fixes on ASN.1 but it only was that I had to make my private key without the encryption or another solution is to change the example code and add the private key password as a parameter and send it to the matrixRsaReadPrivKey function.

If you don’t want to encrypt your private key you have to add the ‘-nodes’ parameter to the ‘openssl req ‘ command

January 2, 2008

Error in matrixssl key generation pdf instruccions for self-signed root certificate

In the MatrixSSLKeyGeneration.pdf instructions, when you want to create a self-signed root certificate to create your own CA it says that you can use the following command:
openssl req -x509 -newkey rsa -out cacert.pem -outform PEM

the correct one is:
openssl req -x509 -newkey rsa:1024 -out cacert.pem -outform PEM

they missed the rsa:1024 maybe in older versions of openssl it worked. The awful thing is that openssl didn’t show a friendly error it only said it was’nt valid and showed all the options :S

December 26, 2007

what means error LNK2019: unresolved external symbol _bind@

compiling my C code in visual studio I had the folowing errors

error LNK2019: unresolved external symbol _listen@8 referenced in function X
error LNK2019: unresolved external symbol _bind@12 referenced in function Y
error LNK2019: unresolved external symbol _setsockopt@20 referenced in function X
error LNK2019: unresolved external symbol _WSAGetLastError@0 referenced in function X
error LNK2019: unresolved external symbol _socket@12 referenced in function X

To solve this I added a new dependencie in my project in properties -> linker -> Input -> Additional Dependencies and I added ws2_32.lib, in this library are things related to windows sockets.

December 26, 2007

wordpress vs blogspot

why I prefer wordpress than blogspot

cause wordpress has more presentation themes, the widgets are faster to configure, I can see my blog statistics (I like to see how many people have read my blog, only for curiosity), is easier to edit an old post, if I need I could add privilegies to someone else to write to my blog, I can manage the comments.

If you are really a newbie maybe is better for you google cause it has few options so you can’t be lost but if you would like more control over your blog I recommend wordpress.

December 26, 2007

what means C1190: managed targeted code requires a ‘clr’ option in visual C++

As I tell you I’m newbie on Visual Studio, I tried to compile mi first hello world just to see if everything is right configured, and I had the following error:

C1190: managed targeted code requires a ‘clr’ optionI found that:
In Visual Studio for C/C++ code you have two options, managed code or unmanaged code.

Managed code compiles to Intermediate Language that will run on the Common Language Runtime (CLR) it’s a thing like the JVM for Java. It born with the .Net framework.
Unmanaged code compiles to machine code that runs directly on the computer.

My code needs to run on Windows XP and Windows Mobile, so I found that Windows mobile can have .Net Compact Framework and with this I will have the CLR.

I solved in two ways the issue:
1) With a code that uses a main like this _tmain() (it is to use the managed way) On the name of the project on the Solution explorer, in the general properties y changed the CLR from ‘no’ to ‘CLR old syntax’.
2)Change my code and don’t use _tmain use main() only like the old way (to use it unmanaged) and don’t use CLR properties.

It worked in both ways, so now I have to decide if I will program managed or unmanaged. mmmm I think managed maybe I will have less portability problems and I will not have to worry to free memory because I will have the garbage collector, the problem is that I will reuse some old fuctions I found in a page, I read that I can mix unmanaged and managed code, I think I will do that.

links to know more about:

http://www.developer.com/net/cplus/print.php/2197621

http://www.ondotnet.com/pub/a/dotnet/2003/03/03/mcppp2.html

December 26, 2007

How to obtain a client IP address in a java webservice

why I need the client IP?
Cause not everybody can access this webservice only some specifics servers, for security reasons we need to validate this IP against a list of valid ips.

This is a part of my class:

public class ServicioAAPGImpl implements ServicioAAPG, javax.xml.rpc.server.ServiceLifecycle {

javax.xml.rpc.server.ServletEndpointContext ctx; //

public void init(Object obj){
this.ctx = (javax.xml.rpc.server.ServletEndpointContext) obj;
}

/**
* Método de la clase javax.xml.rpc.server.ServiceLifecycle
*/
public void destroy(){

}
public ResultadoInformacionGrupo obtenInformacionGrupo(String campus,
String periodo, String claveImparte, String numeroGrupo,
String minuto, String claveSegura) throws RemoteException {

//here I obtain the ip :)
javax.servlet.http.HttpServletRequest req = (javax.servlet.http.HttpServletRequest)
this.ctx.getMessageContext().getProperty(MessageContextProperties.HTTP_SERVLET_REQUEST);
String ipAddr = req.getRemoteAddr();

Tell me if this solved your issue

Follow

Get every new post delivered to your Inbox.