Accidentally amzn-sagemaker-studiolab package & now have weird UI - amazon-sagemaker

I'm very new to Studiolab and I was trying to uninstall some packages I installed with pip. I was lazy and found this script online that did this for me. I ran "python -m pip freeze > requirements.txt" followed by "python -m pip uninstall -r requirements.txt". In the process, I deleted a couple important packages including amzn-sagemaker-studiolab. Could you point me in the right direction as to how I may be able to reset my environment to the default one. I am entirely okay with starting fresh, like I never worked on the environment before but my UI right now is pretty unusable and I can't figure out how to re-install the packages I deleted.
Most of the information is present in the details.

Here are the commands you can use to reinitialize Studio Lab environment:
Open Terminal from JupyterLab IDE
Make sure you are under your home directory
Run rm -rf ..?* .[!.]* * and restart your project runtime, that should reset it
If that still does not work, the only recommendation we have is to delete and recreate your account.

Related

mongodb server not running as a background process

I recently downloaded mongodb and robo 3T. now im new to using mongodb on my system as i normally only use it online. well ever since i installed mongodb, it is meant to run as a background process forever but it never does. for it to even show on my task manager i have to start the service by myself and whenever i restart my laptop its stopped again. my point is, because of this problem, robo 3T hasnt been able to connect to mongodb even though i start the service by myself. did i do anything wrong when installing mongodb and how do i fix this problem?
I don't like the .msi installer to create the MongoD service. Usually I prefer the manual way of doing it. It gives more control and you know what actually happens.
Install MongoDB with MSI installer, disable option "Install MongoD as a Service"
Create mongod.cfg file according to your preferences.
You may use <Installation Path>\Server\5.0\bin\mongod.cfg as template. Pay attention to Windows Service Options.
Install the service by running mongod.exe --config "<full path of mongod.cfg file>" --install
Note, you need to run mongod.exe --install with Administrator privileges. See https://docs.mongodb.com/manual/reference/program/mongod.exe/
Check your Service Manager services.msc for any already existing Mongo services. You can remove them with mongod.exe --config "<mongod.cfg file>" --remove or sc.exe delete <service name>

Trying to find a failing React application build parameter when running yarn

I am forking a React app. I am trying to simply compile the open source code and run it Locally on my PC. I am using yarn command in PowerShell. Everything goes perfectly fine, installs all node modules, and at the very end gives me Error Code 1, $ rm -rf not a recognized command or batch file. So, there is a build parameter somewhere with the commands of $ rm -rf which is failing due to me doing this on Windows 10, and those being Linux commands. So, I think I can just simply find this parameter and change it to the Windows equivalent, or possible remove it entirely, but I have no idea where this build parameter is.
It is not in package.json, it's not in about 50 files I've opened and searched for it with Ctrl+F. I can't find it anywhere.
How do I figure out where this command is? What files does yarn reference besides package.json, package-lock.json, etc.? This is the only thing making it not compile/build.
I am aware there are certain ways to use this command in Windows, like with a Linux VM etc., but I'd rather understand the problem and solve it.

How to create react-app using directly only docker instead of host?

I am creating new Reactjs application using Docker and I want to create new instance without installing Node.js to host system. I have seen many of tutorials but everytime first step was to install Node.js to the host, init app and then setup Docker. Problem I ran into was the official Node.je Docker images are designed for run application only instead of to run like detached container, so I cannot use container command line to initial install. I was about to create image based on any linux distro and install Node.js on my own, but with these approache I cannot use advantages of prepared official images of Node.js.
Does exist any option how to init React app using Docker without installing Node.js to the host system?
Thank You
EDIT: Based od #David Maze answer I decide to use docker-compose, just mount project directory to container and put command: ["sleep", "infinity"] to docker-compose file. So I didn't need to install Node.js to host and I can manage everthing from container command line as usual in project folder. I wasn't solving any shared global cache, but I am not really sure that it is needed if I will have more versions of node containered because of conflict of npms of different versions. Maybe I try to mount it like volume to containers from some global place in the host one day, but disk space is not so big problem ...
You should be able to run something like:
sudo docker run \
--rm \
-it \
-u$(id -u):$(id -g) \
-w/ \
-v"$PWD":/app \
node:10 \
npx create-react-app app
You will have to repeat this litany of Docker options every time you want to do anything to use a Docker-packaged version of Node.
Ultimately this sequence of things starts in the container root directory (-w/) and uses create-react-app to create an app directory; the -v option has that backed by the current directory on the host, and the -u option is needed to make filesystem permissions line up. The -it options make it possible to answer interactive questions, and --rm causes the container to clean up after itself.
I suspect you will find it much easier to just install Node.

npm / yeoman install generator-angular without sudo

I tried to install generator-angularjs using Yo (Yoeman) without sudo:
npm install -g generator-angular
I get:
Error: EACCES, mkdir '/usr/lib/node_modules/generator-angular'
When I type in sudo yo, yo tells me that I should not use sudo (which is perfectly understandable).
I have a ~/node_modules directory - why doesn't yo install its packages there?
Generators are designed to be installed globally. Otherwise, you always have to install the generator you're about to use in each project, which is unnecessarily painful. Also, you don't get to see the lovely yo menu which lists you all the available generators (unless of course, you install them all locally):
Setting up npm for global installation
So, how do we get npm to install packages globally? As you correctly said, you should never, ever run yo with sudo. There are lots of different solutions to this problem and you can spend hours discussing their pros and cons religiously.
I personally dislike installing my user packages into the global /usr/ folder. /usr/ is for software that is shared across all users on the computer. Even if it's only using the machine, there are still good reasons to respect the way the Unix file system hierarchy is designed. For example if you decide at one point to wipe your whole node installation.
My preferred way of enabling npm to install packages globally without breaking out of $HOME is to set a local node prefix. This is as easy as running
echo 'prefix = ~/.node' >> ~/.npmrc
in your local shell. After that, you want to adjust your $PATH, to point to the new installation destination for global node executables by adjusting your favorite shell's config. E.g. by adding
export PATH="$PATH:$HOME/.node/bin"
to your ~/.bashrc. After that, you can happily run npm install -g generator-angular without sudo, without running into permission conflicts and if something is completely broken and you want to start from scratch, all you need to do is remove your ~/.node directory.
Thanks to #passy I managed to finally get this working on ubuntu 13.04 (in case anyone is having similar set up issues) with the following :
sudo apt-get update
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
trying to run:
npm install -g yo
resulted in
Error: EACCES, mkdir '/usr/lib/node_modules/yo'
Fixed using:
echo prefix = ~/.node >> ~/.npmrc
echo 'export PATH=$HOME/.node/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
Running:
yo webapp
resulted in:
Error: EACCES, permission denied '/home/username/.config/configstore/update-notifier-yo.yml'
Fixed using:
sudo chown yourusername:yourusername /home/yourusername/.config/configstore/update-notifier-yo.yml
hi in my case (on ubuntu 12.04), the prefix addition in ~/.npmrc did not changed anything.
if so, build the node package by yourself and install it in /opt/node or /home/user/.node.
I had an almost identical error involving a rogue .yo-rc.json file in my root directory from a project I installed earlier. Yeoman was switching cwd from the installation dir to root dir half way through the installation, but was only outputting the EACCESS permissions error without any details that the installation directory was /. It took ages to figure out why this was, and involved debugging through the Yeoman source, but I eventually learned that Yeoman will look up through the directory tree until it finds a .yo-rc.json, and generate the code there by calling chdir to the new location.
Yeoman should maybe check that the user has write permissions for the directory. Alternatively, it could mention in the output either that the cwd has changed, or print the name of the installation directory if where it finds .yo-rc.json is different than cwd.
The command for finding rogue .yo-rc.json files
sudo find / -name .yo-rc.json
From yoeman getting started page appears the command:
yo doctor
In my case, $NODE_PATH (which in my case, Ubuntu 14.04, is defined in /etc/profile.d) isn't the same than npm root. Adding in npm root in $NODE_PATH solve the problem.
I have been trying to get yeoman to play nice with my vagrant box and this is what I had to do to install npm packages globally without sudo on ubuntu:
1. Create the directory to store global packages
$ mkdir "${HOME}/.npm-packages"
2. Tell npm where to put any packages installed globally
Insert this snippet into your ~/.npmrc file:
prefix=${HOME}/.npm-packages
3. Make sure that npm can locate installed binaries et cetera
Insert this snippet into your .bashrc/.zshrc:
NPM_PACKAGES="${HOME}/.npm-packages"
PATH="$NPM_PACKAGES/bin:$PATH"
// `unset` `manpath` to allow inheritance from `/etc/manpath` with
// the `manpath` command
unset MANPATH // remove this line if you have previously modified `manpath`
export MANPATH="$NPM_PACKAGES/share/man:$(manpath)"
4. Run the following or restart terminal
$ source ~/.bashrc
Hope this helps anyone who finds themselves in a similar situation.

adb install [app_name] - Failure [INSTALL_FAILED_ALREADY_EXISTS]

Firstly I'm aware that this has been asked many many times, but I've tried all those answers and still no luck. Let me explain.
I have 2 apps, 1 stock app, and one with the fino tool added in (sysdream/fino). This all repackaged correctly and was resigned correctly however when I try:
adb install app_fino.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
And adb install -r, which is obvious as I added fino to it and resigned.
adb install -r app_fino.apk
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
Other answers said to Uninstall and then reinstall the new app. So headed over to Apps > All > Uninstalled
...Rebooted phone
adb install app_fino.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
Any ideas anyone?
Try this command to uninstall:
adb uninstall com.your.packagename
If you still get the INSTALL_FAILED_ALREADY_EXISTS message even after an
adb uninstall com.your.packagename
The application may still be present on the system partition and thus cannot be removed using adb uninstall.
To fix this you need to also remove the original system app (can only be done on a rooted device):
adb shell
$ su
# mount -o remount,rw /system
# cd /system/data
# rm OffendingPackage.apk
Note that the package names in the system folder not necessarily follow the com.your.packagename.apk convention. So you may need to look around a bit for the correct apk.
Finally adb reboot the device before trying to install again.

Resources