Skip to content

Instantly share code, notes, and snippets.

View aorborc's full-sized avatar

A or B or C Technologies aorborc

View GitHub Profile
#!/bin/sh
# Install OpenERP 7 on Digital Ocean
# Fernando Altuzar
# Modified script from Carlos E. Fonseca Zorrilla & Mario Gielissen
# First: Create a Droplet with CentOS 32 bits
# Then:
yum -y install wget unzip
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm
@aorborc
aorborc / openerp-Ubuntu-installation
Last active June 26, 2020 02:22
Install OpenERP 7 on Ubuntu
# copied only the scripts from http://www.theopensourcerer.com/2012/12/how-to-install-openerp-7-0-on-ubuntu-12-04-lts/
sudo apt-get install openssh-server denyhosts
sudo apt-get update
sudo apt-get dist-upgrade
sudo adduser --system --home=/opt/openerp --group openerp
sudo apt-get install postgresql
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt openerp
#Enter password for new role: ********
#
# /etc/apache2/sites-available/openerp
#
# OpenERP Reverse Proxy Configuration for Apache 2.
#
# Authors: 2014 Mariano Ruiz <mrsarm@gmail.com>
#
# After copy this file execute:
#
# sudo a2ensite openerp
import sys
n = int(raw_input("Enter the Counter number : "))
for i in range(1,n):
if( i% 15 == 0):
print "fizzbuzz"
elif (i%3 == 0):
print "fizz"
elif (i%5 == 0):
print "buzz"
else:
@aorborc
aorborc / function.php
Created December 4, 2019 07:00 — forked from YugalXD/function.php
Send mail with mailgun api by PHP CURL.
<?php
define('MAILGUN_URL', 'https://api.mailgun.net/v3/DOMAIN_NAME');
define('MAILGUN_KEY', 'KEY');
function sendmailbymailgun($to,$toname,$mailfromnane,$mailfrom,$subject,$html,$text,$tag,$replyto){
$array_data = array(
'from'=> $mailfromname .'<'.$mailfrom.'>',
'to'=>$toname.'<'.$to.'>',
'subject'=>$subject,
'html'=>$html,
@aorborc
aorborc / PushToZohoCreator.php
Last active October 18, 2023 12:09
Create Access Token using Zoho Creator API V2 and add record using PHP. Youtube Tutorial at https://www.youtube.com/watch?v=UqSsP-wz-mE
<?php
$client_id ='1000.GUPPSEH1013UZQA5SN8OAJV1DQU5FM';//Enter your Client ID here
$client_secret = '4932018fd429a4246e96d9186e77704d88d05b052a';//Enter your Client Secret here
$code = '1000.bf0e3723d718ac74660843a2128946b8.c6a7d9ce01ea879a22803f5f88bb0a6c';//Enter your Code here
$base_acc_url = 'https://accounts.zoho.com';
$service_url = 'https://creator.zoho.com';
$refresh_token = '1000.4f4b206a80c5e3e48c1cf3a55994a19c.c7c25dc7144da53c497b2d2ca834d1d0'; //Replce this with your Refresh token
$token_url = $base_acc_url . '/oauth/v2/token?grant_type=authorization_code&client_id='. $client_id . '&client_secret='. $client_secret . '&redirect_uri=http://localhost&code=' . $code;
@aorborc
aorborc / ReadZohoBlogs.gs
Last active March 23, 2022 07:48
Get the latest posts from Zoho Blogs posted in the last hour and send an email via Google Apps Script
function readAndSend() {
let url = 'https://www.zoho.com/blog/feed';
let xml = UrlFetchApp.fetch(url).getContentText();
let document = XmlService.parse(xml.trim());
let root = document.getRootElement();
let channel = root.getChild('channel');
let items = channel.getChildren('item');
for(i =0; i< items.length; i++){
let item = items[i];
let pubDateStr = item.getChild('pubDate').getText();
@aorborc
aorborc / Amount2Words.js
Last active June 28, 2023 15:14
Zoho Creator Functions to Convert Indian Rupees (with paise) Amount to Words
string String.Amount2Words(float amount)
{
//amount.frac() not working for long numbers
paise_str = amount.toString().getSuffix(".");
if(paise_str != "")
{
paise_amount = paise_str.toLong();
paise_str = " and "+ thisapp.String.TwoDigitWords(paise_amount) + " paise";
}
rupee_str = String.RupeeInWords(amount.toLong());
@aorborc
aorborc / guage.js
Last active July 7, 2022 20:58
Process Custom JSON with Guage and table in Zoho Creator HTML -- https://help.zoho.com/portal/en/community/topic/dashboard-data-from-deluge-function
<%{
data_source = {"code":"0","description":"Success","subscriberQuota":{"qtavalue":"500.00","qtabalance":"419.30","qtaconsumption":"80.70","type":"2","refuelingTotal":"0.00","qtaconsumptionTotal":"263.22"},"historyQuota":{{"time":"20220707","qtaconsumption":"19.07","mcc":"714"},{"time":"20220707","qtaconsumption":"236.41","mcc":"710"},{"time":"20220707","qtaconsumption":"7.74","mcc":"708"},{"time":"20220706","qtaconsumption":"164.85","mcc":"714"}},"ext":null};
subscriberQuota = data_source.get("subscriberQuota");
qtaconsumption = subscriberQuota.get("qtaconsumption").toDecimal();
qtavalue = subscriberQuota.get("qtavalue").toDecimal();
percent = ((qtaconsumption / qtavalue).round(4) * 100).round(2);
deg_value = percent / 200;
%>
<div style="margin:10px;display:flex;flex-direction:column;">
<h1 style="text-align:center;">subscriberQuota</h1>
@aorborc
aorborc / gts.jsp
Last active November 4, 2022 01:52
Guess the Song HTML page code. Tutorial at https://youtu.be/ljD3y925zIg
<%{
%>
<link
href="https://aorborc.github.io/bootstrap5/css/main.min.css"
rel="stylesheet"
crossorigin="anonymous"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link