May 17 2009

SSH Tunneling for Privacy and Trickery.

If you have access to a ssh server you can easily tunnel your web browsing and newsgroup/IRC activity to make sure that your IP is never associated with that ..stuff you do. You can basically tunnel any port through the any ssh server. These methods can be used to build up complex chains that are almost impossible to track.

To tunnel your basic browsing through a ssh “proxy” use this command:

ssh -D 8080 -p 22 codytaylor@someserver.com

I used port 8080 instead of the default 80 becuase I run a webserver on my local machine and I didn’t want to mess that up.

The -D in the command specifies a local dynamic application-level port forwarding which creates a socket to listen to the specified port on the local machine. Ancy connections made to this local port are forwarded over the secure channel.

This makes it easily possible to forward all web traffic on the local system through the secure channel by setting up a simple iptables rule:
–iptables -A PREROUTING -t nat -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 8080

If you want to set up a secure ssh tunnel to connect to a specific newsgroup server you can use this command:

sudo ssh -N -p 22 codytaylo@sshserver.net -f -L 443:111.111.111.111:443

The -L specifies that the given port on the local client is to be forwarded to the given host and port on the remote side. This is basically a very specific instruction that tells all traffic that is directed to localhost at port 443 (119 if you don’t like double encryption) to go to the ip address 111.111.111.111:443. Note: I couldn’t get this to work with domains for some reason.

The -N tells ssh to not execute any remote commands. So you do not get the annoying ssh session stuff that makes you leave the terminal open.

The -f tells ssh to go into the background.

Share

May 15 2009

Read PDF’s Locally on the Iphone With Safari. No More Emails or URI Hacks

Read PDF’s Locally on the Iphone With Safari. No More Emails or URI Hacks

Essentially you can browse your entire iphone filesystem using this method but I just want to read PDF files as easily as possible.

I’ve been trying recently to find a proper PDF reader for the iphone that doesn’t really screw up the formatting or require very manual conversions and it seems that safari’s built in pdf reader is better than stanza and other readers.
Because safari on the iphone is not able to view files that are local on the device we need to do some quick work to make safari on the iphone read local files.
For this to work you will need to be able to access the iphone file system from a personal computer somehow. Check out how to get SCP on the iphone working.

First you will need to install the lighttpd program from cydia. It was under the networking section. Lighttpd is a tiny webserver for the iphone or ipod touch.
Once you’ve got lighttpd installed you will need to connect your iphone to your pc and open up SCP or a program similar over either wifi or through USB.

The version of lighttpd that I got from cydia didn’t have a default configuration file. So I created a file called lighttpd.conf which is extremely simple.
I chose not to put anything specific in the file because I never plan on accessing this iphone webserver from anywhere other than localhost.

server.document-root = “/var/www/”

server.port = 80

mimetype.assign = (
“.html” => “text/html”,
“.txt” => “text/plain”,
“.jpg” => “image/jpeg”,
“.png” => “image/png”
)

dir-listing.activate = “enable”

To check that your syntax is ok, log into the iphone with ssh or use a terminal app locally on the iphone and locate the lighttpd.conf file. I put mine in /etc.
Type this at the iphone prompt.

lighttpd -t -f lighttpd.conf

You should get “Syntax OK” after typing that into your iphone.

To start lighttpd:

lighttpd -D -f lighttpd.conf

Your document root on the iphone is now /var/www (if you used my configuration file) so start putting pdfs in there and you’ll now be able to read all those pirated ebooks that have been just sitting there taking up hard drive space for so long.
When you point safari to http://127.0.0.1/ you will now see a list of the pdfs (or whatever else you want to put in there).

Share

May 15 2009

Dojo Examples and Demos

The best resource for browsing all the features of dojo javascript is here. It not only displays all the features of dojo javascript but it also allows you to get any code for any feature you want. Check out here what you can do with it.

Share

May 14 2009

Give Website a Custom Icon for the Iphone

To put a custom icon for a website on the home screen of your iphone or ipod touch you will need a PNG file which is 45×45 pixels.
Call this icon apple-touch-icon.png and store it in the root of the website. Not sure how to add a custom icon to other peoples websites yet.

Of course, to create the link, you will want to go the page in safari and select the ‘+’ button and then select the “add to home screen” option.

Check the icon at this iphone web application example.

If you want to add an icon image that is located somewhere else then use this

<link rel=”apple-touch-icon” href=”/images/iphone-icon.png” />

Share

May 14 2009

Iphone iwebkit Example

Create Custom Iphone or Ipod Touch Web Applications Using iWebKit

For the impatient people like myself, heres what it looks like. You want to point your iphone browser to this location and hit the ‘+’ button at the bottom and select add to the homescreen. This will get rid of the navigation bar on in safari and make the iwebkit example look like a native iphone app.

Here are the steps to take in order to get this working.
Get the frame work: iWebKit framework (I used 4.5.3 for this guide)
Extract the iwebkit and take a look at the manual. Iwebkit comes with a few examples of how to use the key framework elements.We’re going to make a very rudimentary application for the purpose of iphone iwebkit example. Ajax integration with iwebkit will come later.

First you will need to create a directory on your web server and extract the iwebkit files into it.
The webkit contains a few examples but most of them didn’t show up properly for me when I used the Iphone.
Most webapps are built with just really basic html. The custom elements that iwebkit provides are called by normal divs with certain ids.

First start with an extremely basic html skeleton page :

<html>
<head>
<meta content=”yes” name=”apple-mobile-web-app-capable” />
<meta content=”text/html; charset=iso-8859-1″ http-equiv=”Content-Type” />
<meta content=”minimum-scale=1.0, width=device-width, maximum-scale=0.6667, user-scalable=no” name=”viewport” />
<title>iphone iwebkit example</title>
</head>
<body>

</body>
</html>

Hopefully no explanations are needed there. Notice the meta tags? So now we need to start adding the iphone javascript and css.
To get started with iwebkit for the iphone or iphone touch you only need to include two files into this basic html page but you will need to take all four folders from the Framework folder and put them into the directory where you want to host your web app.
Add these two lines to the head portion of the skeleton html file outlined above.

<link href=”css/style.css” rel=”stylesheet” type=”text/css” />
<script src=”javascript/functions.js” type=”text/javascript”></script>

Now to start putting the application together using iwebkits basic elements.

Top Bar
This section will outline the options for the navigation bar at the top of the page on the iphone or ipod touch.
Using iwebkit for the top bar we will normally put navagation buttons and a title like this.

<div id=’topbar’>
<div id=”leftnav”>
<a href=”index.html”><img alt=”home” src=”images/home.png”/></a>
</div>
<div id=’title’>
iphone iwebkit example
</div>
<div id=”rightnav”>
<a href=”index.html”>Next</a>
</div>
</div>

There are four div elements there that make up this top bar. The first is the bar itself and it encompasses the other three elements.
The second is the leftnav div. This specifies that the elements within this div are to appear at the left side of the bar (Big surprise).
The third is the title. The fourth is the rightnav which will appear on the right side. You’re probably going to want to put links and pictures in the leftnav and rightnav divs.
Instead of the rightnav div it is possible to put a rectangle button instead of the arrow button just by changing rightnav to rightbutton in the id.

Content
This section is for basically anything you want to put in your iwebkit page. I’m going to demonstrate a simple iphone-looking list here:

<div id=”content”>
<span class=”graytitle”>Iphone iwebkit example</span>
<ul class=”pageitem”>
<li class=”textbox”>
<p>Some Text for the iwebkit example</p>
<p>More text for the Iphone</p>
</li>
<li class=”textbox”>
<span class=”header”>Iphone iwebkit</span>
<p>Iphone Iphone</p><p>WebKit WebKit</p>
</li>
<li class=”menu”>
<a href=”index.php”>
<img alt=”Description” src=”thumbs/basics.png” />
<span class=”name”>Iphone iwebkit Example</span>
<span class=”comment”>Comment about iwebkit</span>
<span class=”arrow”></span>
</a>
</li>
<li class=”store”>
<a class=”noeffect” href=”index.php”>
<span class=”image” style=”background-image: url(‘image.jpg’)”></span>
<span class=”name”>Iphone Song</span>
<span class=”comment”>iWebKit Comment</span>
<img alt=”rating” class=”stars” src=”images/4stars.png” />
<span class=”starcomment”>13 Reviews</span>
<span class=”arrow”></span>
</a>
</li>

</ul>
</div>

There are a lot of options when using iwebkit. Most are pretty self explanatory, like the <ul> class and the <span> and <li> classes, but who wants to remember all that.
So go check the source of some feature or look that you want on your iwebkit page at <a href=’http://m.iwebkit.net/index.html’>this demo</a>.

The first issue I had when looking at my iwebkit example on the iphone was that the example iwebkit application wasn’t fullscreen in safari.
The only way that I’ve found so far to make this web application look like a native iphone application is to go to the page in safari and then hit the ‘+’ button at the bottom and select add to the homescreen.
This will get rid of the navigation bar on the iphone and make the iwebkit example look like a native iphone app.

This example and the full source for this iwebkit iphone example  can be looked at here.

Share

May 14 2009

Lawyer challenges Mulroney's 1996 testimony during Airbus lawsuit – CBC.ca


National Post

Lawyer challenges Mulroney's 1996 testimony during Airbus lawsuit
CBC.ca
Brian Mulroney testifies at the Oliphant commission, which is looking into business dealings between Karlheinz Schreiber and the former prime minister.
Mulroney in hot seat over selective answers The Canadian Press
Oh, cry me a river, Mr. Mulroney National Post
Globe and Mail – Toronto Star – CBC.ca – CBC.ca
all 696 news articles  Langue : Français
Share

May 14 2009

Caregiver advocate questions Dhalla's story – Canada.com


CTV.ca

Caregiver advocate questions Dhalla's story
Canada.com
By Juliet O'Neill, Canwest News ServiceMay 14, 2009 7:21 PM Brampton Liberal MP Ruby Dhalla during a press conference in Toronto, Friday.
Dhalla lawyer hints scandal was politically motivated StarPhoenix
Dhalla lying, advocate implies Toronto Star
Globe and Mail – The Canadian Press – Winnipeg Sun – Brampton Guardian
all 69 news articles
Share

May 14 2009

Domestic abuse – Ottawa Citizen


CTV.ca

Domestic abuse
Ottawa Citizen
There's blood in the waters, and the sharks are circling for Liberal MP Ruby Dhalla. As fascinating as the spectacle might be for political junkies, the importance of this episode will ultimately be measured by whether it has any effect on the lives of
Dhalla abuse charges 'false' Edmonton Sun
Dhalla a victim of campaign: lawyer National Post
Globe and Mail – Toronto Star – Toronto Star – Toronto Star
all 545 news articles
Share

May 14 2009

Google suffers major failure

Google Search and Google News performance slowed to a crawl, while an outage seemed to spread from Gmail to Google Maps and Google Reader. Comments about the failure were flying on Twitter, with “googlefail” quickly became one of the most searched terms on the popular micro-blogging site.


Share

May 14 2009

Xerox Solid Ink Printer Cuts Waste by 90%

Ink toner cartridges are expensive, wasteful, and energy-intensive. That’s why Xerox’s new ColorQube 9200 printers are so innovative. Instead of using traditional cartridges, the printers use solid blocks of ink that melt when heated. Xerox claims that its ,500 machine–meant squarely for corporate customers


Share