Notify Raspberry when a new device is connected (USB,SPI,I2C...) - raspberry-pi

What i´m trying to do is: having a daemon running in the background that notify when a new "wired" device is connected to the raspberry.
Can anyone help me?
Thanks all!

You can check udev. It's possible to write an udev rule to achieve the behavior. In that way you don't even have to write a daemon.

Related

How can I fix the problem which My substrate node server is been stopped after few hours automatically?

Everyone.
Please help me.
When I run my substrate node server by running this command "./target/release/node-template --dev --ws-external --rpc-external", server works well and start generating blocks first.
But after few hours, my server is been stopped and also stopped generating blocks automatically.
How can I solve this problem?
Here is Terminal Error.
enter image description here
Best Regards.

Killing terminal before running task

I have defined two tasks in VS code (flash, monitor) that uses same COM port.
I would like to automaticaly kill monitor task (terminal), before running flash task.
How can I do this ?
Regards,
Boris Makovecki
Not sure if that's possible, but you might be able to run them both in same terminal using make flash monitor?

Network interface needs to be manually started

I have a CentOS 6.3 machine that when rebooting does not bring up its network interface.
I have to manually connect it via the GUI each and every time by choosing 'System eth0':
Please let me know how I can fix this!
Thanks a million,
Dan
Changing line in
/etc/sysconfig/network-scripts/ifcfg-eth0
from
ONBOOT=no
to
ONBOOT=yes
Fixed this
After I reboot the CentOS 6.4, the network interface is not getting the IP, also when I try to start or restart network service nothing happened.
I used system-config-network tools, and compare the config files, it adds below lines to the end, and after reboot it's OK.
IPV6INIT=no
USERCTL=no
before I have below configurations, but it's not working.
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
I hope this helps.

Disable force stop option for a service or an activity

I have a requirement to create a service that cannot be stopped by end user.
If the OS kills it, it is fine.
I have seen some processes that I am not able to quit. I need help on how this is possible.
For example, if i launch a 2.3 emulator and check the running services, one of the service - Japanese IME input does not a contain a stop option.
I cannot stop this service. Similarly with Swype. How is it possible to create such a service.
Thanks in advance.

SNMP traps not caught in Windows XP

I have an SNMP client, sending my PC SNMP traps with destination port 162.
I run a sniffer (Wireshark) from my PC, and see that the traps are indeed received.
The SNMP.exe and SNMPTRAP.exe system processes are up and running (I've even restarted them),and SNMPTRAP.exe is listening to port 162. I have no activated firewall (whether Windows or 3rd party).
The problem: On my PC I have three different applications, all registered to SNMPTRAP.exe. These are all off-the-shelf sw, not something I wrote. MG-SOFT Trap Ringer is, f.e., one of
them. NONE OF THEM CATCHES ANY OF THE TRAPS, and I have no idea where exactly the failure is.
Do you have any idea what may be causing this? Or how, perhaps, I can debug the SNMPTRAP.exe process?
Thanks!
You may disable Microsoft Trap Service in Services panel. Then MG-SOFT TRAP Ringer will work.
The reason is simply that when Microsoft's SnmpTrap.exe monitors port 162, it prevents other applications, such as MG-SOFT's one from monitoring that port.
How you can eliminate and corner the problem is, try below stuff.
How are sure its not catching traps ( since u see them in wireshark). I mean, should they be displayed on some GUI Screen, if yes are the fields empty? or logged into some file, if yes are you sure you are checking the correct file, have you configured either through conf files or command line options which file the traps need to be logged in?
If step 1 does not work, try installing or configuring the whole setup on different pc /laptop and see if it works?
If step 2 does not work, try a different trap daemon program ( SNMPTRAP.EXE), plenty of open source programs exist, if you could capture with different daemon program, then some issue with SNMPTRAP.EXE you are using.
I'm sure one of these steps should work for you, if not get back :)