background preloader

Cookies

Cookies
Page last changed today See section 6G of the book. This script was originally written by Scott Andrew. Copied and edited by permission. This article has been translated into French On this page I give three functions to save, read and erase cookies. First an introduction to cookies, and a summary of document.cookie, followed by an example. Cookies Cookies were originally invented by Netscape to give 'memory' to web servers and browsers. This can be annoying in a number of ways. Cookies were invented to solve this problem. A cookie is nothing but a small text file that's stored in your browser. A name-value pair containing the actual dataAn expiry date after which it is no longer validThe domain and path of the server it should be sent to As soon as you request a page from a server to which a cookie should be sent, the cookie is added to the HTTP header. So every time you visit the site the cookie comes from, information about you is available. Cookies can be read by JavaScript too. Example

Upside-Down-TernetHowTo Note: This guide was tested using Ubuntu 8.10. Previous versions may not work. This is a HowTo for setting up Upside-Down-Ternet on Ubuntu. Basically, when a user browses the web, all the images are flipped upside-down. While it's not useful, it's quite a good April Fool's prank. The process uses a transparent proxy, web server, and script to flip the images. The proxy used in this guide is Squid v2.7. Installation There are two versions of Squid in the repositories, Squid 2.7 (package name squid) and Squid 3 (package name squid3), the former will be installed. sudo apt-get install squid Configuration Squid's configuration file is located at /etc/squid/squid.conf. On the line starting with #http_access allow localnet, change it to read: acl localnet src [your network range, e.g. 192.168.0.1/24] http_access allow localnet On the line starting with http_port 3128, append transparent so it reads: http_port 3128 transparent Find the section TAG: url_rewrite_program. Reload the configuration file:

Upside-Down-Ternet My neighbours are stealing my wireless internet access. I could encrypt it or alternately I could have fun. I'm starting here by splitting the network into two parts, the trusted half and the untrusted half. The trusted half has one netblock, the untrusted a different netblock. /etc/dhcpd.conf IPtables is Fun! Suddenly everything is kittens! /sbin/iptables -A PREROUTING -s 192.168.0.0/255.255.255.0 -p tcp -j DNAT --to-destination 64.111.96.38 For the uninitiated, this redirects all traffic to kittenwar. For more fun, we set iptables to forward everything to a transparent squid proxy running on port 80 on the machine. /sbin/iptables -A PREROUTING -s 192.168.0.0/255.255.255.0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.0.1 That machine runs squid with a trivial redirector that downloads images, uses mogrify to turn them upside down and serves them out of its local webserver. The redirection script Then the internet looks like this! I made xkcd - how cool is that ?

10 Windows 7 commands every administrator should know The command line is often the best place to resolve Windows 7 desktop problems. These basic commands will help speed your troubleshooting tasks. Holiday rerun: An oldie-but-a-goodie, these command-line basics topped the list of popular troubleshooter posts last year. PC troubleshooting is becoming less common in larger organizations, but consultants and techs in smaller shops still have to get their hands dirty identifying and fixing desktop problems. Before I begin... This article is intended solely as an introduction to some useful troubleshooting commands. 1: System File Checker Malicious software will often attempt to replace core system files with modified versions in an effort to take control of the system. sfc /scannow 2: File Signature Verification One way to verify the integrity of a system is to make sure that all the system files are digitally signed. sigverif 3: Driverquery Incorrect device drivers can lead to any number of system problems. driverquery driverquery -v driverquery -si

64 Things Every Geek Should Know - laptoplogic.com The term ‘geek’, once used to label a circus freak, has morphed in meaning over the years. What was once an unusual profession transferred into a word indicating social awkwardness. As time has gone on, the word has yet again morphed to indicate a new type of individual: someone who is obsessive over one (or more) particular subjects, whether it be science, photography, electronics, computers, media, or any other field. A geek is one who isn’t satisfied knowing only the surface facts, but instead has a visceral desire to learn everything possible about a particular subject. A techie geek is usually one who knows a little about everything, and is thus the person family and friends turn to whenever they have a question. If you’re that type of person and are looking for a few extra skills to pick up, or if you’re a newbie aiming to get a handhold on the honor that is geekhood, read on to find out what skills you need to know. 1. USB – Universal Serial Bus GPU – Graphics Processing Unit 2. 3.

Inserting Data Into MySQL From Excel Using VBA - HTNet seun asked in an old post of mine, Interfacing with MySQL via Excel; whether it’s possible to submit data from Excel into MySQL. Yes, it is very much possible to do this. In fact, I’ve written a tutorial on how to do this with the help of VBA. First, we create the table that we will use to store the data. The SQL statement below will create our sample table called tutorial. Just copy and paste it into your favourite MySQL IDE or phpMyAdmin. CREATE TABLE IF NOT EXISTS `tutorial` ( `id` int(11) NOT NULL auto_increment, `title` varchar(255) NOT NULL, `author` varchar(255) NOT NULL, `price` float(4,2) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; Now that we’ve created the table, it’s time to store some data in it. Now rename that sheet as Books. I prefer to place the toolbars at the top panel area so they’re out of the way of my Excel spreadsheet. Now it’s on to some programming. Connecting to the Database Server and Selecting the Correct Database

Auto-redirecting methods and examples by Phil Craven What is Auto-Redirecting Auto-redirecting is the technique of automatically sending a site visitor to another page once s/he has landed on a page. On-site auto-redirecting is common when a page, within the site, has been created specifically to rank highly in the search engines, but has been so highly optimized that it is no good for people to actually see. Both of those uses are not wanted by the search engines, and they sometimes penalise a page or site for doing it. The engines are not against auto-redirecting when it is done for they what consider to be a valid reason. Auto-Redirecting Methods The "Meta Refresh Tag" method This is the one auto-redirecting method that the engines can automatically detect, or so it is believed. The code for it must be in the <head> section of the page, and looks like this:- <head> ...head section stuff (Title, Description,etc.)... The "content" parameter contains two parts, seperated by a semi-colon. The "Javascript" method The "Form" method

Ten Common Database Design Mistakes No list of mistakes is ever going to be exhaustive. People (myself included) do a lot of really stupid things, at times, in the name of “getting it done.” This list simply reflects the database design mistakes that are currently on my mind, or in some cases, constantly on my mind. Before I start with the list, let me be honest for a minute. So, the list: Poor design/planning Ignoring normalization Poor naming standards Lack of documentation One table to hold all domain values Using identity/guid columns as your only key Not using SQL facilities to protect data integrity Not using stored procedures to access data Trying to build generic objects Lack of testing Poor design/planning “If you don’t know where you are going, any road will take you there” – George Harrison Prophetic words for all parts of life and a description of the type of issues that plague many projects these days. Far too often, a proper planning phase is ignored in favor of just “getting it done”. Ignoring Normalization

What Makes a Design Seem 'Intuitive'? By Jared M. Spool Originally published: Jan 10, 2005 In a recent usability test, I once again witnessed something I've seen a hundred times before: a frustrated user claiming he knows exactly what is wrong with the interface he was fighting with. I think he used the I-Word no less than 25 times during the session. People Intuit, not Interfaces To those who police the English language, interfaces can't be intuitive, since they are the behavior side of programs and programs can't intuit anything. But, I believe that English is an adaptable medium, so it's ok with me if we call a design intuitive. To answer that question, we first have to look at how people understand the design in the first place. Current and Target Knowledge Points Imagine a long wall where you'll line up all the users who will use your design. On the right side, we'll put everyone who knows everything there is to know about the design. There's another point that's of interest to us: the target knowlege point.

Related: