Skip to content

Instantly share code, notes, and snippets.

@chicks
chicks / repair.php
Last active September 3, 2019 08:08
Quick Repair and Rebuild Sugar from the Command line - adapted from Jeff Bickhart's version.
#! /usr/bin/env php
<?php
# Stuff we have to do
if(!defined('sugarEntry'))define('sugarEntry', true);
function usage() {
global $argv;
return "\n" . $argv[0] . " <path to sugar>\n";
}
@chicks
chicks / DB2_Install_Steps.sh
Last active December 8, 2018 13:04
Sugar and DB2 on CentOS 6.4
# Disable SELinux
echo 0 > /selinux/enforce
perl -pi -e 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
# Install required packages
yum install pdksh compat-libstdc++-33 compat-libstdc++-33.i686 libaio libaio.i686 \
pam-1.1.1-17.el6.x86_64 pam-1.1.1-17.el6.i686 nfs-utils openssh-clients \
numactl
# Update Kernel Parameters (http://ibm.co/1czEKb4)
@chicks
chicks / Jenkins_Setup.sh
Last active December 31, 2015 13:39
Sugar Development with Jenkins CI and GitHub (CentOS 6.5)
# Make sure we're using a compatible java
yum remove java
yum install java-1.6.0-openjdk wget
# Install Jenkins
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
# Enable Jenkins at boot, and start it up
@chicks
chicks / gist:8334990
Created January 9, 2014 14:33
Upload File to Account in Sugar
# Create Note
set_entry: Request:
{
"session": "eubisbbcntp13gcvmq9nlcess1",
"module_name": "Notes",
"name_value_list": {
"name":{"name":"name","value":"A Test Note"},
"team_count":{"name":"team_count","value":1},
"team_name":{"name":"team_name","value":"Global"}
}
@chicks
chicks / 0_Sugar_On_CentOS
Last active January 3, 2016 14:29
Sugar and Percona MySQL on CentOS 6.5 w/ PHP 5.4, ElasticSearch, and Memcache
# Install Guide for Sugar on CentOS
# 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
@chicks
chicks / 1_Install_Tidbit.sh
Last active May 21, 2018 12:46
Load Testing Sugar Cheat Sheet
# 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
@chicks
chicks / SugarCRM LAMP Stack Tuning
Last active February 8, 2021 13:33
SugarCRM Performance Tweaks
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:
@chicks
chicks / demo_data.php
Created February 13, 2014 04:04
Demo Data Generation By Hand
<?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';
<?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