sábado, 21 de julho de 2018

Access to Bitbucket stopped to work via http and git


Yesterday I changed my Vivo Fibra plan to 100 Mb, so the company had to change the router. Everything was working fine until I needed to do a git pull, from my bitbucket repository. After tireless searches I found the solution. I still don't know if it has other solution, but this one worked to me. 

I just put it in the file /etc/hosts the line:

104.192.143.2 bitbucket.org

Now, try again to git pull or access bitbucket.org via browser. 

I hope this tip has helped you.

;)

quinta-feira, 5 de abril de 2018

Infinite loop in npm install


To solve this error, run:

$ sudo npm -g --unsafe-perm install node-sass

Laravel - error on migrate


PHP 5.6
Mysql 5.5
Laravel 5.4


I had this error while executing: php artisan migrate

Syntax error or access violation: 1071 Specified key was too long; max key l ength is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))


I solved by changing the file config/database.php:

'charset' => 'utf8mb4' by 'charset' => 'utf8'
'collation' => 'utf8mb4_unicode_ci' by 'collation' => 'utf8_unicode_ci'

Drop the created tables by laravel, and execute php artisan migrate again.

quarta-feira, 11 de outubro de 2017

Mysql: errno 12

Message error: InnoDB: mmap(xxx bytes) failed; errno 12


To resolve the Mysql error 12, follow this steps:

$ sudo dd if=/dev/zero of=/swapfile bs=1M count=1024
$ sudo mkswap /swapfile 
$ sudo swapon /swapfile

Add this line to /etc/fstab
/swapfile swap swap defaults 0 0

This last step is needed if you would like to automatically enable swap file after each reboot.

sexta-feira, 24 de março de 2017

Erro no pip


Hoje me deparei com o seguinte erro ao executar o pip:

$ sudo pip install <pacote>
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
    ['__name__'])
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module>
    from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead

Para resolver o problema, basta apenas atualizar o pip com o easy_install:

$ sudo easy_install --upgrade pip

Feito isso, o pip será atualizado e resolvido o problema.

$ sudo pip

Usage:   
  pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels).
  --log <path>                Path to a verbose appending log.
  --proxy <proxy>             Specify a proxy in the form [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
  --trusted-host <hostname>   Mark this host as trusted, even though it does not have valid or any HTTPS.
  --cert <path>               Path to alternate CA bundle.
  --client-cert <path>        Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --no-cache-dir              Disable the cache.
  --disable-pip-version-check
                              Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.