Skip to content

Instantly share code, notes, and snippets.

@chicks
chicks / updates.diff
Last active October 15, 2022 23:07
jackcaddy_lilygo_wifi
(base) chicks@Charless-MacBook-Pro jackcaddy % git show a9c172c505341b7c1d7e87a7de833e14cab89e7e
commit a9c172c505341b7c1d7e87a7de833e14cab89e7e (HEAD -> lte_refactor_broken)
Author: Charles Hicks <charles@longtail.energy>
Date: Sat Oct 15 16:02:45 2022 -0700
Attempt to refactor for lte support.
diff --git a/platformio.ini b/platformio.ini
index 26a0870..13d0e63 100644
--- a/platformio.ini
/* ejri
// This code: connecting 5 accelerometers to esp32.
The processed data is sent to IoT Hub over LTE Cat-M.
LTE cat-M connection over TinyGSM
https://github.com/vshymanskyy/TinyGSM
Note: even though wifi doesn't actually connect:
// Basic OLED demo for accelerometer readings from Adafruit MPU6050
// ESP32 Guide: https://RandomNerdTutorials.com/esp32-mpu-6050-accelerometer-gyroscope-arduino/
// ESP8266 Guide: https://RandomNerdTutorials.com/esp8266-nodemcu-mpu-6050-accelerometer-gyroscope-arduino/
// Arduino Guide: https://RandomNerdTutorials.com/arduino-mpu-6050-accelerometer-gyroscope/
#include <Adafruit_MPU6050.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_Sensor.h>
#include <driver/adc.h>
#
# This is how I moved a DB2 database from one server to another.
#
# The source DB2 instance was setup to point to db2inst3 with a schema of DB2INST3
# The target DB2 instance was setup to point to db2inst1 with a schema of DB2INST1
#
# The basic flow was to:
# 1. Restore the backup on the target server
# 2. Create a user that matched the source DB user, and grant rights to the target DB user
# 3. Export the source Schema and Table Data
sugar_config_si = array (
'setup_db_host_name' => 'localhost',
'setup_db_database_name' => 'sugarcrm',
'setup_db_drop_tables' => true,
'setup_db_create_database' => true,
'setup_site_admin_user_name' => 'admin',
'setup_site_admin_password' => 'admin',
'setup_db_create_sugarsales_user' => false,
'setup_db_admin_user_name' => 'root',
'setup_db_admin_password' => 'root',
<?php
//-----------------------------------------------------------------------------
if(!defined('sugarEntry'))define('sugarEntry', true);
require_once('include/entryPoint.php');
//-----------------------------------------------------------------------------
$db = DBManagerFactory::getInstance();
//-- TEMPLATE = birgit
$query = "SELECT id from users where user_name='birgit'";
$result = $db->query($query, true,"Error fetching birgit: ");
@chicks
chicks / create_rli.js
Created December 31, 2014 22:01
Create RLI Using Selenium Webdriver.js in Sugar 7
client.init();
client.url('http://localhost:8888/s721');
client.waitUntilVisible('a[name="login_button"]', function(err, res) {});
client.setValue('input[name="username"]', 'admin');
client.setValue('input[name="password"]', 'letmein');
client.click('a[name="login_button"]');
client.waitUntilVisible('#tutorial-controls');
client.click('a[title=Done]');
client.waitUntilVisible('button.close')
@chicks
chicks / gist:217e83e0fe9f848ebdd9
Created October 24, 2014 18:00
Populate Lead Score Columns in MySQL
UPDATE contacts_cstm SET lead_score_rank_c =
ELT(1 + FLOOR(RAND()*5), 'Inquiry', 'Prospect', 'Marketing Qualified', 'Sales Accepted', 'Sales Qualified');
UPDATE contacts_cstm SET engagement_score_rank_c =
ELT(1 + FLOOR(RAND()*3), 'Passive', 'Active', 'Engaged');
@chicks
chicks / install_proxy.sh
Last active August 29, 2015 14:00
Install Cognos Proxy
# Checkout the right git repo
git clone git@github.com:sugarcrm/cognos.git
git checkout -b master origin/master
# Setup Apache proxy for cognos proxy
Add this to /etc/httpd/conf.d/cognos.conf
<VirtualHost *:80>
ServerName cognos.sugarcrmdemo.com
ProxyRequests Off
#!/bin/bash
# chkconfig: 2345 90 90
# description: Cognos Business Intelligence
### BEGIN INIT INFO
# Provides: cognos
# Required-Start: network
# Required-Stop: network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start the program