How to Save Images from A Program Ran from Ubuntu Application Start-up Command - linux

We're trying to run a program at start with Ubuntu's Application Start-up command. We're successfully starting the camera and viewing the images. But the images are not saving to the folder we expect them to be saved too.
The program works flawlessly when started manually from the terminal. Saving into the appropriate folder.
Does anyone have any idea of how to get the images saved but when started from the Application Start-up command upon start-up?
Thanks.

You're not providing a whole lot of details, so my answer may be totally off. To me it sounds like you've created an app that takes a picture with the webcam and saves it to disk. Now you want the app run it when the user logs in, so you've added your app to the list of Startup Applications. The app starts, takes a picture, but can't write it do disk. If that's the case, I'd consider:
Try adding debug logging to your app, so you can see why it fails opening the file. What ever language this app is written in, if opening a file fails, the API will tell you. This information is vital. The easiest is to print to stdout and then, when starting the app, forward it to a log .e.g. /usr/local/bin/myapp &>> /tmp/myapp.log.
Try writing to a location like /tmp where permissions aren't that much of an issue.
Try adding a delay before starting the app, see this list of various approaches on how to do this, the most simple being using this a the command: sleep 10 ; /usr/local/bin/myapp &>> /tmp/myapp.log
If this is all rubbish you need to add more details in your question.

Related

Python Plotly's Dash: How do you shut the web app running on a port or make changes to it? CTRL+C doesn't seem to be working

Am using Plotly's Dash and trying to run the sample app code which they have provided here: https://plot.ly/dash/getting-started#dash-app-layout
Am having trouble with the ports. The code on being run shows this in the console:
However , even after making changes to the code, the output in the web app shows no change.
Basically, when I'm implementing a different code: the web app continues to display the output from the previous run!
The CTRL+C doesn't seem to help and doesn't really quit or cause any change to the application. Please let me know what shall help.
I ran the new code using a new port(8049) and that worked but doesn't solve the initial basic issue!
I've had the same issues, and find that a full restart of the app is necessary to get some changes to propagate in the app after a file update.
In POSIX, you could run sudo killall python or similar. Looks like you're running Windows, so taskmanager or taskkill /F /IM python.exe.
The [1]: Looks like a Jupyter kernel is running? If so, try restarting the kernel.
For me CTRL+C doesn't work either, but CTRL+Pause/Break button stops execution.

How to avoid restarting server every time I need to make a React change?

I'm having an issue in my React environment where I must restart ('npm start') my server every time I want to view an update in the browser. Others seem to be able to simply refresh the browser without the need to restart their servers.
For instance, if I make an update in one of the React Components I can't simply refresh the web page, I have to restart the entire server.
Any suggestions how to fix this issue so I don't need to restart every time?
This problem was fixed once I moved my application out of my Dropbox directory.
Once I moved the application out of the Dropbox directory I no longer needed to manually restart the server when I made any edit to a React component. Note that the application does work just fine and auto-refresh using Google Drive
(linked to the cloud) or a general non-cloud linked folder on my HD.
I was getting the same problem using Visual Studio Code. When I made changes nothing was showing up. VC gave me a hint by saying
"Visual Studio Code is unable to watch for file changes in this large workspace"
so I found these instructions which solved the problem. Could be related.
When you see this notification, it indicates that the VS Code file watcher is running out of handles because the workspace is large and contains many files. The current limit can be viewed by running:
cat /proc/sys/fs/inotify/max_user_watches
The limit can be increased to its maximum by editing /etc/sysctl.conf and adding this line to the end of the file:
fs.inotify.max_user_watches=524288
The new value can then be loaded in by running sudo sysctl -p. Note that Arch Linux works a little differently, See Increasing the amount of inotify watchers for details.
Check out Create-React-App by Facebook. It has all the essential tools you'll need when developing React apps.
I use a combination of Webpack to bundle the js code and Nodemon for server restart. They both have watch functionality so they can watch the code to see if anything has changed.
Seems to be an norm from my research.

Pass Node.js commands while running the file

I'm building a small application that will be running 24/7. I need to be able to give the app Node.js's commands from the console.
Currently, if i want to give an additional command to the app i have to edit it's files, kill it then start it again. I want to start it once and be able to run commands from the console.

Getting detailed crash dumps from a hooked exe

I am trying find a problem with my program that is hooking into a game. This is
vc++. Basically I launch the program and then hook into it using SDL. When I run the code from VS2010, all works fine. But when I try to run from command prompt, my program can launch the game, but after that the game crashes immediately.
I was viewing windows event logs, and it appears that there is an access violation. 0xc000005
How can I log any further details about the program that crashes? I tried "procdump" but that is not useful as I cannot INDIRECTLY target the hooked game from console. Rather it can only target my application that hooks.
Anyway of getting detailed dumps is highly appreciated in this case.
Thanks!
You can perform postmortem debugging by using a combination of the WER registry keys/values to trap any dump that is produced. I’ve used this method to prevent the WER system from collecting the dump file (.dmp). I’ve also written about this in another similar post. To accomplish this, you will need to create a registry key under
Software\Microsoft\Windows\Windows Error Reporting
if one does not already exist. The key should be
LocalDumps\your application.exe
Once that’s done, modify these keys/values to meet your needs:
DumpCount, DumpFolder, DumpType
You’ll need Administrator rights to create and modify the keys, and, you should reset everything you’ve modified when you’re done debugging.

Same program behaves differently in different consoles

I wrote a text mode batch C++ program that since today is giving me some troubles.
The executable worked correctly and it did not change.
The environment did not change; not even a reboot.
When I launch the program from a certain console, everything is fine.
When I launch the program from a new console, everything still works, but I get just the first two lines on the log file, even if the execution completes.
The parameters passed to the executable are the same.
The executable does not interact with the console in any way.
The two consoles' environment variables are the same.
When run from a remote computer as root, everything is fine, the log file is complete.
When logged in again with my user, from another session, everything is fine again.
When logging out and in again, everything is fine again.
So, could it be the from a certain instant on, the new consoles had some issues that caused this problem?
Could this be a problem of my Linux installation?
Or, more realistically, could the problem depend on my program?
Thank you!
Environment:
- Linux OpenSuse 11.4
- gcc 4.5.1
Here is another tool to throw into your debugging toolbox.
Try the command 'reset' -- read the man page for details.
In short, it resets the console to a known state. It is ... possible that your log files may contain control characters that try to interact with tty causing hard-to-trace problems.
You might also want to look at the command 'script' which captures all console activity to at et file for examination.

Resources