Loading
Showing posts with label CLI. Show all posts
Showing posts with label CLI. Show all posts

Sunday, January 2, 2011

Configuring FTP in Isolation Mode in IIS 6

IIS FTP isolation mode enables you to have a separate directory per FTP user. For example if you had a dozen different users that all need access to your FTP server but you did not want them to see any directories but their own you could setup Isolation Mode. Isolation Mode supports users either on the local computer, or if you are a member of a domain it supports domain users.

We will begin by assuming you have FTP (and IIS) installed. Launch IIS Manager (IIS Manager 6.0 in Windows 2008). NOTE: in Windows 2008 make sure you install the IIS Management Console role so you can manage your FTP sites.
  • Delete or disable the default ftp site
  • Create a new FTP site with desired values - at the FTP User Isolation screen select Isolate Users or Isolate Users using Active Directory (which ever works better for your situation)
  • Specify path for your new FTP site
  • Set FTP Site Access Permissions to both Read and Write
Within the root FTP directory you must create either a directory named localuser or <your_domain_name>, depending on which isolation mode you are using.  In my case I am NOT using Active Directory so I created the directory localuser.

Within the localuser or <your_domain_name> directory create the desired user directories and assign each user sufficient permissions to their respective directory.


Example - creating directories:
md ftproot
md ftproot\localuser
md ftproot\localuser\localuser1
md ftproot\localuser\localuser2
md ftproot\localuser\localuser3
Example - setting Create NTFS permissions on each respective directory:
cacls ftproot\localuser\localuser1 /E /G localuser1:C
cacls ftproot\localuser\localuser2 /E /G localuser2:C
cacls ftproot\localuser\localuser3 /E /G localuser3:C

Thursday, November 5, 2009

Command to Find Current Ubuntu Version

Run this command to find the installed version of Ubuntu.
cat /etc/lsb-release
You will get the following info.
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION="Ubuntu 8.04.3 LTS"
You could also use
cat /etc/issue
Which will display the version only:
Ubuntu 8.04.3 LTS \n \l

Tuesday, November 3, 2009

Monday, November 2, 2009

Whois Windows Command Line Utility

WhoisCL is a simple command-line utility that allows you to easily get information about a registered domain. It automatically connect to the right WHOIS server, according to the top-level domain name, and retrieve the WHOIS record of the domain. It supports both generic domains and country code domains.

Runs on all Windows platforms (XP, Vista, Windows 7, 2000, 2003, 2008) & uses TCP/IP port 43.

Download WhoisCL

Whois IP Windows Command Line Utility

WhosIP is a simple command-line utility that allows you to easily find all available information about an IP address: The owner of the IP address, the country/state name, IP addresses range, contact information (address, phone, fax, and email), and more.

Runs on any Windows operating system: Windows 95/98/ME/NT/2000/XP/2003/Vista/Windows 7, etc.

Download WhosIP

Thursday, October 22, 2009

Disable Windows Users From The Command Line

Whether in an Active Directory domain or standalone in a workgroup you can use this simple command line to disable one or more users.
net user <username> /active:no </domain>

Monday, October 19, 2009

Exchange 2007 HOW TO: Add Email Addresses To Public Folders

How do we add email addresses to Public Folders?

It should be pretty simple - If Get-Mailbox shows the emailaddresses property for a mailbox, and Set-Mailbox allows you to use the -EmailAddresses switch to add email addresses, one can't be blamed for believing it'll work the same way for Public Folders.

Objects other than Public Folders need to be mailbox or mail-enabled to be Exchange recipients, Public Folders do not (Yes, they are mail-enabled by default). To modify mail-related attributes of Public Folders, you use the Set-MailPublicFolder command.

To add additional email address to a (mail-enabled) Public Folder:

$PF = Get-MailPublicFolder "Sales"
$PF.EmailAddresses += "Sales-EMEA@domain.com"
$PF | Set-MailPublicFolder

The first line gets mail-related properties of Public Folder "Sales" in a variable called $PF. Next, we add the additional email address, without wiping out the existing ones. Finally, we commit the change using Set-MailPublicFolder.

If you simply use Set-MailPublicFolder "Sales" -EmailAddresses "Sales-EMEA@domain.com", it will replace the existing values in the EmailAddresses property.

Another difference to note between how the Set-PublicFolder and Get-PublicFolder commands work, compared to Set-MailPublicFolder and Get-MailPublicFolder - the former takes a relative path of a Public Folder. For instance, to get the Sales PF if it's in the root of the Public Folder tree, we would need to add a \ before the name:
Get-PublicFolder \Sales
However, the Get/Set-MailPublicFolder commands work using the alias/display name of the PF. Why the difference? One way to look at it - when using Get/Set-PublicFolder, you're working with the actual Public Folder. When using Get/Set-MailPublicFolder, you're working with the Active Directory object created for that Public Folder (which holds mail-related attributes, making it possible for a Public Folder to be mail-enabled).

To change the primary email address of the Public Folder "Sales" from "Sales@domain.com" to the new address we just entered - "Sales-EMEA@domain.com":
Set-MailPublicFolder "Sales" -EmailAddressPolicyEnabled $false -PrimarySmtpAddress "Sales-EMEA@domain.com"
As you may have already figured out, we exempted the Public Folder from getting EmailAddressPolicies applied. In Exchange Server 2003/2000, you could change the default email address of a recipient, without unchecking the checkbox. Result: A few minutes after you completed the change, Recipient Policies would apply and change the primary email address back.

Exchange Server 2007 doesn't let you change the default email address without exempting the recipient from email address policies.

Wednesday, October 7, 2009

FTP - File Transfer Protocol

FTP

File Transfer Protocol
Syntax
      FTP [-options] [-s:filename] [-w:buffer] [host]

key   
   -s:filename   Run a text file containing FTP commands.

   host          Host name or IP address of the remote host.

   -g            Disable filename wildcards.

   -n            No auto-login.

   -i            No interactive prompts during ftp.

   -v            Hide remote server responses.

   -w:buffer     Set buffer size to buffer
                 (default=4096)

   -d            Debug
 
   -a            Use any local interface when binding data connection.


Commands to run at the FTP: prompt

append local-file [remote-file]
             Append a local file to a file on the remote computer.

ascii        Set the file transfer type to ASCII, the default. 
             In ASCII text mode, character-set and end-of-line
             characters are converted as necessary.

bell         Toggle a bell to ring after each command. 
             By default, the bell is off.

binary       Set the file transfer type to binary. 
      Use `Binary' for transferring executable program
             files or binary data files e.g. Oracle

bye          End the FTP session and exit ftp

cd           Change the working directory on the remote host.

close        End the FTP session and return to the cmd prompt.

debug        Toggle debugging. When debug is on, FTP will display
             every command.

delete remote-file
             Delete file on remote host.

dir [remote-directory] [local-file]
             List a remote directory's files and subdirectories.
             (or save the listing to local-file)

disconnect   Disconnect from the remote host, retaining the ftp prompt.

get remote-file [local-file]
             Copy a remote file to the local PC.

glob         Toggle the use of wildcard characters in local pathnames.
             By default, globbing is on.

hash         Toggle printing a hash (#) for each 2K data block transferred. 
             By default, hash mark printing is off.

help [command]
             Display help for ftp command.

lcd [directory]
             Change the working directory on the local PC.
             By default, the working directory is the directory in which ftp was started.

literal argument [ ...]
             Send arguments, as-is, to the remote FTP host.

ls [remote-directory] [local-file]
             List a remote directory's files and folders.
             (short format)

mdelete remote-files [ ...]
             Delete files on remote host.

mdir remote-files [ ...] local-file
             Display a list of a remote directory's files and subdirectories.
             (or save the listing to local-file)
             Mdir allows you to specify multiple files.

mget remote-files [ ...]
             Copy multiple remote files to the local PC.

mkdir directory
             Create a directory on the remote host.

mls remote-files [ ...] local-file
             List a remote directory's files and folders.
             (short format)

mput local-files [ ...]
             Copy multiple local files to the remote host.

open computer [port]
             Connects to the specified FTP server. 

prompt       Toggle prompting. Ftp prompts during multiple file transfers to 
             allow you to selectively retrieve or store files;
             mget and mput transfer all files if prompting is turned off. 
             By default, prompting is on.

put local-file [remote-file]
             Copy a local file to the remote host.

pwd          Print Working Directory
             (current directory on the remote host)

quit         End the FTP session with the remote host and exit ftp.

quote argument [ ...]
             Send arguments, as-is, to the remote FTP host.

recv remote-file [local-file]
             Copy a remote file to the local PC.

remotehelp [command]
             Display help for remote commands.

rename filename newfilename
             Rename remote files.

rmdir directory
             Delete a remote directory.

send local-file [remote-file]
             Copy a local file to the remote host.

status       Display the current status of FTP connections and toggles.

trace        Toggles packet tracing; trace displays the route of each packet 

type [type-name]
             Set or display the file transfer type:
             `binary' or `ASCII' (the default)

             If type-name is not specified, the current type is displayed. 
             ASCII should be used when transferring text files.

             In ASCII text mode, character-set and end-of-line
             characters are converted as necessary.

      Use `Binary' for transferring executable files. 

user user-name [password] [account]
             Specifes a user to the remote host.

verbose      Toggle verbose mode. By default, verbose is on.

! command    Run command on the local PC.

? [command]  Display help for ftp command.
Examples
an example FTP Script to retrieve files in binary and then ascii mode:
::GetFiles.ftp

   [User_id]
   [ftp_password]
   binary
   get /usr/file1.exe
   get file2.html
   mget *.jpeg
   ascii
   mget *.txt
   quit
To run the above script:
FTP -s:GetFiles.ftp [hostname]
This will connect as the user:User_id with password:ftp_password

An FTP Script to publish files in binary mode:
::PutFiles.ftp

   [User_id]
   [ftp_password]
   binary
   mput *.html
   cd images
   mput *.gif
   quit
To run the above script:
FTP -s:PutFiles.ftp [hostname]
This will connect as the user:User_id with password:ftp_password


Using the Windows GUI for FTP
Windows Explorer (not Internet Explorer) also has a built in FTP client.
Type in the address bar:
ftp://username@ftpserver.address.com
you will be prompted for the password.
You can also use

ftp://username:password@ftpserver.address.com
This is not recommended as anyone can read the password.

Secure FTP
Standard FTP does not encrypt passwords - they are sent across the network in plain text. A more secure method is to use SecureFTP (SFTP) or SecureCopy (SCP) Freeware clients are available such as WinSCP.

Monday, October 5, 2009

Ubuntu Linux DNS Settings

DNS server settings are found in /etc/resolv.conf.  To edit use your favorite editor to open, personally I prefer nano.
sudo nano /etc/resolv.conf
Entries will look like
nameserver <ip address>
nameserver <ip address>
nameserver <ip address>
You should enter at least two known good DNS servers.

Set Time Zone From Command Line in Windows 2003, XP and 2000

Quick and easy way to set timezone from command line in Windows 2003, XP and 2000.
CONTROL.EXE TIMEDATE.CPL,,/Z Eastern Standard Time
CONTROL.EXE TIMEDATE.CPL,,/Z Central Standard Time
CONTROL.EXE TIMEDATE.CPL,,/Z Mountain Standard Time
CONTROL.EXE TIMEDATE.CPL,,/Z Pacific Standard Time
These are a little longer but they do the same thing.
RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Eastern Standard Time
RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Central Standard Time
RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Mountain Standard Time
RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Pacific Standard Time
See also Set Time Zone From Command Line in Windows 7 and Windows 2008

Keywords:
change time zone from command line windows xp
windows 2003 change timezone
command to get time zone in win xp

Windows 7 (and Windows 2008) Command Line Utility to Change Time Zone

Here is a great hidden command line utility which is available starting in Windows 7, "tzutil.exe," which can be used to view or change the computer's Time Zone. To use this command:

1. Open the Command Prompt.
2. Enter any of following commands:
tzutil /g (To view current time zone)
tzutil /l (To get a list of all available time zones)
tzutil /s time_zone_ID (To change time zone)
time_zone_ID is the new time zone you want to set. Fox example, if you want to set the time zone to "Eastern Standard Time", then the command would be:
tzutil /s "Eastern Standard Time"
See also Set Time Zone From Command Line in Windows 2003, XP and 2000

Thursday, October 1, 2009

Connecting to Amazon AWS from Windows to a Linux AMI

Connecting from Windows to a Linux Server poses problems for the average person to connect, and use their Windows OS to connect to the Linux Server. For some this is enough to put off people from jumping in, or banging their head against the wall wondering why you cannot simply RDP into the server and where is the Admin Password for the Linux box. We are all used to what we are used to, and for many using a public/private key pair is part of the problem. We are not exposed to this in our daily lives, although with cloud computing via AWS you have to become smart in this process. The instructions at Amazon are not written in plain English and it's hard to find the details.

Here are some handy steps that you can take to get access to your Amazon AWS server (Amazon Web Services) that takes place after you have set up your instance and downloaded your keys. You might want to read this article by Dave Winer to get through the set up of the AMI, downloading your keys and otherwise getting your first AWS instance set up and booted to the point where it is running. This is where this article steps in to help people connect to their Linux server from a Windows Box. For this process, we used the new Windows 7 as our Windows box, and all the software we recommend you download worked great.

When you are building out your system you want to have your instance up and running. You can use any AMI (Amazon Machine Image) that you want to use; in this case we are using the simple LAMP Linux version. You can find the LAMP AMI by searching for “LAMP”. There are some quick GotCha’s that you want to know about before you put a lot of time into an AMI getting it all prepped for what you want to do.

Windows or Linux does not matter, if you terminate the instance there is no way to restart it you will get the no valid actions error. When you terminate an instance you cannot restart it, it is gone, shutdown, lost forever. If you click on Launch, you will be prompted for a new image, regardless of what image you want to restart, so be very careful when you terminate an instance. If you terminate, it will be DOA for life. The image below shows what options you have using the AWS console provided by Amazon (via the Web). Remember, never click on Terminate unless you are completely done with the image and you never want to use it again.



A running Linux instance does not have the “get administrative password” option that Dave talks about in his EC2 for Poets article. With Linux there are some things you have to do to get access. If you search Amazon you will see a ton of words on this subject that again for the average person is a rambling diatribe written by computer geeks for computer geeks. They even offer you a set of tools to download, but if you are running windows many of these tools will not work properly. Here are the tools you need to get started.

Putty – Putty is an SSH terminal client that will tie in with another program that you will download here in a minute. Download PuTTY here.

PuttyGen – You can download this software from the same place you downloaded putty. You will want this program to convert your Amazon Key from Amazon format to PPK format that the next bit of software you will download needs to make the connection to your new Linux server.

WinSCP - WinSCP is a SFTP client and SSH client for Windows. Its main function is the secure file transfer between a local and a remote computer. It uses Secure Shell (SSH) and supports, in addition to Secure FTP, also legacy SCP protocol. You can download the software here.

You should have your private key from Amazon when you first started up your AMI. Find the Private key you downloaded from Amazon, or make another key if you have to. Making a key is very easy, you can use Dave’s article, or follow the directions from Amazon which are less cogent but still follow able.

Start the PuttyGen program as shown below.

[PuttyGen1.png]

Find the key that you made when you made your initial image and click on load. You will get a dialog box that wants you to load your key file that you got from Amazon. Find where you dropped your key file (again probably in downloads). Remember to set your file type to * to see all your files (otherwise it will default to looking for a PPK file, which you do not have yet).

Click on OK when you find and enter your file name. You should see the dialog below that shows the Amazon key was successfully converted from the Amazon format to the PPK format that WinSCP needs to work properly.

Click on OK.

Click on Save Private Key. You really need to save your private key at this point. Remember where you saved your brand new PPK extension key (if you forget where you saved it, search your computer for *.ppk). You have made it through the first hurdle, and now you need to fire up WinSCP.

WinSCP

If you skipped everything else and ended up here, WinSCP is a SFTP client and SSH client for Windows. Its main function is the secure file transfer between a local and a remote computer. It uses Secure Shell (SSH) and supports, in addition to Secure FTP, also legacy SCP protocol. You can download it from Source Forge.

Start (You should find it under start/all programs/WinSCP) WinSCP and you should see this after you have installed it



You only have to enter minimal data here, your host name is your EC2 instance, your user name is Root, leave the password BLANK, and click on the three dots for your private key file. If you do not know what your AWS instance is, you can go back to the AWS console and click on connect, you will get a connect help Secure Shell (SSH) help screen. This screen might look bad, but it has all the information you need for the Amazon instance you want to connect to. The screen below shows you what the help screen looks like.



The “enter the following command line” has a lot of information that you need. You can forget about everything before the “@”, you will not need that. Everything after the @ though is the public DNS that you will need to connect to your Amazon instance. You should copy everything after the @ symbol so that what you have looks like this

ec2-72-44-46-XXX.compute-1.amazonaws.com

This is your host name that you want to put into your WinSCP line for host name. The image below show the WinSCP entry screen with all the data filled out.



You want your WinSCP Login screen to look exactly like this, short of the instance name and the PPK key; yours will be different in terms of what is in the Host Name entry, and where you stored your own Private Key file. Remember that your Private Key file is the key you converted in PuttyGen. Click on Login and you will connect to your Amazon EC2 instance.

The good part is now you can tool around the Linux AMI using a graphical interface, and drag and drop files from your computer to the Amazon AMI that you are using.

In WinSCP on the top command ribbon bar you should see two icons as circled below. To get to the Command Line in Linux (remember this is why you downloaded Putty) you want to click on the two PC’s on the top command ribbon shown below.



This will launch the Putty command shell that will allow you to tool around the Amazon AMI. You need to be familiar with the Linux command line because you can do things here that you cannot do in the graphical interface, like bring up the update programs, tool around the OS to get an idea of where things are, use ps –ef |grep PROGRAM to see what programs are running (great for debugging MySQL), and to launch specific MySQL commands. This is what you should see when you click on the two computers graphic in the screen above.



Here are some discovered issues with the AMI that I built out.

MySQL has no password, it is root followed quickly by a blank password. You need to use the MySQL command line to set a password for this as soon as you can. The MySQL website can help you out setting the password.

The AMI in this instance when you look at the security group in the Amazon Web Services Console automatically opened up port 3306 for world wide access to your MySQL database. You want to take this rule out of the configuration, especially if you do not set a password. This is one excellent and easy way for hackers to get into your MySQL database; you need to fix this before you have the world hit your web site.

If you are interested in just web services you will find the root for HTTP under the home directory.

If you are interested in making sure that your Linux AMI is up to date, you need to use YUM, type in YUM update to update your whole computer or type in YUM update php if you want to make sure you are working with the latest version of PHP. Here is the catch, the YUM repo’s that come with the AMI we were using could not find any updates, and started throwing errors that it could not find any available mirrors. The problem with this is that you cannot update your software, which from a security viewpoint is very bad. If YUM is not finding updates, there are many resources on the internet to help you through this, the problem is that the repo’s that come with the image we were using goes right back to the Fedora repository, which is distressingly empty of updates for known vulnerable software. There are options on where you can go to get updates, but that will be another topic to talk about, updating your shiny new Amazon AMI for security when support is lacking from the people who make the software you are using.

If your program has dependencies on the version of PHP you are using (in my case the version was 5.0.4, and needed 5.1.X) you will have to hack your installation script if it checks the environmental variables for your PHP server. That means stepping through the entire install, and finding the call where it tests the PHP environment and changing that part of the install script. You can edit the file in WinSCP and save it back to the server, just remember what files you had to change (hack) when you get done.

Keywords:
windows amazon keyfile winscp
windows amazon key file winscp
winscp aws command line
winscp to linux ami

Tuesday, September 29, 2009

Glossary of Amazon EC2 terms

Amazon machine image (AMI)
An Amazon Machine Image (AMI) is an encrypted machine image stored in Amazon S3. It contains all the information necessary to boot instances of your software.

Amazon EBS
A type of storage that enables you to create volumes that can be mounted as devices by Amazon EC2 instances. Amazon EBS volumes behave like raw unformatted external block devices. They have user supplied device names and provide a block device interface. You can load a file system on top of Amazon EBS volumes, or use them just as you would use a block device.

Availability Zone
A distinct location within a region that is engineered to be insulated from failures in other Availability Zones and provides inexpensive, low latency network connectivity to other Availability Zones in the same region.

compute unit
An Amazon-generated measure that enables you to evaluate the CPU capacity of different Amazon EC2 instance types.

EBS
See Amazon EBS.

Elastic Block Store
See Amazon EBS.

elastic IP address
A static public IP address designed for dynamic cloud computing. Elastic IP addresses are associated with your account, not specific instances. Any elastic IP addresses that you associate with your account remain associated with your account until you explicitly release them. Unlike traditional static IP addresses, however, elastic IP addresses allow you to mask instance or Availability Zone failures by rapidly remapping your public IP addresses to any instance in your account.

ephemeral store
See instance store.

explicit launch permission
Launch permission granted to a specific user.

group
See security group.

instance store
Every instance includes a fixed amount of storage space on which you can store data. This is not designed to be a permanent storage solution. If you need a permanent storage system, use Amazon EBS.

instance type
A specification that defines the memory, CPU, storage capacity, and hourly cost for an instance. Some instance types are designed for standard applications while others are designed for CPU-intensive applications.

gibibyte (GiB)
a contraction of giga binary byte, a gibibyte is 2^30 bytes or 1,073,741,824 bytes. A gigabyte is 10^9 or 1,000,000,000 bytes. So yes, Amazon has bigger bytes.

image
See Amazon machine image.

instance
Once an AMI has been launched, the resulting running system is referred to as an instance. All instances based on the same AMI start out identical and any information on them is lost when the instances are terminated or fail.

instance store
The disk storage associated with an instance. In the event an instance fails or is terminated (not simply rebooted), all content on the instance store is deleted.

group
Also known as a security group, groups define firewall rules that can be shared among a group of instances that have similar security requirements. The group is specified at instance launch.

launch permission
AMI attribute allowing users to launch an AMI

Linux
Amazon EC2 instances are available for many operating platforms, including Linux, Solaris, Windows, and others.

paid AMI
An AMI that you sell to other Amazon EC2 users. For more information, refer to the Amazon DevPay Developer Guide.

private IP address
All Amazon EC2 instances are assigned two IP addresses at launch: a private address (RFC 1918) and a public address that are directly mapped to each other through Network Address Translation (NAT).

public AMI
An AMI that all users have launch permissions for.

public data sets
Sets of large public data sets that can be seamlessly integrated into AWS cloud-based applications. Amazon stores the data sets at no charge to the community and, like all AWS services, users pay only for the compute and storage they use for their own applications. These data sets currently include data from the Human Genome Project, the U.S. Census, Wikipedia, and other sources.

public IP address
All Amazon EC2 instances are assigned two IP addresses at launch: a private address (RFC 1918) and a public address that are directly mapped to each other through Network Address Translation (NAT).

region
A geographical area in which you can launch instances (e.g., US, EU).

reservation
A collection of instances started as part of the same launch request.

Reserved Instance
An additional Amazon EC2 pricing option. With Reserved Instances, you can make a low one-time payment for each instance to reserve and receive a significant discount on the hourly usage charge for that instance.

security group
A security group is a named collection of access rules. These access rules specify which ingress (i.e., incoming) network traffic should be delivered to your instance. All other ingress traffic will be discarded.

shared AMI
AMIs that developers build and make available for other AWS developers to use.

Solaris
Amazon EC2 instances are available for many operating platforms, including Linux, Solaris, Windows, and others.

snapshot
Amazon EBS provides the ability to create snapshots or backups of your Amazon EBS volumes and store them in Amazon S3. You can use these snapshots as the starting point for new Amazon EBS volumes and to protect your data for long term durability.

supported AMIs
These AMIs are similar to paid AMIs, except that you charge for software or a service that customers use with their own AMIs.

tebibyte (TiB)
a contraction of tera binary byte, a tebibyte is 2^40 bytes or 1,099,511,627,776 bytes. A terabyte is 10^12 or 1,000,000,000,000 bytes. So yes, Amazon has bigger bytes.

UNIX
Amazon EC2 instances are available for many operating platforms, including Linux, Solaris, Windows, and others.

Windows
Amazon EC2 instances are available for many operating platforms, including Linux, Solaris, Windows, and others.

Amazon Elastic Compute Cloud (EC2) Command Line Tools Reference

The Amazon Elastic Compute Cloud Command Line Tools Reference Guide provides the syntax, a description, options, and usage examples for each command line tool. This section describes who should read this guide, how the guide is organized, and other resources related to Amazon Elastic Compute Cloud.

The Amazon Elastic Compute Cloud is occasionally referred to within this guide as simply "Amazon EC2"; all copyrights and legal protections still apply.

View guide here.

Amazon Elastic Compute Cloud
Command Line Tools Reference (straight to the meat and potatoes)

Thursday, September 24, 2009

How to run Bucket Commander: A command line interface for Amazon S3

Bucket commander is a command line tool for Amazon S3.

Bucket Commander needs a configuration file, which can be created using Bucket Explorer's UI.

Bucket Commander takes three arguments. " -action " , " -authenticate ” and " -emailprofile ”

“ -emailprofile” is optional argument , you need to specify it only when you have configured the Email profile for getting report of Bucket Commander operations (Upload, Download and Copy) via Email.
Valid values for " -action " are:
  • upload
  • download
  • copy
To run Bucket Commander at least one credential should be saved.

In case of Single credential saved the authentication argument is optional.

For " -authenticate " specify the nick name that you see in "quick connect" drop down from Bucket Explorer's UI.
For Bucket Commander to work it needs config folder and .Lic file, i.e. bucketcommander.xml and bucketexplorer.xml . Upload /Download/Copy details are picked from the commander xml and authentication details are picked from bucketexplorer xml.

If BucketCommander.exe runs on different machines then it will not be able to decrypt credentials so it will prompt to update credentials, now you need to update credentials by giving Access Key and Secret Key .

For " -emailprofile " specify the profile name that you have saved in Email profile configuration from Bucket Explorer's UI.

How to send report with Bucket Commander

You can specify more than one Email Profile by comma separator for getting report of Bucket Commander operations via email to each specified profile.
An example of working command looks like:
Command on Windows
Bucketcommander.exe -action:upload/download/copy [-authenticate:nick-name][[-emailprofile:profilename1,profilename2]
Command on Linux
BucketExplorer.sh -action:upload/download/copy [-authenticate:nick-name][-emailprofile:profilename1,profilename2]
Note: On Linux you can open terminal from Applications->Accessories->Terminal in Finder
Command on Mac OSX
java -jar BucketExplorer.jar -action:upload/download/copy [-authenticate:nick-name][-emailprofile:profilename1,profilename2]
Note: On Mac OSX you can open terminal from Applications->Utilities->Terminal in Finder.

Download bucket explorer for windows, linux and mac osx

Monday, September 14, 2009

Uninstall the Annoying Windows Language Bar from the Windows Command Line

The lanuage bar can be uninstalled / removed / deleted / disabled completely by running the following command:
regsvr32.exe /u /s msutb.dll

Friday, September 4, 2009

GNU WGet for Windows (Windows 7, Vista, XP, etc.)

Whether you need a quick-and-dirty way to download a file via HTTP, HTTPS or FTP; or test a web page or recursively download a whole site, WGET is a great tool for the task.

GNU Wget is a free software package for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc., on both Windows- or *nix-based systems.

GNU Wget has many features to make retrieving large files or mirroring entire web or FTP sites easy, including:
  • Resume aborted downloads, using REST and RANGE
  • Use filename wild cards and recursively mirror directories
  • NLS-based message files for many different languages
  • Optionally converts absolute links in downloaded documents to relative, so that downloaded documents may link to each other locally
  • Runs on most UNIX-like operating systems as well as Microsoft Windows
  • Supports HTTP proxies
  • Supports HTTP cookies
  • Supports persistent HTTP connections
  • Unattended / background operation
  • Uses local file timestamps to determine whether documents need to be re-downloaded when mirroring
  • GNU Wget is distributed under the GNU General Public License.
Wget has an extensive set of options, the full list of which can be viewed from the command line with "wget --help."  Here are a few useful examples

Example 1 - Download the default page for given site to your current directory:
wget powercram.com
Example 2 - Recursively download the default page plus an additional level based on links from the default page:
wget -r -l 2 powercram.com
Example 3 - This will do as in example 2, additionally specifying username and password if required by site:
wget -r -l 2 --random-wait --http-user=powercram --http-password=powercram powercram.com
Example 4 - WGET can be used to recursively mirror your site, including download all the images, css and javascript, etc., and localize all of the URLS (so the site works on your local machine).  You can even save all the pages as .html files.

- To mirror your site:
wget -r http://www.powercram.com
- To mirror the site and localize all of the URLs:
wget --convert-links -r http://www.powercram.com
- To mirror the site and save the files as .html:
wget --html-extension -r http://www.powercram.com
Download WGet for Windows, install it, play with it and have some fun.

GNU wget runs on any version of Windows, including 2000, 2003, XP, Vista, Windows 7.

More

Tuesday, September 1, 2009

Manually sync clock on Ubuntu Linux

You may manually sync the clock using the following

sudo ntpdate servername
where servername can be any public or private time server.

Example
sudo ntpdate pool.ntp.org

Monday, August 31, 2009

Synergy - desktop sharing for Windows, Linux and Mac OS

Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems without special hardware. It's intended for users with multiple computers on their desk since each system uses its own display.

sourceforge.net/projects/synergy2/

Command line shortcut to Windows Components Wizard

Quick and easy way to launch the Windows Components Wizard. You could either run the following command from the Start / Run line or create a shortcut.

%windir%\system32\sysocmgr.exe /i:%windir%\inf\sysoc.inf

This will launch the Windows Components Wizard so you don't have to go the traditional route through Control Panel / Add/Remove Programs.