This file contains 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
[gcode_macro PA_CAL] | |
# Klipper pressure advance line calibration macro. | |
# Usage: PA_CAL BED=100 NOZZLE=240 PA_START=0.0 PA_STOP=0.1 NZL=0.4 | |
# Or you can execute with no parameters, which will use values from printer.cfg and saved_variables.cfg. | |
# First prints a line with current set PA, then prints 21 additional line segments starting with PA_START, and increasing to PA_STOP. | |
# Based on http://realdeuce.github.io/Voron/PA/pressure_advance.html | |
# Cleaned up and moved to using saved_variables.cfg by u/jibbsisme | |
# Sourced from u/Deepsiks, assisted by u/imoftendisgruntled, u/scul86, and thanks to u/beansisfat, u/stray_r | |
description: Tune Pressure Advance |
This file contains 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
-- Be careful using this on large or on servers with production databases, it could take a long time, and is very invasive to performance. | |
-- Example, searching a 6GB Magento database on an idle dedicated server took 2 minutes. | |
set @search = 'my_search_text'; | |
set @database = 'database_name'; | |
select CONCAT('select \'', tbl.`TABLE_NAME`,'\' as TableName, \'', col.`COLUMN_NAME`,'\' as Col, `',col.`COLUMN_NAME`,'` as value from ' ,@database, '.`' , tbl.`TABLE_NAME`,'` where `' , | |
col.`COLUMN_NAME` , '` like \'%' ,@search, '%\' UNION') AS q | |
from information_schema.`tables` tbl | |
inner join information_schema.`columns` col on tbl.TABLE_SCHEMA = col.TABLE_SCHEMA and tbl.`TABLE_NAME` = col.`TABLE_NAME`and (col.DATA_TYPE='varchar' or col.DATA_TYPE='text') |
This file contains 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
#Run the following commands to install SourceGuardian Loader | |
#The example below is for PHP 7.2. Please use the version that applies to your situation. | |
sudo su | |
mkdir /usr/local/sourceguardian | |
cd /usr/local/sourceguardian | |
curl https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz --output loaders.linux-x86_64.tar.gz | |
tar xzf loaders.linux-x86_64.tar.gz | |
cp ixed.7.2.lin /usr/lib64/php/modules/ |
This file contains 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
ES_HOST='elasticsearch-host' # for example 127.0.0.1 | |
ES_PORT='elasticsearch-port' # default 9200 | |
# get indices | |
curl $ES_HOST:$ES_PORT/_cat/indices | |
ES_INDEX='index-name' | |
# get first 5 results from empty | |
curl $ES_HOST:$ES_PORT/$ES_INDEX/_search | jq . |
This file contains 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
# Generic example | |
export PHP_IDE_CONFIG="serverName=<host.lan>" && php -d xdebug.remote_autostart=on -f <somefile>.php -- <any PHP file CLI arguments> | |
# bin/magento example | |
export PHP_IDE_CONFIG="serverName=<host.lan>" && php -d xdebug.remote_autostart=on -f bin/magento -- <bin:magento:command> <any bin/magento command line arguments> | |
#### OLD WAY #### |
This file contains 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
# find the biggest .png files in a sub directory | |
# referenced from https://www.cyberciti.biz/faq/how-do-i-find-the-largest-filesdirectories-on-a-linuxunixbsd-filesystem/ | |
find . -type f -iname "*.png" -printf '%s %p\n'| sort -nr | head -25 | |
# List all symlinks recursively in a directory | |
find ./ -type l -printf "%p -> %l\n" | |
find . -type l -ls | |
# List all broken symlinks |