How to get the vendor information of my NIC on top of Ubuntu? I wanna get its vendor, type and things like that? Any shell commands available? Thanks in advance.
Try something like this -
sudo lshw -C network
OR
sudo ethtool -i eth0
Related
What syscalls i can use that get information about OS Linux? I new in assembler. I write code on nasm.
I have to get the most detailed information about the OS type, version and other information. I know that there is some information in the system files, but I do not understand how to get this information using system calls.
You can use command dmidecode with option --type to see info that you want.
Example:
To see Memory info, run one of these commands:
sudo dmidecode --type "Memory"
sudo dmidecode --type 17
To see System Info, run one of these commands:
sudo dmidecode --type 1
sudo dmidecode --type "System"
If you only want to see OS info, run lsb_release -a
See more option about dmidecode type here.
I want to clear the arp cache in Linux, and I have tried to do it with
IP -s -s neigh flush all And also with arp -d <specific IP address>
Both of them does not work...
Check where is your arp binary located:
$ which arp
/usr/sbin/arp
The sbin proposes that the binary is intended to be run by superuser. IT touches things that you don't want to give normal users to touch, as described in manual page:
arp -d address
will delete a ARP table entry. Root or netadmin priveledge is required to do this. The entry is found by IP address. If a hostname is given, it will be resolved before looking up the entry in the ARP table.
You need to run it as a root, for example using sudo should work for you:
sudo arp -d <specific IP address>
I need to ssh to the server, remove the original network driver and insert a new one, but after I remove the original one, the connection will lose.
Is there any way to do it without losing connection.
The thing I want to do is:
$ ssh user#server
$ sudo rmmod igb
$ sudo insmod ./igb.ko
P.S., igb is the driver for one of Intel ethernet network card.
Thanks in advance.
Check this:
$ ssh user#server
$ sudo rmmod igb; sudo insmod ./igb.ko
Here the SSH server in the server will receive both the both commands even before executing the first command.
What is the best-practiced way to get an unique machine ID in GNU/Linux for i386 architecture?
Are there any good ways except the mac address?
Depending on your kernel, the DMI information may be available via sysfs.
Try those:
# cat /sys/class/dmi/id/board_serial
xxxxxxxxxxxxxxx
# cat /sys/class/dmi/id/product_uuid
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
or using a tool
# dmidecode -s baseboard-serial-number
...
# dmidecode -s system-uuid
...
On modern machines with systemd: machine id is created by systemd-machine-id-setup. The location of machine id is documented - in freedesktop machine-id and man machine-id and machine id has a more standardized format - see RFC4122. Just:
cat /etc/machine-id
You can use lshal. This needs hal (apt-get install hal or yum install hal) to be installed first. This way you can access all the info of dmidecode without root permissions.
A non-root equivalent of
# dmidecode | grep -i uuid
will be
$ lshal |grep -i system.hardware.uuid
And similarly other info as per your needs.
A simple and portable way of computing your own sysid may be to serialize uname(), gethostid() and some inodes like /home or your application homedir (obtained with stat()) etc. in a string and hash It.
I am trying to run kannel bearer box but i got error something like could not write/read device. I think kannel doest have permission to read/write bluetooth device /dev/rfcomm0
Thanks for reading. Any help would be appreciated.
with root account do
chmod a+rw /dev/rfcomm0
If you know which program is generating the error message, run the program with strace and see which system call yields the error. If it's open, then the chmod solution recommended by Francis should do the trick. If it's read or write, then you should investigate further: is there a problem in the kernel or the appication code.
Permission to access the bluetooth device can be added by checking the device file group using ls -h and adding current user to that group with following command:
sudo usermod -a -G <rfcomm0 group> $USER