The code that gets the native IP address under Linux, the return value is the Internet standard dot-format string.#defineEth_name "Eth0"//get the native IP addressChar*getlocaladdress () {intsock; structsockaddr_in sin; structIfreq IFR; Sock= Socket (Af_inet, SOCK_DGRAM,0); if(Sock = =-1) {perror ("Socket"); returnNULL; } strncpy (Ifr.ifr_name, Eth_name, I
Get native IP (for Linux systems)/*** @desc get native IP (for Linux systems) * @return ip*/public static string Getlocalip () {String Ip = ""; try {Enumer ationGet the native IP (for Linux systems)
Introduction: In the current method of acquiring IP, the ifconfig and IP get functions are all intranet IP. Sometimes the need to obtain an external IP, the current practice is to send requests to external servers to resolve the external server response, resulting in their own external network IP. Curl under Linux can do the work for us, of course, not afraid of trouble, you can analyze the HTTP protocol yourself, to achieve the above process. If you'
the application boots to sampling (s)GCT: GC Total time from Application boot to sample (s)NGCMN: initial (minimum) size in Young generation (bytes)NGCMX: Max capacity of young generation (bytes)NGC: Current capacity in young generation (bytes)The size (in bytes) of the initialization (minimum) in ogcmn:old generationMaximum capacity of the Ogcmx:old generation (bytes)The current newly generated capacity of the Ogc:old generation (bytes)The size (in bytes) of the initialization (minimum) in pgc
This example summarizes Python's approach to obtaining native local IP addresses under Windows and Linux. Share to everyone for your reference. The specific analysis is as follows:
Python socket contains a wealth of functions and methods to obtain the IP address information of the machine, the gethostbyname method of the socket object can obtain the native IP ad
The hosts is a system file with no extension,The function is to map the host name to the corresponding IP address.When the user executes a ping command (such as Ping www.abc.com), the system will first automatically look for the IP address of the www.abc.com from the hosts file.Once found, the system will immediately ping the corresponding IP, or the system will submit the DNS domain name resolution server for IP address resolution.For quick and easy connection, you can record the domain name an
There may be multiple network adapters including virtual network cards that need to be excludedString IP = "";Try{Enumerationnetworkinterface.getnetworkinterfaces ();//Get multiple network cards while(E1.hasmoreelements ()) {NetworkInterface ni=(NetworkInterface) e1.nextelement (); if(("eth0"). Equals (Ni.getname ()) | | ("Ens33"). Equals (Ni.getname ())) {//Take "eth0" and "Ens33" two NICs enumerationni.getinetaddresses (); while(E2.hasmoreelements ()) {inetaddress ia=(inetaddress) e2.nextelem
Modify native IP address The
first way:
Setup
1) Select "Network Configuration"
2) Select "Device Configuration"
3) Select "First network card"
4) set up details such as IP address
5) service Network restart (must have) the second way
Modify User name
Install the following figure to modify it
Modify Host name Linux View host name
[ROOT@LINUX_EPM2 ~]# hostname Modify Network File
Th
, All CPUs will immediately enter exception handling, without any delay and wait. This CPU is busy waiting until the process of exception processing is called the CPU collection
On native Linux, MCE's file is arch/x86/kernel/cpu/mcheck/mce.c.
The core processing function is: Do_machine_check, this is the handler function for int 18
Mce_start is invoked in Do_machine_check to perform a collection of CPUs
I
Label:Yesterday the power outage, this morning after the discovery of web anomalies, up to open Nginx, PHP-FPM, MySQL, etc., found that the request found abnormal ~ Nginx error log prompt *82 FastCGI sent in stderr: ' Primary script unknown ' while reading response headers from upstream Memcache's request is also abnormal PHP notice:memcachepool::get (): Server 192.168.17.145 (TCP 11211, UDP 0) failed with:permission denied (13) MySQL request prompt Permissions Issues ~ ~ ~ Confused, before the
Environment:
Windows XP + VMware + RedHat (UBUNTU)
Note: The environment described in this article is also the development environment of Android native C (JNI ).
1. First download a cross-compilation tool chain version
Http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3057 select the latest version to enter the download page, select the ia32 GNU/Linux compiler for Advanced packages
2,
Method Two/sbin/ifconfig-a|grep inet|grep-v 127.0.0.1|grep-v Inet6|awk ' {print $} ' |tr-d ' addr: 'Method OneGet the native IP address and save it in a variablearg=ifconfig eth0 |grep "inet addr"| cut -f 2 -d ":"|cut -f 1 -d " " Ipaddr=
a r g e c h o
IpaddThis assumes that your interface name is eth0, it is possible that your interface is not this, you need to change it.Introduction to cut Parameters-D is used to define the del
was closed with this command, and the command was found to be unavailable, and it was later found that the command was seldom used, and that there were other commands to replace it, and found the UFW command.Install First: sudo apt-get install UFW disable firewall: sudo ufw disableView status: sudo UFW status22 ports allowed: sudo UFW allow 22After you have done the above steps, try connecting againFound still unable to connect, and began to find information on the Internet. The discovery could
1 #!/usr/bin/env python2 #Encoding:utf-83 #description:get Local IP address4 5 ImportOS6 Importsocket, fcntl, struct7 8 defget_ip ():9 #Note that the perimeter uses double quotation marks instead of single quotes, and assumes that the default is the first network card, and that special circumstances should modify the code appropriatelyTenout = Os.popen ("ifconfig | grep ' inet addr: ' | grep-v ' 127.0.0.1 ' | cut-d:-f2 | awk ' {print $} ' | Head-1"). Read () One Print out A - #ano
In the Linux system we usually install a service after it is very distressed, the software is not aware of their own installation of those software and services.Here's how to view installed packages in LinuxRpm-qa can view all installed packagesRpm-qa | grep + Software's nameFor example:To see what files are in the software packageRPM-QL + software NameRPM-QL Perl-json-2.59-2.el7.noarchFor exampleLinux version 7 about viewing
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.