Github

  • ARM,  Github

    TODO ARM Actions MS (CI/CD)

    CI/CD Workflow Deploy credentials Configure secret Add ARM Template Create workflow The workflow is trigger when there is a push event on the main branch, which modifies at least one of the two files specified. Workflow status https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-github-actions

    Comments Off on TODO ARM Actions MS (CI/CD)
  • Github

    Git pull request

    https://opensource.com/article/19/7/create-pull-request-github Account donaldtest fork the repos from spawnmarvel: https://github.com/donaldtest/powershellcode git clone https://github.com/request-user/demo cd foldergit checkout -b new_branch git remote add upstream https://github.com/fork-user/demo Now you can make changes to the code. Once you push the changes to your repo, the Compare & pull request button will appear in GitHub. Click Compare & pull request Open a pull request by clicking the Create pull request button. This allows the repo’s maintainers to review your contribution. From here, they can merge it if it is good, or they may ask you to make some changes. Back at the donaldtest, there is now a pull request, that we can merge if we want it.…

    Comments Off on Git pull request
  • Github,  Python

    Python Development in Visual Studio Code

    https://realpython.com/python-development-visual-studio-code/ (Real Python and Jon Fincher tutorial) In this article, you’ll learn about Python development in Visual Studio Code, including how to: Install Visual Studio Code Discover and install extensions that make Python development easy Write a simple Python application Learn how to run and debug existing Python programs in VS Code Connect Visual Studio Code to Git and GitHub to share your code with the world My setup now (Magic Python and Python) extensions https://marketplace.visualstudio.com/items?itemName=ms-python.python

    Comments Off on Python Development in Visual Studio Code
  • Github,  Information Retrieval,  Python,  Solr

    Apache Solr 7.5 Index build with DirectUpdateHandler2 HTTP (with delete index)

    http://lucene.apache.org/solr/guide/7_5/uploading-data-with-index-handlers.html Index Handlers are Request Handlers designed to add, delete and update documents to the index. In addition to having plugins for importing rich documents using Tika or from structured data sources using the Data Import Handler, Solr natively supports indexing structured documents in XML, CSV and JSON. The default in solrconfig.xml is an UpdateHandler: <!– The default high-performance update handler –><updateHandler class=”solr.DirectUpdateHandler2″> DirectUpdateHandler2 implements an UpdateHandler where documents are added directly to the main Lucene index as opposed to adding to a separate smaller index. Now it is going to be a bit code, so the code for Python can be found at github: https://github.com/spawnmarvel/solrhttp Ok, lets index a…

    Comments Off on Apache Solr 7.5 Index build with DirectUpdateHandler2 HTTP (with delete index)
  • Github,  Python

    pywinservice, running a simple Python script as a windows service

    pywinservice, running a simple Python script as a windows service Code: https://github.com/spawnmarvel/pywinservice Make a virtualenv, store your code there. Make a run.py file, in that file you can start / call a database, a webcrawler, http, mail or whatever code you want to execute. When you are done with coding your scripts, test this: Make a bat file, that will be started when the service starts (i.e 3 party libraries will start) First: Activate the env: ~\pywinservice\Scripts\activate.bat Second: Call the Python script file, ie run.py python app\run.py runserver Make some log statments also, always good. If the test is success: Download NSSM – the Non-Sucking Service Manager. https://nssm.cc/download nssm install,…

    Comments Off on pywinservice, running a simple Python script as a windows service
  • Django,  e-lo,  Github

    Django database API foreign key 102

    https://docs.djangoproject.com/en/2.0/topics/db/queries/   Our models have now changed and a new model has been added to e-lo. In RawText, we store the input, in BlobText we store the functions from TextBlob lib. If we remove the instance from the first table, we also need to remove it from the second. Ref on_delete = models.CASCADE Lets add two instances and view them, then delete them.  

    Comments Off on Django database API foreign key 102
  • Django,  Github,  Sql

    Django database API migrations and models 101

    Django API Once you’ve created your data models, Django automatically gives you a database-abstraction API that lets you create, retrieve, update and delete objects. This document explains how to use this API. Refer to the data model reference for full details of all the various model lookup options. https://docs.djangoproject.com/en/2.0/topics/db/queries/ So our testmodel is a simple Note where we store text from the user. This is our base for e-lo on web. We feed e-lo some text and select a of several NLP functions that will be implemented later (Some of them are implemented, but must interfaced with Django, now they are interfaced with class cmd.Cmd([completekey[, stdin[, stdout]]]).

    Comments Off on Django database API migrations and models 101
  • Github

    Github 101 + ssh

    Commit and push to a newly created repository: https://git-scm.com/docs Navigate to folder with git cmdAdd the files in your new local repository. This stages them for the first commit.Commit the files that you’ve staged in your local repository.At the top of your GitHub repository’s Quick Setup page, click to copy the remote repository URL. In the Command prompt, add the URL for the remote repository where your local repository will be pushed.Push the changes in your local repository to GitHub. Conflict with commit to origin master?, do a pull before commit. BASH VSC Cloning a repository: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository Navigate to where you want to store the repository: cp the url and…

    Comments Off on Github 101 + ssh
  • Github,  Python

    Python and Flask

    I have been learning flask for about 1 year now. It has been fun, frustrating at times and I wish I would have finished the full documentation for it. But at least now I know how the different parts fit together, and all the “magic” that is inculde in Django is a developer’s choice when using flask. But what a great micro web framework to use! Flask is super easy to setup and works great if you are using RAD (Rapid-application development) or have a medium to small size app, it might work really good for bigs apps also, but then there is a lot of choices to consider for…

    Comments Off on Python and Flask