ssh —
OpenSSH
SSH client (remote login program)
| ssh |
[-46AaCfGgKkMNnqsTtVvXxYy]
[-b bind_address]
[-c cipher_spec]
[-D [bind_address:]port]
[-E log_file]
[-e escape_char]
[-F configfile]
[-I pkcs11]
[-i identity_file]
[-J [user@]host[:port]]
[-L address]
[-l login_name]
[-m mac_spec]
[-O ctl_cmd]
[-o option]
[-p port]
[-Q query_option]
[-R address]
[-S ctl_path]
[-W host:port]
[-w local_tun[:remote_tun]]
[user@]hostname
[command] |
ssh (SSH client) is a program for logging into a
remote machine and for executing commands on a remote machine. It is intended
to provide secure encrypted communications between two untrusted hosts over an
insecure network. X11 connections, arbitrary TCP ports and
UNIX-domain sockets can also be forwarded over the
secure channel.
ssh connects and logs into the specified
hostname (with optional
user name). The user must prove his/her
identity to the remote machine using one of several methods (see below).
If
command is specified, it is executed on the
remote host instead of a login shell.
The options are as follows:
- -4
- Forces ssh to use IPv4
addresses only.
- -6
- Forces ssh to use IPv6
addresses only.
- -A
- Enables forwarding of the authentication agent connection.
This can also be specified on a per-host basis in a configuration file.
Agent forwarding should be enabled with caution. Users with the ability to
bypass file permissions on the remote host (for the agent's
UNIX-domain socket) can access the local agent
through the forwarded connection. An attacker cannot obtain key material
from the agent, however they can perform operations on the keys that
enable them to authenticate using the identities loaded into the agent.
- -a
- Disables forwarding of the authentication agent connection.
- -b
bind_address
- Use bind_address on the
local machine as the source address of the connection. Only useful on
systems with more than one address.
- -C
- Requests compression of all data (including stdin, stdout,
stderr, and data for forwarded X11, TCP and
UNIX-domain connections). The compression
algorithm is the same used by
gzip(1). Compression is
desirable on modem lines and other slow connections, but will only slow
down things on fast networks. The default value can be set on a
host-by-host basis in the configuration files; see the
Compression option.
- -c
cipher_spec
- Selects the cipher specification for encrypting the
session. cipher_spec is a comma-separated
list of ciphers listed in order of preference. See the
Ciphers keyword in
ssh_config(5) for
more information.
- -D
[bind_address:]port
- Specifies a local “dynamic” application-level
port forwarding. This works by allocating a socket to listen to
port on the local side, optionally bound
to the specified bind_address. Whenever a
connection is made to this port, the connection is forwarded over the
secure channel, and the application protocol is then used to determine
where to connect to from the remote machine. Currently the SOCKS4 and
SOCKS5 protocols are supported, and ssh will
act as a SOCKS server. Only root can forward privileged ports. Dynamic
port forwardings can also be specified in the configuration file.
IPv6 addresses can be specified by enclosing the address in square brackets.
Only the superuser can forward privileged ports. By default, the local
port is bound in accordance with the
GatewayPorts setting. However, an explicit
bind_address may be used to bind the
connection to a specific address. The
bind_address of “localhost”
indicates that the listening port be bound for local use only, while an
empty address or ‘*’ indicates that the port should be
available from all interfaces.
- -E
log_file
- Append debug logs to
log_file instead of standard error.
- -e
escape_char
- Sets the escape character for sessions with a pty (default:
‘
~
’). The escape character is only
recognized at the beginning of a line. The escape character followed by a
dot (‘.
’) closes the connection;
followed by control-Z suspends the connection; and followed by itself
sends the escape character once. Setting the character to
“none” disables any escapes and makes the session fully
transparent.
- -F
configfile
- Specifies an alternative per-user configuration file. If a
configuration file is given on the command line, the system-wide
configuration file (/etc/ssh/ssh_config) will
be ignored. The default for the per-user configuration file is
~/.ssh/config.
- -f
- Requests ssh to go to
background just before command execution. This is useful if
ssh is going to ask for passwords or
passphrases, but the user wants it in the background. This implies
-n. The recommended way to start X11 programs
at a remote site is with something like ssh -f
host xterm.
If the ExitOnForwardFailure configuration
option is set to “yes”, then a client started with
-f will wait for all remote port forwards to
be successfully established before placing itself in the background.
- -G
- Causes ssh to print its
configuration after evaluating Host and
Match blocks and exit.
- -g
- Allows remote hosts to connect to local forwarded ports. If
used on a multiplexed connection, then this option must be specified on
the master process.
- -I
pkcs11
- Specify the PKCS#11 shared library
ssh should use to communicate with a PKCS#11
token providing the user's private RSA key.
- -i
identity_file
- Selects a file from which the identity (private key) for
public key authentication is read. The default is
~/.ssh/id_dsa,
~/.ssh/id_ecdsa,
~/.ssh/id_ed25519 and
~/.ssh/id_rsa. Identity files may also be
specified on a per-host basis in the configuration file. It is possible to
have multiple -i options (and multiple
identities specified in configuration files). If no certificates have been
explicitly specified by the CertificateFile
directive, ssh will also try to load
certificate information from the filename obtained by appending
-cert.pub to identity filenames.
- -J
[user@]host[:port]
- Connect to the target host by first making a
ssh connection to the jump
host and then establishing a TCP
forwarding to the ultimate destination from there. Multiple jump hops may
be specified separated by comma characters. This is a shortcut to specify
a ProxyJump configuration directive.
- -K
- Enables GSSAPI-based authentication and forwarding
(delegation) of GSSAPI credentials to the server.
- -k
- Disables forwarding (delegation) of GSSAPI credentials to
the server.
- -L
[bind_address:]port:host:hostport
-
- -L
[bind_address:]port:remote_socket
-
- -L
local_socket:host:hostport
-
- -L
local_socket:remote_socket
- Specifies that connections to the given TCP port or Unix
socket on the local (client) host are to be forwarded to the given host
and port, or Unix socket, on the remote side. This works by allocating a
socket to listen to either a TCP port on
the local side, optionally bound to the specified
bind_address, or to a Unix socket.
Whenever a connection is made to the local port or socket, the connection
is forwarded over the secure channel, and a connection is made to either
host port
hostport, or the Unix socket
remote_socket, from the remote machine.
Port forwardings can also be specified in the configuration file. Only the
superuser can forward privileged ports. IPv6 addresses can be specified by
enclosing the address in square brackets.
By default, the local port is bound in accordance with the
GatewayPorts setting. However, an explicit
bind_address may be used to bind the
connection to a specific address. The
bind_address of “localhost”
indicates that the listening port be bound for local use only, while an
empty address or ‘*’ indicates that the port should be
available from all interfaces.
- -l
login_name
- Specifies the user to log in as on the remote machine. This
also may be specified on a per-host basis in the configuration file.
- -M
- Places the ssh client into
“master” mode for connection sharing. Multiple
-M options places
ssh into “master” mode with
confirmation required before slave connections are accepted. Refer to the
description of ControlMaster in
ssh_config(5) for
details.
- -m
mac_spec
- A comma-separated list of MAC (message authentication code)
algorithms, specified in order of preference. See the
MACs keyword for more information.
- -N
- Do not execute a remote command. This is useful for just
forwarding ports.
- -n
- Redirects stdin from /dev/null
(actually, prevents reading from stdin). This must be used when
ssh is run in the background. A common trick
is to use this to run X11 programs on a remote machine. For example,
ssh -n shadows.cs.hut.fi emacs & will
start an emacs on shadows.cs.hut.fi, and the X11 connection will be
automatically forwarded over an encrypted channel. The
ssh program will be put in the background.
(This does not work if ssh needs to ask for a
password or passphrase; see also the -f
option.)
- -O
ctl_cmd
- Control an active connection multiplexing master process.
When the -O option is specified, the
ctl_cmd argument is interpreted and
passed to the master process. Valid commands are: “check”
(check that the master process is running), “forward”
(request forwardings without command execution), “cancel”
(cancel forwardings), “exit” (request the master to exit),
and “stop” (request the master to stop accepting further
multiplexing requests).
- -o
option
- Can be used to give options in the format used in the
configuration file. This is useful for specifying options for which there
is no separate command-line flag. For full details of the options listed
below, and their possible values, see
ssh_config(5).
 This can be
specified on a per-host basis in the configuration file.
- -Q
query_option
- Queries ssh for the algorithms
supported for the specified version 2. The available features are:
cipher (supported symmetric ciphers),
cipher-auth (supported symmetric ciphers
that support authenticated encryption),
mac (supported message integrity codes),
kex (key exchange algorithms),
key (key types),
key-cert (certificate key types),
key-plain (non-certificate key types),
and protocol-version (supported SSH
protocol versions).
- -q
- Quiet mode. Causes most warning and diagnostic messages to
be suppressed.
- -R
[bind_address:]port:host:hostport
-
- -R
[bind_address:]port:local_socket
-
- -R
remote_socket:host:hostport
-
- -R
remote_socket:local_socket
-
- -R
[bind_address:]port
- Specifies that connections to the given TCP port or Unix
socket on the remote (server) host are to be forwarded to the local side.
This works by allocating a socket to listen to either a TCP
port or to a Unix socket on the remote
side. Whenever a connection is made to this port or Unix socket, the
connection is forwarded over the secure channel, and a connection is made
from the local machine to either an explicit destination specified by
host port
hostport, or
local_socket, or, if no explicit
destination was specified, ssh will act as a
SOCKS 4/5 proxy and forward connections to the destinations requested by
the remote SOCKS client.
Port forwardings can also be specified in the configuration file. Privileged
ports can be forwarded only when logging in as root on the remote machine.
IPv6 addresses can be specified by enclosing the address in square
brackets.
By default, TCP listening sockets on the server will be bound to the
loopback interface only. This may be overridden by specifying a
bind_address. An empty
bind_address, or the address
‘
*
’, indicates that the remote
socket should listen on all interfaces. Specifying a remote
bind_address will only succeed if the
server's GatewayPorts option is enabled (see
sshd_config(5)).
If the port argument is
‘0
’, the listen port will be
dynamically allocated on the server and reported to the client at run
time. When used together with -O forward the
allocated port will be printed to the standard output.
- -S
ctl_path
- Specifies the location of a control socket for connection
sharing, or the string “none” to disable connection sharing.
Refer to the description of ControlPath and
ControlMaster in
ssh_config(5) for
details.
- -s
- May be used to request invocation of a subsystem on the
remote system. Subsystems facilitate the use of SSH as a secure transport
for other applications (e.g.
sftp(1)). The subsystem is
specified as the remote command.
- -T
- Disable pseudo-terminal allocation.
- -t
- Force pseudo-terminal allocation. This can be used to
execute arbitrary screen-based programs on a remote machine, which can be
very useful, e.g. when implementing menu services. Multiple
-t options force tty allocation, even if
ssh has no local tty.
- -V
- Display the version number and exit.
- -v
- Verbose mode. Causes ssh to
print debugging messages about its progress. This is helpful in debugging
connection, authentication, and configuration problems. Multiple
-v options increase the verbosity. The
maximum is 3.
- -W
host:port
- Requests that standard input and output on the client be
forwarded to host on
port over the secure channel. Implies
-N, -T,
ExitOnForwardFailure and
ClearAllForwardings, though these can be
overridden in the configuration file or using
-o command line options.
- -w
local_tun[:remote_tun]
- Requests tunnel device forwarding with the specified
tun(4) devices between the
client (local_tun) and the server
(remote_tun).
The devices may be specified by numerical ID or the keyword
“any”, which uses the next available tunnel device. If
remote_tun is not specified, it defaults
to “any”. See also the Tunnel
and TunnelDevice directives in
ssh_config(5). If
the Tunnel directive is unset, it is set to
the default tunnel mode, which is “point-to-point”.
- -X
- Enables X11 forwarding. This can also be specified on a
per-host basis in a configuration file.
X11 forwarding should be enabled with caution. Users with the ability to
bypass file permissions on the remote host (for the user's X authorization
database) can access the local X11 display through the forwarded
connection. An attacker may then be able to perform activities such as
keystroke monitoring.
For this reason, X11 forwarding is subjected to X11 SECURITY extension
restrictions by default. Please refer to the
ssh -Y option
and the ForwardX11Trusted directive in
ssh_config(5) for
more information.
- -x
- Disables X11 forwarding.
- -Y
- Enables trusted X11 forwarding. Trusted X11 forwardings are
not subjected to the X11 SECURITY extension controls.
- -y
- Send log information using the
syslog(3) system module.
By default this information is sent to stderr.
ssh may additionally obtain configuration data from
a per-user configuration file and a system-wide configuration file. The file
format and configuration options are described in
ssh_config(5).
The OpenSSH SSH client supports SSH protocol 2.
The methods available for authentication are: GSSAPI-based authentication,
host-based authentication, public key authentication, challenge-response
authentication, and password authentication. Authentication methods are tried
in the order specified above, though
PreferredAuthentications can be used to change
the default order.
Host-based authentication works as follows: If the machine the user logs in from
is listed in
/etc/hosts.equiv or
/etc/shosts.equiv on the remote machine, and the
user names are the same on both sides, or if the files
~/.rhosts or
~/.shosts exist in the user's home directory on
the remote machine and contain a line containing the name of the client
machine and the name of the user on that machine, the user is considered for
login. Additionally, the server
must be able to
verify the client's host key (see the description of
/etc/ssh/ssh_known_hosts and
~/.ssh/known_hosts, below) for login to be
permitted. This authentication method closes security holes due to IP
spoofing, DNS spoofing, and routing spoofing. [Note to the administrator:
/etc/hosts.equiv,
~/.rhosts, and the rlogin/rsh protocol in
general, are inherently insecure and should be disabled if security is
desired.]
Public key authentication works as follows: The scheme is based on public-key
cryptography, using cryptosystems where encryption and decryption are done
using separate keys, and it is unfeasible to derive the decryption key from
the encryption key. The idea is that each user creates a public/private key
pair for authentication purposes. The server knows the public key, and only
the user knows the private key.
ssh implements
public key authentication protocol automatically, using one of the DSA, ECDSA,
Ed25519 or RSA algorithms. The HISTORY section of
ssl(8) contains a brief
discussion of the DSA and RSA algorithms.
The file
~/.ssh/authorized_keys lists the public
keys that are permitted for logging in. When the user logs in, the
ssh program tells the server which key pair it
would like to use for authentication. The client proves that it has access to
the private key and the server checks that the corresponding public key is
authorized to accept the account.
The server may inform the client of errors that prevented public key
authentication from succeeding after authentication completes using a
different method. These may be viewed by increasing the
LogLevel to
DEBUG or
higher (e.g. by using the
-v flag).
The user creates his/her key pair by running
ssh-keygen(1). This
stores the private key in
~/.ssh/id_dsa (DSA),
~/.ssh/id_ecdsa (ECDSA),
~/.ssh/id_ed25519 (Ed25519), or
~/.ssh/id_rsa (RSA) and stores the public key in
~/.ssh/id_dsa.pub (DSA),
~/.ssh/id_ecdsa.pub (ECDSA),
~/.ssh/id_ed25519.pub (Ed25519), or
~/.ssh/id_rsa.pub (RSA) in the user's home
directory. The user should then copy the public key to
~/.ssh/authorized_keys in his/her home directory
on the remote machine. The
authorized_keys file
corresponds to the conventional
~/.rhosts file,
and has one key per line, though the lines can be very long. After this, the
user can log in without giving the password.
A variation on public key authentication is available in the form of certificate
authentication: instead of a set of public/private keys, signed certificates
are used. This has the advantage that a single trusted certification authority
can be used in place of many public/private keys. See the CERTIFICATES section
of
ssh-keygen(1) for
more information.
The most convenient way to use public key or certificate authentication may be
with an authentication agent. See
ssh-agent(1) and
(optionally) the
AddKeysToAgent directive in
ssh_config(5) for more
information.
Challenge-response authentication works as follows: The server sends an
arbitrary “challenge” text, and prompts for a response. Examples
of challenge-response authentication include
BSD
Authentication (see
login.conf(5)) and PAM
(some non-
OpenBSD systems).
Finally, if other authentication methods fail,
ssh
prompts the user for a password. The password is sent to the remote host for
checking; however, since all communications are encrypted, the password cannot
be seen by someone listening on the network.
ssh automatically maintains and checks a database
containing identification for all hosts it has ever been used with. Host keys
are stored in
~/.ssh/known_hosts in the user's
home directory. Additionally, the file
/etc/ssh/ssh_known_hosts is automatically checked
for known hosts. Any new hosts are automatically added to the user's file. If
a host's identification ever changes,
ssh warns
about this and disables password authentication to prevent server spoofing or
man-in-the-middle attacks, which could otherwise be used to circumvent the
encryption. The
StrictHostKeyChecking option can
be used to control logins to machines whose host key is not known or has
changed.
When the user's identity has been accepted by the server, the server either
executes the given command in a non-interactive session or, if no command has
been specified, logs into the machine and gives the user a normal shell as an
interactive session. All communication with the remote command or shell will
be automatically encrypted.
If an interactive session is requested
ssh by
default will only request a pseudo-terminal (pty) for interactive sessions
when the client has one. The flags
-T and
-t can be used to override this behaviour.
If a pseudo-terminal has been allocated the user may use the escape characters
noted below.
If no pseudo-terminal has been allocated, the session is transparent and can be
used to reliably transfer binary data. On most systems, setting the escape
character to “none” will also make the session transparent even
if a tty is used.
The session terminates when the command or shell on the remote machine exits and
all X11 and TCP connections have been closed.
When a pseudo-terminal has been requested,
ssh
supports a number of functions through the use of an escape character.
A single tilde character can be sent as
~~ or by
following the tilde by a character other than those described below. The
escape character must always follow a newline to be interpreted as special.
The escape character can be changed in configuration files using the
EscapeChar configuration directive or on the
command line by the
-e option.
The supported escapes (assuming the default
‘
~
’) are:
- ~.
- Disconnect.
- ~^Z
- Background ssh.
- ~#
- List forwarded connections.
- ~&
- Background ssh at logout when
waiting for forwarded connection / X11 sessions to terminate.
- ~?
- Display a list of escape characters.
- ~B
- Send a BREAK to the remote system (only useful if the peer
supports it).
- ~C
- Open command line. Currently this allows the addition of
port forwardings using the -L,
-R and -D
options (see above). It also allows the cancellation of existing
port-forwardings with
-KL[bind_address:]port
for local,
-KR[bind_address:]port
for remote and
-KD[bind_address:]port
for dynamic port-forwardings.
!command
allows the user to execute a local command if the
PermitLocalCommand option is enabled in
ssh_config(5). Basic
help is available, using the -h option.
- ~R
- Request rekeying of the connection (only useful if the peer
supports it).
- ~V
- Decrease the verbosity
(LogLevel) when errors are being written to
stderr.
- ~v
- Increase the verbosity
(LogLevel) when errors are being written to
stderr.
Forwarding of arbitrary TCP connections over the secure channel can be specified
either on the command line or in a configuration file. One possible
application of TCP forwarding is a secure connection to a mail server; another
is going through firewalls.
In the example below, we look at encrypting communication between an IRC client
and server, even though the IRC server does not directly support encrypted
communications. This works as follows: the user connects to the remote host
using
ssh, specifying a port to be used to
forward connections to the remote server. After that it is possible to start
the service which is to be encrypted on the client machine, connecting to the
same local port, and
ssh will encrypt and forward
the connection.
The following example tunnels an IRC session from client machine
“<IP_ADDRESS>” (localhost) to remote server
“server.example.com”:
$ ssh -f -L 1234:localhost:6667 server.example.com sleep 10
$ irc -c '#users' -p 1234 pinky <IP_ADDRESS>
This tunnels a connection to IRC server “server.example.com”,
joining channel “#users”, nickname “pinky”, using
port 1234. It doesn't matter which port is used, as long as it's greater than
1023 (remember, only root can open sockets on privileged ports) and doesn't
conflict with any ports already in use. The connection is forwarded to port
6667 on the remote server, since that's the standard port for IRC services.
The
-f option backgrounds
ssh and the remote command “sleep
10” is specified to allow an amount of time (10 seconds, in the
example) to start the service which is to be tunnelled. If no connections are
made within the time specified,
ssh will exit.
If the
ForwardX11 variable is set to
“yes” (or see the description of the
-X,
-x, and
-Y options above) and the user is using X11 (the
DISPLAY
environment variable is set), the
connection to the X11 display is automatically forwarded to the remote side in
such a way that any X11 programs started from the shell (or command) will go
through the encrypted channel, and the connection to the real X server will be
made from the local machine. The user should not manually set
DISPLAY
. Forwarding of X11 connections can
be configured on the command line or in configuration files.
The
DISPLAY
value set by
ssh will point to the server machine, but with a
display number greater than zero. This is normal, and happens because
ssh creates a “proxy” X server on
the server machine for forwarding the connections over the encrypted channel.
ssh will also automatically set up Xauthority data
on the server machine. For this purpose, it will generate a random
authorization cookie, store it in Xauthority on the server, and verify that
any forwarded connections carry this cookie and replace it by the real cookie
when the connection is opened. The real authentication cookie is never sent to
the server machine (and no cookies are sent in the plain).
If the
ForwardAgent variable is set to
“yes” (or see the description of the
-A and
-a options
above) and the user is using an authentication agent, the connection to the
agent is automatically forwarded to the remote side.
When connecting to a server for the first time, a fingerprint of the server's
public key is presented to the user (unless the option
StrictHostKeyChecking has been disabled).
Fingerprints can be determined using
ssh-keygen(1):
$ ssh-keygen -l -f
/etc/ssh/ssh_host_rsa_key
If the fingerprint is already known, it can be matched and the key can be
accepted or rejected. If only legacy (MD5) fingerprints for the server are
available, the
ssh-keygen(1)
-E option may be used to downgrade the
fingerprint algorithm to match.
Because of the difficulty of comparing host keys just by looking at fingerprint
strings, there is also support to compare host keys visually, using
random art. By setting the
VisualHostKey option to “yes”, a
small ASCII graphic gets displayed on every login to a server, no matter if
the session itself is interactive or not. By learning the pattern a known
server produces, a user can easily find out that the host key has changed when
a completely different pattern is displayed. Because these patterns are not
unambiguous however, a pattern that looks similar to the pattern remembered
only gives a good probability that the host key is the same, not guaranteed
proof.
To get a listing of the fingerprints along with their random art for all known
hosts, the following command line can be used:
$ ssh-keygen -lv -f
~/.ssh/known_hosts
If the fingerprint is unknown, an alternative method of verification is
available: SSH fingerprints verified by DNS. An additional resource record
(RR), SSHFP, is added to a zonefile and the connecting client is able to match
the fingerprint with that of the key presented.
In this example, we are connecting a client to a server,
“host.example.com”. The SSHFP resource records should first be
added to the zonefile for host.example.com:
$ ssh-keygen -r host.example.com.
The output lines will have to be added to the zonefile. To check that the zone
is answering fingerprint queries:
$ dig -t SSHFP host.example.com
Finally the client connects:
$ ssh -o "VerifyHostKeyDNS ask" host.example.com
[...]
Matching host key fingerprint found in DNS.
Are you sure you want to continue connecting (yes/no)?
See the
VerifyHostKeyDNS option in
ssh_config(5) for more
information.
ssh contains support for Virtual Private Network
(VPN) tunnelling using the
tun(4) network pseudo-device,
allowing two networks to be joined securely. The
sshd_config(5)
configuration option
PermitTunnel controls
whether the server supports this, and at what level (layer 2 or 3 traffic).
The following example would connect client network <IP_ADDRESS>/24 with remote
network <IP_ADDRESS>/24 using a point-to-point connection from <IP_ADDRESS> to
<IP_ADDRESS>, provided that the SSH server running on the gateway to the remote
network, at <IP_ADDRESS>, allows it.
On the client:
# ssh -f -w 0:1 <IP_ADDRESS> true
# ifconfig tun0 <IP_ADDRESS> <IP_ADDRESS> netmask <IP_ADDRESS>
# route add <IP_ADDRESS>/24 <IP_ADDRESS>
On the server:
# ifconfig tun1 <IP_ADDRESS> <IP_ADDRESS> netmask <IP_ADDRESS>
# route add <IP_ADDRESS>/24 <IP_ADDRESS>
Client access may be more finely tuned via the
/root/.ssh/authorized_keys file (see below) and
the
PermitRootLogin server option. The following
entry would permit connections on
tun(4) device 1 from user
“jane” and on tun device 2 from user “john”, if
PermitRootLogin is set to
“forced-commands-only”:
tunnel="1",command="sh /etc/netstart tun1" ssh-rsa ... jane
tunnel="2",command="sh /etc/netstart tun2" ssh-rsa ... john
Since an SSH-based setup entails a fair amount of overhead, it may be more
suited to temporary setups, such as for wireless VPNs. More permanent VPNs are
better provided by tools such as
ipsecctl(8) and
isakmpd(8).
ssh will normally set the following environment
variables:
DISPLAY
- The
DISPLAY
variable
indicates the location of the X11 server. It is automatically set by
ssh to point to a value of the form
“hostname:n”, where “hostname” indicates the
host where the shell runs, and ‘n’ is an integer ≥ 1.
ssh uses this special value to forward X11
connections over the secure channel. The user should normally not set
DISPLAY
explicitly, as that will render
the X11 connection insecure (and will require the user to manually copy
any required authorization cookies).
HOME
- Set to the path of the user's home directory.
LOGNAME
- Synonym for
USER
; set
for compatibility with systems that use this variable.
MAIL
- Set to the path of the user's mailbox.
PATH
- Set to the default
PATH
,
as specified when compiling ssh.
SSH_ASKPASS
- If ssh needs a passphrase, it
will read the passphrase from the current terminal if it was run from a
terminal. If ssh does not have a terminal
associated with it but
DISPLAY
and
SSH_ASKPASS
are set, it will execute
the program specified by SSH_ASKPASS
and open an X11 window to read the passphrase. This is particularly useful
when calling ssh from a
.xsession or related script. (Note that on
some machines it may be necessary to redirect the input from
/dev/null to make this work.)
SSH_AUTH_SOCK
- Identifies the path of a
UNIX-domain socket used to communicate with the
agent.
SSH_CONNECTION
- Identifies the client and server ends of the connection.
The variable contains four space-separated values: client IP address,
client port number, server IP address, and server port number.
SSH_ORIGINAL_COMMAND
- This variable contains the original command line if a
forced command is executed. It can be used to extract the original
arguments.
SSH_TTY
- This is set to the name of the tty (path to the device)
associated with the current shell or command. If the current session has
no tty, this variable is not set.
TZ
- This variable is set to indicate the present time zone if
it was set when the daemon was started (i.e. the daemon passes the value
on to new connections).
USER
- Set to the name of the user logging in.
Additionally,
ssh reads
~/.ssh/environment, and adds lines of the format
“VARNAME=value” to the environment if the file exists and users
are allowed to change their environment. For more information, see the
PermitUserEnvironment option in
sshd_config(5).
- ~/.rhosts
- This file is used for host-based authentication (see
above). On some machines this file may need to be world-readable if the
user's home directory is on an NFS partition, because
sshd(8) reads it as root.
Additionally, this file must be owned by the user, and must not have write
permissions for anyone else. The recommended permission for most machines
is read/write for the user, and not accessible by others.
- ~/.shosts
- This file is used in exactly the same way as
.rhosts, but allows host-based authentication
without permitting login with rlogin/rsh.
- ~/.ssh/
- This directory is the default location for all
user-specific configuration and authentication information. There is no
general requirement to keep the entire contents of this directory secret,
but the recommended permissions are read/write/execute for the user, and
not accessible by others.
- ~/.ssh/authorized_keys
- Lists the public keys (DSA, ECDSA, Ed25519, RSA) that can
be used for logging in as this user. The format of this file is described
in the sshd(8) manual
page. This file is not highly sensitive, but the recommended permissions
are read/write for the user, and not accessible by others.
- ~/.ssh/config
- This is the per-user configuration file. The file format
and configuration options are described in
ssh_config(5).
Because of the potential for abuse, this file must have strict
permissions: read/write for the user, and not writable by others.
- ~/.ssh/environment
- Contains additional definitions for environment variables;
see ENVIRONMENT, above.
- ~/.ssh/id_dsa
-
- ~/.ssh/id_ecdsa
-
- ~/.ssh/id_ed25519
-
- ~/.ssh/id_rsa
- Contains the private key for authentication. These files
contain sensitive data and should be readable by the user but not
accessible by others (read/write/execute).
ssh will simply ignore a private key file if
it is accessible by others. It is possible to specify a passphrase when
generating the key which will be used to encrypt the sensitive part of
this file using 3DES.
- ~/.ssh/id_dsa.pub
-
- ~/.ssh/id_ecdsa.pub
-
- ~/.ssh/id_ed25519.pub
-
- ~/.ssh/id_rsa.pub
- Contains the public key for authentication. These files are
not sensitive and can (but need not) be readable by anyone.
- ~/.ssh/known_hosts
- Contains a list of host keys for all hosts the user has
logged into that are not already in the systemwide list of known host
keys. See sshd(8) for
further details of the format of this file.
- ~/.ssh/rc
- Commands in this file are executed by
ssh when the user logs in, just before the
user's shell (or command) is started. See the
sshd(8) manual page for
more information.
- /etc/hosts.equiv
- This file is for host-based authentication (see above). It
should only be writable by root.
- /etc/shosts.equiv
- This file is used in exactly the same way as
hosts.equiv, but allows host-based
authentication without permitting login with rlogin/rsh.
- /etc/ssh/ssh_config
- Systemwide configuration file. The file format and
configuration options are described in
ssh_config(5).
- /etc/ssh/ssh_host_key
-
- /etc/ssh/ssh_host_dsa_key
-
- /etc/ssh/ssh_host_ecdsa_key
-
- /etc/ssh/ssh_host_ed25519_key
-
- /etc/ssh/ssh_host_rsa_key
- These files contain the private parts of the host keys and
are used for host-based authentication.
- /etc/ssh/ssh_known_hosts
- Systemwide list of known host keys. This file should be
prepared by the system administrator to contain the public host keys of
all machines in the organization. It should be world-readable. See
sshd(8) for further
details of the format of this file.
- /etc/ssh/sshrc
- Commands in this file are executed by
ssh when the user logs in, just before the
user's shell (or command) is started. See the
sshd(8) manual page for
more information.
ssh exits with the exit status of the remote
command or with 255 if an error occurred.
scp(1),
sftp(1),
ssh-add(1),
ssh-agent(1),
ssh-keygen(1),
ssh-keyscan(1),
tun(4),
ssh_config(5),
ssh-keysign(8),
sshd(8)
S. Lehtinen and
C. Lonvick, The Secure Shell (SSH)
Protocol Assigned Numbers, RFC 4250,
January 2006.
T. Ylonen and
C. Lonvick, The Secure Shell (SSH)
Protocol Architecture, RFC 4251,
January 2006.
T. Ylonen and
C. Lonvick, The Secure Shell (SSH)
Authentication Protocol, RFC 4252,
January 2006.
T. Ylonen and
C. Lonvick, The Secure Shell (SSH)
Transport Layer Protocol, RFC 4253,
January 2006.
T. Ylonen and
C. Lonvick, The Secure Shell (SSH)
Connection Protocol, RFC 4254,
January 2006.
J. Schlyter and
W. Griffin, Using DNS to Securely
Publish Secure Shell (SSH) Key Fingerprints, RFC
4255, January 2006.
F. Cusack and
M. Forssen, Generic Message
Exchange Authentication for the Secure Shell Protocol (SSH),
RFC 4256, January
2006.
J. Galbraith and
P. Remaker, The Secure Shell (SSH)
Session Channel Break Extension, RFC 4335,
January 2006.
M. Bellare,
T. Kohno, and C. Namprempre,
The Secure Shell (SSH) Transport Layer Encryption
Modes, RFC 4344, January
2006.
B. Harris,
Improved Arcfour Modes for the Secure Shell (SSH) Transport
Layer Protocol, RFC 4345,
January 2006.
M. Friedl,
N. Provos, and W. Simpson,
Diffie-Hellman Group Exchange for the Secure Shell (SSH)
Transport Layer Protocol, RFC 4419,
March 2006.
J. Galbraith and
R. Thayer, The Secure Shell (SSH)
Public Key File Format, RFC 4716,
November 2006.
D. Stebila and
J. Green, Elliptic Curve Algorithm
Integration in the Secure Shell Transport Layer, RFC
5656, December 2009.
A. Perrig and
D. Song, Hash Visualization: a New
Technique to improve Real-World Security,
1999, International Workshop on
Cryptographic Techniques and E-Commerce (CrypTEC '99).
OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu
Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt
and Dug Song removed many bugs, re-added newer features and created OpenSSH.
Markus Friedl contributed the support for SSH protocol versions 1.5 and
2.0.


blenderNewSource new Corpus
resource name
Graph URI
default language
type
SKOS
OWL
copy from Resource
keep originalUri
create resource
Cancel


2 references to PdhSafeLogHandle
Microsoft.PowerShell.Commands.Diagnostics (2)
PdhHelper.cs (2)
323
out
PdhSafeLogHandle
phLog
396
private
PdhSafeLogHandle
_hOutputLog = null;


SIGNVER
Section: NSS Security Tools (1)Updated: 5 June 2014
Index Return to Main Contents
NAME
signver - Verify a detached PKCS#7 signature for a file.SYNOPSIS
- signtool -A | -V -d directory [-a] [-i input_file] [-o output_file] [-s signature_file] [-v]
STATUS
DESCRIPTION
The Signature Verification Tool, signver, is a simple command-line utility that unpacks a base-64-encoded PKCS#7 signed object and verifies the digital signature using standard cryptographic techniques. The Signature Verification Tool can also display the contents of the signed object.
OPTIONS
-A
- Displays all of the information in the PKCS#7 signature.
-V
- Verifies the digital signature.
-d [sql:]directory
-
Specify the database directory which contains the certificates and keys.
signver supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix sql: is not used, then the tool assumes that the given databases are in the old format.
-a
- Sets that the given signature file is in ASCII format.
-i input_file
- Gives the input file for the object with signed data.
-o output_file
- Gives the output file to which to write the results.
-s signature_file
- Gives the input file for the digital signature.
-v
- Enables verbose output.
EXTENDED EXAMPLES
Verifying a Signature
The -V option verifies that the signature in a given signature file is valid when used to sign the given object (from the input file).
-
signver -V -s signature_file -i signed_file -d sql:/home/my/sharednssdb signatureValid=yes
Printing Signature Data
The -A option prints all of the information contained in a signature file. Using the -o option prints the signature file information to the given output file rather than stdout.
-
signver -A -s signature_file -o output_file
NSS DATABASE TYPES
NSS originally used BerkeleyDB databases to store security information. The last versions of these legacy databases are:
- * cert8.db for certificates
- * key3.db for keys
- * secmod.db for PKCS #11 module information
BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. NSS has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues. Still, NSS requires more flexibility to provide a truly shared security database.
In 2009, NSS introduced a new set of databases that are SQLite databases rather than BerkleyDB. These new databases provide more accessibility and performance:
- * cert9.db for certificates
- * key4.db for keys
- * pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory
Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility.
By default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more common legacy type. Using the SQLite databases must be manually specified by using the sql: prefix with the given security directory. For example:
-
# signver -A -s signature -d sql:/home/my/sharednssdb
To set the shared database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to sql:
-
export NSS_DEFAULT_DB_TYPE="sql"
This line can be added to the ~/.bashrc file to make the change permanent for the user.
Most applications do not use the shared database by default, but they can be configured to use them. For example, this how-to article covers how to configure Firefox and Thunderbird to use the new shared NSS databases:
For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:
SEE ALSO
signtool (1)
The NSS wiki has information on the new database design and how to configure applications to use it.
- * Setting up the shared NSS database
- * Engineering and technical information about the shared NSS database
ADDITIONAL RESOURCES
For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at m[blue]http://www.mozilla.org/projects/security/pki/nss/m[]. The NSS site relates directly to NSS code changes and releases.
Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto
AUTHORS
The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.
Authors: Elio Maldonado<EMAIL_ADDRESS>Deon Lackey<EMAIL_ADDRESS>LICENSE
Licensed under the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
NOTES
- 1.
-
Mozilla NSS bug 836477
Index
- NAME
- SYNOPSIS
- STATUS
- DESCRIPTION
- OPTIONS
- EXTENDED EXAMPLES
- NSS DATABASE TYPES
- SEE ALSO
- ADDITIONAL RESOURCES
- AUTHORS
- LICENSE
- NOTES
This document was created by man2html, using the manual pages.
Time: 05:29:10 GMT, December 24, 2015


This is a simple example of the jQuery countTo plugin created by Matt Huggins. Refer to the full documentation for more usage information.


13 of the best and 13 of the worst movies of the decade, according to audiences, Business Insider - Business Insider Singapore
by Lara Walsh- A lot of movies made their debut in the 2010s, and some are more beloved than others.
- According to audiences, some of the best films of the decade include “Harriet” (2019), “Coco” (2017), and “Spotlight” (2015).
- Audiences hated movies like “The Devil Inside” (2012) and “Movie 43” (2013).
- Visit Insider’s homepage for more stories.
From comedies to thrillers, a lot of films have made their debut over the past decade, but not all of them have been a hit with viewers.
Here are some of the best and worst movies of the 2010s based on audience scores from Rotten Tomatoes.
Although critics had mixed reviews about the 2019 Harriet Tubman biopic, “Harriet” scored big with viewers.
Audience Score: 97%
Reviewers called the American-history film, which starred Cynthia Erivo, Leslie Odom Jr., Janelle Monae, and Joe Alwyn, “riveting” and “inspiring.”
“Maleficent: Mistress of Evil,” Disney’s 2019 live-action sequel to the 2014 re-telling, was beloved by viewers.
Audience Score: 95%
Although the Angelina Jolie-led fairytale about the “Sleeping Beauty” villain didn’t impress critics, who gave the film only a 40% on Rotten Tomatoes, audiences loved it.
Reviewers praised the film’s visuals and special effects as well as its overall storyline.
“Spider-Man: Far From Home” was a hit with most viewers.
Audience Score: 95%
With Tom Holland, Zendaya, and Samuel L. Jackson as its leads, “Spider-Man: Far From Home” managed to impress both critics and audiences as a hybrid between superhero action and teen romance.
Many praised the 2019 film’s fresh storyline and smart dialogue.
The live-action reboot “Aladdin” was a flop with critics but it managed to enthrall viewers.
Audience Score: 94%
Although many felt that the film didn’t top the original from 1992, one viewer called this remake “one of the biggest surprises of the year” because of its “impressive” musical numbers and effects.
Many also said they loved that Will Smith was cast as Genie.
The 2018 documentary about the life of Fred Rogers won over viewers.
Audience Score: 94%
The film explored the TV personality Mr. Rogers’ background and his approach to educating and entertaining children.
Reviews of “Won’t You Be My Neighbor” were overwhelmingly positive, with one audience member calling the film “honest, stirring, and emotional.”
Both critics and audiences lauded Pixar’s 2017 animated film “Coco.”
Audience Score: 94%
The flick tells the story of a musically gifted boy who learns about his family while exploring the Land of the Dead.
One reviewer called the movie “an extravagant tale of culture and ambition that’s exemplary in all aspects,” praising its soundtrack, colorful visuals, and heartfelt storyline.
Critics weren’t impressed by “Black and Blue,” but audiences praised the film’s suspenseful storyline.
Audience Score: 94%
Alongside Tyrese Gibson, Naomie Harris played a new cop who accidentally captures footage of corrupt cops murdering a drug dealer.
Many praised the fast-paced plot of the 2019 film, saying it kept them on the edge of their seats.
Damien Chazelle’s “Whiplash” was applauded for its riveting storytelling.
Audience Score: 94%
This fast-paced film from 2014 about what it takes to become a master drummer received praise for its premise and its impressive leads, Miles Teller and JK Simmons.
The 2015 film “Spotlight” was lauded for the way it depicted a real-life investigation.
Audience Score: 93%
The intense drama told the true story of the Boston Globe’s harrowing investigation into one of the biggest and most trusted institutions in the world.
“Perfectly executed praise of the power of the press,” one viewer wrote, praising Mark Ruffalo, Michael Keaton, Rachel McAdams, Liev Schreiber, and Stanley Tucci for their acting chops. “A stellar cast and flawless direction make for an engaging and highly entertaining result.”
Marvel was praised for its first “Guardians of the Galaxy” film, which starred Chris Pratt and Zoe Saldana.
Audience Score: 92%
“Guardians of the Galaxy” is a space-adventure film about a bounty hunter (Chris Pratt) who steals a mysterious orb.
Many viewers were impressed with how the 2014 Marvel film balanced humor, action, and adventure. It even got a sequel and it currently has a third movie in the works.
“The King’s Speech” is one of the rare films that is beloved by both critics and audiences.
Audience Score: 92%
The 2010 period drama is all about Bertie (Colin Firth), a royal who becomes a king and must overcome a debilitating speech impediment with the help of a quirky instructor.
The movie picked up a best picture Oscar and audiences praised it as a “true masterwork of modern cinema.”
Disney’s “Big Hero 6” touched audiences with its impressive animation and heartwarming storyline.
Audience Score: 91%
Many viewers noted that the 2014 film about a robotics prodigy felt different than some of Disney’s other recent offerings in the best way.
They applauded its “astonishingly beautiful” animation and its plentiful heartwarming moments.
Quentin Tarantino’s “Django Unchained” was popular with viewers.
Audience Score: 91%
The 2012 film tells the story of a freed slave’s journey to save his wife from a plantation owner.
Audiences praised the performances of Jamie Foxx, Christoph Waltz, Leonardo DiCaprio, and Samuel L. Jackson, saying the film is “stylish, deliciously violent, and is not afraid to go far in some places.”
On the other hand, viewers lambasted the final installment of the “Human Centipede” trilogy.
Audience Score: 11%
“The Human Centipede III (Final Sequence),” a gross horror film about people who are trying to connect humans together, was not the first of its kind but many audience members are glad it’s likely the last.
The 2015 comedic horror flick saw the return of Dieter Laser and Laurence R. Harvey and it was ripped apart by audiences, with one viewer calling it the “vilest piece of garbage ever.”
The 2015 film “United Passions” was criticized for how it detailed the history of the FIFA World Cup.
Audience Score: 11%
This film about the history of the FIFA World Cup was a flop with viewers. Several audience members called it the “worst movie” they’d ever seen, with many calling it “dull” and “unwatchable.”
Halle Berry and Olivier Martinez starred in the 2012 flop “Dark Tide.”
Audience Score: 15%
The film tells the story of a former shark whisperer’s attempts to get past an attack that happened on her watch.
Reviewers weren’t impressed with the plot or lack of action in this flick.
The 2014 Bollywood movie “Humshakals” tells the story of three friends who cause confusion wherever they go.
Audience Score: 16%
This Bollywood comedy about lookalikes and their antics wasn’t a hit with audiences.
One viewer called the movie “interrogation-room torture material” and another said it was an “absolute profane piece of cinema.”
Reviewers and critics alike revealed that they were very disappointed with “The Disappointments Room.”
Audience Score: 17%
With Kate Beckinsale and Mel Raido as its leads, the 2016 thriller about a secret room lived up to its title, with viewers lambasting the nonexistent storyline and lack of character development.
The Kevin Bacon and Radha Mitchell-led horror movie “The Darkness” was criticized for not being scary enough.
Audience Score: 19%
One reviewer wrote that the 2016 horror film about a family that accidentally brings a dark force home with them “lacks scares, thrills, and any plot at all.”
“Piranha 3DD” was critiqued as even more un-watchable than its 2010 predecessor.
Audience Score: 22%
The 2012 movie about flesh-eating fish failed to win over audiences even though it had a celebrity cameo from David Hasselhoff.
Audience members criticized the flick’s gratuitous nudity, lackluster dialogue, and extreme gore.
“The Devil Inside” is another horror movie that didn’t live up to audience expectations.
Audience Score: 22%
The 2012 mockumentary-style film follows a woman who is possessed by demons during an exorcism.
Viewers weren’t impressed with the premise and were especially bothered that the film didn’t have an official ending – instead, it concluded with a link to a website telling them to “Read up on the case.”
Starring Kate Upton and Alexandra Daddario, “The Layover” disappointed audiences.
Audience Score: 22%
The film about two best friends falling for the same guy during an airport layover was a flop with audiences.
Many roasted the rom-com for its unfunny jokes and unromantic plotline and one reviewer even called the comedy “one of the worst films of 2017.”
Dax Shepard’s directorial debut “Brother’s Justice” was panned by critics and audiences.
Audience Score: 23%
The 2011 film, which follows a comedian’s journey to be a big martial-arts star and document it with the help of his friends, was panned as a “mockumentary of staggering incompetence.”
The Bruce Willis-led 2016 film “Precious Cargo” was ripped apart by most viewers.
Audience Score: 23%
The crime thriller about a boss hunting down a thief who disappointed him was ripped apart by critics and audiences who felt it had a poorly done script and a ridiculous plot.
“Bucky Larson: Born to Be a Star” starred Nick Swardson, Christina Ricci, and Don Johnson.
Audience Score: 24%
The 2011 film tells the story of a grocery bagger who becomes convinced that his mission in life is to become a porn star.
Some reviewers called it “garbage” and many said it wasn’t very funny. Critics even gave it a 0% score on Rotten Tomatoes.
Despite its star-studded cast, “Movie 43” was a flop with both audiences and critics.
Audience Score: 24%
Even having Kate Winslet, Emma Stone, Gerard Butler, Hugh Jackman, Uma Thurman, Naomi Watts, Richard Gere, and many more A-listers on board couldn’t save this 2013 ensemble comedy.
As one reviewer wrote, “It’s hard to believe that so many first-rate stars could be involved in such a distasteful compilation of bad taste stories, which are so exceedingly gross and offensive.”
Read More:


DOCUMENT-CREATOR is an application to generate sythetic document images
has been developed by J. Albouys- Perrois, J.P. Domenger, N. Journet, V.C. Kieu, B. Mansencal, R. Mullot, V. Rabeux, N. Vidal, M. Visani
Font extractor is an application to extract font from images
has been developed by T.Autret, A.Boschet, T.Labrousse, R.Tisné


<?php namespace CodeIgniter\HTTP; /** * CodeIgniter * * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * * Copyright (c) 2014-2019 British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * @package CodeIgniter * @author CodeIgniter Dev Team * @copyright 2014-2019 British Columbia Institute of Technology (https://bcit.ca/) * @license https://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 3.0.0 * @filesource */ use Config\App; /** * Class CLIRequest * * Represents a request from the command-line. Provides additional * tools to interact with that request since CLI requests are not * static like HTTP requests might be. * * Portions of this code were initially from the FuelPHP Framework, * version 1.7.x, and used here under the MIT license they were * originally made available under. * * http://fuelphp.com * * @package CodeIgniter\HTTP */ class CLIRequest extends Request { /** * Stores the segments of our cli "URI" command. * * @var array */ protected $segments = []; /** * Command line options and their values. * * @var array */ protected $options = []; //-------------------------------------------------------------------- /** * Constructor * * @param App $config */ public function __construct(App $config) { parent::__construct($config); // Don't terminate the script when the cli's tty goes away ignore_user_abort(true); $this->parseCommand(); } //-------------------------------------------------------------------- /** * Returns the "path" of the request script so that it can be used * in routing to the appropriate controller/method. * * The path is determined by treating the command line arguments * as if it were a URL - up until we hit our first option. * * Example: * php index.php users 21 profile -foo bar * * // Routes to /users/21/profile (index is removed for routing sake) * // with the option foo = bar. * * @return string */ public function getPath(): string { $path = implode('/', $this->segments); return empty($path) ? '' : $path; } //-------------------------------------------------------------------- /** * Returns an associative array of all CLI options found, with * their values. * * @return array */ public function getOptions(): array { return $this->options; } //-------------------------------------------------------------------- /** * Returns the path segments. * * @return array */ public function getSegments(): array { return $this->segments; } //-------------------------------------------------------------------- /** * Returns the value for a single CLI option that was passed in. * * @param string $key * * @return string|null */ public function getOption(string $key) { if (array_key_exists($key, $this->options)) { return $this->options[$key]; } return null; } //-------------------------------------------------------------------- /** * Returns the options as a string, suitable for passing along on * the CLI to other commands. * * Example: * $options = [ * 'foo' => 'bar', * 'baz' => 'queue some stuff' * ]; * * getOptionString() = '-foo bar -baz "queue some stuff"' * * @return string */ public function getOptionString(): string { if (empty($this->options)) { return ''; } $out = ''; foreach ($this->options as $name => $value) { // If there's a space, we need to group // so it will pass correctly. if (strpos($value, ' ') !== false) { $value = '"' . $value . '"'; } $out .= "-{$name} $value "; } return trim($out); } //-------------------------------------------------------------------- /** * Parses the command line it was called from and collects all options * and valid segments. * * NOTE: I tried to use getopt but had it fail occasionally to find * any options, where argv has always had our back. */ protected function parseCommand() { // Since we're building the options ourselves, // we stop adding it to the segments array once // we have found the first dash. $options_found = false; $argc = $this->getServer('argc', FILTER_SANITIZE_NUMBER_INT); $argv = $this->getServer('argv'); // We start at 1 since we never want to include index.php for ($i = 1; $i < $argc; $i ++) { // If there's no '-' at the beginning of the argument // then add it to our segments. if (! $options_found && strpos($argv[$i], '-') === false) { $this->segments[] = filter_var($argv[$i], FILTER_SANITIZE_STRING); continue; } $options_found = true; if (strpos($argv[$i], '-') !== 0) { continue; } $arg = filter_var(str_replace('-', '', $argv[$i]), FILTER_SANITIZE_STRING); $value = null; // If the next item starts with a dash it's a value if (isset($argv[$i + 1]) && strpos($argv[$i + 1], '-') !== 0) { $value = filter_var($argv[$i + 1], FILTER_SANITIZE_STRING); $i ++; } $this->options[$arg] = $value; } } //-------------------------------------------------------------------- }


[gecode-users] Propagation for reasoning with models
Nacho
ncasti at fdi.ucm.es
Sat Nov 6 11:44:00 CET 2010
Hi all,
We are using Gecode as a external FD solver for our system, which basically
reason about models. Our system is implemented in Prolog, and we rely in the
Prolog backtracking mechanism. We need to add and remove constraints from a
Gecode Space. As it is not possible to remove constraints from a Space, you
recommended me to clone each Space before any new constraint is added.
Now we are planning a non-propagation mode for our system, in order to allow the
user the possibility of propagate or not the different constraints which are
added to the model. With this, we are trying to stablish a new configuration
reducing the spent time in the solver interface layer. However, I can not
inmediately implement this feature in my Gecode integration, as the Space
becomes non-stable and this forbids the clonning process. Would it be possible
to implement this feature in the context we are using Gecode for?
Thank you very much in advance,
Nacho
More information about the users
mailing list


MINA TANNENBAUM A film review by Peer Wandel Hansen Copyright 1995 Peer Wandel Hansen
Rating (0-10) 9.0
Directed by Martine Dugowson Written by Martine Dugowson Cast Romane Bohringer, Elsa Zylberstein, Stephane Slima, Florence Thomassin, Nils Tavernier, Eric Defosse, Jean-Philippe Ecoffey, Hugues Quester, Harry Cleven Cinematography Dominique Chapuis Music by Peter Chase Produced by IMA Films, Georges Benayoun Running Time 108 minutes
The story is situated in Paris in the period from 1958 to present day, where we follow the friendship between the two main characters Mina (Romane Bohringer) and Ethel (Elsa Zylberstein). Mina and Ethel are born the same day in the same hospital, but meet for the first time as six years old in the ballet institute where they are taking lessons.
The movie now take us into the teenage years and their first experiences with love, and their friendship grows stronger but their personality grow more and more apart. The two girls become each others ideal, even though they approach life different. Mina is artistic and has the courage to do what she believe in, where Ethel in contrast takes life less serious and live from day to day. As the movie approaches and the girls get older the differences become larger.
Mina enter a sketch course, where she is attracted to a fellow student and the affection is mutual, but faith and her shyness will that they never end up together. Ethel on the other hand is has more courage with her pianist friend, but eventually in the intimate situation, she chickens out as well.
In their adult life they have a quarrel about a common guy, which Mina has been secretly in love with, but when Ethel announces she is about to marry him their friendship is jeopardized. Mina become more and more reserved and isolated and lack inspiration for her artistic expression.
This is one of the most brilliant French movies I have seen in a while. I will especially emphasize the manuscript as fabulous, and it received the "Palme d'Or" price in Cannes in 1994. This is only the second movie from Martine Dugowson (according to The Movie database at Cardiff) and is show some experimenting with light and cutting We see inspiration from David Lynch (Wild at Heart) with close-up of a cigarette being lit. The main characters, Romane Bohringer and Elsa Zylberstein play they parts astounding.
Martine Dugowson describe the move as a mix between a comedy and a Western. Westerns because they often are centered around a strong, unbreakable friendship between two widely different individuals. I highly recommend this movie, and I'm looking forward to see what the writer/director will bring us next time.
- Peer Wandel Hansen Copenhagen, Denmark
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Greetings, Thank you for viewing my website. This is V.Surya Teja Reddy, graduate from Hyderabad (India). I'm working at Tech Mahindra (ASE). I'm man of curiosity, always learning new trends in technology. I'm also huge fan of history, learning how world has evolved breaking many barriers which were thought as impossible and I'm regular follower of quora and medium websites.
I started my web development journey back in 2015, but because of academics I paused for a few months. Now I am totally into web development from june 2016.


Caman.DOMUpdated = ->
imgs = document.querySelectorAll("img[data-caman]")
return unless imgs.length > 0
for img in imgs
parser = new CamanParser img, ->
@parse()
@execute()
Inform CamanJS that the DOM has been updated, and that it should re-scan for CamanJS instances in the document.
Caman.DOMUpdated = ->
imgs = document.querySelectorAll("img[data-caman]")
return unless imgs.length > 0
for img in imgs
parser = new CamanParser img, ->
@parse()
@execute()
If enabled, we check the page to see if there are any images with Caman instructions provided using HTML5 data attributes.
if Caman.autoload then do ->
if document.readyState is "complete"
Caman.DOMUpdated()
else
document.addEventListener "DOMContentLoaded", Caman.DOMUpdated, false
Parses Caman instructions embedded in the HTML data-caman attribute.
class CamanParser
Regex used for parsing options out of the data-caman attribute.
INST_REGEX = "(\\w+)\\((.*?)\\)"
Creates a new parser instance.
@param [DOMObject] ele DOM object to be instantiated with CamanJS @param [Function] ready Callback function to pass to CamanJS
constructor: (ele, ready) ->
@dataStr = ele.getAttribute('data-caman')
@caman = Caman ele, ready.bind(@)
Parse the DOM object and call the parsed filter functions on the Caman object.
parse: ->
@ele = @caman.canvas
First we find each instruction as a whole using a global regex search.
r = new RegExp(INST_REGEX, 'g')
unparsedInstructions = @dataStr.match r
return unless unparsedInstructions.length > 0
Once we gather all the instructions, we go through each one and parse out the filter name + it's parameters.
r = new RegExp(INST_REGEX)
for inst in unparsedInstructions
[m, filter, args] = inst.match(r)
Create a factory function so we can catch any errors that are produced when running the filters. This also makes it very simple to support multiple/complex filter arguments.
instFunc = new Function("return function() {
this.#{filter}(#{args});
};")
try
func = instFunc()
func.call @caman
catch e
Log.debug e
Execute {Caman#render} on this Caman instance.
execute: ->
ele = @ele
@caman.render ->
ele.parentNode.replaceChild @toImage(), ele


Next EU Commission chief wants to increase foreign spending
PARIS (AP) - The next European Commission president says she wants to spend almost a third more on foreign policy goals over the next half decade to better establish the EU as a global player.
Ursula von der Leyen said Tuesday that the extra money is needed to develop a stronger strategic culture of the bloc, which is often criticized as high on ideals but low on effective impact.
Von der Leyen said at the Paris Peace Forum that “there is need for stable and responsible leadership. We all have to contribute.”
Her demand for more funds for such foreign policy goals comes at a time when EU member states are seeking to contain their budgetary contributions to the EU, especially with the departure of the UK, expected over the coming months.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


Detects unresolved argument labels in calls to methods annotated by @NamedVariant/@NamedParam/@NamedDelegate


| Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
|---|---|---|---|---|
| gems/gems/highline-1.5.1/lib/highline.rb | 758 | 433 | 51.98%
|
28.41%
|
Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.
1 #!/usr/local/bin/ruby -w |
2 |
3 # highline.rb |
4 # |
5 # Created by James Edward Gray II on 2005-04-26. |
6 # Copyright 2005 Gray Productions. All rights reserved. |
7 # |
8 # See HighLine for documentation. |
9 # |
10 # This is Free Software. See LICENSE and COPYING for details. |
11 |
12 require "erb" |
13 require "optparse" |
14 require "stringio" |
15 require "abbrev" |
16 require "highline/compatibility" |
17 require "highline/system_extensions" |
18 require "highline/question" |
19 require "highline/menu" |
20 require "highline/color_scheme" |
21 |
22 |
23 # |
24 # A HighLine object is a "high-level line oriented" shell over an input and an |
25 # output stream. HighLine simplifies common console interaction, effectively |
26 # replacing puts() and gets(). User code can simply specify the question to ask |
27 # and any details about user interaction, then leave the rest of the work to |
28 # HighLine. When HighLine.ask() returns, you'll have the answer you requested, |
29 # even if HighLine had to ask many times, validate results, perform range |
30 # checking, convert types, etc. |
31 # |
32 class HighLine |
33 # The version of the installed library. |
34 VERSION = "1.5.1".freeze |
35 |
36 # An internal HighLine error. User code does not need to trap this. |
37 class QuestionError < StandardError |
38 # do nothing, just creating a unique error type |
39 end |
40 |
41 # The setting used to disable color output. |
42 @@use_color = true |
43 |
44 # Pass +false+ to _setting_ to turn off HighLine's color escapes. |
45 def self.use_color=( setting ) |
46 @@use_color = setting |
47 end |
48 |
49 # Returns true if HighLine is currently using color escapes. |
50 def self.use_color? |
51 @@use_color |
52 end |
53 |
54 # The setting used to disable EOF tracking. |
55 @@track_eof = true |
56 |
57 # Pass +false+ to _setting_ to turn off HighLine's EOF tracking. |
58 def self.track_eof=( setting ) |
59 @@track_eof = setting |
60 end |
61 |
62 # Returns true if HighLine is currently tracking EOF for input. |
63 def self.track_eof? |
64 @@track_eof |
65 end |
66 |
67 # The setting used to control color schemes. |
68 @@color_scheme = nil |
69 |
70 # Pass ColorScheme to _setting_ to turn set a HighLine color scheme. |
71 def self.color_scheme=( setting ) |
72 @@color_scheme = setting |
73 end |
74 |
75 # Returns the current color scheme. |
76 def self.color_scheme |
77 @@color_scheme |
78 end |
79 |
80 # Returns +true+ if HighLine is currently using a color scheme. |
81 def self.using_color_scheme? |
82 not @@color_scheme.nil? |
83 end |
84 |
85 # |
86 # Embed in a String to clear all previous ANSI sequences. This *MUST* be |
87 # done before the program exits! |
88 # |
89 CLEAR = "\e[0m" |
90 # An alias for CLEAR. |
91 RESET = CLEAR |
92 # Erase the current line of terminal output. |
93 ERASE_LINE = "\e[K" |
94 # Erase the character under the cursor. |
95 ERASE_CHAR = "\e[P" |
96 # The start of an ANSI bold sequence. |
97 BOLD = "\e[1m" |
98 # The start of an ANSI dark sequence. (Terminal support uncommon.) |
99 DARK = "\e[2m" |
100 # The start of an ANSI underline sequence. |
101 UNDERLINE = "\e[4m" |
102 # An alias for UNDERLINE. |
103 UNDERSCORE = UNDERLINE |
104 # The start of an ANSI blink sequence. (Terminal support uncommon.) |
105 BLINK = "\e[5m" |
106 # The start of an ANSI reverse sequence. |
107 REVERSE = "\e[7m" |
108 # The start of an ANSI concealed sequence. (Terminal support uncommon.) |
109 CONCEALED = "\e[8m" |
110 |
111 # Set the terminal's foreground ANSI color to black. |
112 BLACK = "\e[30m" |
113 # Set the terminal's foreground ANSI color to red. |
114 RED = "\e[31m" |
115 # Set the terminal's foreground ANSI color to green. |
116 GREEN = "\e[32m" |
117 # Set the terminal's foreground ANSI color to yellow. |
118 YELLOW = "\e[33m" |
119 # Set the terminal's foreground ANSI color to blue. |
120 BLUE = "\e[34m" |
121 # Set the terminal's foreground ANSI color to magenta. |
122 MAGENTA = "\e[35m" |
123 # Set the terminal's foreground ANSI color to cyan. |
124 CYAN = "\e[36m" |
125 # Set the terminal's foreground ANSI color to white. |
126 WHITE = "\e[37m" |
127 |
128 # Set the terminal's background ANSI color to black. |
129 ON_BLACK = "\e[40m" |
130 # Set the terminal's background ANSI color to red. |
131 ON_RED = "\e[41m" |
132 # Set the terminal's background ANSI color to green. |
133 ON_GREEN = "\e[42m" |
134 # Set the terminal's background ANSI color to yellow. |
135 ON_YELLOW = "\e[43m" |
136 # Set the terminal's background ANSI color to blue. |
137 ON_BLUE = "\e[44m" |
138 # Set the terminal's background ANSI color to magenta. |
139 ON_MAGENTA = "\e[45m" |
140 # Set the terminal's background ANSI color to cyan. |
141 ON_CYAN = "\e[46m" |
142 # Set the terminal's background ANSI color to white. |
143 ON_WHITE = "\e[47m" |
144 |
145 # |
146 # Create an instance of HighLine, connected to the streams _input_ |
147 # and _output_. |
148 # |
149 def initialize( input = $stdin, output = $stdout, |
150 wrap_at = nil, page_at = nil ) |
151 @input = input |
152 @output = output |
153 |
154 self.wrap_at = wrap_at |
155 self.page_at = page_at |
156 |
157 @question = nil |
158 @answer = nil |
159 @menu = nil |
160 @header = nil |
161 @prompt = nil |
162 @gather = nil |
163 @answers = nil |
164 @key = nil |
165 end |
166 |
167 include HighLine::SystemExtensions |
168 |
169 # The current column setting for wrapping output. |
170 attr_reader :wrap_at |
171 # The current row setting for paging output. |
172 attr_reader :page_at |
173 |
174 # |
175 # A shortcut to HighLine.ask() a question that only accepts "yes" or "no" |
176 # answers ("y" and "n" are allowed) and returns +true+ or +false+ |
177 # (+true+ for "yes"). If provided a +true+ value, _character_ will cause |
178 # HighLine to fetch a single character response. A block can be provided |
179 # to further configure the question as in HighLine.ask() |
180 # |
181 # Raises EOFError if input is exhausted. |
182 # |
183 def agree( yes_or_no_question, character = nil ) |
184 ask(yes_or_no_question, lambda { |yn| yn.downcase[0] == ?y}) do |q| |
185 q.validate = /\Ay(?:es)?|no?\Z/i |
186 q.responses[:not_valid] = 'Please enter "yes" or "no".' |
187 q.responses[:ask_on_error] = :question |
188 q.character = character |
189 |
190 yield q if block_given? |
191 end |
192 end |
193 |
194 # |
195 # This method is the primary interface for user input. Just provide a |
196 # _question_ to ask the user, the _answer_type_ you want returned, and |
197 # optionally a code block setting up details of how you want the question |
198 # handled. See HighLine.say() for details on the format of _question_, and |
199 # HighLine::Question for more information about _answer_type_ and what's |
200 # valid in the code block. |
201 # |
202 # If <tt>@question</tt> is set before ask() is called, parameters are |
203 # ignored and that object (must be a HighLine::Question) is used to drive |
204 # the process instead. |
205 # |
206 # Raises EOFError if input is exhausted. |
207 # |
208 def ask( question, answer_type = String, &details ) # :yields: question |
209 @question ||= Question.new(question, answer_type, &details) |
210 |
211 return gather if @question.gather |
212 |
213 # readline() needs to handle it's own output, but readline only supports |
214 # full line reading. Therefore if @question.echo is anything but true, |
215 # the prompt will not be issued. And we have to account for that now. |
216 say(@question) unless (@question.readline and @question.echo == true) |
217 begin |
218 @answer = @question.answer_or_default(get_response) |
219 unless @question.valid_answer?(@answer) |
220 explain_error(:not_valid) |
221 raise QuestionError |
222 end |
223 |
224 @answer = @question.convert(@answer) |
225 |
226 if @question.in_range?(@answer) |
227 if @question.confirm |
228 # need to add a layer of scope to ask a question inside a |
229 # question, without destroying instance data |
230 context_change = self.class.new(@input, @output, @wrap_at, @page_at) |
231 if @question.confirm == true |
232 confirm_question = "Are you sure? " |
233 else |
234 # evaluate ERb under initial scope, so it will have |
235 # access to @question and @answer |
236 template =<EMAIL_ADDRESS>nil, "%") |
237 confirm_question = template.result(binding) |
238 end |
239 unless context_change.agree(confirm_question) |
240 explain_error(nil) |
241 raise QuestionError |
242 end |
243 end |
244 |
245 @answer |
246 else |
247 explain_error(:not_in_range) |
248 raise QuestionError |
249 end |
250 rescue QuestionError |
251 retry |
252 rescue ArgumentError, NameError => error |
253 raise if error.is_a?(NoMethodError) |
254 if error.message =~ /ambiguous/ |
255 # the assumption here is that OptionParser::Completion#complete |
256 # (used for ambiguity resolution) throws exceptions containing |
257 # the word 'ambiguous' whenever resolution fails |
258 explain_error(:ambiguous_completion) |
259 else |
260 explain_error(:invalid_type) |
261 end |
262 retry |
263 rescue Question::NoAutoCompleteMatch |
264 explain_error(:no_completion) |
265 retry |
266 ensure |
267 @question = nil # Reset Question object. |
268 end |
269 end |
270 |
271 # |
272 # This method is HighLine's menu handler. For simple usage, you can just |
273 # pass all the menu items you wish to display. At that point, choose() will |
274 # build and display a menu, walk the user through selection, and return |
275 # their choice amoung the provided items. You might use this in a case |
276 # statement for quick and dirty menus. |
277 # |
278 # However, choose() is capable of much more. If provided, a block will be |
279 # passed a HighLine::Menu object to configure. Using this method, you can |
280 # customize all the details of menu handling from index display, to building |
281 # a complete shell-like menuing system. See HighLine::Menu for all the |
282 # methods it responds to. |
283 # |
284 # Raises EOFError if input is exhausted. |
285 # |
286 def choose( *items, &details ) |
287 @menu = @question = Menu.new(&details) |
288 @menu.choices(*items) unless items.empty? |
289 |
290 # Set _answer_type_ so we can double as the Question for ask(). |
291 @menu.answer_type = if @menu.shell |
292 lambda do |command| # shell-style selection |
293 first_word = command.to_s.split.first || "" |
294 |
295 options = @menu.options |
296 options.extend(OptionParser::Completion) |
297 answer = options.complete(first_word) |
298 |
299 if answer.nil? |
300 raise Question::NoAutoCompleteMatch |
301 end |
302 |
303 [answer.last, command.sub(/^\s*#{first_word}\s*/, "")] |
304 end |
305 else |
306 @menu.options # normal menu selection, by index or name |
307 end |
308 |
309 # Provide hooks for ERb layouts. |
310 @header = @menu.header |
311 @prompt = @menu.prompt |
312 |
313 if @menu.shell |
314 selected = ask("Ignored", @menu.answer_type) |
315 @menu.select(self, *selected) |
316 else |
317 selected = ask("Ignored", @menu.answer_type) |
318 @menu.select(self, selected) |
319 end |
320 end |
321 |
322 # |
323 # This method provides easy access to ANSI color sequences, without the user |
324 # needing to remember to CLEAR at the end of each sequence. Just pass the |
325 # _string_ to color, followed by a list of _colors_ you would like it to be |
326 # affected by. The _colors_ can be HighLine class constants, or symbols |
327 # (:blue for BLUE, for example). A CLEAR will automatically be embedded to |
328 # the end of the returned String. |
329 # |
330 # This method returns the original _string_ unchanged if HighLine::use_color? |
331 # is +false+. |
332 # |
333 def color( string, *colors ) |
334 return string unless self.class.use_color? |
335 |
336 colors.map! do |c| |
337 if self.class.using_color_scheme? and self.class.color_scheme.include? c |
338 self.class.color_scheme[c] |
339 elsif c.is_a? Symbol |
340 self.class.const_get(c.to_s.upcase) |
341 else |
342 c |
343 end |
344 end |
345 "#{colors.flatten.join}#{string}#{CLEAR}" |
346 end |
347 |
348 # |
349 # This method is a utility for quickly and easily laying out lists. It can |
350 # be accessed within ERb replacements of any text that will be sent to the |
351 # user. |
352 # |
353 # The only required parameter is _items_, which should be the Array of items |
354 # to list. A specified _mode_ controls how that list is formed and _option_ |
355 # has different effects, depending on the _mode_. Recognized modes are: |
356 # |
357 # <tt>:columns_across</tt>:: _items_ will be placed in columns, flowing |
358 # from left to right. If given, _option_ is the |
359 # number of columns to be used. When absent, |
360 # columns will be determined based on _wrap_at_ |
361 # or a default of 80 characters. |
362 # <tt>:columns_down</tt>:: Identical to <tt>:columns_across</tt>, save |
363 # flow goes down. |
364 # <tt>:inline</tt>:: All _items_ are placed on a single line. The |
365 # last two _items_ are separated by _option_ or |
366 # a default of " or ". All other _items_ are |
367 # separated by ", ". |
368 # <tt>:rows</tt>:: The default mode. Each of the _items_ is |
369 # placed on it's own line. The _option_ |
370 # parameter is ignored in this mode. |
371 # |
372 # Each member of the _items_ Array is passed through ERb and thus can contain |
373 # their own expansions. Color escape expansions do not contribute to the |
374 # final field width. |
375 # |
376 def list( items, mode = :rows, option = nil ) |
377 items = items.to_ary.map do |item| |
378 ERB.new(item, nil, "%").result(binding) |
379 end |
380 |
381 case mode |
382 when :inline |
383 option = " or " if option.nil? |
384 |
385 case items.size |
386 when 0 |
387 "" |
388 when 1 |
389 items.first |
390 when 2 |
391 "#{items.first}#{option}#{items.last}" |
392 else |
393 items[0..-2].join(", ") + "#{option}#{items.last}" |
394 end |
395 when :columns_across, :columns_down |
396 max_length = actual_length( |
397 items.max { |a, b| actual_length(a) <=> actual_length(b) } |
398 ) |
399 |
400 if option.nil? |
401 limit = @wrap_at || 80 |
402 option = (limit + 2) / (max_length + 2) |
403 end |
404 |
405 items = items.map do |item| |
406 pad = max_length + (item.length - actual_length(item)) |
407 "%-#{pad}s" % item |
408 end |
409 row_count = (items.size / option.to_f).ceil |
410 |
411 if mode == :columns_across |
412 rows = Array.new(row_count) { Array.new } |
413 items.each_with_index do |item, index| |
414 rows[index / option] << item |
415 end |
416 |
417 rows.map { |row| row.join(" ") + "\n" }.join |
418 else |
419 columns = Array.new(option) { Array.new } |
420 items.each_with_index do |item, index| |
421 columns[index / row_count] << item |
422 end |
423 |
424 list = "" |
425 columns.first.size.times do |index| |
426 list << columns.map { |column| column[index] }. |
427 compact.join(" ") + "\n" |
428 end |
429 list |
430 end |
431 else |
432 items.map { |i| "#{i}\n" }.join |
433 end |
434 end |
435 |
436 # |
437 # The basic output method for HighLine objects. If the provided _statement_ |
438 # ends with a space or tab character, a newline will not be appended (output |
439 # will be flush()ed). All other cases are passed straight to Kernel.puts(). |
440 # |
441 # The _statement_ parameter is processed as an ERb template, supporting |
442 # embedded Ruby code. The template is evaluated with a binding inside |
443 # the HighLine instance, providing easy access to the ANSI color constants |
444 # and the HighLine.color() method. |
445 # |
446 def say( statement ) |
447 statement = statement.to_str |
448 return unless statement.length > 0 |
449 |
450 template = ERB.new(statement, nil, "%") |
451 statement = template.result(binding) |
452 |
453 statement = wrap(statement) unless @wrap_at.nil? |
454 statement = page_print(statement) unless @page_at.nil? |
455 |
456 if statement[-1, 1] == " " or statement[-1, 1] == "\t" |
457 @output.print(statement) |
458 @output.flush |
459 else |
460 @output.puts(statement) |
461 end |
462 end |
463 |
464 # |
465 # Set to an integer value to cause HighLine to wrap output lines at the |
466 # indicated character limit. When +nil+, the default, no wrapping occurs. If |
467 # set to <tt>:auto</tt>, HighLine will attempt to determing the columns |
468 # available for the <tt>@output</tt> or use a sensible default. |
469 # |
470 def wrap_at=( setting ) |
471 @wrap_at = setting == :auto ? output_cols : setting |
472 end |
473 |
474 # |
475 # Set to an integer value to cause HighLine to page output lines over the |
476 # indicated line limit. When +nil+, the default, no paging occurs. If |
477 # set to <tt>:auto</tt>, HighLine will attempt to determing the rows available |
478 # for the <tt>@output</tt> or use a sensible default. |
479 # |
480 def page_at=( setting ) |
481 @page_at = setting == :auto ? output_rows : setting |
482 end |
483 |
484 # |
485 # Returns the number of columns for the console, or a default it they cannot |
486 # be determined. |
487 # |
488 def output_cols |
489 return 80 unless @output.tty? |
490 terminal_size.first |
491 rescue |
492 return 80 |
493 end |
494 |
495 # |
496 # Returns the number of rows for the console, or a default if they cannot be |
497 # determined. |
498 # |
499 def output_rows |
500 return 24 unless @output.tty? |
501 terminal_size.last |
502 rescue |
503 return 24 |
504 end |
505 |
506 private |
507 |
508 # |
509 # A helper method for sending the output stream and error and repeat |
510 # of the question. |
511 # |
512 def explain_error( error ) |
513<EMAIL_ADDRESS>unless error.nil? |
514 if @question.responses[:ask_on_error] == :question |
515 say(@question) |
516 elsif @question.responses[:ask_on_error] |
517 say(@question.responses[:ask_on_error]) |
518 end |
519 end |
520 |
521 # |
522 # Collects an Array/Hash full of answers as described in |
523 # HighLine::Question.gather(). |
524 # |
525 # Raises EOFError if input is exhausted. |
526 # |
527 def gather( ) |
528 @gather = @question.gather |
529 @answers = [ ] |
530 original_question = @question |
531 |
532 @question.gather = false |
533 |
534 case @gather |
535 when Integer |
536 @answers << ask(@question) |
537 @gather -= 1 |
538 |
539 original_question.question = "" |
540 until @gather.zero? |
541 @question = original_question |
542 @answers << ask(@question) |
543 @gather -= 1 |
544 end |
545 when String, Regexp |
546 @answers << ask(@question) |
547 |
548 original_question.question = "" |
549 until (@gather.is_a?(String) and @answers.last.to_s == @gather) or |
550 (@gather.is_a?(Regexp) and @answers.last.to_s =~ @gather) |
551 @question = original_question |
552 @answers << ask(@question) |
553 end |
554 |
555 @answers.pop |
556 when Hash |
557 @answers = { } |
558 @gather.keys.sort.each do |key| |
559 @question = original_question |
560 @key = key |
561 @answers[key] = ask(@question) |
562 end |
563 end |
564 |
565 @answers |
566 end |
567 |
568 # |
569 # Read a line of input from the input stream and process whitespace as |
570 # requested by the Question object. |
571 # |
572 # If Question's _readline_ property is set, that library will be used to |
573 # fetch input. *WARNING*: This ignores the currently set input stream. |
574 # |
575 # Raises EOFError if input is exhausted. |
576 # |
577 def get_line( ) |
578 if @question.readline |
579 require "readline" # load only if needed |
580 |
581 # capture say()'s work in a String to feed to readline() |
582 old_output = @output |
583 @output = StringIO.new |
584 say(@question) |
585 question = @output.string |
586 @output = old_output |
587 |
588 # prep auto-completion |
589 Readline.completion_proc = lambda do |string| |
590 @question.selection.grep(/\A#{Regexp.escape(string)}/) |
591 end |
592 |
593 # work-around ugly readline() warnings |
594 old_verbose = $VERBOSE |
595 $VERBOSE = nil |
596 answer = @question.change_case( |
597 @question.remove_whitespace( |
598 Readline.readline(question, true) ) ) |
599 $VERBOSE = old_verbose |
600 |
601 answer |
602 else |
603 raise EOFError, "The input stream is exhausted." if @@track_eof and |
604 @input.eof? |
605 |
606 @question.change_case(@question.remove_whitespace(@input.gets)) |
607 end |
608 end |
609 |
610 # |
611 # Return a line or character of input, as requested for this question. |
612 # Character input will be returned as a single character String, |
613 # not an Integer. |
614 # |
615 # This question's _first_answer_ will be returned instead of input, if set. |
616 # |
617 # Raises EOFError if input is exhausted. |
618 # |
619 def get_response( ) |
620 return @question.first_answer if @question.first_answer? |
621 |
622 if @question.character.nil? |
623 if @question.echo == true and @question.limit.nil? |
624 get_line |
625 else |
626 raw_no_echo_mode if stty = CHARACTER_MODE == "stty" |
627 |
628 line = "" |
629 backspace_limit = 0 |
630 begin |
631 |
632 while character = (stty ? @input.getbyte : get_character(@input)) |
633 # honor backspace and delete |
634 if character == 127 or character == 8 |
635 line.slice!(-1, 1) |
636 backspace_limit -= 1 |
637 else |
638 line << character.chr |
639 backspace_limit = line.size |
640 end |
641 # looking for carriage return (decimal 13) or |
642 # newline (decimal 10) in raw input |
643 break if character == 13 or character == 10 or |
644 (@question.limit and line.size == @question.limit) |
645 if @question.echo != false |
646 if character == 127 or character == 8 |
647 # only backspace if we have characters on the line to |
648 # eliminate, otherwise we'll tromp over the prompt |
649 if backspace_limit >= 0 then |
650 @output.print("\b#{ERASE_CHAR}") |
651 else |
652 # do nothing |
653 end |
654 else |
655 if @question.echo == true |
656 @output.print(character.chr) |
657 else |
658<EMAIL_ADDRESS>|
659 end |
660 end |
661 @output.flush |
662 end |
663 end |
664 ensure |
665 restore_mode if stty |
666 end |
667 if @question.overwrite |
668 @output.print("\r#{ERASE_LINE}") |
669 @output.flush |
670 else |
671 say("\n") |
672 end |
673 |
674 @question.change_case(@question.remove_whitespace(line)) |
675 end |
676 elsif @question.character == :getc |
677<EMAIL_ADDRESS>|
678 else |
679 response = get_character(@input).chr |
680 if @question.overwrite |
681 @output.print("\r#{ERASE_LINE}") |
682 @output.flush |
683 else |
684 echo = if @question.echo == true |
685 response |
686 elsif @question.echo != false |
687 @question.echo |
688 else |
689 "" |
690 end |
691 say("#{echo}\n") |
692 end |
693 @question.change_case(response) |
694 end |
695 end |
696 |
697 # |
698 # Page print a series of at most _page_at_ lines for _output_. After each |
699 # page is printed, HighLine will pause until the user presses enter/return |
700 # then display the next page of data. |
701 # |
702 # Note that the final page of _output_ is *not* printed, but returned |
703 # instead. This is to support any special handling for the final sequence. |
704 # |
705 def page_print( output ) |
706 lines = output.scan(/[^\n]*\n?/) |
707 while lines.size > @page_at |
708 @output.puts lines.slice!(0...@page_at).join |
709 @output.puts |
710 # Return last line if user wants to abort paging |
711 return (["...\n"] + lines.slice(-2,1)).join unless continue_paging? |
712 end |
713 return lines.join |
714 end |
715 |
716 # |
717 # Ask user if they wish to continue paging output. Allows them to type "q" to |
718 # cancel the paging process. |
719 # |
720 def continue_paging? |
721 command = HighLine.new(@input, @output).ask( |
722 "-- press enter/return to continue or q to stop -- " |
723 ) { |q| q.character = true } |
724 command !~ /\A[qQ]\Z/ # Only continue paging if Q was not hit. |
725 end |
726 |
727 # |
728 # Wrap a sequence of _lines_ at _wrap_at_ characters per line. Existing |
729 # newlines will not be affected by this process, but additional newlines |
730 # may be added. |
731 # |
732 def wrap( text ) |
733 wrapped = [ ] |
734 text.each_line do |line| |
735 while line =~ /([^\n]{#{@wrap_at + 1},})/ |
736 search = $1.dup |
737 replace = $1.dup |
738 if index = replace.rindex(" ", @wrap_at) |
739 replace[index, 1] = "\n" |
740 replace.sub!(/\n[ \t]+/, "\n") |
741 line.sub!(search, replace) |
742 else |
743 line[@wrap_at, 0] = "\n" |
744 end |
745 end |
746 wrapped << line |
747 end |
748 return wrapped.join |
749 end |
750 |
751 # |
752 # Returns the length of the passed +string_with_escapes+, minus and color |
753 # sequence escapes. |
754 # |
755 def actual_length( string_with_escapes ) |
756 string_with_escapes.gsub(/\e\[\d{1,2}m/, "").length |
757 end |
758 end |
Generated on Thu Nov 12 16:05:07 +0530 2009 with rcov 0.9.6


#include <boost/constrained_value/constrained.hpp>
Public Types | |
| typedef ExceptionType | exception_type |
| Type of exceptions thrown. | |
Public Member Functions | |
| template<typename V , typename C > | |
| void | operator() (const V &, const V &, const C &) const |
| Throws the exception. |
DefaultConstructible
and derive publicly from std::exception
. Definition at line 64 of file constrained.hpp.
| void operator() | ( | const V & | , | |
| const V & | , | |||
| const C & | ||||
| ) | const |
Throws the exception.
Uses BOOST_THROW_EXCEPTION
macro to throw a default-constructed exception of exception_type.
Definition at line 75 of file constrained.hpp.


Left
(lĕft), imp. & p. p.of ≪Leave≫.
Left
a.[OE. left, lift, luft; akin to Fries. leeft, OD. lucht, luft; cf. AS. left (equiv. to L. inanis), lyftādl palsy; or cf. AS. lēf weak.] Of or pertaining to that side of the body in man on which the muscular action of the limbs is usually weaker than on the other side; -- opposed to right, when used in reference to a part of the body; as, the left hand, or arm; the left ear. Also said of the corresponding side of the lower animals.
Left bank of a river, that which is on the left hand of a person whose face is turned downstream.
Left bower. See under 2d ≪Bower≫.
Left center, the members whose sympathies are, in the main, with the members of the Left, but who do not favor extreme courses, and on occasions vote with the government. They sit between the Center and the extreme Left.
Over the left shoulder, or
Over the left, an old but still current colloquialism, or slang expression, used as an aside to indicate insincerity, negation, or disbelief; as, he said it, and it is true, -- over the left.
Left
n.
1. That part of surrounding space toward which the left side of one's body is turned; as, the house is on the left when you face North.
Put that rose a little more to the left.
Ld. Lytton.
2. Those members of a legislative assembly (as in France) who are in the opposition; the advanced republicans and extreme radicals. They have their seats at the left-hand side of the presiding officer. See ≪Center≫, and ≪Right≫.
Left
a.Situated so that the left side of the body is toward it; as, the left side of a deliberative meeting is that to the left of the presiding officer; the left wing of an army is that to the left of the center to one facing an enemy.


This wireless speaker can fill up even a large, spacious room with immersive sound. You just need to integrate the device with your voice and it’s ready to follow your commands. You can play music tracks, get weather news, receive and make calls, control smart home devices, and a lot more to help you with your daily tasks.
Echo Dot is the tiny version of Echo speaker but with equally efficient functionality and sound quality. On your voice commands, the speaker starts streaming from one of the major music web apps, turn off and on light bulbs, answer your questions, make and receive phone calls, and more. Pair the device with your smartphone and you are good to go.
This hands-free device is designed to be your personal style assistant. The in-built smart camera takes shots and videos of you. Then, with the help of its marquee feature reviews the outfits you’re wearing in these photos and suggests you the perfect outfit that perfectly suits your looks. You can keep this sleek device anywhere in your room.
Echo Show features an amazing design and great sound quality, all this combined to take your Echo experience to the next level. It features a high-resolution, responsive screen which you can use to have video calls with other Echo Show users, check weather forecasts, view and read recipes and books, get news, and a lot more.
You need only a single tap to wake your device. Combined with a virtual assistant, this smart device is perfect music streaming device for music enthusiasts. You only need to connect it with your WiFi and order it to play your favorite title track. It is powered by Dolby technology that helps in getting you a 360-degree omnidirectional audio experience.
Echo Plus is a great speaker to experience immersive sound quality, thanks to the Dolby technology built inside it. Combined with Zigbee hub, the speaker is pretty easy to set up and use. You can control your smart home devices, make and receive calls, and play your favorite music. Pair it with another Plus and experience dynamic audio quality.
It’s a breeze to perform an Echo setup, provided, you know how to do it correctly. Still, if you find yourself stuck anywhere during the setup process or even while using it, you can take the supportive hand of our experts to get you easy solutions. Let’s see how you can set up your device on your own:
That’s it! You can now use the Echo to get your daily tasks done in an easy and fast manner.
The amazing Echo devices are a smart and revolutionary way to get multiple tasks done quickly and conveniently, without even touching the devices. They run on voice commands and follow your instructions to help you get weather news, make lists, place and receive calls, shop online, listen to your favorite music, and much more.
All said many users have reported that they face a different type of difficulties while setting up their Echo speakers and devices, and using them afterward. In the failure of getting the configuration done easily and safely, they have to experience a lot of inconveniences which costs them huge money and wastes their time, as well.
Fret not; we’ve got your back! We flaunt a highly dedicated team of trained professionals, especially hand-picked resolve your problems within minutes. You can contact us by email or through chat at any time of the day and night. Our technicians are always eager to assist you with reliable and permanent solutions.
Echo Download App team is great. They helped me a lot with my Echo Dot. I was having trouble while pairing it up with my Bluetooth: it wasn’t detecting my Bluetooth name. Thank you, guys! You did a fantabulous job!
Joshua Hardy


dashboard
Search and Filter Payment
{{ text }}
dashboard
Dashboard
filter_list
Search Property
home
Create new property
{{ text }}


Headhunter Results
Invalid results
Resource
Exceptions
HTML context
Full source
{{INVALID_RESULTS}}
Valid results
Resource
Exceptions
HTML context
Full source
{{VALID_RESULTS}}