Skip to content

Instantly share code, notes, and snippets.

@vjaro
vjaro / repair.php
Last active March 30, 2018 03:04
SugarCRM Quick Repair and Rebuild From the Command Line
#!/usr/bin/php
<?php
if(!defined('sugarEntry'))define('sugarEntry', true);
require_once('include/entryPoint.php');
require_once('modules/Administration/QuickRepairAndRebuild.php');
//Bug 27991 . Redirect to index.php if the request is not come from CLI.
$sapi_type = php_sapi_name();
@vjaro
vjaro / packages_si.php
Created March 26, 2014 10:21
Install SugarCRM Module Packages from the Command Line
#!/usr/bin/env php
<?php
function usage()
{
print("usage: -i /path/to/instance -p /path/to/expanded/module -z /path/to/zipfile\n");
exit(1);
}
$opts = getopt('i:p:z:');
<?php
$sugar_config_si = array(
'setup_db_host_name' => 'localhost',
'setup_db_database_name' => '{DB_NAME}',
'setup_db_drop_tables' => 0,
'setup_db_create_database' => 1,
'setup_db_pop_demo_data' => 0,
'setup_site_admin_password' => '{ADMIN_PASSWORD}',
'setup_db_create_sugarsales_user' => 0,
'setup_db_admin_user_name' => '{DB_USER}',
<?php
$sugar_config_si = array(
'setup_db_host_name' => 'localhost',
'setup_db_sugarsales_user' => 'sugarcrm',
'setup_db_sugarsales_password' => 'DB_USER_PASSWORD',
'setup_db_database_name' => 'sugarcrm',
'setup_db_type' => 'mysql',
'setup_db_pop_demo_data' => false,
<?php
$sugar_config_si = array(
'setup_db_host_name' => 'localhost',
'setup_db_sugarsales_user' => 'sugarcrm',
'setup_db_sugarsales_password' => 'DB_USER_PASSWORD',
'setup_db_database_name' => 'sugarcrm',
'setup_db_type' => 'mysql',
'setup_db_pop_demo_data' => false,
@vjaro
vjaro / Manual
Last active August 29, 2015 14:03
Manual PHP building
wget -q -O - http://www.atomicorp.com/installers/atomic | sh
yum install httpd -y
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
service iptables save
service httpd restart
check if appache is installed
yum install mysql-server mysql -y
service mysqld start
/usr/bin/mysql_secure_installation
service mysqld restart
@vjaro
vjaro / es.sh
Created September 1, 2014 09:05 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@vjaro
vjaro / gist:f6a82f76c58f38c98cc6
Created May 14, 2015 08:18
Xdebug with CentOS 6.5 + PHPStorm Configuration
xdebug.remote_enable=true
xdebug.remote_host=your_ip
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/tmp/xdebug/prof"
xdebug.idekey="PHPSTORM"
DEVICE=eth0
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
IPADDR=192.168.1.44
NETMASK=255.255.255.0
Setup NAT and Host Only adapter
// iMacro CheatSheet - Command Reference
// http://wiki.imacros.net/Command_Reference
// iMacros supports 3 types of variables:
// * The macro variables !VAR0 thru !VAR9. They can be used with the SET and ADD command inside a macro.
// * Built-in variables. They contain certain values set by iMacros.
// * User-defined variables. They are defined in-macro using the SET command.