This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Для удаления файла из git-репозитория без его физического удаления: | |
| git rm --cached mylogfile.log | |
| Для удаления папки (рекурсивно) можно сделать так: | |
| git rm -r --cached folderName | |
| А для того, чтобы ситуация не повторялась, лучше добавьте файл или папку в .gitignore. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git config --global user.name "YourFullName" | |
| git config --global user.email myemail@mail.ru | |
| //------------------------------------------------------------------------------------ | |
| git init | |
| git add . | |
| git commit -m "first commit" | |
| git remote add origin https://github.com/you_repository/you_project | |
| git push -u origin master | |
| git push -f origin master | |
| //------------------------------------------OR----------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo -u postgres psql -c "DROP DATABASE art" && sudo -u postgres psql -c "CREATE DATABASE art" && psql art < 2018 | |
| sudo -u postgres psql -c "DROP DATABASE art" | |
| sudo -u postgres psql -c "CREATE DATABASE art" | |
| psql artdb < 2018-03-01_15-30-backup-artdb.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ------------------------------------------------------------------------------------------------------------ | |
| https://webhamster.ru/mytetrashare/index/mtb0/1413010541hzh3175lej | |
| git checkout HEAD@{1} | |
| ------------------------------- | |
| git branch temp | |
| git checkout temp | |
| git branch -f master temp | |
| git checkout master | |
| git branch -d temp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo phpdismod xdebug | |
| sudo phpenmod xdebug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select user_id, profession_id, count(*) | |
| from professions | |
| group by user_id, profession_id | |
| HAVING count(*) > 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. в файле /etc/php/x.x/mods-available/xdebug.ini прописываем настройки: | |
| zend_extension=xdebug.so | |
| xdebug.show_error_trace = 1 | |
| xdebug.remote_enable=1 | |
| xdebug.remote_host=127.0.0.1 | |
| xdebug.remote_port=9000 | |
| 1.1 делаем sudo service apache2 restart если надо |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
| sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" | |
| sudo apt-get update | |
| sudo apt-get install docker-ce | |
| # https://docs.docker.com/compose/install/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UPDATE public.mytable SET | |
| jsonfieldname = jsonb_set( jsonfieldname, '{json_obj_key}', array_to_json( | |
| ARRAY( | |
| SELECT DISTINCT( UNNEST( ARRAY( | |
| SELECT json_array_elements_text( COALESCE( jsonfieldname::json->'json_obj_key', '[]' ) ) | |
| ) || ARRAY['Element to add'] ) ) | |
| ) | |
| )::jsonb ) | |
| WHERE id = 23 | |
| RETURNING *; |
OlderNewer