KErnelMAster

Welcome to the World famous Wieland's blog

Coding...

  • Colocando una imagen flotante en blog

    Ya que muchos me han preguntado como hacerle para colocar una imagen flotante en su blog pondré este pequeño how-to.
    - Creas y guardas tu imagen PNG (fondo transparente) en un dir dentro de tu blog.
    - Editas el archivo CSS, colocando el siguiente código:
    **
    a#identificador {
    position: fixed;
    right: 0;
    bottom: 0;
    display: block;
    height: 153px;
    width: 150px;
    background: url(/images/tuimagen.png) bottom right no-repeat;
    text-indent: -999em;
    text-decoration: none;
    }
    **
    - En tu archivo general HTML ( Main.html, Layout.html, etc) pones la linea que hace referencia a la imagen del CSS.
    Esta linea va justo después del <body>
    ** <a id="identificador" alt="Titulo de la imagen" title="Titulo de la imagen" href="www.tublog.com">Titulo de la imagen</a> **
    ''Las variables que deberás cambiar son:''
    **identificador**: es el id que le darás al bloque de tu imagen, pon lo que quieras.
    **Titulo de la imagen**: como le llamarás a tu imagen flotante.
    **height**: cuanto medirá la imagen en altura en pixeles.
    **width**: cuanto medirá la imagen en ancho en pixeles.
    **background**: url(/images/tuimagen.png): la ruta hacia tu imagen.
    Es todo! ;-) Enjoy !
  • Nueva versión de JAWS SpamGuard 0.2 - "She's a Spameater"

    Jaws SpamGuard 0.2 ("She is a Spameater")
    Esta nueva versión sustiyuye a la versión 0.1. Es un mod para Jaws >= 0.6.2 que protege de ataques de spam por bots, esta nueva versión es compatible con más configuraciones de Jaws y servers.
    La puedes descargar de [url]http://kublun.com/spamguard[/url] , sigue las instrucciones de INSTALL y listo ;-)
    /*
    Gracias a Héctor Bautista y los demás que no recuerdo por la ayuda proporcionada y hacerme llegar los bugs.
    */
  • C.R.A.P and DRM

    Nowadays many manufacturers are selling DRM-integrated devices such iPods and other players, that's why they suck to me, companies do the impossible to sell products that play only their own things, also iPods are difficult to load with songs and their batteries suck so much, you can see this video so you can get the whole idea:

     
    http://news.zdnet.com/2036-2_22-6035707.html 

     
  • Jaws SpamGuard v 0.2 [Spammers - 0 , Me - 1]

    =====UPDATE: Jaws SpamGuard versión 0.2=====

    Harto del puto spam en mi blog he decidido crear este pequeño hack el cual reemplaza algunos archivos de Jaws para poder activarlo. Jaws SpamGuard es un anti-spam el cual rechaza peticiones de bots spammeros en los gadgets ChatBox, Blog y Phoo. Apenas va empezando, pero a mi me ha funcionado perfectamente, bloquea todo mi spam.

    Doy gracias a Elliot y a Carlos Nieto por ideas y su gran ayuda.

    PROS:

    1. Protección transparente sin molestar al usuario
    2.  Compatible con los navegadores más nuevos
    3.  Elimina 99.9 % del spam, sino es que todo

    CONS:

    1.  No funciona sin JavaScript activado
    2.  Los spammers se la pueden ingeniar cuando se popularice este método
    3.  Necesita implementarse como Jaws Plugin o componente
     
    Requerimientos:
     
    Jaws >= 0.6.2 
     
    INSTALL:
     
               1. Desactiva Los Captchas
             2. Haz respaldo y reemplaza los viejos archivos por los nuevos del ZIP file.
             3. Edita el archivo /themes/TU_TEMA/Layout.html
    Ingresa las siguientes líneas:

    < !-- BEGIN head -- >{ELEMENT}< !-- END head -- >


    {sguardload}
    Justo antes de y después de como se muestra arriba.
  • PHP+MySQL Downloads counter little script

    Use this simple PHP script for keeping track of the hits a file on your site receives.
    ** CREATE DATABASE: **
    [code='SQL']
    CREATE TABLE downloads (
    file VARCHAR(60) NOT NULL,
    counter INT UNSIGNED,
    PRIMARY KEY (file)
    );
    [/code]
    ** WE CREATE download.php file **
    // Create a string containing the header info we'll use to redirect the browser:
    [code='PHP']
    $location = "Location: $file";
    header ($location);
    // Connect to the DB
    $db_user = "dbuser";
    $db_passwd = "dbpassword";
    $db_name = "dbname";
    $db = mysql_connect("localhost", $db_user, $db_passwd);
    mysql_select_db($db_name, $db);
    // Update the downloads table - increment the counter for that page.
    mysql_query("UPDATE downloads SET counter=counter+1 WHERE file='$file'",$db);
    /* If no row was affected by the last update statement, then there must have been no previous download of this file before, so we just need to add it to the table. We use an INSERT statement to insert the file name and '1' for the number of downloads. */
    if (mysql_affected_rows($db) < 1) {
    $resultado = mysql_query("INSERT INTO downloads VALUES ('$file', 1)", $db); }
    // The final statement closes the connection to the database.
    mysql_close($db);
    // end of script
    [/code]
    **
    Usage...**
    If you want to reset the counter, you just delete the appropriate rows from the database. So to delete the downloads for all files:
    [code='PHP']
    delete from downloads;
    [/code]
    +To use the script you can have a download button by creating a form like this:
    [code='Html4Strict']


    [/code]
    +Or you can have a text link to the script by including the parameters in the URL:
    [code='Html4Strict']
    Ebook Narnia
    [/code]
    To show the hits of our file we write an echo:
    [code='SQL']
    result = mysql_query("Select hits from downloads where file = 'Narnia';",$db);
    echo $result;
    [/code]
  • Controlling access to php file

    ====Español:====
    Mucha gente me ha preguntado como hacerle para proteger de accesos no permitidos a algún script de PHP, es por eso que pondré aqui una forma eficaz de hacerlo sin necesidad de una base de datos, permitiendo el acceso a un sólo usuario con estas simples lineas.
    El código: (poner en las primeras lineas de tu código PHP)
    [code='PHP']
    if ((!isset($_SERVER['PHP_AUTH_USER'])) || (($_SERVER['PHP_AUTH_USER'] != "USUARIO") || (!isset($_SERVER['PHP_AUTH_USER'])) || ( $_SERVER['PHP_AUTH_PW'] != "CONTRASEÑA" )) ) {
    header("WWW-Authenticate: Basic entrer=\"Login\"");
    header("HTTP/1.0 401 Unauthorized");
    die("Sorry, no tienes acceso LOL");
    }
    [/code]
    Eso es todo, disfrútalo y controla tus accesos en PHP. ;-)
    ====English:====
    Many people have asked me how to deny or grant access to a PHP script file without messing with a database and granting access to just one user, here's how with just a few lines.
    The code: (write this piece of code just at the beginning of all the script file)
    [code='PHP']
    if ((!isset($_SERVER['PHP_AUTH_USER'])) || (($_SERVER['PHP_AUTH_USER'] != "USERNAME") || (!isset($_SERVER['PHP_AUTH_USER'])) || ( $_SERVER['PHP_AUTH_PW'] != "PASSWORD" )) ) {
    header("WWW-Authenticate: Basic entrer=\"Login\"");
    header("HTTP/1.0 401 Unauthorized");
    die("Sorry, you dont have access LOL");
    }
    [/code]
    That's it Enjoy controlling access to your scripts in PHP ;-)
  • GoogleVideoViewer crackeado

    A un día de que [term]Google[/term] lanzara al mercado su aplicación VideoViewer (para ver videos alojados en servidores Google únicamente) [url]http://video.google.com[/url], [friend]Jon Lech Johansen[/friend] (DVD jon) logró sacar un [term]patch[/term] para que la aplicación basada en VideoLan no sólo reproduzca videos alojados en Google, sino también en servidores desconocidos a Google.com. Realmente impresionante la habilidad de Jon para sacar herramientas ** anti-DRM** cada vez que las compañías "creen" haber logrado su negocio.
    [code='ASP']
    // Este codigo del patch por Jon Lech J.
    /*
    * Jon Lech Johansen <jon@nanocrew.net>
    */
    using System;
    using System.IO;
    using System.Text;
    using Microsoft.Win32;
    using System.Windows.Forms;
    class MainClass
    {
    public static void Main( string[] args )
    {
    try
    {
    RegistryKey hklm = Registry.LocalMachine;
    hklm = hklm.OpenSubKey( "SOFTWARE\GoogleVideoViewer\VLC" );
    Object obp = hklm.GetValue( "InstallDir" );
    string file_path = String.Format( "{0}{1}plugins{2}libaccess_http_plugin.dll",
    obp, Path.DirectorySeparatorChar,
    Path.DirectorySeparatorChar );
    using( Stream s = new FileStream( file_path, FileMode.Open,
    FileAccess.Read | FileAccess.Write ) )
    {
    int offset = 0;
    long file_pos = 0;
    int bytes_read = 0;
    byte[] buffer = new byte[ 65536 ];
    byte[] search_bytes = new byte[]
    {
    0xBF, 0x40, 0x65, 0x00, 0x10,
    0xE9, 0x36, 0xFC, 0xFF, 0xFF
    };
    while( ( bytes_read = s.Read( buffer, offset, buffer.Length - offset ) ) > 0 )
    {
    for( int i = 0; i < bytes_read + offset - search_bytes.Length; i++ )
    {
    bool match = true;
    for( int j = 0; j < search_bytes.Length; j++ )
    {
    if( search_bytes[ j ] != buffer[ i + j ] )
    {
    match = false;
    break;
    }
    }
    if( match )
    {
    s.Seek( file_pos + i - offset, SeekOrigin.Begin );
    for( int j = 0; j < search_bytes.Length; j++ )
    search_bytes[ j ] = 0x90;
    s.Write( search_bytes, 0, search_bytes.Length );
    MessageBox.Show( "GoogleVideoViewer was successfully patched", "GVVPatch" );
    return;
    }
    }
    file_pos = s.Position;
    offset = search_bytes.Length;
    for( int i = 0; i < offset; i++ )
    {
    buffer[ i ] = buffer[ buffer.Length - offset + i ];
    }
    }
    }
    MessageBox.Show( "Error: Could not find bytes to patch. File already patched?", "GVVPatch" );
    }
    catch( Exception e )
    {
    MessageBox.Show( "Error: " + e.Message, "GVVPatch" );
    }
    }
    }
    [/code]
    **Nota: Es necesario contar con el .NET runtime framework
    **URLs**
    El patch se encuentra aquí: [url]http://nanocrew.net/wp-content/GVVPatch.exe[/url]
    El código fuente: [email]http://nanocrew.net/wp-content/GVVPatch.cs[/email]
  • Life Code...

    [code="C#"]using System;
    using Life;
    using Beer;
    using Girlfriend;
    using Friends;
    class Life {
    public static void Main() {
    Console.WriteLine ("Esto es la vida en sí");
    }
    }
    [/code]


    ...