Skip to content

Recent Articles

30
Jun

Python 3: __del__ method and imported modules

My python script generates the following error and the strange thing is that this error only occurs occasionally:

Exception AttributeError: "'NoneType' object has no attribute 'path'" in 
<bound method Client.__del__ of <__main__.MyObject object at 0x108c3dc50>> ignored

Read more »

26
Jun

Salesforce: Triggering Closed/Won Opportunity to New Entry in Assets Table associated with Opportunity.

In Salesforce, when an opportunity stage becomes ‘Closed/Won’, it doesn’t automatically convert the Products in Opportunity (OpportunityLineItem) into Assets. Luckily, there are two contributed packages available in Salesforce’s Appexchange; one by Comity Design and the other one by Salesforce Lab.

In this article, we

  • Install the Closed/Won trigger package
  • Add custom field to Asset table to reference Opportunity
  • Modify trigger code to update the reference to Opportunity in the Asset table
  • Show how to include the Assets table in the Accounts page layout

Read more »

19
Jun

PowerDNS: Configuring and Running Authoritative & Recursor Servers In The Same Host.

This article gives a quick introduction of setting up PowerDNS (pdns) Authoritative and Recursor servers, and also demonstrates a scenario that how we need to use both in the same host.

DNS

DNS has two type of server operations: Authoritative and Recursive. Most common use of DNS servers is authoritative. For those who don’t know the difference, here is a good introduction. Both are for different purposes, also both types of server can be operated individually and cooperatively under the same host. Read more »

23
Mar

Issue on running grunt. Error: Cannot find module ‘findup-sync’

grunt error

This problem occurs when I archive the whole node_modules directory (including the grunt command) to another machine. I have to do this because I have to create an Ubuntu 14 ISO for offline installation containing grunt as a requirement. Generally, this copy across approach works fine but not straightforward for grunt.

Although reinstalling grunt on the target machine works, it is not an option to me,

npm install -g grunt-cli

The real problem is actually the executable, /usr/local/bin/grunt, that is supposed to be a symbolic file which links to ../lib/node_modules/grunt-cli/bin/grunt. Copying across can break the symbolic link which causes the above error when running it. Rebuild the symbolic link and the problem is resolved.

 

23
Mar

Checklist to configure headless and offline Ubuntu 14

Headless

Grub Failsafe boot

Set the boot failsafe prompt to have some timeout instead of indefinite wait

echo 'GRUB_RECORDFAIL_TIMEOUT=5' &gt;&gt; /etc/default/grub
update-grub

Fsck fix

Don’t ask when fs needs checking

echo 'FSCKFIX=yes' &gt;&gt; /etc/default/rcS

Offline

Automatic Check New Release

/etc/update-manager/release-upgrades

[DEFAULT]
Prompt=never

Apport – sending bug/crash reports

/etc/default/apport

enabled=0

Postfix – Mail transfer agent

update-rc.d postfix disable

apt-check – periodic apt check

/etc/apt/apt.conf.d/10periodic

APT::Periodic::Update-Package-Lists "0";

More to come when I find out more ….

14
Mar

Building ExtJs/Highcharts Application with Sencha Cmd 4 Tool

Here is a blog showing you how to build application with the Highcharts extension using Sencha Cmd 4 tool. First of all, we generate ExtJs 4 application skeleton with the following command example:

~/bin/Sencha/Cmd/4.0.4.84/sencha -sdk extjs4 generate app SenchaCmd4Demo sc4demo

Next we copy (don’t use symbolic link) the whole ‘Chart’ directory into the application directory.

cd sc4demo
cp -fr {path}/{to}/Highcharts_Sencha/Chart .

Read more »

28
Feb

Building ExtJs/Highcharts Application with Sencha Cmd 5 Tool

A number of users have asked me how to build ExtJs application with my Highcharts extension using Sencha Cmd tool. I have been ignoring this question with the excuse of way too busy. Now, my new book is done and I am going to address this here. The aim of this article is to demonstrate that the extension does work with sencha command tool.

Lets start off by generating an ExtJs 5 application with the following sencha command:

sencha -sdk extjs5 generate app HighchartsSenchaDemo hcExtJsDemo

Read more »

3
Feb

Postgresql – command line to return a single size value of databases

Return the total size usage of a particular database

psql -c "SELECT pg_database_size(pg_database.datname) FROM pg_database WHERE pg_database.datname = 'MyDatabase'; " -t -h localhost -U postgres

Return the total size usage of all the databases

psql -c "SELECT sum(pg_database_size(pg_database.datname)) FROM pg_database;" -t -h localhost -U postgres;

screen

1
Feb

Converting HTML document with IMG src link to IMG embedded data in PHP

In my previous blog, I need to convert a HTML document with IMG src link to IMG with embedded base64 image content. Here is a PHP script that scans the HTML document and replace the IMG tags with embedded content, i.e. changing from this

<img src='./4/data.png'/>

to that

<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhE....

Read more »

31
Jan

Notes on exporting HTML document with images to Word on Linux

We have a web application (under Ubuntu webserver) with a WYSIWYG html editor which let users to create a report template with custom tags. These custom tags are then resolved to technical graph images and embedded into the report. This application allows users to

  1. preview the report with graphs on the web browsers
  2. schedule to generate the report which then export to Word document and deliver via email attachment.

Read more »

Follow

Get every new post delivered to your Inbox.

Join 38 other followers