Beaglebone black ( Debian Image 2014-05-14) goes to sleep after 10 minutes - ssh

As the title say it the board goes to sleep after 10 minutes. All I want is to SSH into the board (no keyboard/mouse or monitor attached). After googling for a good period of time all I found are some settings for X (Gui) I have also try the following command:
setterm -blank 0 -powersave off -append
It gives me the following error
setterm: cannot (un)set powersave mode: Inappropriate ioctl for device
How can I fiddle or completely disable this power management. I am pretty sure is not a scheduled task or a process but rather the kernel itself and a setting I couldn't found.
Thanks in advance!

I'm not entirely sure, but if your /sys/power/state file has a state, i.e. some string is returned, try echo -n /sys/power/state to make the file blank.

In my case I left the instalation SD inserted into the board. It wasnt power management but rather the disto linux would install over and over again - therefore the approx 10 minutes interval.
I am pretty sure the answer with the PM settings file is correct however it wasn't my case.
Regards,
DAN

Related

Cannot extract jester dataset in windows 10

I know that this topic already appears in other posts but I'm not able to solve it and your help would be very much appreciated.
I'm trying to extract the Jester V1 Hand Gesture Recognition dataset but, when you download it, it comes in a very strange format. I've tried the command cat 20bn-jester-v1-?? | tar zx in the Windows Powershell which made my computer run something (don't know what) for several hours (I know that it was running because my computer was slow) but nothing changed in the file. And in the command line (this second option gave me an error). I've also tried to extract them with 7zip and was able to extract the first file but I couldn't accomplish it with the rest.
Please help, I'm using Windows 10 and have already installed 7zip and here's a screenshot of the files.
Thank you so much!
This page says to cat 20bn-jester-v1-?? | tar zx to extract the videos. However it also says that those 23 pieces are about 1 GB each. Your screen shot shows them as less than 1 MB each. Perhaps something went wrong further upstream.
A solution that I found to this problem is to install the Linux terminal on windows with ubuntu.

inittab respawn of Node.js too fast

So I am trying to keep my Node server on a embedded computer running when it is out in the field. This lead me to leveraging inittab's respawn action. Here is the file I added to inittab:
node:5:respawn:node /path/to/node/files &
I know for a fact that when I startup this node application from command line, it does not get to the bottom of the main body and console.log "done" until a good 2-3 seconds after I issue the command.
So I feel like in that 2-3 second window the OS just keeps firing off respawns of the node app. I see in the error logs too in fact that the kernel ends up killing off a bunch of node processes because its running out of memory and stuff... plus I do get the 'node' process respawning too fast will suspend for 5 minutes message too.
I tried wrapping this in a script, dint work. I know I can use crontab but thats every minute... am I doing something wrong? or should I have a different approach all together?
Any and all advice is welcome!
TIA
Surely too late for you, but in case someone else finds such a problem: try removing the & from the command invocation.
What happens is that when the command goes to the background (thanks to the &), the parent (init) sees that it exited, and respawns it. Result: a storm of new instantations of your command.
Worse, you mention embedded, so I guess you are using busybox, whose init won't rate-limit the respawning - as would other implementations. So the respawning will only end when the system is out of memory.
inittab is overkill for this. I found out what I need is a process monitor. I found one that is lightweight and effective; it has some good reports of working great out in the field. http://en.wikipedia.org/wiki/Process_control_daemon
Using this would entail configuring this daemon to start and monitor your Node.js application for you.
That is a solution that works from the OS side.
Another way to do it is as follows. So if you are trying to keep Node.js running like I was, there are several modules written meant to keep other Node.js apps running. To mention a couple there are forever and respawn. I chose to use respawn.
This method entails starting one app written in Node.js that uses the respawn module to start and monitor the actual Node.js app you were interested in keeping running anyway.
Of course the downside of this is that if the Node.js engine (V8) goes down altogether then both your monitoring and monitored process will go down with it :-(. But its better than nothing!
PCD would be the ideal option. It would go down probably only if the OS goes down, and if the OS goes down then hope fully one has a watchdog in place to reboot the device/hardware.
Niko

WebSphere on AIX not taking system time

I have WebSphere 8 running on AIX and am currently experimenting with date simulation. For this purpose I use a software package called Time Machine from SolutionSoft.
The idea with Time Machine is that it replaces the system time API so that a user can specify any date, a frozen date and even the cadence.
Now, this is all very well and AIX and for instance date and "touch -m" both work as expected. When it comes to WAS8 there is quite a different story.
From what I can tell keeps WAS picking up the real time and not the system time, and this is a bother as you can realise. I have not found a way to make WAS aware of the simulated time - I have tried restarting the WAS-processes to no avail.
Anybody know how the combination WAS/AIX is handling time and, more specifically, how I can persuade WAS to pick up the simulated time?
The answer is to first make Time Machine aware of the JRE that comes with WAS as this is not done automatically. This is done with the tminstall command:
tminstall -j <path to JVM directory>
Once done, it is possible to manipulate the WAS time using the tmuser command. For example
tmuser -a -u wasuser -x 122323592015
to set the time to almost midnight, the night before Christmas 2015.

Run script on Fedora screen lock

I'm looking for a way to run a program when locking the screen in Fedora 15 (linux). Basically I want to start running a motion detection program when the screen locks, or I manually hit Ctrl+Alt+L, but I don't know what commands are being run or where to alias my own intermediate step in. I assume it's:
gnome-screensaver-command --lock
but am not sure how to go about this. Anybody know how, or a direction to start looking in?
Edit, since link was in a comment:
This is done with dbus-monitor and described here.
The dbus system advertises screen locking; monitor for ActiveChanged on org.gnome.ScreenSaver. (see http://people.gnome.org/~mccann/gnome-screensaver/docs/gnome-screensaver.html )
e.g. (word-wrapped for clarity)
signal sender=:1.68 -> dest=(null destination)
serial=53 path=/org/gnome/ScreenSaver;
interface=org.gnome.ScreenSaver; member=ActiveChanged
boolean true
Unfortunately, this will require writing more code than just a shell script, I'm afraid; although I'd be curious if you could ask dbus to call your program as a handler for that signal, somehow; otherwise, I suppose you'd just start a daemon process and listen for that signal to be broadcast…

PHP script stops running arbitrarily with no errors

I have a PHP script that seemed to stop running after about 20 minutes.
To try to figure out why, I made a very simple script to see how long it would run without any complex code to confuse me.
I found that the same thing was happening with this simple infinite loop. At some point between 15 and 25 minutes of running, it stops without any message or error. The browser says "Done".
I've been over every single possible thing I could think of:
set_time_limit ( session.gc_maxlifetime in the php.ini)
memory_limit
max_execution_time
The point that the script is stopped is not consistent. Sometimes it will stop at 15 minutes, sometimes 22 minutes.
Please, any help would be greatly appreciated.
It is hosted on a 1and1 server. I contacted them and they don't provide support for bugs caused by developers.
At some point your browser times out and stops loading the page. If you want to test, open up the command line and run the code in there. The script should run indefinitely.
Have you considered just running the script from the command line, eg:
php script.php
and have the script flush out a message every so often that its still running:
<?php
while (true) {
doWork();
echo "still alive...";
flush();
}
in such cases, i turn on all the development settings in php.ini, of course on a development server. This display many more messages, including deprecation warnings.
In my experience of debugging long running php scripts, the most common cause was memory allocation failure (Fatal error: Allowed memory size of xxxx bytes exhausted...)
I think what you need to find out is the exact time that it stops (you can set an initial time and keep dumping out the current time minus initial). There is something on the server side that is stopping the file. Also, consider doing an ini_get to check to make sure the execution time is actually 0. If you want, set the time limit to 30 and then EVERY loop you make, continue setting at 30. Every time you call set_time_limit, the counter resets and this might allow you to bypass the actual limits. If this still isn't working, there is something on 1and1's servers that might kill the script.
Also, did you try the ignore_user_abort?
I appreciate everyone's comments. Especially James Hartig's, you were very helpful and sent me on the right path.
I still don't know what the problem was. I got it to run on the server with using SSH, just by using the exec() command as well as the ignore_user_abort(). But it would still time out.
So, I just had to break it into small pieces that will run for only about 2 minutes each, and use session variables/arrays to store where I left off.
I'm glad to be done with this fairly simple project now, and am supremely pissed at 1and1. Oh well...
I think this is caused by some process monitor killing off "zombie processes" in order to allow resources for other users.
Run the exec using "2>&1" to log anything including stderr.
In my output I managed to catch this:
...
script.sh: line 4: 15932 Killed php5-cli -d max_execution_time=0 -d memory_limit=128M myscript.php
So something (an external force, not PHP itself) is killing my process!
I use IdWebSpace which is excellent BTW but I think most shared hosting providers impose this resource/process control mechanism just to be sane.