Setting up an Android device under Linux for development, without root
Date : March 29 2020, 07:55 AM
it should still fix some issue I dont think you need root access for adb. Though for the device to be detected, AFAIK you need to add device details in rules.d . If you have device and the computer on the same network, you could use adb over wifi. But to put the device in tcp mode , you need root access on phone or another computer where device can be detected.
|
c program for linux, to get a serial number of the device, for a non-root user
Tag : cpp , By : user123284
Date : March 29 2020, 07:55 AM
it fixes the issue Why don't you use the MAC address as unique computer id. Here is the code to get MAC address of one of the interface. The code below basically reads name of all the available interfaces and then loops through them to get the MAC address of the first one excluding the loopback interface. int main()
{
struct ifreq ifr;
struct ifconf ifc;
char buf[1024];
int success = 0;
int sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
if (sock == -1) { /* handle error*/ };
ifc.ifc_len = sizeof(buf);
ifc.ifc_buf = buf;
if (ioctl(sock, SIOCGIFCONF, &ifc) == -1) { /* handle error */ }
struct ifreq* it = ifc.ifc_req;
const struct ifreq* const end = it + (ifc.ifc_len / sizeof(struct ifreq));
for (; it != end; ++it) {
strcpy(ifr.ifr_name, it->ifr_name);
if (ioctl(sock, SIOCGIFFLAGS, &ifr) == 0) {
if (! (ifr.ifr_flags & IFF_LOOPBACK)) { // don't count loopback
if (ioctl(sock, SIOCGIFHWADDR, &ifr) == 0) {
success = 1;
break;
}
}
}
else { /* handle error */ }
}
unsigned char mac_address[6];
if (success) memcpy(mac_address, ifr.ifr_hwaddr.sa_data, 6);
}
|
Unable to log in as root in Oracle Linux Docker container
Date : March 29 2020, 07:55 AM
around this issue I am trying to edit some files in a docker container using docker exec -it container_Id bash , docker exec supports a -u / --user option: docker exec -it -u root MS1 bash
|
Getting exclusive access to a tty device from a root program on Linux
Date : March 29 2020, 07:55 AM
|
pjsip new-call error ... Unable to find default audio device (PJMEDIA_EAUD_NODEFDEV)
Tag : cpp , By : francisco santos
Date : March 29 2020, 07:55 AM
|