Wine Tasting at Niagara Vineyards.

A trip to the Niagara Vineyards was a lot of fun, even for me who doesn't drink. Alright I don't mind drinking a glass of wine but more as a social thing. 

Wine Tasting at Niagara Vineyards.

Create a new file on Mac OS X with two mouse clicks.

Having just moved from Windows to Mac, there was one feature I was missing. The capability to create a New File as easily as one mouse click.

Create a new file on Mac OS X with two mouse clicks.

Create a File on Mac OS X with two mouse clicks

I have neglected updating my website, these are busy times for me and I apologize for those of you who have been waiting for this.

Jailbreak Is Now 100% Legal

This is a great day for the all iPhone users, jailbreaking is now 100% legal.  EFF (Electronic Frontier Foundation) has won three critical exemptions to the Digital Millennium Copyright Act (D

Jailbreak Is Now 100% Legal

Useful commands to know in Linux.

Switching from a windows environment to Linux is a big change, the most obvious to overcome was knowing what commands to use to get information about your operating system. This is why I am putting this list together, to minimize the amount of search needed to find the right information.

This list will be updated from time to time.

ifconfig - this command is used to configure and control network interfaces, simply running this command will display the current state of your network interface.

netstat - combining switch with this command will will display a lot of useful information about your network, such as Routing Tables, all open ports, all listening ports and more.

This command will display a numeric routing table, (-n) tells the command to output IP address instead of hostname, (-r) prints the routing table on your screen.

Example: netstat -nr

This command will display all open ports.

Example: netstat -a

This will display all listening ports.

Example: netstat -l

 

Installing MySQL on Debian

apt-get install mysql-server mysql-client libmysqlclient-dev
mysqladmin -u root password yourrootsqlpassword

When you run netstat -tap you should now see a line like this:

tcp 0 0 localhost.localdo:mysql *:* LISTEN 2449/mysqld

Installing Apache, PHP and a few other modules

apt-get install apache2 apache2-doc
apt-get install php4 php4-cli php4-common php4-curl php4-dev php4-domxml php4-gd php4-imap php4-ldap php4-mcal php4-mhash php4-mysql php4-odbc php4-pear php4-xslt curl imagemagick

FreeRADIUS

Fetch FreeRADIUS and some tools:

apt-get install freeradius freeradius-mysql freeradius-dialupadmin

Apache Cheat Sheet

Setup a Virtual Domain
NameVirtualHost *
<VirtualHost * >
  DocumentRoot /web/example.com/www
  ServerName example.com
  ServerAlias example.com
  CustomLog /web/example.com/logs/access.log combined
  ErrorLog /web/example.com/logs/error.log
</VirtualHost>
Include another conf file
Include /etc/apache/virtual-hosts/*.conf
Hide apache version info
ServerSignature Off
ServerTokens Prod
Custom 404 Error message

ErrorDocument 404 /404.html

Create a virtual directory (mod_alias)
Alias /common /web/common
Perminant redirect (mod_alias)
Redirect permanent /old http://example.com/new
Create a cgi-bin
ScriptAlias /cgi-bin/ /web/cgi-bin/
Process .cgi scripts
AddHandler cgi-script .cgi
Add a directory index

DirectoryIndex index.cfm index.cfm

Turn off directory browsing
Options -Indexes
Turn on directory browsing
<Location /images>
  Options +Indexes
</Location>
Create a new user for basic auth (command line)

htpasswd -c /etc/apacheusers

Apache basic authentication
AuthName "Authentication Required"
AuthType Basic
AuthUserFile /etc/apacheusers
Require valid-user
Only allow access from a specific IP
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Only allow access from your subnet
Order Deny,Allow
Deny from all
Allow from 176.16.0.0/16

mod_rewrite

Turn on the rewrite engine

RewriteEngine On

Redirect /news/123 to /news.cfm?id=123
RewriteRule ^/news/([0-9]+)$ /news.cfm?id=$1 [PT,L]
Redirect www.example.com to example.com
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com$1 [R=301,L]