root@test:/var/log/nginx# wget -qO – icanhazip.com
www.xxx.yyy.zzz
root@test:/var/log/nginx# wget -qO- http://ipecho.net/plain | xargs echo
www.xxx.yyy.zzz
root@test:/var/log/nginx# wget -qO – icanhazip.com
www.xxx.yyy.zzz
root@test:/var/log/nginx# curl icanhazip.com
www.xxx.yyy.zzz
root@test:/var/log/nginx#
Tag Archives: address
Microsoft Azure Set a Static Internal IP Address for a VM
Before you specify a static IP address from your address pool, you may want to verify that the IP address has not been already assigned. In the example below, we’re checking to see whether the IP address 10.1.61.140 is available in the TestVNet virtual network.
Test-AzureStaticVNetIP –VNetName TestVNet –IPAddress 10.1.61.140
Be sure to change the variables for the cmdlets to reflect what you require for your environment before running them.
New-AzureVMConfig -Name $vmname -ImageName $img –InstanceSize Small | Set-AzureSubnet –SubnetNames $sub | Set-AzureStaticVNetIP -IPAddress 10.1.61.140 | New-AzureVM –ServiceName $vmsvc1 –VNetName TestVNet
If you want to set a static IP address for a VM that you previously created, you can do so by using the following cmdlets. If you already set an IP address for the VM and you want to change it to a different IP address, you’ll need to remove the existing static IP address before running these cmdlets. See the instructions below to remove a static IP.
For this procedure, you’ll use the Update-AzureVM cmdlet. The Update-AzureVM cmdlet restarts the VM as part of the update process. The DIP that you specify will be assigned after the VM restarts. In this example, we set the IP address for VM2, which is located in cloud service StaticDemo.
Get-AzureVM -ServiceName StaticDemo -Name VM2 | Set-AzureStaticVNetIP -IPAddress 10.1.61.140 | Update-AzureVM
When you remove a static IP address from a VM, the VM will automatically receive a new DIP after the VM restarts as part of the update process. In the example below, we remove the static IP from VM2, which is located in cloud service StaticDemo.
Get-AzureVM -ServiceName StaticDemo -Name VM2 | Remove-AzureStaticVNetIP | Update-AzureVM
How to get a copy of root’s email or forward it to an smtp email address
We can edit the aliases file for the system and set our address as the destination for root. so you can edit /etc/aliases (or wherever the aliases file has gone) and look at the existing aliases. There is probably an entry for root (possibly commented out) that shows a fictitious user. Add an entry like:
root: your_id@your_email.address
and save the file. Run the newaliases command and all mail to root will go to you.
Example:
# cat /etc/aliases
# @(#)87 1.3 src/bos/usr/sbin/sendmail/aliases, cmdsend, bos530 6/15/90 23:21:43
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# bos530 src/bos/usr/sbin/sendmail/aliases 1.3
#
# Licensed Materials – Property of IBM
#
# (C) COPYRIGHT International Business Machines Corp. 1985,1989
# All Rights Reserved
#
# US Government Users Restricted Rights – Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
# IBM_PROLOG_END_TAG
#
# COMPONENT_NAME: CMDSEND aliases
#
# FUNCTIONS:
#
# ORIGINS: 10 26 27
#
# (C) COPYRIGHT International Business Machines Corp. 1985, 1989
# All Rights Reserved
# Licensed Materials – Property of IBM
#
# US Government Users Restricted Rights – Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
##
# Aliases in this file will NOT be expanded in the header from
# Mail, but WILL be visible over networks or from /bin/bellmail.
#
# >>>>>>>>>> The command “sendmail -bi” must be run after
# >> NOTE >> this file is updated for any changes to
# >>>>>>>>>> affect sendmail operation.
##
# Alias for mailer daemon
MAILER-DAEMON:root
# Following alias is required by the new mail protocol, RFC 822
postmaster:root
# Aliases to handle mail to msgs and news
nobody: /dev/null
# Alias to which SSA related warnings are mailed
ssa_adm: root
root:Unix-Support@123software.com
#
Unix Sort by IP Address
[root@sunx4150 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
10.1.50.101 sunx4150.xyz.com localhost.localdomain localhost
127.0.0.1 sunx4150.xyz.com localhost.localdomain localhost
10.0.51.50 T5220 T5220.xyz.com
10.0.50.36 ibmaix ibmaix.xyz.com
10.0.50.9 bucnodc01.xyz.com
10.0.50.36 ibmaix.xyz.com ibmaix
10.1.50.106 ibmcl03.xyz.com ibmcl03
10.1.51.83 nnl106.xyz.com
10.1.50.134 dbcimb01
10.0.2.20 bkonetapp1
10.112.2.101 spblrdc010
10.0.2.11 bpelapp1
[root@sunx4150 ~]#
[root@sunx4150 ~]#
[root@sunx4150 ~]# sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
10.0.2.11 bpelapp1
10.0.2.20 bkonetapp1
10.0.50.9 bucnodc01.xyz.com
10.0.50.36 ibmaix ibmaix.xyz.com
10.0.50.36 ibmaix.xyz.com ibmaix
10.0.51.50 T5220 T5220.xyz.com
10.1.50.101 sunx4150.xyz.com localhost.localdomain localhost
10.1.50.106 ibmcl03.xyz.com ibmcl03
10.1.50.134 dbcimb01
10.1.51.83 nnl106.xyz.com
10.112.2.101 spblrdc010
127.0.0.1 sunx4150.xyz.com localhost.localdomain localhost
[root@sunx4150 ~]#
[root@sunx4150 ~]#
[root@sunx4150 ~]# sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n /etc/hosts | awk '$1!~/:/ &&
!/^$/ && !/^#/’
10.0.2.11 bpelapp1
10.0.2.20 bkonetapp1
10.0.50.9 bucnodc01.xyz.com
10.0.50.36 ibmaix ibmaix.xyz.com
10.0.50.36 ibmaix.xyz.com ibmaix
10.0.51.50 T5220 T5220.xyz.com
10.1.50.101 sunx4150.xyz.com localhost.localdomain localhost
10.1.50.106 ibmcl03.xyz.com ibmcl03
10.1.50.134 dbcimb01
10.1.51.83 nnl106.xyz.com
10.112.2.101 spblrdc010
127.0.0.1 sunx4150.xyz.com localhost.localdomain localhost
[root@sunx4150 ~]# sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n /etc/hosts | awk '$1!~/:/ && !/^$/ && !/^#/ && !/localhost/'
10.0.2.11 bpelapp1
10.0.2.20 bkonetapp1
10.0.50.9 bucnodc01.xyz.com
10.0.50.36 ibmaix ibmaix.xyz.com
10.0.50.36 ibmaix.xyz.com ibmaix
10.0.51.50 T5220 T5220.xyz.com
10.1.50.106 ibmcl03.xyz.com ibmcl03
10.1.50.134 dbcimb01
10.1.51.83 nnl106.xyz.com
10.112.2.101 spblrdc010
[root@sunx4150 ~]#