Tuesday, 5 December 2017

[Linux] nmcli command (Network Manager Command Line Interface)

You can edit network configuration using nmcli command, not editing /etc/* files.









This is man file of nmcli.

NMCLI(1)                                                                                      General Commands Manual                                                                                      NMCLI(1)



NAME
       nmcli - command-line tool for controlling NetworkManager

SYNOPSIS
       nmcli [OPTIONS...] {help | general | networking | radio | connection | device | agent | monitor} [COMMAND] [ARGUMENTS...]

DESCRIPTION
       nmcli is a command-line tool for controlling NetworkManager and reporting network status. It can be utilized as a replacement for nm-applet or other graphical clients.  nmcli is used to create, display,
       edit, delete, activate, and deactivate network connections, as well as control and display network device status.

       Typical uses include:

       ·   Scripts: Utilize NetworkManager via nmcli instead of managing network connections manually.  nmcli supports a terse output format which is better suited for script processing. Note that NetworkManager
           can also execute scripts, called "dispatcher scripts", in response to network events. See NetworkManager(8) for details about these dispatcher scripts.

       ·   Servers, headless machines, and terminals: nmcli can be used to control NetworkManager without a GUI, including creating, editing, starting and stopping network connections and viewing network status.

OPTIONS
       -t | --terse
           Output is terse. This mode is designed and suitable for computer (script) processing.

       -p | --pretty
           Output is pretty. This causes nmcli to produce easily readable outputs for humans, i.e. values are aligned, headers are printed, etc.

       -m | --mode {tabular | multiline}
           Switch between tabular and multiline output:

           tabular
               Output is a table where each line describes a single entry. Columns define particular properties of the entry.

           multiline
               Each entry comprises multiple lines, each property on its own line. The values are prefixed with the property name.

           If omitted, default is tabular for most commands. For the commands producing more structured information, that cannot be displayed on a single line, default is multiline. Currently, they are:

           ·   nmcli connection show ID

           ·   nmcli device show

       -c | --colors {yes | no | auto}
           This option controls color output (using terminal escape sequences).  yes enables colors, no disables them, auto only produces colors when standard output is directed to a terminal. The default value
           is auto.

       -f | --fields {field1,field2... | all | common}
           This option is used to specify what fields (column names) should be printed. Valid field names differ for specific commands. List available fields by providing an invalid value to the --fields option.
           all is used to print all valid field values of the command.  common is used to print common field values of the command.

           If omitted, default is common. The option is mandatory when --terse is used. In this case, generic values all and common cannot be used. This is to maintain compatibility when new fields are added in
           the future.

       -e | --escape {yes | no}
           Whether to escape : and \ characters in terse tabular mode. The escape character is \.

           If omitted, default is yes.

       -a | --ask
           When using this option nmcli will stop and ask for any missing required arguments, so do not use this option for non-interactive purposes like scripts. This option controls, for example, whether you
           will be prompted for a password if it is required for connecting to a network.

       -s | --show-secrets
           When using this option nmcli will display passwords and secrets that might be present in an output of an operation. This option also influences echoing passwords typed by user as an input.

       -w | --wait seconds
           This option sets a timeout period for which nmcli will wait for NetworkManager to finish operations. It is especially useful for commands that may take a longer time to complete, e.g. connection
           activation.

           Specifying a value of 0 instructs nmcli not to wait but to exit immediately with a status of success. The default value depends on the executed command.

       --complete-args
           Instead of conducting the desired action, nmcli will list possible completions for the last argument. This is useful to implement argument completion in shell.

           The exit status will indicate success or return a code 65 to indicate the last argument is a file name.

           NetworkManager ships with command completion support for GNU Bash.

       -v | --version
           Show nmcli version.

       -h | --help
           Print help information.

GENERAL COMMANDS
       nmcli general {status | hostname | permissions | logging} [ARGUMENTS...]

       Use this command to show NetworkManager status and permissions. You can also get and change system hostname, as well as NetworkManager logging level and domains.

       status
           Show overall status of NetworkManager. This is the default action, when no additional command is provided for nmcli general.

       hostname [hostname]
           Get and change system hostname. With no arguments, this prints currently configured hostname. When you pass a hostname, it will be handed over to NetworkManager to be set as a new system hostname.

           Note that the term "system" hostname may also be referred to as "persistent" or "static" by other programs or tools. The hostname is stored in /etc/hostname file in most distributions. For example,
           systemd-hostnamed service uses the term "static" hostname and it only reads the /etc/hostname file when it starts.

       permissions
           Show the permissions a caller has for various authenticated operations that NetworkManager provides, like enable and disable networking, changing Wi-Fi and WWAN state, modifying connections, etc.

       logging [level level] [domains domains...]
           Get and change NetworkManager logging level and domains. Without any argument current logging level and domains are shown. In order to change logging state, provide level and, or, domain parameters.
           See NetworkManager.conf(5) for available level and domain values.

NETWORKING CONTROL COMMANDS
       nmcli networking {on | off | connectivity} [ARGUMENTS...]

       Query NetworkManager networking status, enable and disable networking.

       on, off
           Enable enable or disable networking control by NetworkManager. All interfaces managed by NetworkManager are deactivated when networking is disabled.

       connectivity [check]
           Get network connectivity state. The optional check argument tells NetworkManager to re-check the connectivity, else the most recent known connectivity state is displayed without re-checking.

           Possible states are:

           none
               the host is not connected to any network.

           portal
               the host is behind a captive portal and cannot reach the full Internet.

           limited
               the host is connected to a network, but it has no access to the Internet.

           full
               the host is connected to a network and has full access to the Internet.

           unknown
               the connectivity status cannot be found out.

RADIO TRANSMISSION CONTROL COMMANDS
       nmcli radio {all | wifi | wwan} [ARGUMENTS...]

       Show radio switches status, or enable and disable the switches.

       wifi [on | off]
           Show or set status of Wi-Fi in NetworkManager. If no arguments are supplied, Wi-Fi status is printed; on enables Wi-Fi; off disables Wi-Fi.

       wwan [on | off]
           Show or set status of WWAN (mobile broadband) in NetworkManager. If no arguments are supplied, mobile broadband status is printed; on enables mobile broadband, off disables it.

       all [on | off]
           Show or set all previously mentioned radio switches at the same time.

ACTIVITY MONITOR
       nmcli monitor

       Observe NetworkManager activity. Watches for changes in connectivity state, devices or connection profiles.

       See also nmcli connection monitor and nmcli device monitor to watch for changes in certain devices or connections.

CONNECTION MANAGEMENT COMMANDS
       nmcli connection {show | up | down | modify | add | edit | clone | delete | monitor | reload | load | import | export} [ARGUMENTS...]

       NetworkManager stores all network configuration as "connections", which are collections of data (Layer2 details, IP addressing, etc.) that describe how to create or connect to a network. A connection is
       "active" when a device uses that connection's configuration to create or connect to a network. There may be multiple connections that apply to a device, but only one of them can be active on that device
       at any given time. The additional connections can be used to allow quick switching between different networks and configurations.

       Consider a machine which is usually connected to a DHCP-enabled network, but sometimes connected to a testing network which uses static IP addressing. Instead of manually reconfiguring eth0 each time the
       network is changed, the settings can be saved as two connections which both apply to eth0, one for DHCP (called default) and one with the static addressing details (called testing). When connected to the
       DHCP-enabled network the user would run nmcli con up default , and when connected to the static network the user would run nmcli con up testing.

       show [--active] [--order [+-]category:...]
           List in-memory and on-disk connection profiles, some of which may also be active if a device is using that connection profile. Without a parameter, all profiles are listed. When --active option is
           specified, only the active profiles are shown.

           The --order option can be used to get custom ordering of connections. The connections can be ordered by active status (active), name (name), type (type) or D-Bus path (path). If connections are equal
           according to a sort order category, an additional category can be specified. The default sorting order is equivalent to --order active:name:path.  + or no prefix means sorting in ascending order
           (alphabetically or in numbers), - means reverse (descending) order. The category names can be abbreviated (e.g.  --order -a:na).

       show [--active] [id | uuid | path | apath] ID...
           Show details for specified connections. By default, both static configuration and active connection data are displayed. When --active option is specified, only the active profiles are taken into
           account. Use global --show-secrets option to display secrets associated with the profile.

           id, uuid, path and apath keywords can be used if ID is ambiguous. Optional ID-specifying keywords are:

           id
               the ID denotes a connection name.

           uuid
               the ID denotes a connection UUID.

           path
               the ID denotes a D-Bus static connection path in the format of /org/freedesktop/NetworkManager/Settings/num or just num.

           apath
               the ID denotes a D-Bus active connection path in the format of /org/freedesktop/NetworkManager/ActiveConnection/num or just num.

           It is possible to filter the output using the global --fields option. Use the following values:

           profile
               only shows static profile configuration.

           active
               only shows active connection data (when the profile is active).

           You can also specify particular fields. For static configuration, use setting and property names as described in nm-settings(5) manual page. For active data use GENERAL, IP4, DHCP4, IP6, DHCP6, VPN.

           When no command is given to the nmcli connection, the default action is nmcli connection show.

       up [id | uuid | path] ID [ifname ifname] [ap BSSID] [passwd-file file]
           Activate a connection. The connection is identified by its name, UUID or D-Bus path. If ID is ambiguous, a keyword id, uuid or path can be used. When requiring a particular device to activate the
           connection on, the ifname option with interface name should be given. If the ID is not given an ifname is required, and NetworkManager will activate the best available connection for the given ifname.
           In case of a VPN connection, the ifname option specifies the device of the base connection. The ap option specify what particular AP should be used in case of a Wi-Fi connection.

           If --wait option is not specified, the default timeout will be 90 seconds.

           See connection show above for the description of the ID-specifying keywords.

           Available options are:

           ifname
               interface that will be used for activation.

           ap
               BSSID of the AP which the command should connect to (for Wi-Fi connections).

           passwd-file
               some networks may require credentials during activation. You can give these credentials using this option. Each line of the file should contain one password in the form:

                   setting_name.property_name:the password

               For example, for WPA Wi-Fi with PSK, the line would be

                   802-11-wireless-security.psk:secret12345

               For 802.1X password, the line would be

                   802-1x.password:my 1X password

               nmcli also accepts wifi-sec and wifi strings instead of 802-11-wireless-security. When NetworkManager requires a password and it is not given, nmcli will ask for it when run with --ask. If --ask
               was not passed, NetworkManager can ask another secret agent that may be running (typically a GUI secret agent, such as nm-applet or gnome-shell).

       down [id | uuid | path | apath] ID...
           Deactivate a connection from a device without preventing the device from further auto-activation. Multiple connections can be passed to the command.

           Be aware that this command deactivates the specified active connection, but the device on which the connection was active, is still ready to connect and will perform auto-activation by looking for a
           suitable connection that has the 'autoconnect' flag set. This includes the just deactivated connection. So if the connection is set to auto-connect, it will be automatically started on the
           disconnected device again.

           In most cases you may want to use device disconnect command instead.

           The connection is identified by its name, UUID or D-Bus path. If ID is ambiguous, a keyword id, uuid, path or apath can be used.

           See connection show above for the description of the ID-specifying keywords.

           If --wait option is not specified, the default timeout will be 10 seconds.

       modify [--temporary] [id | uuid | path] ID {option value | [+|-]setting.property value}...
           Add, modify or remove properties in the connection profile.

           To set the property just specify the property name followed by the value. An empty value ("") removes the property value.

           In addition to the properties, you can also use short names for some of the properties. Consult the PROPERTY ALIASES section for details.

           If you want to append an item to the existing value, use + prefix for the property name. If you want to remove just one item from container-type property, use - prefix for the property name and
           specify a value or an zero-based index of the item to remove (or option name for properties with named options) as value. The + and - modifies only have a real effect for multi-value (container)
           properties like ipv4.dns, ipv4.addresses, bond.options, etc.

           See nm-settings(5) for complete reference of setting and property names, their descriptions and default values. The setting and property can be abbreviated provided they are unique.

           The connection is identified by its name, UUID or D-Bus path. If ID is ambiguous, a keyword id, uuid or path can be used.

       add [save {yes | no}] {option value | [+|-]setting.property value}...
           Create a new connection using specified properties.

           You need to describe the newly created connections with the property and value pairs. See nm-settings(5) for the complete reference. You can also use the aliases described in PROPERTY ALIASES section.
           The syntax is the same as of the nmcli connection modify command.

           To construct a meaningful connection you at the very least need to set the connection.type property (or use the type alias) to one of known NetworkManager connection types:

           ·   ethernet

           ·   wifi

           ·   wimax

           ·   pppoe

           ·   gsm

           ·   cdma

           ·   infiniband

           ·   bluetooth

           ·   vlan

           ·   bond

           ·   bond-slave

           ·   team

           ·   team-slave

           ·   bridge

           ·   bridge-slave

           ·   vpn

           ·   olpc-mesh

           ·   adsl

           ·   tun

           ·   ip-tunnel

           ·   macvlan

           ·   vxlan

           The most typical uses are described in the EXAMPLES section.

           Aside from the properties and values two special options are accepted:

           save
               Controls whether the connection should be persistent, i.e. NetworkManager should store it on disk (default: yes).

           --
               If a single -- argument is encountered it is ignored. This is for compatibility with older versions on nmcli.

       edit {[id | uuid | path] ID | [type type] [con-name name] }
           Edit an existing connection or add a new one, using an interactive editor.

           The existing connection is identified by its name, UUID or D-Bus path. If ID is ambiguous, a keyword id, uuid, or path can be used. See connection show above for the description of the ID-specifying
           keywords. Not providing an ID means that a new connection will be added.

           The interactive editor will guide you through the connection editing and allow you to change connection parameters according to your needs by means of a simple menu-driven interface. The editor
           indicates what settings and properties can be modified and provides in-line help.

           Available options:

           type
               type of the new connection; valid types are the same as for connection add command.

           con-name
               name for the new connection. It can be changed later in the editor.

           See also nm-settings(5) for all NetworkManager settings and property names, and their descriptions; and nmcli-examples(7) for sample editor sessions.

       clone [--temporary] [id | uuid | path] ID new_name
           Clone a connection. The connection to be cloned is identified by its name, UUID or D-Bus path. If ID is ambiguous, a keyword id, uuid or path can be used. See connection show above for the description
           of the ID-specifying keywords.  new_name is the name of the new cloned connection. The new connection will be the exact copy except the connection.id (new_name) and connection.uuid (generated)
           properties.

           The new connection profile will be saved as persistent unless --temporary option is specified, in which case the new profile won't exist after NetworkManager restart.

       delete [id | uuid | path] ID...
           Delete a configured connection. The connection to be deleted is identified by its name, UUID or D-Bus path. If ID is ambiguous, a keyword id, uuid or path can be used. See connection show above for
           the description of the ID-specifying keywords.

           If --wait option is not specified, the default timeout will be 10 seconds.

       monitor [id | uuid | path] ID...
           Monitor connection profile activity. This command prints a line whenever the specified connection changes. The connection to be monitored is identified by its name, UUID or D-Bus path. If ID is
           ambiguous, a keyword id, uuid or path can be used. See connection show above for the description of the ID-specifying keywords.

           Monitors all connection profiles in case none is specified. The command terminates when all monitored connections disappear. If you want to monitor connection creation consider using the global
           monitor with nmcli monitor command.

       reload
           Reload all connection files from disk. NetworkManager does not monitor changes to connection files by default. So you need to use this command in order to tell NetworkManager to re-read the connection
           profiles from disk when a change was made to them. However, the auto-loading feature can be enabled and then NetworkManager will reload connection files any time they change
           (monitor-connection-files=true in NetworkManager.conf(5)).

       load filename...
           Load/reload one or more connection files from disk. Use this after manually editing a connection file to ensure that NetworkManager is aware of its latest state.

       import [--temporary] type type file file
           Import an external/foreign configuration as a NetworkManager connection profile. The type of the input file is specified by type option.

           Only VPN configurations are supported at the moment. The configuration is imported by NetworkManager VPN plugins.  type values are the same as for vpn-type option in nmcli connection add. VPN
           configurations are imported by VPN plugins. Therefore the proper VPN plugin has to be installed so that nmcli could import the data.

           The imported connection profile will be saved as persistent unless --temporary option is specified, in which case the new profile won't exist after NetworkManager restart.

       export [id | uuid | path] ID [file]
           Export a connection.

           Only VPN connections are supported at the moment. A proper VPN plugin has to be installed so that nmcli could export a connection. If no file is provided, the VPN configuration data will be printed to
           standard output.

DEVICE MANAGEMENT COMMANDS
       nmcli device {status | show | set | connect | reapply | modify | disconnect | delete | monitor | wifi | lldp} [ARGUMENTS...]

       Show and manage network interfaces.

       status
           Print status of devices.

           This is the default action if no command is specified to nmcli device.

       show [ifname]
           Show detailed information about devices. Without an argument, all devices are examined. To get information for a specific device, the interface name has to be provided.

       set [ifname] ifname [autoconnect {yes | no}] [managed {yes | no}]
           Set device properties.

       connect ifname
           Connect the device. NetworkManager will try to find a suitable connection that will be activated. It will also consider connections that are not set to auto connect.

           If --wait option is not specified, the default timeout will be 90 seconds.

       reapply ifname
           Attempt to update device with changes to the currently active connection made since it was last applied.

       modify ifname {option value | [+|-]setting.property value}...
           Modify the settings currently active on the device.

           This command lets you do temporary changes to a configuration active on a particular device. The changes are not preserved in the connection profile.

           See nm-settings(5) for the list of available properties. Please note that some properties can't be changed on an already connected device.

           You can also use the aliases described in PROPERTY ALIASES section. The syntax is the same as of the nmcli connection modify command.

       disconnect ifname...
           Disconnect a device and prevent the device from automatically activating further connections without user/manual intervention. Note that disconnecting software devices may mean that the devices will
           disappear.

           If --wait option is not specified, the default timeout will be 10 seconds.

       delete ifname...
           Delete a device. The command removes the interface from the system. Note that this only works for software devices like bonds, bridges, teams, etc. Hardware devices (like Ethernet) cannot be deleted
           by the command.

           If --wait option is not specified, the default timeout will be 10 seconds.

       monitor [ifname...]
           Monitor device activity. This command prints a line whenever the specified devices change state.

           Monitors all devices in case no interface is specified. The monitor terminates when all specified devices disappear. If you want to monitor device addition consider using the global monitor with nmcli
           monitor command.

       wifi [list [ifname ifname] [bssid BSSID]]
           List available Wi-Fi access points. The ifname and bssid options can be used to list APs for a particular interface or with a specific BSSID, respectively.

       wifi connect (B)SSID [password password] [wep-key-type {key | phrase}] [ifname ifname] [bssid BSSID] [name name] [private {yes | no}] [hidden {yes | no}]
           Connect to a Wi-Fi network specified by SSID or BSSID. The command creates a new connection and then activates it on a device. This is a command-line counterpart of clicking an SSID in a GUI client.
           The command always creates a new connection and thus it is mainly useful for connecting to new Wi-Fi networks. If a connection for the network already exists, it is better to bring up (activate) the
           existing connection as follows: nmcli con up id name. Note that only open, WEP and WPA-PSK networks are supported at the moment. It is also supposed that IP configuration is obtained via DHCP.

           If --wait option is not specified, the default timeout will be 90 seconds.

           Available options are:

           password
               password for secured networks (WEP or WPA).

           wep-key-type
               type of WEP secret, either key for ASCII/HEX key or phrase for passphrase.

           ifname
               interface that will be used for activation.

           bssid
               if specified, the created connection will be restricted just for the BSSID.

           name
               if specified, the connection will use the name (else NM creates a name itself).

           private
               if set to yes, the connection will only be visible to the user who created it. Otherwise the connection is system-wide, which is the default.

           hidden
               set to yes when connecting for the first time to an AP not broadcasting its SSID. Otherwise the SSID would not be found and the connection attempt would fail.

       wifi hotspot [ifname ifname] [con-name name] [ssid SSID] [band {a | bg}] [channel channel] [password password]
           Create a Wi-Fi hotspot. The command creates a hotspot connection profile according to Wi-Fi device capabilities and activates it on the device. The hotspot is secured with WPA if device/driver
           supports that, otherwise WEP is used. Use connection down or device disconnect to stop the hotspot.

           Parameters of the hotspot can be influenced by the optional parameters:

           ifname
               what Wi-Fi device is used.

           con-name
               name of the created hotspot connection profile.

           ssid
               SSID of the hotspot.

           band
               Wi-Fi band to use.

           channel
               Wi-Fi channel to use.

           password
               password to use for the created hotspot. If not provided, nmcli will generate a password. The password is either WPA pre-shared key or WEP key.

               Note that --show-secrets global option can be used to print the hotspot password. It is useful especially when the password was generated.

       wifi rescan [ifname ifname] [ssid SSID...]
           Request that NetworkManager immediately re-scan for available access points. NetworkManager scans Wi-Fi networks periodically, but in some cases it can be useful to start scanning manually (e.g. after
           resuming the computer). By using ssid, it is possible to scan for a specific SSID, which is useful for APs with hidden SSIDs. You can provide multiple ssid parameters in order to scan more SSIDs.

           This command does not show the APs, use nmcli device wifi list for that.

       lldp [list [ifname ifname]]
           Display information about neighboring devices learned through the Link Layer Discovery Protocol (LLDP). The ifname option can be used to list neighbors only for a given interface. The protocol must be
           enabled in the connection settings.

SECRET AGENT
       nmcli agent {secret | polkit | all}

       Run nmcli as a NetworkManager secret agent, or polkit agent.

       secret
           Register nmcli as a NetworkManager secret agent and listen for secret requests. You do usually not need this command, because nmcli can handle secrets when connecting to networks. However, you may
           find the command useful when you use another tool for activating connections and you do not have a secret agent available (like nm-applet).

       polkit
           Register nmcli as a polkit agent for the user session and listen for authorization requests. You do not usually need this command, because nmcli can handle polkit actions related to NetworkManager
           operations (when run with --ask). However, you may find the command useful when you want to run a simple text based polkit agent and you do not have an agent of a desktop environment. Note that
           running this command makes nmcli handle all polkit requests, not only NetworkManager related ones, because only one polkit agent can run for the session.

       all
           Runs nmcli as both NetworkManager secret and a polkit agent.

PROPERTY ALIASES
       Apart from the property-value pairs, connection add, connection modify and device modify also accept short forms of some properties. They exist for convenience and compatiblity with older versions of
       nmcli that could not accept the raw properties.

       The overview of the aliases is below. An actual connection type is used to disambiguate these options from the options of the same name that are valid for multiple connection types (such as mtu).

       Table 1. Options for all connections
       ┌────────────┬───────────────────────────┬───────────────────────────────────────────────────────┐
       │Alias       │ Property                  │ Note                                                  │
       ├────────────┼───────────────────────────┼───────────────────────────────────────────────────────┤
       │type        │ connection.type           │ This option also accepts values of bond-slave,        │
       │            │                           │ team-slave and bridge-slave. They create ethernet     │
       │            │                           │ connection profiles. Their use is discouraged in      │
       │            │                           │ favor of using a specific type with master option.    │
       ├────────────┼───────────────────────────┼───────────────────────────────────────────────────────┤
       │con-name    │ connection.id             │ When not provided a default name is generated:        │
       │            │                           │ <type>[-<ifname>][-<num>]).                           │
       ├────────────┼───────────────────────────┼───────────────────────────────────────────────────────┤
       │autoconnect │ connection.autoconnect    │                                                       │
       ├────────────┼───────────────────────────┼───────────────────────────────────────────────────────┤
       │ifname      │ connection.interface-name │ A value of * will be interpreted as no value, making  │
       │            │                           │ the connection profile interface-independent.  Note:  │
       │            │                           │ use quotes around * to suppress shell expansion.  For │
       │            │                           │ bond, team and bridge connections a default name will │
       │            │                           │ be generated if not set.                              │
       ├────────────┼───────────────────────────┼───────────────────────────────────────────────────────┤
       │master      │ connection.master         │ Value specified here will be canonicalized.  It can   │
       │            │                           │ be prefixed with ifname/, uuid/ or id/ to             │
       │            │                           │ disambiguate it.                                      │
       ├────────────┼───────────────────────────┼───────────────────────────────────────────────────────┤
       │slave-type  │ connection.slave-type     │                                                       │
       └────────────┴───────────────────────────┴───────────────────────────────────────────────────────┘

       Table 2. PPPoE options
       ┌─────────┬────────────────┐
       │Alias    │ Property       │
       ├─────────┼────────────────┤
       │username │ pppoe.username │
       ├─────────┼────────────────┤
       │password │ pppoe.password │
       ├─────────┼────────────────┤
       │service  │ pppoe.service  │
       └─────────┴────────────────┘

       Table 3. Wired Ethernet options
       ┌───────────┬──────────────────────────┐
       │Alias      │ Property                 │
       ├───────────┼──────────────────────────┤
       │mtu        │ wired.mtu                │
       ├───────────┼──────────────────────────┤
       │mac        │ wired.mac-address        │
       ├───────────┼──────────────────────────┤
       │cloned-mac │ wired.cloned-mac-address │
       └───────────┴──────────────────────────┘

       Table 4. Infiniband options
       ┌───────────────┬───────────────────────────┐
       │Alias          │ Property                  │
       ├───────────────┼───────────────────────────┤
       │mtu            │ infiniband.mtu            │
       ├───────────────┼───────────────────────────┤
       │mac            │ infiniband.mac-address    │
       ├───────────────┼───────────────────────────┤
       │transport-mode │ infiniband.transport-mode │
       ├───────────────┼───────────────────────────┤
       │parent         │ infiniband.parent         │
       ├───────────────┼───────────────────────────┤
       │p-key          │ infiniband.p-key          │
       └───────────────┴───────────────────────────┘

       Table 5. Wi-Fi options
       ┌───────────┬─────────────────────────────┐
       │Alias      │ Property                    │
       ├───────────┼─────────────────────────────┤
       │ssid       │ wireless.ssid               │
       ├───────────┼─────────────────────────────┤
       │mode       │ wireless.mode               │
       ├───────────┼─────────────────────────────┤
       │mtu        │ wireless.mtu                │
       ├───────────┼─────────────────────────────┤
       │mac        │ wireless.mac-address        │
       ├───────────┼─────────────────────────────┤
       │cloned-mac │ wireless.cloned-mac-address │
       └───────────┴─────────────────────────────┘

       Table 6. WiMax options
       ┌──────┬────────────────────┐
       │Alias │ Property           │
       ├──────┼────────────────────┤
       │nsp   │ wimax.network-name │
       ├──────┼────────────────────┤
       │mac   │ wimax.mac-address  │
       └──────┴────────────────────┘

       Table 7. GSM options
       ┌─────────┬──────────────┐
       │Alias    │ Property     │
       ├─────────┼──────────────┤
       │apn      │ gsm.apn      │
       ├─────────┼──────────────┤
       │user     │ gsm.username │
       ├─────────┼──────────────┤
       │password │ gsm.password │
       └─────────┴──────────────┘

       Table 8. CDMA options
       ┌─────────┬───────────────┐
       │Alias    │ Property      │
       ├─────────┼───────────────┤
       │user     │ cdma.username │
       ├─────────┼───────────────┤
       │password │ cdma.password │
       └─────────┴───────────────┘

       Table 9. Bluetooth options
       ┌────────┬──────────────────┬───────────────────────────────────────────────────────┐
       │Alias   │ Property         │ Note                                                  │
       ├────────┼──────────────────┼───────────────────────────────────────────────────────┤
       │addr    │ bluetooth.bdaddr │                                                       │
       ├────────┼──────────────────┼───────────────────────────────────────────────────────┤
       │bt-type │ bluetooth.type   │ Apart from the usual dun and panu options, the values │
       │        │                  │ of dun-gsm and dun-cdma can be used for compatibility │
       │        │                  │ with older versions. They are equivalent to using dun │
       │        │                  │ and setting appropriate gsm.* or cdma.* properties.   │
       └────────┴──────────────────┴───────────────────────────────────────────────────────┘

       Table 10. VLAN options
       ┌────────┬───────────────────────────┐
       │Alias   │ Property                  │
       ├────────┼───────────────────────────┤
       │dev     │ vlan.parent               │
       ├────────┼───────────────────────────┤
       │id      │ vlan.id                   │
       ├────────┼───────────────────────────┤
       │flags   │ vlan.flags                │
       ├────────┼───────────────────────────┤
       │ingress │ vlan.ingress-priority-map │
       ├────────┼───────────────────────────┤
       │egress  │ vlan.egress-priority-map  │
       └────────┴───────────────────────────┘

       Table 11. Bonding options
       ┌──────────────┬──────────────┬───────────────────────────────────────────────────────┐
       │Alias         │ Property     │ Note                                                  │
       ├──────────────┼──────────────┼───────────────────────────────────────────────────────┤
       │mode          │              │ Setting each of these adds the option to bond.options │
       ├──────────────┤              │ property.  It's equivalent of using the +bond.options │
       │primary       │              │ 'option=value' syntax.                                │
       ├──────────────┤              │                                                       │
       │miimon        │              │                                                       │
       ├──────────────┤              │                                                       │
       │downdelay     │              │                                                       │
       ├──────────────┤ bond.options │                                                       │
       │updelay       │              │                                                       │
       ├──────────────┤              │                                                       │
       │arp-interval  │              │                                                       │
       ├──────────────┤              │                                                       │
       │arp-ip-target │              │                                                       │
       ├──────────────┤              │                                                       │
       │lacp-rate     │              │                                                       │
       └──────────────┴──────────────┴───────────────────────────────────────────────────────┘

       Table 12. Team options
       ┌───────┬─────────────┐
       │Alias  │ Property    │
       ├───────┼─────────────┤
       │config │ team.config │
       └───────┴─────────────┘

       Table 13. Team port options
       ┌───────┬──────────────────┐
       │Alias  │ Property         │
       ├───────┼──────────────────┤
       │config │ team-port.config │
       └───────┴──────────────────┘

       Table 14. Bridge options
       ┌───────────────────┬───────────────────────────┐
       │Alias              │ Property                  │
       ├───────────────────┼───────────────────────────┤
       │stp                │ bridge.stp                │
       ├───────────────────┼───────────────────────────┤
       │priority           │ bridge.priority           │
       ├───────────────────┼───────────────────────────┤
       │forward-delay      │ bridge.forward-delay      │
       ├───────────────────┼───────────────────────────┤
       │hello-time         │ bridge.hello-time         │
       ├───────────────────┼───────────────────────────┤
       │max-age            │ bridge.max-age            │
       ├───────────────────┼───────────────────────────┤
       │ageing-time        │ bridge.ageing-time        │
       ├───────────────────┼───────────────────────────┤
       │multicast-snooping │ bridge.multicast-snooping │
       ├───────────────────┼───────────────────────────┤
       │mac                │ bridge.mac-address        │
       ├───────────────────┼───────────────────────────┤
       │priority           │ bridge-port.priority      │
       ├───────────────────┼───────────────────────────┤
       │path-cost          │ bridge-port.path-cost     │
       ├───────────────────┼───────────────────────────┤
       │hairpin            │ bridge-port.hairpin-mode  │
       └───────────────────┴───────────────────────────┘

       Table 15. VPN options
       ┌─────────┬──────────────────┐
       │Alias    │ Property         │
       ├─────────┼──────────────────┤
       │vpn-type │ vpn.service-type │
       ├─────────┼──────────────────┤
       │user     │ vpn.user-name    │
       └─────────┴──────────────────┘

       Table 16. OLPC Mesh options
       ┌─────────────┬────────────────────────────────┐
       │Alias        │ Property                       │
       ├─────────────┼────────────────────────────────┤
       │ssid         │ olpc-mesh.ssid                 │
       ├─────────────┼────────────────────────────────┤
       │channel      │ olpc-mesh.channel              │
       ├─────────────┼────────────────────────────────┤
       │dhcp-anycast │ olpc-mesh.dhcp-anycast-address │
       └─────────────┴────────────────────────────────┘

       Table 17. ADSL options
       ┌──────────────┬────────────────────┐
       │Alias         │ Property           │
       ├──────────────┼────────────────────┤
       │username      │ adsl.username      │
       ├──────────────┼────────────────────┤
       │protocol      │ adsl.protocol      │
       ├──────────────┼────────────────────┤
       │password      │ adsl.password      │
       ├──────────────┼────────────────────┤
       │encapsulation │ adsl.encapsulation │
       └──────────────┴────────────────────┘

       Table 18. MACVLAN options
       ┌──────┬────────────────┐
       │Alias │ Property       │
       ├──────┼────────────────┤
       │dev   │ macvlan.parent │
       ├──────┼────────────────┤
       │mode  │ macvlan.mode   │
       ├──────┼────────────────┤
       │tap   │ macvlan.tap    │
       └──────┴────────────────┘

       Table 19. VxLAN options
       ┌─────────────────┬────────────────────────┐
       │Alias            │ Property               │
       ├─────────────────┼────────────────────────┤
       │id               │ vxlan.id               │
       ├─────────────────┼────────────────────────┤
       │remote           │ vxlan.remote           │
       ├─────────────────┼────────────────────────┤
       │dev              │ vxlan.parent           │
       ├─────────────────┼────────────────────────┤
       │local            │ vxlan.local            │
       ├─────────────────┼────────────────────────┤
       │source-port-min  │ vxlan.source-port-min  │
       ├─────────────────┼────────────────────────┤
       │source-port-max  │ vxlan.source-port-max  │
       ├─────────────────┼────────────────────────┤
       │destination-port │ vxlan.destination-port │
       └─────────────────┴────────────────────────┘

       Table 20. Tun options
       ┌────────────┬─────────────────┐
       │Alias       │ Property        │
       ├────────────┼─────────────────┤
       │mode        │ tun.mode        │
       ├────────────┼─────────────────┤
       │owner       │ tun.owner       │
       ├────────────┼─────────────────┤
       │group       │ tun.group       │
       ├────────────┼─────────────────┤
       │pi          │ tun.pi          │
       ├────────────┼─────────────────┤
       │vnet-hdr    │ tun.vnet-hdr    │
       ├────────────┼─────────────────┤
       │multi-queue │ tun.multi-queue │
       └────────────┴─────────────────┘

       Table 21. IP tunneling options
       ┌───────┬──────────────────┐
       │Alias  │ Property         │
       ├───────┼──────────────────┤
       │mode   │ ip-tunnel.mode   │
       ├───────┼──────────────────┤
       │local  │ ip-tunnel.local  │
       ├───────┼──────────────────┤
       │remote │ ip-tunnel.remote │
       ├───────┼──────────────────┤
       │dev    │ ip-tunnel.parent │
       └───────┴──────────────────┘

       Table 22. IPv4 options
       ┌──────┬────────────────┬────────────────────────────────────────────────────┐
       │Alias │ Property       │ Note                                               │
       ├──────┼────────────────┼────────────────────────────────────────────────────┤
       │ip4   │ ipv4.addresses │ This option can be specified multiple times.  It's │
       │      │                │ equivalent of using +ipv4.addresses syntax.        │
       ├──────┼────────────────┼────────────────────────────────────────────────────┤
       │gw4   │ ipv4.gateway   │                                                    │
       └──────┴────────────────┴────────────────────────────────────────────────────┘

       Table 23. IPv6 options
       ┌──────┬────────────────┬────────────────────────────────────────────────────┐
       │Alias │ Property       │ Note                                               │
       ├──────┼────────────────┼────────────────────────────────────────────────────┤
       │ip6   │ ipv6.addresses │ This option can be specified multiple times.  It's │
       │      │                │ equivalent of using +ipv6.addresses syntax.        │
       ├──────┼────────────────┼────────────────────────────────────────────────────┤
       │gw6   │ ipv6.gateway   │                                                    │
       └──────┴────────────────┴────────────────────────────────────────────────────┘

ENVIRONMENT VARIABLES
       nmcli's behavior is affected by the following environment variables.

       LC_ALL
           If set to a non-empty string value, it overrides the values of all the other internationalization variables.

       LC_MESSAGES
           Determines the locale to be used for internationalized messages.

       LANG
           Provides a default value for the internationalization variables that are unset or null.

INTERNATIONALIZATION NOTES
       Be aware that nmcli is localized and that is why the output depends on your environment. This is important to realize especially when you parse the output.

       Call nmcli as LC_ALL=C nmcli to be sure the locale is set to C while executing in a script.

       LC_ALL, LC_MESSAGES, LANG variables specify the LC_MESSAGES locale category (in that order), which determines the language that nmcli uses for messages. The C locale is used if none of these variables are
       set, and this locale uses English messages.

EXIT STATUS
       nmcli exits with status 0 if it succeeds, a value greater than 0 is returned if an error occurs.

       0
           Success – indicates the operation succeeded.

       1
           Unknown or unspecified error.

       2
           Invalid user input, wrong nmcli invocation.

       3
           Timeout expired (see --wait option).

       4
           Connection activation failed.

       5
           Connection deactivation failed.

       6
           Disconnecting device failed.

       7
           Connection deletion failed.

       8
           NetworkManager is not running.

       10
           Connection, device, or access point does not exist.

       65
           When used with --complete-args option, a file name is expected to follow.

EXAMPLES
       This section presents various examples of nmcli usage. If you want even more, please refer to nmcli-examples(7) manual page.

       nmcli -t -f RUNNING general
           tells you whether NetworkManager is running or not.

       nmcli -t -f STATE general
           shows the overall status of NetworkManager.

       nmcli radio wifi off
           switches Wi-Fi off.

       nmcli connection show
           lists all connections NetworkManager has.

       nmcli -p -m multiline -f all con show
           shows all configured connections in multi-line mode.

       nmcli connection show --active
           lists all currently active connections.

       nmcli -f name,autoconnect c s
           shows all connection profile names and their auto-connect property.

       nmcli -p connection show "My default em1"
           shows details for "My default em1" connection profile.

       nmcli --show-secrets connection show "My Home WiFi"
           shows details for "My Home WiFi" connection profile with all passwords. Without --show-secrets option, secrets would not be displayed.

       nmcli -f active connection show "My default em1"
           shows details for "My default em1" active connection, like IP, DHCP information, etc.

       nmcli -f profile con s "My wired connection"
           shows static configuration details of the connection profile with "My wired connection" name.

       nmcli -p con up "My wired connection" ifname eth0
           activates the connection profile with name "My wired connection" on interface eth0. The -p option makes nmcli show progress of the activation.

       nmcli con up 6b028a27-6dc9-4411-9886-e9ad1dd43761 ap 00:3A:98:7C:42:D3
           connects the Wi-Fi connection with UUID 6b028a27-6dc9-4411-9886-e9ad1dd43761 to the AP with BSSID 00:3A:98:7C:42:D3.

       nmcli device status
           shows the status for all devices.

       nmcli dev disconnect em2
           disconnects a connection on interface em2 and marks the device as unavailable for auto-connecting. As a result, no connection will automatically be activated on the device until the device's
           'autoconnect' is set to TRUE or the user manually activates a connection.

       nmcli -f GENERAL,WIFI-PROPERTIES dev show wlan0
           shows details for wlan0 interface; only GENERAL and WIFI-PROPERTIES sections will be shown.

       nmcli -f CONNECTIONS device show wlp3s0
           shows all available connection profiles for your Wi-Fi interface wlp3s0.

       nmcli dev wifi
           lists available Wi-Fi access points known to NetworkManager.

       nmcli dev wifi con "Cafe Hotspot 1" password caffeine name "My cafe"
           creates a new connection named "My cafe" and then connects it to "Cafe Hotspot 1" SSID using password "caffeine". This is mainly useful when connecting to "Cafe Hotspot 1" for the first time. Next
           time, it is better to use nmcli con up id "My cafe" so that the existing connection profile can be used and no additional is created.

       nmcli -s dev wifi hotspot con-name QuickHotspot
           creates a hotspot profile and connects it. Prints the hotspot password the user should use to connect to the hotspot from other devices.

       nmcli dev modify em1 ipv4.method shared
           starts IPv4 connection sharing using em1 device. The sharing will be active until the device is disconnected.

       nmcli dev modify em1 ipv6.address 2001:db8::a:bad:c0de
           temporarily adds an IP address to a device. The address will be removed when the same connection is activated again.

       nmcli connection add type ethernet autoconnect no ifname eth0
           non-interactively adds an Ethernet connection tied to eth0 interface with automatic IP configuration (DHCP), and disables the connection's autoconnect flag.

       nmcli c a ifname Maxipes-fik type vlan dev eth0 id 55
           non-interactively adds a VLAN connection with ID 55. The connection will use eth0 and the VLAN interface will be named Maxipes-fik.

       nmcli c a ifname eth0 type ethernet ipv4.method disabled ipv6.method link-local
           non-interactively adds a connection that will use eth0 Ethernet interface and only have an IPv6 link-local address configured.

       nmcli connection edit ethernet-em1-2
           edits existing "ethernet-em1-2" connection in the interactive editor.

       nmcli connection edit type ethernet con-name "yet another Ethernet connection"
           adds a new Ethernet connection in the interactive editor.

       nmcli con mod ethernet-2 connection.autoconnect no
           modifies 'autoconnect' property in the 'connection' setting of 'ethernet-2' connection.

       nmcli con mod "Home Wi-Fi" wifi.mtu 1350
           modifies 'mtu' property in the 'wifi' setting of 'Home Wi-Fi' connection.

       nmcli con mod em1-1 ipv4.method manual ipv4.addr "192.168.1.23/24 192.168.1.1, 10.10.1.5/8, 10.0.0.11"
           sets manual addressing and the addresses in em1-1 profile.

       nmcli con modify ABC +ipv4.dns 8.8.8.8
           appends a Google public DNS server to DNS servers in ABC profile.

       nmcli con modify ABC -ipv4.addresses "192.168.100.25/24 192.168.1.1"
           removes the specified IP address from (static) profile ABC.

       nmcli con import type openvpn file ~/Downloads/frootvpn.ovpn
           imports an OpenVPN configuration to NetworkManager.

       nmcli con export corp-vpnc /home/joe/corpvpn.conf
           exports NetworkManager VPN profile corp-vpnc as standard Cisco (vpnc) configuration.

NOTES
       nmcli accepts abbreviations, as long as they are a unique prefix in the set of possible options. As new options get added, these abbreviations are not guaranteed to stay unique. For scripting and long
       term compatibility it is therefore strongly advised to spell out the full option names.

BUGS
       There are probably some bugs. If you find a bug, please report it to https://bugzilla.gnome.org/ — product NetworkManager.

SEE ALSO
       nmcli-examples(7), nm-online(1), NetworkManager(8), NetworkManager.conf(5), nm-settings(5), nm-applet(1), nm-connection-editor(1).



NetworkManager 1.4.0                                                                                                                                                                                       NMCLI(1)

Monday, 4 December 2017

[Windows] Port Forwarding

1. Open CMD

2. Register Port Forwarding

netsh interface portproxy add v4tov4 listenport=[SOURCE_PORT] listenaddress=[SOURCE_IP] connectport=[TARGET_PORT] connectaddress=[TARGET_IP]

3. Terminate Port Forwarding

netsh interface portproxy delete v4tov4 listenport=[SOURCE_PORT] listenaddress=[SOURCE_IP]


[Oracle] 테이블 컬럼명, Comment 확인

SELECT A.COLUMN_NAME, B.COMMENTS, A.DATA_TYPE
FROM COLS A, USER_COL_COMMENTS B
WHERE A.TABLE_NAME = '[TABLE_NAME]'
AND A.TABLE_NAME = B.TABLE_NAME
AND A.COLUMN_NAME = B.COLUMN_NAME
;

Saturday, 30 September 2017

[Hadoop] Install Hadoop as Standalone in CentOS 7

1. Install RSync

#> yum -y install rsync




2. Download Hadoop

http://hadoop.apache.org/releases.html

#> cd /usr/local
#> wget http://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-2.8.1/hadoop-2.8.1.tar.gz



3. Unzip Hadoop file

#> tar zxf hadoop-2.8.1.tar.gz




4. Setup environment variables

#> cd /usr/local/hadoop-2.8.1/etc/hadoop
#> vi hadoop-env.sh
#> vi ~/.bash_profile








5. Configure core-site.xml file

#> cd /usr/local/hadoop-2.8.1/etc/hadoop
#> vi core-site.xml




6. Configure hdfs-site.xml

#> cd /usr/local/hadoop-2.8.1/etc/hadoop
#> vi hdfs-site.xml







7. Create SSH key

#> ssh-keygen -t rsa
#> cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys





8. Test SSH

#> ssh localhost




9. Format NameNode

#> hadoop namenode -format






10. Startup Hadoop

#> start-all.sh





11. Connect on Web browser

http://hadoophost:50070

[CentOS] Setup FTP when SElinux is enabled

1. Set FTP User home directory (FTP 유저 홈디렉터리 설정)

#> chown -R ftp:ftp /var/ftp
#> semanage fcontext -a -t public_content_rw_t /var/ftp
#> restorecon -Rvv /var/ftp
#> setsebool -P ftp_home_dir 1
#> setsebool -P ftpd_full_access 1
#> ls -lZ /var | grep ftp




2. Restart FTP service

# Set FTP service auto enable
#> systemctl enable vsftpd

# Restart FTP Server
#> systemctl restart vsftpd

[CentOS] Set enable to connect FTP server by root user

1. Edit /etc/vsftpd/user_list and exclude root user


#> vi /etc/vsftpd/user_list




2. Edit /etc/vsftpd/ftpusers and exclude root user

#> /etc/vsftpd/ftpusers

Friday, 22 September 2017

[Java] How to get OS name, version, CPU Architecture from System.property(String)

System.getProperty("os.name");
System.getProperty("os.version");
System.getProperty("os.arch");

os.name os.version os.arch Comments
Linux 2.0.31 x86 IBM Java 1.3
Linux (*) i386 Sun Java 1.3.1, 1.4 or Blackdown Java; (*) os.version depends on Linux Kernel version
Linux (*) x86_64 Blackdown Java; note x86_64 might change to amd64; (*) os.version depends on Linux Kernel version
Linux (*) sparc Blackdown Java; (*) os.version depends on Linux Kernel version
Linux (*) ppc Blackdown Java; (*) os.version depends on Linux Kernel version
Linux (*) armv41 Blackdown Java; (*) os.version depends on Linux Kernel version
Linux (*) i686 GNU Java Compiler (GCJ); (*) os.version depends on Linux Kernel version
Linux (*) ppc64 IBM Java 1.3; (*) os.version depends on Linux Kernel version
Mac OS 7.5.1 PowerPC
Mac OS 8.1 PowerPC
Mac OS 9.0, 9.2.2 PowerPC MacOS 9.0: java.version=1.1.8, mrj.version=2.2.5; MacOS 9.2.2: java.version=1.1.8 mrj.version=2.2.5
Mac OS X 10.1.3 ppc
Mac OS X 10.2.6 ppc Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-39)
Java HotSpot(TM) Client VM (build 1.4.1_01-14, mixed mode)
Mac OS X 10.2.8 ppc using 1.3 JVM: java.vm.version=1.3.1_03-74, mrj.version=3.3.2; using 1.4 JVM: java.vm.version=1.4.1_01-24, mrj.version=69.1
Mac OS X 10.3.1, 10.3.2, 10.3.3, 10.3.4ppc JDK 1.4.x
Mac OS X 10.3.8 ppc Mac OS X 10.3.8 Server; using 1.3 JVM: java.vm.version=1.3.1_03-76, mrj.version=3.3.3; using 1.4 JVM: java.vm.version=1.4.2-38; mrj.version=141.3
Windows 95 4.0 x86
Windows 98 4.10 x86 Note, that if you run Sun JDK 1.2.1 or 1.2.2 Windows 98 identifies itself as Windows 95.
Windows Me 4.90 x86
Windows NT 4.0 x86
Windows 20005.0 x86
Windows XP 5.1 x86 Note, that if you run older Java runtimes Windows XP identifies itself as Windows 2000.
Windows 20035.2 x86 java.vm.version=1.4.2_06-b03; Note, that Windows Server 2003 identifies itself only as Windows 2003.
Windows CE 3.0 build 11171 arm Compaq iPAQ 3950 (PocketPC 2002)
OS/2 20.40 x86
Solaris 2.x sparc
SunOS 5.7 sparc Sun Ultra 5 running Solaris 2.7
SunOS 5.8 sparc Sun Ultra 2 running Solaris 8
SunOS 5.9 sparc Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)
MPE/iX C.55.00 PA-RISC
HP-UX B.10.20 PA-RISC JDK 1.1.x
HP-UX B.11.00 PA-RISC JDK 1.1.x
HP-UX B.11.11 PA-RISC JDK 1.1.x
HP-UX B.11.11 PA_RISC JDK 1.2.x/1.3.x; note Java 2 returns PA_RISC and Java 1 returns PA-RISC
HP-UX B.11.00 PA_RISC JDK 1.2.x/1.3.x
HP-UX B.11.23 IA64N JDK 1.4.x
HP-UX B.11.11 PA_RISC2.0JDK 1.3.x or JDK 1.4.x, when run on a PA-RISC 2.0 system
HP-UX B.11.11 PA_RISC JDK 1.2.x, even when run on a PA-RISC 2.0 system
HP-UX B.11.11 PA-RISC JDK 1.1.x, even when run on a PA-RISC 2.0 system
AIX 5.2 ppc64 sun.arch.data.model=64
AIX 4.3 Power
AIX 4.1 POWER_RS
OS/390 390 02.10.00 J2RE 1.3.1 IBM OS/390 Persistent Reusable VM
FreeBSD 2.2.2-RELEASE x86
Irix 6.3 mips
Digital Unix4.0 alpha
NetWare 4.114.11 x86
OSF1 V5.1 alpha Java 1.3.1 on Compaq (now HP) Tru64 Unix V5.1
OpenVMS V7.2-1 alpha Java 1.3.1_1 on OpenVMS 7.2


Reference : http://lopica.sourceforge.net/os.html

Monday, 28 August 2017

[JMX] RMI, Stub, Skelton 개념

RMI(Remote Method Invocation)

RPC(Remote Procedure Call)를 객체지향으로 구현한 것, 흔히 JAVA버전으로 알려져 있다.
서버와 클라이언트 측 모두 Helper가 필요하며 서버 측 Helper가 Skeleton, 클라이언트 측 Helper가 Stub이다.


Stub

원격지에 위치해있는 프로그램을 대리하는 작은 루틴. RPC(혹은 RMI)를 사용하는 프로그램이 컴파일되면 요청된 절차를 제공하는 프로그램의 대역을 한다.
클라이언트에서 작업을 요청하는 데이터를 Marshaling하고 작업이 완료된 데이터를 다시 UnMarshaling하는 역할
클라이언트 보조 객체가 Stub이고 서버 보조객체가 Skeleton이다.
   

Skeleton

Stub와 비슷한 역할로 서버의 보조 객체이다.
클라이언트의 Stub에서 데이터가 Marshaling되어 전송되면 Skeleton에서 UnMarshaling하여 원래의 형태로 복원한다.
Marshaling / UnMarshaling
Marshaling은 데이터를 바이트로 쪼개서 TCP/IP같은 통신 채널을 통해 전송될 수 있는 형태로 바꿔주는 과정
UnMarshaling은 반대로 전송 받은 바이트를 원래의 형태로 복원하는 과정
Routine
어떤 프로그램이 실행될 때 불려지거나 반복해서 사용되도록 만들어진 일력의 코드

Wednesday, 16 August 2017

[Oracle] Oracle Thin JDBC Driver URL Format

1. SID vs Service Name

SID :  DB 인스턴스명 (Unique)
Service Name : 1개 이상의 인스턴스의 별칭. 같은 DB를 다를 용도로 사용할 때, 이를 구별하기 위해도 쓸 수 있다.


2. Thin Driver URL Format

SID (no longer recommended by Oracle to be used):

 jdbc:oracle:thin:[<user>/<password>]@<host>[:<port>]:<SID>

Services:
 jdbc:oracle:thin:[<user>/<password>]@//<host>[:<port>]/<service>

TNSNames:
 jdbc:oracle:thin:[<user>/<password>]@<TNSName>



* ref

https://stackoverflow.com/questions/43866/how-sid-is-different-from-service-name-in-oracle-tnsnames-ora
http://www.orafaq.com/wiki/JDBC

Monday, 14 August 2017

[ActiveMQ] Authentication for JMX Connector

Apache ActiveMQ JMX connector는 2 가지 Authentication 메카니즘을 제공한다.

1. Simple authentication 
- 로그인 유저/패스워드 설정파일인 jmx.password, 유저별 권한설정 파일인 jmx.access 를 통해 접근을 제어한다.

2. JAAS authentication
- JAAS(Java Authentication and Authorization Service) realm과 로그인 모듈을 이용하여 접근을 제어한다.


Simple authentication(jmx.password, jmx.access)를 이용한 ActiveMQ JMX Connector 설정 방법

1. jmx.password 설정

$> vi $ACTIVEMQ_BASE/conf/jmx.password

# The "admin" user has password "activemq".
admin activemq
user1 password
user2 password
...
와 같이 설정한다.


2. jmx.access 설정

$> vi $ACTIVEMQ_BASE/conf/jmx.access

* 권한 종류
readonly : MBean attributes를 read만 가능
readwrite : MBean attributes Read/Write 권한 및 Invoke operation을 호출, MBean 생성/삭제 등의 권한

# The "admin" user has readwrite access.
admin readwrite
user1 readwrite
user2 readonly
...
와 같이 설정한다.

3. conf/activemq.xml 설정


<beans ... >
  <broker xmlns="http://activemq.apache.org/schema/core" ... >
    ...
    <managementContext>
      <managementContext createConnector="true"
                         connectorPort="2011"
                         jmxDomainName="org.apache.activemq">
        <property xmlns="http://www.springframework.org/schema/beans" name="environment">
          <map xmlns="http://www.springframework.org/schema/beans">
            <entry xmlns="http://www.springframework.org/schema/beans"
                   key="jmx.remote.x.password.file"
                   value="${activemq.base}/conf/jmx.password"/>
            <entry xmlns="http://www.springframework.org/schema/beans"
                   key="jmx.remote.x.access.file"
                   value="${activemq.base}/conf/jmx.access"/>
          </map>
        </property>
      </managementContext>
    </managementContext>
    ...
  </broker>
  ...
</beans>


4. Connect using (j)VisualVM




















* reference
https://access.redhat.com/documentation/en-US/Fuse_ESB/4.4.1/html/ActiveMQ_Security_Guide/files/JMX-AmqConnector-Authent.html
http://activemq.apache.org/jmx.html

Friday, 11 August 2017

[GitHub] 유용한 것 정리

* 특정 기간 전부터의 변경 내역 확인

- https://github.com/[USER]/[PROJECT]/compare/[BRANCH]@[n.day.ago}...[BRANCH]
   - day, week, month, year 옵션 사용 가능
   - 변경 내역이 많으면 최근 내용만 나옴

* 지정한 날 이후 변경 내역 확인

- https://github.com/[USER]/[PROJECT]/compare/[BRANCH]@{YYYY-MM-DD}...[BRANCH]

* commit 메시지로 Issue 연관 나타내기

- [Commit Message] #[이슈번호]
   - ex) Modified code communicating DB server #3

* commit 메시지로 Issue Close 하기

- fix #[이슈번호]
   - fixes #[이슈번호]
   - fixed #[이슈번호]
   - close #[이슈번호]
   - closes #[이슈번호]
   - closed #[이슈번호]
   - resolve #[이슈번호]
   - resolves #[이슈번호]
   - resolved #[이슈번호]

* 이모티콘 자동완성

- ':'(colon) 입력하면 이모티콘 리스트 나옴

Friday, 7 July 2017

[Network] Nagle Algorithm (Related with TCP_NODELAY)

Nagle

If possible, do not send it a few times, but send it a lot at once.(Effective TCP)


1. Nagle algorithm network communication

It sends packet when receive ACK. Before receiving ACK, a socket stacks data in output buffer, and makes it as packet and send all data when receive ACK.
Therefore, it reduces network traffic. It is default TCP socket algorithm.

2. Non Nagle network communication (TCP_NODELAY)

It sends packet when data comes in output buffer regardless of ACK. It support fast response. But it is inefficient. if you set TCP_NODELAY option as true, the TCP socket do not apply Nagle algorithm.