Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
tsinghua said:In Linux, hostid is the MAC of NIC.
You can change it using ifconfig.
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
BigBoss said:If we could change the hostid of a computer,we can also use a existing license file that is created for another machine ?? So, we change the hostid of our computer and borrow a license file of another machine ???
I don't think so easy..
Pigi_102 said:take a look at:
and exactly where it states:
#include <stdio.h>
#include <unistd.h>
int main() {
long id,res;
// get real (default) hostid
id = gethostid();
printf("current hostid is: %x\n",id);
// set new hostid if is superuser
res = sethostid(0x11223344);
if (res == 0) printf("if result is zero - success! (%d) \n",res);
// check if it is changed....
id = gethostid();
printf("current hostid is: %x ;-PPPppppp\n",id);
}
HTH
Pigi
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
int main(int argc, char *argv[]) {
int base, status;
char *str, *endptr;
long id;
if(argc < 2) {
fprintf(stderr, "Usage: %s hostid [base]\n", argv[0]);
exit(EXIT_FAILURE);
}
str = argv[1];
base = (argc > 2) ? atoi(argv[2]) : 16;
errno = 0;
id = strtol(str, &endptr, base);
if ((errno == ERANGE && (id == LONG_MAX || id == LONG_MIN)) || (errno != 0 && id == 0)) {
perror("strtol");
exit(EXIT_FAILURE);
}
if (endptr == str) {
fprintf(stderr, "No digits were found\n");
exit(EXIT_FAILURE);
}
status = sethostid(id);
if(status == 0) fprintf(stdout, "Host id changed to 0x%x\n", id);
else {
perror("sethostid");
exit(EXIT_FAILURE);
}
return 0;
}