Wednesday, June 22, 2011

Python script to Stop/Sniff Popups

Create a new File called myhosts and fill it with the DNS redirects you want then run the script
What this does is creates a psuedo web server that responds with a script to close the window
later i will modify it to load in a html script so you can respond with whatever you wish!

Thursday, March 3, 2011

My first Chrome Ext: Scroll top/bottom

So today i actually got down into some code and wrote an extension for chrome that scrolls you to the top and/or bottom of the page instantly none of that slow scroll crap
using pure javascript without the magical jquery library :)
you can download it here
lets take a look the code i used

Simply created 2 Elements and populated their properties so they would stay on top and scroll with the page thanks to CSS

and i simply set their href to a javascript injection of scroll(x-axis,y-axis)

Its nothing too fancy but I find it useful for many things :)

Tuesday, March 1, 2011

Pygame Game and Player Class

This is a simple python class I wrote back when I was playing around with pygame its very basic and I used it as a foundation for my game projects

Sunday, February 20, 2011

Simple Multithreaded Web Server in Python

Like before when a client connects its socket it passed to the clientThread Class and then we call start which starts the thread

in the main loop of the thread instead of trying to pinpoint where the GET or POST request is i simply split the string by a space and then get the 2nd element(in this case its the 1st since we start at 0) is the file the client wants
so we take this file and get the extension of the file by spiting the file by the "." so that the 2nd elements(again starting at 0) so that we get the ext of the file requested now we can do a small check and see if they want a plain text/css/javascript file or a exe or image or anything else that would need to be opened with the binary mode right after that we close the socket and stop the while loop
so the client knows we are done sending the requested file.

Saturday, February 19, 2011

Win32 Api Usage using Ctypes

This utilizes the Ctypes library that allows you to use functions and methods from both Dlls and .so files in both the windows and *nix Operating system i assume it would also work in mac since its based on unix
This test simply uses the FindWindow Function with SetWindowText to change the title of the Window that was found.
This is great if you want to make alot of Api Calls but dont want to program in C just for the purpose of using windows api calls
for refrence on how to use the functions you should use msdn and search the function

Simple Multithreaded Echo Server in Python

This listens for connections comming in and for each client that connects
it spawns a thread for each client by passing in the socket that is created in the while loop to the clientThread class (that has a base Class of Thread)