Sunday, April 26, 2009

"tail" command in Windows

Go to http://www.microsoft.com/windowsserver2003/downloads/tools/default.mspx and download "Windows Server 2003 Resource Kit Tools"

Tuesday, August 05, 2008

How to boot Windows without using password

  • Run "control userpasswords2" and press Enter to open the Windows 2000-style User Accounts.
  • Clear the "Users Must Enter A User Name And Password To Use This Computer."
  • Type the username and password for the account you want to be logged on each time you start your computer.

Friday, June 27, 2008

Ubuntu machine's hostname is invisible to router

Edit /etc/dhcp3/dhclient.conf

Uncomment or add the following line

send host-name "yourhostname"


Source
http://ubuntu.wordpress.com/2006/02/06/fix-hostname-unknown-in-router/

Labels: ,

encore

encore
noun [C]
an extra song or piece of music that is performed at the end of a show because the audience shout for it:
We were shouting for an encore.
They did a few old hits as/for an encore.

Reference
Cambridge Dictionaries Online

Wednesday, June 18, 2008

Slipstreaming Windows XP

Download Windows XP SP3
Download the updated Windows deploy.cab
- Windows XP SP3 Deployment Tools ~1.7MB

Extract SP3
C:\OS\SP.EXE /U /X:C:\OS\SP

Update
C:\OS\SP\I386\UPDATE\UPDATE.EXE /S:C:\OS\ROOT

To create fully-automated setup (winnt.sif)
Extract deploy.cab, and run setupmgr.exe
A file "unattended.txt" will be generated. Rename to "winnt.sif", and place it in the direction "i386."

To create a bootable CD
Download a boot file (boot.ima) from bootfiles-from-tacktech-website.zip
- Data Mode = Mode 1
- No Emulation
- File System = ISO 9660 + Joliet
- File Name Length = Max. of 31 chars (Level 2)
- Allow path depth more than 8 directories
- Allow more than 255 chars in path
- Allow more than 64 chars for Joliet names
- Load segment of sectors (hex) = 0000
- Number of loaded sectors = 4


References
http://www.tacktech.com/display.cfm?ttid=295
http://www.tacktech.com/display.cfm?ttid=346
http://www.justusers.net/articles/ossystem/installxp/installxp.htm

Unable to update Windows XP

A problem on your computer is preventing updates from being downloaded or installed

Click Start > Run and type

regsvr32 wuapi.dll
regsvr32 wuaueng1.dll
regsvr32 wuaueng.dll
regsvr32 wucltui.dll
regsvr32 wups2.dll
regsvr32 wups.dll
regsvr32 wuweb.dll


Reference
http://www.technipages.com/error-a-problem-on-your-computer-is-preventing-updates-from-being-downloaded.html

Thursday, March 27, 2008

Make a user control transparent

Refer to
http://www.thescripts.com/forum/thread248836.html
http://www.peterritchie.com/Hamlet/Articles/62.aspx


Step 1:
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x00000020;
return cp;
}
}

Step 2:

Add the following lines in the constructor.

SetStyle(ControlStyles.Opaque, true);
UpdateStyles();


Step 3:

protected override void OnPaint(PaintEventArgs e)
{
// TODO: Add TransparentControl.OnPaint implementation
base.OnPaint (e);
}


Example

namespace Magnifier.NET
{

public class TransparentControl : System.Windows.Forms.UserControl
{
private System.ComponentModel.Container components = null;

public TransparentControl()
{
SetStyle(ControlStyles.Opaque, true);
UpdateStyles();
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();

// TODO: Add any initialization after the InitializeComponent call

}

protected override CreateParams CreateParams
{
get
{
const int WS_EX_TRANSPARENT = 0x20;
CreateParams cp = base.CreateParams;
cp.ExStyle |= WS_EX_TRANSPARENT;
return cp;
}
}

protected override void OnPaint(PaintEventArgs e)
{
// TODO: Add TransparentControl.OnPaint implementation
base.OnPaint (e);
}
}
}

Labels: , ,

Tuesday, December 18, 2007

TrueMobile 1300 running on Ubuntu with WPA

Refer to: http://ubuntuforums.org/archive/index.php/t-411299.html

sudo wpa_passphrase (your wireless ssid)
The Terminal will say it is getting it or something like that, and there will be a cursor below that line.
Enter your WPA password

Now Terminal will give you a very long string for your key. I just copied and pasted it into NetworkManager's password prompt, and also in the keychain request that came up right after.

Labels:

Friday, November 16, 2007

How to use GMail's SMTP server with Rails

How to use GMail's SMTP server with Rails

1. Create a file 'smtp_tls.rb' and save in lib/smtp_tls.rb

require "openssl"
require "net/smtp"

Net::SMTP.class_eval do
private
def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started
check_auth_args user, secret, authtype if user or secret

sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
@socket = Net::InternetMessageIO.new(sock)
@socket.read_timeout = 60 #@read_timeout
#@socket.debug_output = STDERR #@debug_output

check_response(critical { recv_response() })
do_helo(helodomain)

if starttls
raise 'openssl library not installed' unless defined?(OpenSSL)
ssl = OpenSSL::SSL::SSLSocket.new(sock)
ssl.sync_close = true
ssl.connect
@socket = Net::InternetMessageIO.new(ssl)
@socket.read_timeout = 60 #@read_timeout
#@socket.debug_output = STDERR #@debug_output
do_helo(helodomain)
end

authenticate user, secret, authtype if user
@started = true
ensure
unless @started
# authentication failed, cancel connection.
@socket.close if not @started and @socket and not @socket.closed?
@socket = nil
end
end

def do_helo(helodomain)
begin
if @esmtp
ehlo helodomain
else
helo helodomain
end
rescue Net::ProtocolError
if @esmtp
@esmtp = false
@error_occured = false
retry
end
raise
end
end

def starttls
getok('STARTTLS') rescue return false
return true
end

def quit
begin
getok('QUIT')
rescue EOFError, OpenSSL::SSL::SSLError
end
end
end

2. Run the command
ruby script/generate mailer Notifier

3. Add the following method

def signup_thanks( user )
# Email header info MUST be added here
recipients user.email
from "accounts@mywebsite.com"
subject “Thank you for registering with our website”

# Email body substitutions go here
body :first_name => user.first_name, :last_name => user.last_name
end

4. Add the following line in a controller

Notifier.deliver_signup_thanks(user)

5. Create a file named 'signup_thanks.rhtml' and save in the directory app/models/notifier

Dear <%= @first_name %> <%= @last_name %>,
Thanks for signing up with My Website!
Your account will allow you to do blah, blah, blah.

6. Add the following lines in the configuration file 'config/environment.rb'

require 'smtp_tls'
ActionMailer::Base.server_settings = {
:address => "smtp.gmail.com",
:port => "587",
:domain => "localhost.localdomain",
:authentication => :plain,
:user_name => "someusername",
:password => "somepassword"
}

Sources
http://www.rubyinside.com/how-to-use-gmails-smtp-server-with-rails-394.html
http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer
http://21croissants.blogspot.com/2007/08/configuring-rails-to-use-gmails-smtp.html
http://api.rubyonrails.org/classes/ActionMailer/Base.html

Labels: ,