device

Detect if interface is in promiscuous mode with C

孤街浪徒 提交于 2019-12-06 07:59:27
问题 I am doing a different tools to check security of linux servers... nothing important and very similar to the tools of chkrootkit. One of the tools I want to do, is like the ifpromisc.c from chkrootkit, that is detect if one of the server interfaces is in promiscuous mode. I found an answer on stackoverflow: howto check a network devices status in C? But after check this solution, I noticed is only for old kernels, because new libpcap doesn't set IFF_PROMISC flag when uses PACKET_MR_PROMISC. I

How bind socket to device in windows?

馋奶兔 提交于 2019-12-06 07:27:53
问题 I have same network cards in computer. All cards has identical IP. I need to bind socket to specific card. In linux I can use flag SO_BINDTODEVICE. How I can do this in windows. P.S. This needed for UDP sockets. 回答1: I answered a similar question here: Using a specific network interface for a socket in windows AFIK: in Windows XP and Windows Server 2003 IP4 I believe you can't, but for IP6 you can. And for Windows Vista and Windows 2008 you can (except for certain circumstances). Hope that

Drawables for qHD resolution

好久不见. 提交于 2019-12-06 05:36:37
I'm designing a game possibly for all kinds of Android devices, so I have multiple drawable folders for phones of different resolutions, and for tablets. Here is the list of my folders: drawable-mdpi - for 480x320 devices drawable-hdpi - for 800x480 and 854x480 devices drawable-large-hdpi - for 1024x600 tablets drawable-xlarge-mdpi - for 1200x800 tablets My question is what name should have a folder with drawables for qHD resolution, which is 960x540 and 256 dpi? Thanks in advance. I will deeply, strongly, emphatically encourage you not to use "-large" or "-xlarge" qualifiers with drawables.

How to get device type from MAC or IP address?

可紊 提交于 2019-12-06 03:07:12
I am making a Device Discovery windows application in C#. Is this possible to know the device type if I have MAC address or IP address? device type means either it is computer or router or mobile or any other device? Note: HostName entry is not useful for it because Host Name is defined by User. for example i may assign "Nokia N70" name to my computer. Thanks in anticipation. You can get the manufacturer from the MAC address. In order to get any more information you'd need to do a port scan to do a 'fingerprint' of the device in question. Application such as NMAP use this approach. Non-spoofed

How to get OS version and Device Name of an Android device connected via USB with C#.net (VS2010/4.0+)?

一笑奈何 提交于 2019-12-06 02:24:59
I want to build a windows application in C#.net which should identify the installed Adroid OS version (e.g. 4.0) and user friendly Device Name (e.g. Samsung Galaxy S3, Samsung Galaxy Tab 8.9 etc.) when you connect an Android device to your computer via USB. I tried with the System.Management class to identify the connected USB devices on my machine, however, the problems I had were: I just have 3 USB ports and connected the Samsung Galaxy Tab 8.9 on one of the USB ports and tried to get the list of USB devices using USBhub WMI class and I got around 6-7 results in the list including the

GPIO on Beaglebone Black

a 夏天 提交于 2019-12-05 20:49:11
I'm currently stuck on a problem with GPIO pins with the Beaglebone black. I am looking for a proper way to read the values from GPIO pin p8_4 in C. I tried to use a library which used an old not supported way from the time before device tree's where introduced, if I understand this correctly. I tried to find other solutions to my problem but I can't seem to find one. Is there anyone who can get me on the right track in C? Here is a C code: #include <stdio.h> int main() { FILE *io,*iodir,*ioval; io = fopen("/sys/class/gpio/export", "w"); fseek(io,0,SEEK_SET); fprintf(io,"%d",39); fflush(io);

iOS USB HID programming

邮差的信 提交于 2019-12-05 19:15:42
I am trying to make some code regarding USB HID devices. I have found an article about Bluetooth programming which uses Game Kit Framework . Now I'm looking for some tutorial or maybe some code to work on connecting HID device via USB. Where should I look? Is Game Kit the right way? Is it difficult to implement communication between iOS and HID device? You can use IOKit for USB, but it's a private framework on iOS - so it depends if you want to deploy to the App Store. Here is the USB Intro for Mac , I'm not sure if it's the same on iOS - but just to get the idea. Actually I just found out

Detect the device is shutting down?

删除回忆录丶 提交于 2019-12-05 17:20:36
In my android application i need to do some action if the device is turning off suddenly. Is there any way to detect the device is shutting down? Triode Broadcast Action: Device is shutting down. This is broadcast when the device is being shut down (completely turned off, not sleeping). Once the broadcast is complete, the final shutdown will proceed and all unsaved data lost. Apps will not normally need to handle this, since the foreground activity will be paused as well. This is a protected intent that can only be sent by the system. May include the following extras: EXTRA_SHUTDOWN_USERSPACE

Calculate PPI of Android Device

对着背影说爱祢 提交于 2019-12-05 17:07:54
问题 How do I calculate PPI of Android device. Most specifically Android Tablets. Take a Note that I want to calculate PPI of the device and not DPI. 回答1: It's easy like one-two-three =) Let's caculate PPI to Nexus 5 , for example. float LCD_Diagonal = 4.95f; int screenHeightPx = 1920; int screenWidthPx = 1080; float PPI = (float)Math.sqrt((double)(screenWidthPx*screenWidthPx + screenHeightPx*screenHeightPx))/LCD_Diagonal; Log.e(TAG, "display_page_screen_ppi: " + String.format(Locale.getDefault(),

How to remove device from apple developer account while resetting device list

偶尔善良 提交于 2019-12-05 12:25:17
We have already reached to iPhone device limit so we are not able to add new iPhone to our developer accounts device list. We have renewed our membership for our apple's developer account. and it is asking us to reset our device list. but when we proceed to reset device list, but we are not able to remove device from device list. but on next page it is not changing the count of no of devices able to register So it is confusing for me will it remove the deselected devices and let me add new devices instead of them or the it will just disable them. I'm about to go through same process. The page