Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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 / en_us_lang.php
Last active December 17, 2015 04:18
Programmatically Change Dropdowns in Sugar
// custom/include/language/en_us.lang.php
$GLOBALS['app_list_strings']['sales_stage_dom']=array (
'Prospecting' => 'Prospecting',
'Qualification' => 'Qualification',
'Needs Analysis' => 'Needs Analysis',
'Value Proposition' => 'Value Proposition',
'Id. Decision Makers' => 'Id. Decision Makers',
'Perception Analysis' => 'Perception Analysis',
'Proposal/Price Quote' => 'Proposal/Price Quote',
'Negotiation/Review' => 'Negotiation/Review',
@chicks
chicks / layoutdefs.ext.php
Last active December 17, 2015 03:38
Limit which subpanels are displayed by a custom field on User
<?php
// Put this in: custom/modules/Accounts/Layoutdefs/layoutdefs.ext.php
global $current_user;
$edition = $current_user->edition_c;
if ( $edition == "Basic" ) {
unset($layout_defs['Accounts']['subpanel_setup']['documents']);
unset($layout_defs['Accounts']['subpanel_setup']['quotes']);
}
@chicks
chicks / add_and_remove_user_from_role.json
Last active December 17, 2015 03:29
Manipulate Roles for a Sugar User
// Add user to Standard Role
set_relationship: Request:
{
"session": "ok01qfmdj0fihe5mlbddjsbj61",
"module_name": "ACLRoles",
"module_id": "323ce5f6-b090-8cbd-e9c1-518ab8951821", // Role ID
"link_field_name": "users",
"related_ids": ["1af1e378-9126-ffa9-a026-518a9bdd6177"], // User ID
"name_value_list": [],
"delete": 0
@chicks
chicks / gist:5258166
Created March 27, 2013 21:26
Rename Cells, Nodes on WAS 7
ConnectionsCell01
ConnectionsCellManager01
ConnectionsNode01
ConnectionsNode02
AdminConfig.list('Server')
dmgr(
cells/ip-10-172-50-218Cell01/
nodes/ConnectionsCellManager01/
servers/dmgr|server.xml#Server_1
<?php
// Server in the this format: <computer>\<instance name> or
// <server>,<port> when using a non default port number
$server = 'localhost';
$user = 'sa';
$pass = 'password';
// Connect to MSSQL
$link = mssql_connect($server, $user, $pass);