IE 7 and password fields

Posted by John
on Thursday, 06 March 2008

Quick Note. Unlike Firefox, Internet Explorer handles password fields a little differently, blanking out whatever value you pass it within a 'value' tag.

So...

Will have a password box in Firefox starred out, but in IE it'll appear blank.

To get around this you can use Prototype to inject a value into the password field, so the user see's it as starred out.

$('mypass').value='**';

Note, if you're generating the form dynamically with...

var innerhtml='

Only fire your $('mypass') code after the form has been written to the page otherwise you won't be able to get a handle on it (most cases you won't ever have this problem).

Installer.app can't find host! - iPhone

Posted by John
on Thursday, 14 February 2008

If you're one of those guys with a hacked iPhone, you might get this error with the InstallerApp, nothing serious, just one of the repositories has changed location.

New Repository Location

  • Go to Sources in Installer.app.
  • Tap the Edit button. Click on the - icon over Ste Packaging source line to delete it.
  • Tap the Add button and type the right new URL for STE Packaging source:
  • Type in the new location.. http://repo.smxy.org/iphone-apps/

Getting Extra Space on your iPhone

PS, It's recommend you install both Community Sources and BossTool (in the Utilities category) and run the Free Disk Space tool inside BossTool in order to relocate Fonts, Ringtones and Applications to the main disk partition and thus, be able to install a lot more applications without space problems.

Note: do this in the recommended order;

  • first Fonts
  • then Ringtones
  • and Applications at the last

As always, be careful with this; haven't done it myself btw.

Update

Just ran the BossTool on my iphone (1.1.4) and it worked fine, did each in order fonts, then ringtones, then apps.

Also try using ZiPhone to update and unlock your iphone, you should get the new sources in the installer automatically with it.

Rails => Forgot your Password code...

Posted by John
on Wednesday, 07 November 2007

Finally got around to adding a 'forgot your password' feature to AtomPad.com.

For the rest of you, I found an excellent example online at...

I changed the Find_By to the following as Mongrel doesn't seem to like dynamic finds,

In forgot password method...

if @user = User.find(:first, :conditions => [ "email = ?", params[:email] ])

And reset password method...

@user = User.find(:first, :conditions => [ "pw_reset_code = ?", params[:id] ] ) rescue nil

Nice to have that problem out of the way,

NET::SSH Fingerprint Faults

Posted by John
on Tuesday, 25 September 2007

Had a real headache today with NET::SSH complaining the remote host's fingerprint id didn't match up and thus it wasn't going to play ball.

Refreshing Your SSH Fingerprint

Thankfully a fix!

link

require 'rubygems'
require 'net/ssh'
include Net
domain = 'www.mydomain.com' # insert IP address or domain name here
begin
Net::SSH.start(domain, 'deploy') do |ssh|
# ...
end
rescue Net::SSH::HostKeyMismatch => e
puts "remembering new key: #{e.fingerprint}"
e.remember_host!
retry
end

Basically open up IRB in the console and alter the 'domain' to be your remote target.

'deploy' is the name of the user account you have used to setup your Rails app in your deploy.rb file.

Remember this 'deploy' account needs to be already created on your target server, otherwise it won't know what your talking about.

If it fails, try using 'root'

Then when you run the IRB script NET::SSH will remember the new fingerprint and thus your cap commands will start working again.

Thank god I found that, saved my neck he did.

...or Totally Ignoring It?

Now on top of this if you still get problems you can tell NET::SSH to totally ignore checking whether the key matches or not, this is good if all your normal SSH connections are fine but the Ruby NET::SSH library still won't play ball and you just want it working.

If you've put in a firewall on your Linux box via iptables you should be protected anyway, so not many security issues there.

This IRB script will tell NET::SSH to stop being paranoid and let you do your job.

require 'rubygems'
require 'net/ssh'
include Net
domain = 'www.mydomain.com'
begin
Net::SSH.start(domain, 'deploy', :paranoid => false) do |ssh|
# ...
end
end

Replace mydomain.com with your domain name and it'll get the message and let you do your job, bypassing it's fingerprint match.

John.

Getting your footers to stay put

Posted by John
on Thursday, 13 September 2007

One of the problems I get with building a new web layout is footers, they’ll either be just where I want them or bunch up and push themselves into the side of my floated image; real annoying.

Thankfully a nice girl called Kathy Marks has posted a guide on keeping the footers in-place via adding Absolute positioning within your CSS styling, enjoy…

The short of it is you wrap your content in one div and have another div within that to hold the footer. For the footer css you set it to ‘position: absolute;’ making sure it will stay put. On top of this adding ‘bottom: 0px;’ to keep it starting at the very start of the footer div.

Make your content div have it’s css calling ‘min-height:100%;’ and you’ll be forcing it to soak up the complete screen leaving the footer to exist at the very bottom.

It sounds complex but is so simple it’s perfect!