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
<?php | |
namespace App\Engines; | |
use Laravel\Scout\Engines\AlgoliaEngine; | |
use Log; | |
class AdvancedAlgoliaEngine extends AlgoliaEngine | |
{ | |
protected $index; |
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
Odoo 9 | |
https://www.linode.com/docs/websites/cms/install-odoo-9-erp-on-ubuntu-14-04 | |
To change to 10 just need to pull master from GIT | |
git clone https://github.com/odoo/odoo.git | |
To install nginx as a proxy | |
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
#!/bin/bash | |
cd /media/dumps | |
name=$(date +%b-%d) | |
year=$(date +%Y) | |
[ -d $year ] || mkdir $year || { echo "Could not create directory '$year'"; exit 1; } | |
mongodump --db t3_mage --out $name &> mongodump.log | |
if [ $? ]; then | |
tar -czf snapshots/$year/$name.tgz $name | |
if [ $(($(date +%d | sed 's/^0*//') % 10)) == 0 ]; then |
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
#!/bin/bash | |
DBNAME=mwe | |
SNAPSHOT_DAYS=7 | |
ARCHIVE_DAYS=60 | |
mysqldump=/usr/bin/mysqldump | |
gzip=/bin/gzip | |
function error() { | |
echo $1 >> $logfile.tmp |
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
#!/bin/bash | |
# | |
# Optimize all jpg and png files in the cwd | |
# Run it again to optimize new files since the last run | |
# | |
# Example: | |
# echo "optimize_media.sh > /tmp/optimize.log" | sudo -u www-data bash -s | |
# | |
# Colin Mollenhour 2016 |
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
show global status like 'open%'; |
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
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'; | |
show global status like '%Threads_connected%'; |
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
set @a=null,@c=null,@b=concat("show tables where",ifnull(concat(" `Tables_in_",database(),"` like '",@c,"' and"),'')," (@a:=concat_ws(',',@a,`Tables_in_",database(),"`))"); | |
Prepare `bd` from @b; | |
EXECUTE `bd`; | |
DEALLOCATE PREPARE `bd`; | |
set @a:=concat('optimize table ',@a); | |
PREPARE `sql` FROM @a; | |
EXECUTE `sql`; | |
DEALLOCATE PREPARE `sql`; |
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
SELECT table_schema "Data Base Name", | |
sum( data_length + index_length ) / 1024 / | |
1024 "Data Base Size in MB", | |
sum( data_free )/ 1024 / 1024 "Free Space in MB" | |
FROM information_schema.TABLES | |
GROUP BY table_schema ; |
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
SELECT | |
table_schema as `Database`, | |
table_name AS `Table`, | |
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` | |
FROM information_schema.TABLES | |
ORDER BY (data_length + index_length) DESC; |