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
| # Powershell script to split large sql files to separate sql files per table - joram77 | |
| $inputFile = "c:\users\money\dumps\db_slimmed.sql" | |
| $fileInfo = New-Object System.IO.FileInfo($inputFile) | |
| $newDir = $fileInfo.Directory.ToString() + '\' + $fileInfo.BaseName.ToString() | |
| New-Item -ItemType Directory -Force -Path $newDir | |
| $outputFile = "$newDir\db_slimmed_start.sql" | |
| $reader = New-Object System.IO.StreamReader($inputFile) | |
| $count = 0 |
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
| docker cp ./.ssh/id_ed25519 container-name:/root/.ssh/id_rsa ; docker exec container-name bash -c "chmod 700 /root/.ssh/id_rsa" |
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
| # B from C fromdomain D frompath E statuscode F to G rewriterule(formula below) | |
| ="if ($host = """&C8&""") { rewrite ^"®EXREPLACE(regexreplace(B8,"(.+)\?(.*)","$1"),"^(https://|http://)([^/]+)(.+)","$3")& "$ "& F8 &"? permanent; }" | |
| # C fromdomain (formula below) | |
| =index(split(B3,"/"),0,2) |
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 badblocks -sv /dev/sda > bad-blocks-result | |
| sudo fsck -t ext4 -l bad-blocks-result /dev/sda1 | |
| ---- | |
| sudo add-apt-repository universe | |
| sudo apt-get install hfsprogs hfsplus | |
| sudo fsck.hfsplus /dev/sda2 |
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
| DOCKER_CP_XDEBUG_ON=docker cp docker/php-fpm/docker-php-ext-xdebug-on.ini php-fpm_1:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
| DOCKER_CP_XDEBUG_OFF=docker cp docker/php-fpm/docker-php-ext-xdebug.ini php-fpm_1:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
| .PHONY: about xdebug-on xdebug-off | |
| about: | |
| echo "Xdebug Makefile https://github.com/joram77 - Joram Declerck" | |
| echo "- Install: copy contents to Makefile in your project" | |
| echo "- Usage: make xdebug-on or make xdebug-off" |
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
| %div.button | |
| = render layout: 'folder/link_layout', locals: {link: link} do | |
| = button_contents_variable | |
| #folder/_link_layout.html.haml contents: | |
| %a{href: link} | |
| = yield # contents of button_contents_variable will be nested in the %a tag | |
| # inspired by https://stackoverflow.com/questions/35933558/unexpected-error-using-yield-in-haml-nesting | |
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
| zend_extension=xdebug | |
| [xdebug] | |
| xdebug.mode=debug # develop has impact on performance | |
| xdebug.client_port = 9000 | |
| xdebug.idekey=PHPSTORM | |
| xdebug.client_host=host.docker.internal |
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 * FROM information_schema.tables |
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 schema_name as database_name from information_schema.schemata order by schema_name; |
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
| # copy current dir | |
| cp -rv . ~/backup/$(basename "$PWD").bak.$(date '+%Y-%m-%d_%H-%M-%S') | |
| # or tar current dir | |
| tar -cvzf ~/backup/$(basename "$PWD").bak.$(date '+%Y-%m-%d_%H-%M-%S').tar.gz . | |
| # tar current dir and exclude dot dirs/files in root to tar | |
| tar --exclude="./.*" -cvzf /tmp/backup/$(basename "$PWD").bak.$(date '+%Y-%m-%d_%H-%M-%S').tar.gz . |