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 | |
//sugarcrm/custom/Extension/modules/KBContents/Ext/Vardefs/vardefs.php | |
$dictionary['KBContent']['indices'] = array( | |
array('name' => 'kbcontentspk', 'type' => 'primary', 'fields' => array('id')), | |
array('name' => 'fts_unique_idx', 'type' => 'unique', 'fields' => array('kb_index')), | |
//array('name' => '', 'type' => 'fulltext', 'fields' => array('kbdocument_body'), 'db' => 'mysql'), | |
//array('name' => 'kbcontentsftk', 'type' => 'fulltext', 'fields' => array('kbdocument_body'), 'db' => 'ibm_db2', 'options' => 'UPDATE FREQUENCY D(*) H(*) M(0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55) UPDATE MINIMUM 1', 'message_locale' => 'en_US'), // Update the TS index every 5 minutes if only 1 record was updated | |
//array('name' => 'kbcontentsftk', 'type' => 'fulltext', 'fields' => array('kbdocument_body'), 'db' => 'oci8', 'indextype' => 'CTXSYS.CONTEXT', 'parameters' => 'sync (on commit)'), |
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
for t in $(mysql -NBA -D <database_name> -e 'show tables') | |
do | |
echo "DUMPING TABLE: $t" | |
mysqldump <database_name> $t | gzip > <some_dir>/$t.sql.gz | |
done |
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
$sql = "SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='%s' AND engine='MyISAM' AND table_name NOT IN (SELECT table_name FROM INFORMATION_SCHEMA.statistics WHERE index_type='FULLTEXT' AND table_schema='%s')"; | |
$result = $db->query(sprintf($sql, | |
mysql_escape_string($instance->getName()), | |
mysql_escape_string($instance->getName()) | |
)); | |
while ($row = $db->fetch_array($result)) { | |
$tables[] = $row[0]; | |
} | |
foreach ($tables as $table) { |
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 . \( \! -user apache -o \! -group apache \) -print0 | xargs -0 -r chown apache:apache | |
find . -type d \! -perm 2770 -print0 | xargs -0 -r chmod 2770 | |
find . -type f \! -perm 660 -print0 | xargs -0 -r chmod 660 |
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
# Need to install data studio for JDBC driver: | |
http://www.ibm.com/developerworks/downloads/im/data/ | |
# Also | |
http://www-01.ibm.com/support/docview.wss?uid=swg27016878 | |
# Data Studio: | |
https://iwm.dhe.ibm.com/sdfdl/v2/regs2/rderwin0/capilano/Xa.2/Xb.YZuqrdMh2VbH5-oLrjMnzn14lxn0Ys0mc2jXWvchDw/Xc.IBMIM_win32.exe/Xd./Xf.LPr.D1vc/Xg.7454885/Xi.swg-iim-ws/XY.regsrvs/XZ.QQrR8mvCDmR69vL4xEDDQMs63O8/IBMIM_win32.exe | |
https://iwm.dhe.ibm.com/sdfdl/v2/regs2/rderwin0/capilano/Xa.2/Xb.YZuqrdMh2VbH5-oLrjMnzn14lxn0Ys0mc2jXtNC0zA/Xc.IBMIM_linux.zip/Xd./Xf.LPr.D1vc/Xg.7454885/Xi.swg-iim-ws/XY.regsrvs/XZ.cwd8ycc8-C2b5c8AsVsDZ9c7HfM/IBMIM_linux.zip |
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 | |
class Opportunities { | |
public function __construct() { | |
# Instantiate this so we can read all of our resources into RAM ONCE | |
$this->generator = new OpportunityGenerator(); | |
} | |
public function populateForAccount(&$account) { | |
# Need our demo array |
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 | |
define('sugarEntry', 1); | |
ini_set('max_execution_time', '0'); | |
ini_set('memory_limit', '2G'); | |
require_once 'include/entryPoint.php'; | |
require_once 'include/SugarQuery/SugarQuery.php'; | |
require 'include/language/en_us.lang.php'; | |
require 'install/demoData.en_us.php'; |
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
Apache: | |
- Activated 'KeepAlive' connections | |
- Lowered keep alive timeout from 15 seconds to 2 seconds | |
- Increased the number of minimum workers from 8 to 16 | |
- Activated server status page (/server-status) | |
APC (Alternative PHP Cache): | |
- Set cache size to 256MB (ideal for SugarCRM workload) | |
Memcache: |
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
# Download from here: https://github.com/sugarcrm/Tidbit | |
# Copy Tidbit to your Sugar Root and unpack | |
cp Tidbit-master.zip /var/www/html | |
unzip Tidbit-master.zip | |
# Run Tidbit | |
cd Tidbit | |
php -f install_cli.php -- -c |
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
# Make a local copy | |
service mysql stop | |
cp -ra /var/lib/mysql mysqldata | |
service mysql start | |
# Make a local dump | |
mysqldump --routines --events --flush-privileges --all-databases > all-databases.sql | |
# drop everything except the mysql table | |
mysql -e "SELECT DISTINCT CONCAT ('DROP DATABASE ',TABLE_SCHEMA,' ;') FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA <> 'mysql' AND TABLE_SCHEMA <> 'information_schema';" | tail -n+2 > drop.sql |