How do I use "ros init" properly? - amazon-ec2

I have an app that works fine with Realm currently; I've got the ROS 2.0.18 running on an AWS EC2 instance, which started with a "blank" Ubuntu AMI onto which I installed/started ROS using, I believe, curl -s https://raw.githubusercontent.com/realm/realm-object-server/master/install.sh | bash. It's possible I started it with npm install -g realm-object-server; however I'm pretty positive I've never typed ros init, or any versions of ros init my-app, at any point in any process.
I'm preparing to integrate Google Authentication, and the ROS documentation says "To include the Google provider, create a Realm Object Server project via ros init" and then has some code.
I imagine this means I need to SSH into my server (which is already up and running for ROS) and enter ros init. And then put the code from the documentation in the window that I imagine will pop up.
But I don't really know anything about ros init or what an ros project actually is (or node or anything like that for that matter), so I'm a little trepidatious, and these questions come up:
Will ros init mess anything up that's currently on my server? Does it "initialize" or reset anything?
Assuming the answer to #1 is "no", what do I do once I've pasted the code into this file (assuming I'm correct about what to do wit the code)? Do I need to make my app or my ROS instance aware of it somehow?
Anything else I'm missing?
Thank you.

Related

How to make react native app communicate with local machine (ios)

I need to know ALL the things I need to do in order to allow a react native app communicate with a local server running on my mac. (I'm running react native on an ios device).
This is what I know of/have tried:
Using the actual IP address of my machine instead of localhost
Set up signing & capabilities in xcode
Make sure both the iphone and computer are on the same network
Make sure there are no firewalls up on the computer running the api
Set the info.plist to "AllowArbitraryLoads = true"
Here's my full info.plist if you want to check it
I have been trying to get this simple react native app to communicate with a bare-bones flask app on my computer for like a week now, and I'm starting to lose my mind.
Assume I'm a complete moron. If there's something that "everybody knows and isn't worth mentioning", please mention it. If I didn't list it above, then I don't know about it. I feel like I'm missing a very simple step here but I cannot for the life of me figure out what it is.
Here are the error logs (i've tried googling the Flipper errors, with little success, so if you know anything about that please share):
Here's a link to a demo project I'm using to test this:
https://github.com/aymather/reactNativeHttpTest
Finally figured out the last step I was missing...
When you run the flask app, you have to run it to be hosted on 0.0.0.0 rather than 127.0.0.1 which are both ways of referencing your local machine, but are treated slightly differently on the network.

Shopify CLI - Ngrok error when serving app

I am on a windows 10 machine and trying to use the Shopify App CLI to create apps, but I am running into some errors.
First I installed ruby so I could use the gem command to install the Shopify App CLI, as explained here.
When running shopify version as explained in the above documentation, I get the following output:
bash: shopify: command not found
After googling for a bit I found a solution to this problem, by running shopify.bat version. With this command I can use the CLI.
Moving on, I tried following this tutorial to create my first Shopify App. I used shopify.bat create node to create my app, moved into the folder and ran shopify.bat serve to serve my app locally.
Now the following problem arises:
It starts promising by installing ngrok:
But after waiting for a bit, I get the following output (Sorry for the screenshot, I could not get it to look normal with inline code):
What I also notice is that it uses C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-1.4.0/ as the path to the CLI, but when looking on Google, most people have /home/[USER]/.shopify-app-cli/ as the path to the CLI. This path does not exist on my machine.
So I would like to know why first of all the serving of the app won't work, because ngrok can't be found, and second why ~/home/user/.shopify-app-cli does not exist.
Thanks in advance,
Mike
I think modern Windows come with Linux now. Since the Internet runs on Linux, you might find development and following tutorials much easier if you use Linux, since all these inconveniences of Windows disappear. Unless you are already super handy with all the quirks of Windows to work around their results, it could be your ticket!
That being said, I mastered this development pattern using *nix and it remains pretty advanced to actually have a smooth workflow for both localhost and production development. Ngrok itself is painful without paying for the service and using puma-dev and puma-ngrok... I laugh when I think about how those essentials running under Windows will be for you.

.NET Core Profiling When Running in Docker Container

I am using asp.net core 2.2 and Visual Studio 2019. The containers my application are running on are Debian (one of the official aspnet:2.2 docker images)
So my situation is this. I have an application that consists of 4 microservices running in docker containers and I'm seeing very high cpu usage on the containers nodes when this is under load. What I would like to do is profile the executing code to get an idea where this resource use is happening.
As a starting point I thought I would simply get some profiling running on my local development environment, just to get an idea of what the execution looks like in general. Although in production this runs in Kubernetes I do have a development environment that uses docker compose and I find the Visual Studio Docker tools to be fairly good.
I was hoping to use some of the visual studio profiling tools. I was able to install VSDBG on one of my locally running containers and connect to it with VS BUT in the diagnostic pane I see "the diagnostic tools window does not support the current debugging configuration". I've also tried just running the project from VS using docker compose but I see the same message when I hit a breakpoint. I'm not finding much out there about how to do this.
I also tried getting profiling going using perfcollect but after I generated the trace and opened it with perfviewer I was getting a parsing error when trying to view the cpu stacks . Still not sure what's going on there. I did find an old closed issue on their github describing what I am seeing but there was a fairly recent comment from someone saying they were seeing it with the latest version so maybe it's a regression.
So.. after all this .. my question is this. Are either of the above approaches viable? Is there a better way to achieve this? I'm interested in any way someone has had success viewing some code profiling of a .net core 2.2 application running on a linux docker container. All I really want to do is be able to see where in my code the execution time is going and what resources are being consumed. As I've mentioned I'm not finding much out there when I Google for this and I seem to keep hitting walls. If anyone had any advice or direction on a approach here I would really appreciate it. Thanks much!
Are you open to upgrading to .Net Core 3.0 (.Net Core 2.2 is going out of support in a few days: 12/23/2019)
If you're open to that you can take advantage of the new tool dotnet-trace which supports running in a linux container and can be used with the tools in Visual Studio.
Here are the steps I used to add it to my project:
Change your base image to use the sdk image (needed to install the tool).
Add installing the tool to the image:
RUN dotnet tool install --global dotnet-trace
ENV PATH $PATH:/root/.dotnet/tools
Alternatively if you don’t want to add it in your image you can run the following commands in a running container (as long as it as based on the SDK image):
dotnet tool install --global dotnet-trace
export PATH="$PATH:/root/.dotnet/tools"
Start the project without debugging (Ctrl+F5)
Use the Containers Tool Window to open a terminal window
Run the command:
dotnet-trace collect --process-id $(pidof dotnet) --providers Microsoft-DotNETCore-SampleProfiler
When you are done collecting press enter or Ctrl+C to end the collection
This will crate a file called “trace.nettrace”
By default that /app folder that file would be created in is volume mapped to your project folder. You can open the file from there in VS.

cb_share_config won't run locally, DISPLAY error

I'm trying to run cb_share_config from an xterm to import some color themes using:
"sudo cb_share_config"
which results in:
"Unable to initialize gtk, is DISPLAY set properly?"
This doesn't make sense to me since I'm running it locally, not through ssh or anything. I didn't think I needed to set the the display. Everything I've searched for is related to connecting to a server, which I'm not doing.
Code::Blocks version 16.01
OpenSUSE Leap version 42.3
Thanks in advance.
Ok so I've solved the problem or rather avoided it altogether by just running the tool directly from a file manager (Thunar). I'm still not entirely satisfied with Windows-like solution but it works. If anyone has any insights as to why I couldn't run it through a terminal I'd like to hear it but I suspect it might be a better question for a linux board.

Certificate error while running boot2Docker

I am using boot2docker which creates a VM of linux on OSX and allows you to use regular docker.
I am following thistutorial to try and use google's recent "deep dreams" image software. There is a python implementation on github that was released and become very popular. Not knowing python or the frameworks it comes with I decided to look for a simpler way to run it. So this guy made a container in docker to run it and explains how to set it up in that link. Unfortunately I am running into a bug where it denies the IP certificate. AS you can see..
As recommended by Sabin, this is what i get when i run the curl command.

Resources