Jupyter after installation "Anaconda" - anaconda

I used to work with Anaconda for sometime, now i am trying to install it and facing some issues with Jupyter.eatch time i try to launch Jupyter i get
http://localhost:8892/undefined/tree
And is there a way to change the default browser from Internet Explorer to Google Crome ?

launching from command line
You can type jupyter-notebook.exe --help to get the command line options. The one you are interested in is shown below:
--browser=<Unicode> (NotebookApp.browser)
Default: ''
Specify what command to use to invoke a web browser when opening the
notebook. If not specified, the default browser will be determined by the
`webbrowser` standard library module, which allows setting of the BROWSER
environment variable to override it.
So jupyter-notebook.exe --browser='chrome' should work. You could incorporate this command into a Windows shortcut or consider the alternative below.
changing your config
From the command line type jupyter-notebook.exe --generate-config which will create a config file called jupyter_notebook_config.py located in your C:\Users\<user>\.jupyter directory. Open this file and uncomment the line containing c.NotebookApp.browser. Then set its value to be 'chrome'.

Related

How to run file watcher in virtual environment in GoLand?

I have enabled golangci-lint file watcher in GoLand but when I save file I got error like below one:
msg="Running error: context loading failed: no go files to analyze"
After some debugging I found that this error comes when I run golangci-lint without activating my virtual env.
So my question is how do I tell file watcher to run golangci-lint after activating virtual environment?
So, In summary I want this:
Before running any file watcher command, Run this command
source .my_virtual_env_folder/bin/activate
This command is basically activates virtual environment.
I am new to GoLand. I tried to do google search but no luck.
I found a workaround.
Make a executable file, write all the commands there. We have full control on which commands do we want to run and in which order. Then in file watcher "Program", paste the absolute path of this file.
I just wrote source <name_of_the_env>/bin/activate at the top of file and then wrote my main command.
This way it activated the virtual environment and then call the command.

Is there any method to create a YAML file via Microsoft cmd?

I practice Kubernetes on my windows machine. I need to create a YAML file to run some objects on Kubernetes but I couldn't able to create YAML file with CLI command on windows. There are alternative ways to make it in brute force such as creating txt and then changing its extension manually but I wonder if there is any way to create a YAML file via cmd similar to Linux (touch yamlfile.yaml)
Thank you in advance.
update: #tquadrat answer helps to create yamlfile successfully but on windows cmd, when you try to edit yamlfile via default notepad, that turns out .txt again instead of .yaml
My palliative solution is to use VScode to create yamlfiles and also using terminal in VScode.
On Linux, touch yamlfile.yaml creates an empty file. If this is your goal, try
echo. > yamlfile.yaml

Set default profile in Firefox via command-line

I'm trying to pre-setup a new Firefox installation with a custom user.js. However, no profile is made until Firefox is first run, unless you run this command:
Firefox.exe -CreateProfile <NAME>
Problem is, even if this command is run, Firefox will still create and launch with the default-release profile. Is there any way to set a default profile via the command line or by modifying a file?
Solved:
Used Process Monitor to see what it does when changing default profile.
In %APPDATA%\Roaming\Mozilla\Firefox\profiles.ini there's a Default=<Profile Path> line. Replace
<Profile Path> with your desired profile's path, which should be included in that file as well. Ex. Profiles/bd3a3mdf.default-release

appcfg.py is not running with cmd prompt (Windows 7)

I am having strange problem. I used to run appcfg.py to update my app to appengine but now its not working anymore. When I run this command
C:\Program Files <x86>\Google\google_appengine>appcfg.py update E:\path\myApp\
Its not giving me anything, no error no feedback. Its just back to this line
C:\Program Files <x86>\Google\google_appengine>
Any idea about this issue!
P.S. I'm using Python 2.7. My code is updating through google app launcher but I need to run it from cmd prompt as I will be downloading/uploading appengine stuff which launcher doesn't allow me to do!
Thanks
I still had a little trouble with the instructions. Here's the steps I used to create a batch file to use the Google App Engine download_app with Windows 7.
In my example,
I'll use drive, C:
Default python path will be, C:\Python27\python.exe
GAE path (include "), "C:\Program Files (x86)\Google\google_appengine\appcfg.py"
App ID {your_app_id} will be just your app-id name
{your_app_version} is the "Version:" number in your GAE app.yaml file
I'll create a folder on my Windows 7 desktop and call it GAE_App
The desktop folder path will be C:\Users\{username}\Desktop\GAE_App
{your email} will be the Gmail account connected to your GAE
Right-click on the desktop and select New->Text Document. Open the newly created text document and add the following line of code modified for your setup to the blank text document,
C:\Python27\python.exe "C:\Program Files (x86)\Google\google_appengine\appcfg.py" download_app -A {your_app_id} -V {your_app_version} --email={your email} C:\Users\{username}\Desktop\GAE_App
Save the text document and change the file name to GAE_Download.bat
It's important that the extension now says ".bat" instead of ".txt"
Once finished, click on the batch to execute it. You'll be asked for a password and then the files should download into the GAE_App folder on your desktop. Now, whenever you need to download your files, just click on the batch file.
Not sure why Google didn't simply include this feature with their GAE for Windows software.
I faced the same issue. Here is a simple solution.
Just do this following Steps:
Go to program file where google app engine is installed. Generally It is named as Google.
click on appcfg.py and select open with.. Select "Choose Default Programs".
Select Python from programs and select "Always Use the selected program to open this kind of file" .
Now run the command you should get the results on command line.
For reference click here
Fixed by accessing python lib like that
C:\Python27>python appcfg.py update E:\path\myApp\
Here's a solution that worked for me:
"google_appengine/appcfg.py" update "C:\PATH TO APP
The appcfg.bat that should be used is located **C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\appengine-java-sdk\bin** and not the empty appcfg.bat that for some unknown reason also was here C:\Program Files\Google\Cloud SDK\
Good practice is to add this path to the system variable PATH
This worked for me
Basis
<PATH_TO_PYTHON>python <PATH_TO_APPCFG.PY>appcfg.py -A <PROJECT_INSTANCE_NAME> update app.yaml
Example
X:\Software\Python2.7\python Q:\SOFTWARE\GoogleAppEngineSDK\appcfg.py -A great-1337 update app.yaml

CakePHP Console via Cron Question

I'm using the CakePHP Console to download files from we and processed in a database. I'm running the console from inside the "app" directory. But when I'm trying to run the console outside app and by just setting the "-app" parameter for my cron job, it doesn't work.
To be honest, I've had no success using -app parameter. It's like it's not working at all.
By the way, I'm using Windows & Pycron for my cron jobs.
Here's what happens when I'm trying to run the console from D:\
D:\>web\elink\cake\console\cake -app D:\web\elink\app
Welcome to CakePHP v1.2.2.8120 Console
---------------------------------------------------------------
Current Paths:
-app: app
-working: D: -app D:/web/elink/app
-root: D: -app D:/web/elink
-core: D:\web\elink
Changing Paths:
your working path should be the same as your application path
to change your path use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp
Available Shells:
D:\web\elink\vendors\shells:
- none
CORE\console\libs:
acl
api
bake
console
i18n
schema
testsuite
To run a command, type 'cake shell_name [args]'
To get help on a specific command, type 'cake shell_name help'
My shells are located at D:\web\elink\app\vendors\shells.
I have managed to reproduce this issue using versions 1.2.2.8120 and 1.2.3.8166 on Windows. The -app parameter doesn't seem to work at all as expected.
The console will only list global shells in the /vendors/shells folder and not application-specific ones located in /app/vendors/shells or in plugins (/app/plugins/plugin_name/vendors/shells).
The -app parameter works as expected on OpenSUSE, listing all available application-specific shells (including those in plugins).
Unless we are doing something incorrectly, it is probably worth opening a ticket on Trac about this issue.
A workaround would be to add your Cake console directory to the Windows PATH environment variable.
Open 'System Properties' (Start key + Pause/Break key)
Open 'Advanced' tab
Click 'Environment Variables'
Select the PATH variable in the 'System variables' section
Press 'Edit'
Append ;E:\web\elink\cake\console\ to the 'Variable value'
Press 'Okay' on all dialogs
Close all open cmd prompts
You can then set up pycron to run E:\web\elink\cake without the -app parameter and all your application-specific shells should be available.
-For the people having the same problem but on linux systems, here there is an easy solution:
http://book.cakephp.org/complete/3/The-Manual#Running-Shells-as-cronjobs-846
-Another alternative solution for any system would be to create a simple script with two lines like this:
cd /path/to/app
/path/to/cake
-Both solutions worked for me in a Cent0S and in a MacOS based machines.

Resources