GIT

Today I am configuring the remote GIT repository over the shared LAN then some issues I found solving those for this way.


  1. remote: error: refusing to update checked out branch: refs/heads/master
    1. Needs a bare repository Solve it: git config --bool core.bare true
  2. Then after try to update it I can't, so is necessary to un bare the current remote repository
    1. git config --unset core.bare
  3. So at the end was preferable create a new branch and remote one recongnized it with no throubles
Delete remote branch from local repository
  • git push --delete origin <remote branch name>
Delete local branch in current repository
  • git branch -D <local branch name>
  • -D means you're really sure to delete it

Add up hierachy modules lookup to Python

Usually we created nested files so, optimun code order and trying to add better performance to our project we desing most frecuently used methods into modules so, here how we can access from bottom modules to up into our scratched code.

So just adding those lines in the top of our files we will able to access the up hierchies files modules

import sys
sys.path.append("..")

Understanding Angular 8 Event emitters


Resultado de imagen para communication
How communicate my components?

I've been working with Angular 8, as a my common habit I start new projects with technologies I wanna to learn and during design and implementation workflow I use learn and now a day I desire share here stuff from my daily challenges, today I about how I comunicate child components with parent one in my Angular APP and after few researchig hours between read Angular's documentation and research for post with similar content I found that

https://www.intertech.com/Blog/angular-component-tutorial-inputs-outputs-and-eventemitters/

I reallly undestood clearly how @Input, @Output and EventEmitter flows throw the Angular environment and I can fix things with it.



Setting up Selenium over python 2.7 virtualenv


Let's search for PIP installation command



  1. pip install selenium
After install via PIP our selenium module, search for the webDriver, in this case I prefered implement Chrome webDriver, so next step to iwebDriver installation

  1. sudo apt-get install chromium-chromedriver (for apt repositories)
  2. The let's start to code...
    • Open our editor end call to selenium module
    • Declare variable with webDriver module and run
    #!/usr/bin/python3
    from selenium import webdriver
    from selenium.common.exceptions import TimeoutException
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    from selenium.webdriver.common.by import By
    url = 'http://www.yoururl.com'
    driver = webdriver.Chrome('/usr/bin/chromedriver')
    <---- Call to webDriver installation router on the SO
    driver.get(url)
    print(driver.title)
    •  Then run and I fount some issues like:

    Traceback (most recent call last):
      File "bikes/main.py", line 12, in <module>
        user = webdriver.Chrome('/usr/bin/chromedriver')
      File "/home/system/craweler/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
        desired_capabilities=desired_capabilities)
      File "/home/system/craweler/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
        self.start_session(capabilities, browser_profile)
      File "/home/system/craweler/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
        response = self.execute(Command.NEW_SESSION, parameters)
      File "/home/system/craweler/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
        self.error_handler.check_response(response)
      File "/home/system/craweler/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
        raise exception_class(message, screen, stacktrace)
    selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
      (unknown error: DevToolsActivePort file doesn't exist)
      (The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
    • Solved addind additional parameters to webDriver declaration:
    chrome_options = webdriver.ChromeOptions()chrome_options.add_argument('--headless')chrome_options.add_argument('--no-sandbox')chrome_options.add_argument('--disable-dev-shm-usage')

    • Then now our webDriver declaration looks 
    driver = webdriver.Chrome('/usr/bin/chromedriver',chrome_options=chrome_options) 

    And we've ready our selenium installation to start to be use 




                                          GIT

                                          Today I am configuring the remote GIT repository over the shared LAN then some issues I found solving those for this way. remote: erro...