background preloader

QA

Facebook Twitter

Ruby Built-in Functions. Since the Kernel module is included by Object class, its methods are available everywhere in the Ruby program. They can be called without a receiver (functional form). Therefore, they are often called functions. A complete list of Built-in Functions is given here for your reference: Functions for Numbers: Here is list of Built-in Functions related to number. They should be used as follows: #! This will produce the following result: 12 22.4 false Assuming, n is a number: Functions for Float Here is a list of Ruby Built-in functions especially for float numbers.

Functions for Math Here is a list of Ruby Built-in math functions: Conversion Field Specifier: The function sprintf( fmt[, arg...]) and format( fmt[, arg...]) returns a string in which arg is formatted according to fmt. The following conversion specifiers are supported by Ruby's format: Following is the usage example: #! Abc d=42 00ff hello he Test Function Arguments: File tests with two arguments are as follows: Following is the usage example. . #!

Effin' around

How To Get SSH Command-Line Access to Windows 7 Using Cygwin. Are you comfortable with Linux/Unix and want SSH access to your Windows 7 machine? Cygwin provides this functionality and gives you a familiar environment to work with in a few simple steps. We’re assuming you’ve got Cygwin installed and configured. If not, check out our article, How To Use Linux Commands in Windows with Cygwin to get started. Installing OpenSSH OpenSSH is what we’ll be using, so if you don’t have it installed, find Cygwin’s setup.exe file and run it.

You can keep all of the same defaults as when you originally set up Cygwin. On the package selection screen, search for “open” and look under the “Net” menu. You’ll see a package called “openssh”. Configuring OpenSSH in Cygwin Unlike in most Linux distros, OpenSSH won’t automatically configure itself to run and just work. This will make sure we have the proper privileges for everything. Enter the following command: ssh-host-config You’ll be prompted to create a new account with special privileges. Ntsec net start sshd That’s it! In Unix, how do I use the scp command to securely transfer files between two computers. In Unix, you can use SCP (the scp command) to securely copy files and directories between remote hosts without starting an FTP session or logging into the remote systems explicitly.

The scp command uses SSH to transfer data, so it requires a password or passphrase for authentication. Unlike rcp or FTP, scp encrypts both the file and any passwords exchanged so that anyone snooping on the network cannot view them. Syntax The syntax for the scp command is: scp [options] username1@source_host:directory1/filename1 username2@destination_host:directory2/filename2 The location of the source file is specified by username1@source_host:directory1/filename1 , which includes the: Name of the account on the host computer (username1) Hostname of the computer on which the source file resides (source_host) Name of the directory containing the source file (directory1) Filename of the source file (filename1) Note: Make sure to include a space between the source and destination paths. Man scp Examples.

QA Automation.