Wednesday, December 10, 2014

Howto Install Joomla 3 on MS Windows 8

Content Management Systems (CMS) provides a simple framework to focus on developing a web site to deliver specific contents. Basic stuff like user authentication, layout and web standards will be handled by the CMS while more important stuffs like getting the message across and providing a specific service can be the main focus.

Yes, gain insights of experts and community around the world by using a CMS like Joomla! that practices use of open source software (OSS) license.

Installation was done based on notes from docs.joomla.org at https://docs.joomla.org/Use_Joomla!_on_your_own_computer

Following are my notes on installation of Joomla! 3.3.6 on Windows 8. Before going to step 1, ensure the web server has;

Apache 2.4
PHP 5.4 (min 5.3.10), enable following PHP modules
  • Magic Quotes GPC Off
  • Register Globals Off   
  • Zlib Compression Support 
  • XML Support   
  • Database Support: (mysql, mysqli, pdo)  
  • MB Language is Default 
  • MB String Overload Off  
  • INI Parser Support    
  • JSON Support  
  • configuration.php Writeable
MySQL 5.5

Step 1: Getting Joomla!

Download Joomla! from http://www.joomla.org/download.html and extract it to a folder, e.g. myjoomla.
Copy this to your web folder. e.g. C:\apache24htdocs

Step 2: Preparation

Create a MySQL database called myjoomla3. Login to MySQL client and type;

CREATE database myjoomla3;

 And logout.

Step 3: Installation

Open a web browser and enter URL Address. E.g. http://localhost/myjoomla and enter details. Complete the sections for "Configuration", "Database", "Overview".

Configuration


I choose to create the default Administrator username as "admin".



Database
Ensure the configuration for database created is entered correctly. Choose MYSQLi if you are prompted to do so.

Overview
Choose Install Sample Data: Default English (GB) Sample Data

Click "Install". When installation is completed, you will receive the confirmation message "Congratulations! Joomla! is now installed."

Open Windows Explorer and remove the installation folder in joomla named installation. E.g. C:\Apache24\htdocs\myjoomla\installation


Step 4: Post installation

Test the installation with a web browser as;
  1.  front-end page  at http://localhost/myjoomla/
  2.  site administration page  at http://localhost/myjoomla/administrator/
First access: Front-end on desktop

First access: Front-end on mobile
First access:Administration page


Step 5: Choosing a template

This is an extra step for looks. In a web browser open the Administration page, e.g. http://localhost/myjoomla/administrator

In the default Administration page, observer the left column and click "Template Manager". In the left menu choose "Styles". There are 4 styles available for you;
  1. Beez3 (for Front-end)
  2. Hathor (for Administration page)
  3. isis (Default for Administration page)
  4. protostar (Default for Front-end)
 Try to click on Hathor, notice the page has changed. Click Beez3, and in Front-end see the changes.


Done.

Wednesday, December 3, 2014

Install DebugKit for Cakephp 2.5

Debugging in Cakephp is made easier with the DebugKit. Here are steps to install the DebugKit on Centos 6 and CakePHP 2.5.6.

Following are notes based on installation instructions from the Debugkit site.

Step 1: Install CakePHP 2

See previous posting on Installing Cakephp.

Step 2: Download and extract

Read the instructions from DebugKit from Github then download and extract to the cakephp folder app/Plugin.

cd /var/www/html/cakephp-2.5.6/app/Plugin
unzip debug_kit-master.zip
mv debug_kit-master debug_kit
chown -R apache debug_kit-master

Step 3: Configure CakePHP

In app/Config/bootstrap.php add following line;

CakePlugin::load('DebugKit');

In app/Controller/AppController.php edit the class with the array line;

class AppController extends Controller {
         public $components = array('DebugKit.Toolbar');
}



In app/Config/core.php change debug from 2 to 1
         Configure::write('debug', 1);

Note: The Make sure to remove the 'sql_dump' element from your layout (usually app/View/Layouts/default.ctp)

In a web browser open the cakephp site to confirm if Debugkit is available. e.g. http://localhost/cakephp-2.5.6



Howto install CakePHP 2.5 on Centos 6

Installation of this PHP programming framework is based on the installation guide CakePHP from cakephp.org. There is a document on upgrades from CakePHP 1.3, here.

The Centos Linux 6.4 setup based on requirements:
httpd 2.2.15-28x
php-5.3.3-27x
php-pdo-5.3.3-27x
mysql-5.169x

Step 1: Extract Cakephp 

Download the code from https://github.com/cakephp/cakephp/tags
or from Linux console with proper permission (e.g. use sudo if you are not root user)

wget https://github.com/cakephp/cakephp/archive/2.5.6.zip
cd /var/www/html
unzip cakephp-2.5.6.zip
chown -R apache cakephp-2.5.6
ls cakephp-2.5.6

This gives us the folders;
Cakephp2 folders

Cakephp2 folders for app

Step 2: Test installation

Ensure the web server is running, and open a web browser to that installation. E.g. http://localhost/cakephp-2.5.6/

It should appear with a page similar as below;

Step 3: Post installation

Follow instructions given at the test page to rectify any errors/recommendations. E.g.
  1. Change value of Security.salt in core.php file
  2. Change value of Security.cipherSeed in core.php file
  3. Configure to use a database in database.php
  4. Install the DebugKit
Note:
Its made easy to migrate from CakePHP 1.3 to 2.5. Good read on upgrading of 1.3 to 2 (in no particular order)
  1.  stacks
  2. Upgrade to CakePHP 2.
  3. CakePHP Migration.
  4. Authentication.

List files as a tree in Linux

Usually we have the directory listing as follows;

ls -l



Can we print the linux directory in a tree format? Yes we have several options, of which two is shown here.

Option 1

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'

Option 2

Install the tree package (Steve Baker, Francesc Rocher) then execute it.

tree 
This command can specify depth of folders.
tree -L 2


Thursday, November 27, 2014

Resize video with Avidemux


Avidemux, a video editing tool is an open source software or GPL v2 licensed, and can be downloaded from http://www.avidemux.org for Linux, Mac OS and MS Windows. Currently I am using version is 2.6.8 on MS Windows 8.






Found a good reference Compressing with Avidemux by Bo be.


Need to try this out soon to prepare videos to be shared online (outside of youtube).

Points to note
General file size = bitrate * running time


Thursday, November 13, 2014

Howto set Default Account in Thunderbird

Mozilla Thunderbird is a widely used Email client that is fast, friendly and can be extended with many plug-ins available for Linux, OS X and MS Windows platform. Licensed with Mozilla Public License 2.0 it is an open source software (OSS) with an active list of developers. The current version being 31 and more information can be found at Mozilla website.
Mozilla Thunderbird


Many email accounts can be created within this email client and this makes it easy to see all emails from one screen. Emails can be composed by opening the Thunderbird email client or via links that user clicks to activate the email composer. In order improve efficiency, one of the accounts can be assigned as the default email account and this is normally indicated in bold. This allows all new emails to use this account and users do not need to choose the account. I have listed the steps tested for Thunderbird version 24 and 31 where the example shows account2 in bold as the default account and we want to switch the default to account1.

Step 1: Open Thunderbird account's setting.

Start Thunderbird and from its menu bar at the top (default), choose Tools ->Account Settings...
Identify the default account that is used to send out emails. This is in bold, for example "account2"

Step 2: Set the default account

Choose the account to be used as the default. In this case, its "account1". At bottom of the window, click Account Actions. Choose "Set as Default".

Click OK, notice that this email account will go to the top of the list and is in bold font. Ensure all email screens are closed and restart Thunderbird.

Thursday, October 9, 2014

Managing Firefox Sidetab

In the recent upgrade to Firefox version 32.xxx, the sidetab bar appeared when using the Delicious bookmarks addon. Steps shown are for disabling and enabling display of the sidebar.

So whats a sidebar? Its just displays and application/addon in a column next to the web pages being viewed. Delicious and Facebook are example of addon that uses Sidebars.


Disable the sidebar

Step 1. Disable sidebar
At the top of the sidebar, click on the gear.
Uncheck the "Show sidebar".
Done

Enable sidebar
Step 1. Add Sidebar item to the Firefox menu.
Click on the Firefox menu, choose "Customize"
In the Additional Tools and Features window, drag "Sidebars" icon to the menu. Click "Exit Customize"

Step 2. Turn on Sidebar.
Click on Firefox menu, choose Sidebars.

Click on the Application available for Sidebars. In this case its the Delicious bookmarks.

Done.

Monday, September 29, 2014

Presenting ideas with Mind Map

Was on the internet today and saw a long time software, Freemind. How I miss working with Mind Map.

Mind mapping was traditionally used on sheets of paper or mahjong paper to present ideas and later it was also used for teams to work together to build an idea together. The mind mapping technique I learnt was something made popular by Tony Buzan, UK. Looks like branches from a tree, but from what I have also learnt, mind mapping was around long before Buzan and appears in many forms to pictorially describe an idea. Officially, I learnt a great deal of mind mapping during the courses at SMR.

Many of the mind mapping software subscribes to Buzan way of doing things. There are 2 software that is open source software; (1) Freemind is a Java Technology based mind mapping tool that allowed users to use data interchangeably on Linux and MS Windows. (2) XMind is considered one of the more popular tool in the Internet, but it didn't really stick with me. Note taking tools such as Evernote provided even more flexibility for mind mappers as it is integrated with XMind.

Saw good reviews on Mindomo, why not try it, as its advantage is that it is available on MS Windows, Mac and Android. That is if you don't mind installing Adobe Air.

Today, there is even a mind mapping tool built into Chrome web browser.

See https://chrome.google.com/webstore/detail/mindmap/gdaeohpmcenmffofpikllphdhlkkocfa?utm_source=gmail

It saves the mindmap in Google Drive and I can access it pretty much any where.

Serious exploits in August and Sept 2014

These recent months have shown how the open source software model could handle (or is still handling) bugs that could be turned into an exploit of Linux servers. These are;

Shellshock (Sept 2014) - remotely take over a server.
BBC http://www.bbc.com/news/technology-29361794

Heartbleed (April 2014) - OpenSSL data could be intercepted.
BBC http://www.bbc.com/news/technology-28867113

The sheer number of Linux servers affected means that it is a serious threat and is wide spread. In Heartbleed, its patched but Shellshock is yet to have a patch to fully resolve the bug.

Interesting technical discussion on Shellshock is found at stackexchange.
https://unix.stackexchange.com/questions/157329/what-does-env-x-command-bash-do-and-why-is-it-insecure

How do you know if your shell is vulnerable? Hackernews recommends to run the following command in all the shell being used;

env X="() { :;} ; echo shellshock" /bin/sh -c "echo completed"
env X="() { :;} ; echo shellshock" `which bash` -c "echo completed"

If you see the text output "shellshock", please find a patch.

Chris, a contributor at Buzzfeed News, provided a good material on how 2 persons maintained the OpenSSL package, Steve Marquess and Stephen Henson. The commercial entity for this is known as OpenSSL Software Foundation.

Now doesn't it make you wonder who is responsible of bash shell and is it the same package for every Linux distro?


Tuesday, September 9, 2014

What is FTP?

FTP or File Transfer Protocol
"... is a standard network protocol used to transfer computer files from one host to another host over a TCP-based network, such as the Internet. FTP is built on a client-server architecture and uses separate control and data connections between the client and the server."
wikipedia.org

One reason why this is being replaced by other network protocol is in its exposure of the user password in plain text for a traditional FTP server. SSH and encrypted FTP sessions have replaced almost all new implementations these days.

Which ports are used by this service?
Standard ports used are port 20 (data) and 21 (command) but this may change depending on the server's settings. On the client FTP site, free standard ports higher than number 1023  is used.



This service by the FTP Server can provide active or passive connection and sometimes both. A simplified explanation in Slacksite.org entitled "Active FTP vs. Passive FTP, a Definitive Explanation" is a good read.

Typically, on the FTP server in Passive mode will require connection to several higher standard ports and this allows larger number of connections. In Active mode, limitation on the server is to how many connections can be done over that one port 20.

How to determine if its in Passive more?
After login to FTP server, type
quote PASV

How to establish connection to an FTP server?
Use an FTP client and enter the FTP server's URL. E.g. on Linux, to connect to the FTP server ftp.myserver.com

ftp ftp.myserver.com

-end-


Friday, September 5, 2014

Microsoft's Windows Defender

It was time to uninstall the McAfee antivirus that came pre-installed with the Windows 8 laptop. Just by doing that I noticed that the bubble appear to say that I am no longer protected and to click it. This is when Windows Defender application started, which makes me wonder if its good enough to replace the previous antivirus.

Doing an update to virus and spyware definition version 1.183.1668.0 on 5th Sept 2014. Will continue to run this with Basic membership setting where this means almost anything could be sent to Microsoft.




Tuesday, August 26, 2014

Quick start to Mozilla Firefox OS 1.x

For those of you who were looking for a new smart phone, it might be good to also look at Firefox OS. This is being developed by Mozilla and will be a game changer.

Quick notes:

  1. Initially known as B2G (Boot to Gecko) in the Mozilla Project and initially demonstrated in 2012
  2. Has a Linux based operating system
  3. Target for smart phones, tablets and smart TV.
  4. Among the first adopter was ZTE Open phone
  5. Its has 4 software layers. I.e. Gonk (Linux kernel), Gecko (application services), XUL Runner (Application run-time) and Gaia (User interface system)
  6. Supports HTML5
  7. Website at https://developer.mozilla.org/en-US/Firefox_OS
  8. Apps can be found at the Firefox marketplace.
Current development is at Firefox OS 1.3 (Stable) and Firefox OS 2.1 (Unstable)  and you can try it out via a simulator.

Following are steps to install and run a simulator:
Requirements: Firefox version 30+

Step 1. Install the simulator.

Open Mozilla Firefox web browser and access "App Manager add-ons" by typing in the URL
https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/

Click "Install Firefox OS 1.3 Simulator (Stable)" or which ever version pleases you.

When the Pop-up appears, Click "Allow" then wait till the download starts (There isn't any indicator onscreen) and when the Software Installation box appears, click "Install Now".

Click "Firefox OS 1.3 Simulator has been installed successfully."

Step 2:  Check installation

To determine if its installed, open Mozilla Firefox web browser and enter URL as
about:addon

You should see "Firefox OS 1.3 Simulator ...."

Step 3: Start up the App Manager

In Mozilla Firefox web browser enter URL as
about:app-manager

At bottom of the  App Manager click "Start Simulator"
The Firefox OS Simulator will appear as a new Firefox Window.


Congratulations...you now have access to the latest Smartphone OS.





Tuesday, July 8, 2014

Howto Turn On Menu and Back Button Lights on Samsung S3

The Samsung S3 is a clever device to conserve energy, but to some users who keep forgetting where is the frequently invisible "Menu" and "Back" buttons, they should have it lit all the time (and off when screen is off).

These buttons are on the left (Menu) and right (Back) of the Home button. By default, each time either keys are pressed, the lights will stay lit for about 1.5 seconds only.


Here are step to have "Menu" and "Back" buttons lit all the time (and off when screen is off).

Step 1. At the Home screen, go to settings.
Simple? For the unacquainted, just touch the Apps button (usually the centre circle at bottom of the screen) and choose settings.

Step 2. Choose "My device", scroll down and touch "Display". 

Step 3. Scroll down to touch "Touch key light duration".

 Step 4. Choose "Always on".

Press "Home" and you will notice the lights are lit next to the "Home" key. If the screen if off, these lights will also go off.

Howto Turn Off Samsung S3 keyboard sound

For some reason, the keyboard on Samsung S3 (GT-I9300) started to beep with each press and this gets annoying after having to type lots. Instructions can be applied for most Android 4, but here the screenshot are for Android 4.3 kernel version 3.0.31-2429075 dpi@HP20 #1.

To turn off/on the sound in 3 simple steps;

Step 1. At the Home screen, go to settings.
Simple? For the unacquainted, just touch the Apps button (usually the centre circle at bottom of the screen) and choose settings.

Step 2. Choose "My device", scroll down and touch "Language and input"





Step 3. Scroll down and find Key-tap feedback "Sound". To turn keyboard sounds off, uncheck the "Sound" box.


Press the "Home" key and you can test out keyboard sound, off or on as you have  selected.


Thursday, May 15, 2014

Writing Equations in Moodle - Part 2

This is a follow up post on enabling users to write equations in Moodle. In the previous post, the required tools were installed on Linux (Centos Linux) and we resume from there.

Step 1:

Login as administrator in Moodle. In the Administration menu, click on Plugins-> Filters-> Manage filters
Choose Filter for Tex notation and change Active? to On. If you click Settings it will bring you to the same screen as in the next step below.

In the Administration menu, click on Plugins-> Filters-> Tex notation
Verify that Path of Latex, dvips and convert binary all contain the linux tools that was created in Part 1 of this tutorial.

Latex = /usr/bin/latex
dvips = /usr/bin/dvips
convert = /usr/bin/convert

Change the convert output format to PNG.

Step 2:

Within a course, create a content and notice that the Insert equation button is visible in TinyMCE editor.

Tuesday, May 6, 2014

OSS Meetup in Kuala Lumpur

Those who are keen to meet fellow OSS in Kuala Lumpur should register for the Malaysia Open Source Community Meetup Q2 2014.

Date: 31 May 2014
Time: 9Am to 2PM
Registration: Required

Please go to the above link for further details.

Writing Equations in Moodle - Part 1

Moodle leverages on MathML for users to enter Math equations. Moodle 2 comes with DragMath and this reduces the need for complicated installation of libraries. On Linux, equations can be displayed with Latex through the use of MimeTex (http://www.ctan.org/tex-archive/support/mimetex) and the newer MathTex.

Examples on the use of MathText can be found at http://www.forkosh.com/mimetex.html#examples

Inserting math equation on a Moodle require certain filters to be enabled but before doing this, the related linux tools need to be installed. End users will need to ensure Java's JRE is installed and enabled in their web browser.

The required Linux (Referring to Centos Linux) tools to be installed include packages mimetex, texlive, texlive-dvips, texlive-latex, ImageMagick and their dependencies. The important tools that should be working and that is needed by Moodle later includes;
/usr/bin/latex
/usr/bin/dvips
/usr/bin/convert

A good tip on enabling Java in web browsers can be found at the Java site. (https://www.java.com/en/download/help/java_blocked.xml)

Tuesday, February 25, 2014

Managing PostgreSQL with pgsql and pgAdmin3

The command line interface (CLI) tool that comes with Postgres server is known as pgsql. Alternatively, pgAdmin3 and phpPgAdmin can be installed.

The pgsql

Among some of the commands for pgsql can be shown as below;





Example of common commands

Login to the Postgres prompt
$ psql -U postgres -h 127.0.0.1

Create a role to create database
postgres=# CREATE ROLE dbadmin CREATEDB;

Create a role as administrator
postgres=# CREATE ROLE admin SUPERUSER;

Create a role to create group roles
postgres=# CREATE ROLE dbadmin CREATEROLE;

Add a user to any of above role groups
postgres=# GRANT dbadmin to userone;

Assign role to a database and allow to login
GRANT all privileges on database dbname TO dbadmin;
ALTER ROLE "dbadmin" WITH LOGIN; 

Remove a user from a role group
postgres=# REVOKE dbadmin from userone;

A user can change their roles if they are assigned to several roles. 
postgres=# SET ROLE admin;

A user can restore to default role group 
postgres=# RESET ROLE;

Remove a role
postgres=# DROP ROLE admin;

List available users and roles
postgres=# \du

                               List of roles
   Role name   |                   Attributes                   | Member of 
---------------+------------------------------------------------+-----------
 admin         | Create DB, Cannot login                        | {}
 dbmsuser      | Superuser                                      | {admin}
 dbmsuserlogin | Superuser, Cannot login                        | {}
 postgres      | Superuser, Create role, Create DB, Replication | {}

Change privileges of a role
postgres=# ALTER ROLE admin WITH LOGIN CREATEDB;

Create a database and assign to a role
postgres=# CREATE DATABASE mycms WITH admin;

Delete a database
postgres=# DROP DATABASE mycms;

Done

The Window pgAdmin3



Try out SQL statements within these tools. I found one nice reference at http://www.itl.nist.gov/div897/ctg/dm/sql_examples.htm

Installing PostgreSQL on Centos 6

PostgreSQL being an OSS licensed database is very different compared to MySQL. PostgreSQL (or Postges) maintains a repository for Linux systems like Centos to install the database. This repository is known as pgdg and is maintained at yum.postgresql.org or yum.pgrpms.org

Installation of the Postgres comes with psql, this is a CLI to manage Postgres.

Installation of PostgreSQL 9.3 on Centos 6.4 is as follows;

Step 1:
Open a CLI as root user and retrieve the pgdg repo RPM, then install it. This will allow the Centos to find for software from the pgdg.

wget http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
rpm -ivh pgdg-centos93-9.3-1.noarch.rpm

wget http://yum.pgrpms.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
rpm -ivh pgdg-centos93-9.3-1.noarch.rpm

Step 2:
Install the client and server.

yum groupinstall "PostgreSQL Database Server 9.3 PGDG"

yum install postgresql93 postgresql93-server

(-)


Step 3:
Initialise database and tables, and start. This creates the default user postgres.

service postgresql-9.3 initdb
service postgresql-9.3 start

You can now login with the default user to the Postgres terminal as follows;

[root]# su postgres
bash$ cd
bash$ psql -d postgres

If you get the error "psql: could not connect to server: No such file or directory...." Ensure the postgresql server service is running.
Step 4:
As the postgres user, create an administrative user, then log out from the psql (use \q), then the shell (Control-d).

CREATE ROLE dbmsuser LOGIN PASSWORD 'password' SUPERUSER;

As reference, here is summary of the syntax:
CREATE ROLE name [ [WITH] option [ . . . ] ]

 where option includes:
SUPERUSER | NOSUPERUSER
LOGIN | NOLOGIN

Step 5:
Edit Postgres configuration file;

vi /var/lib/pgsql/9.3/data/postgresql.conf

Uncomment the line and save.
#listen_addresses = ‘localhost’ and change it to listen_addresses = ‘*’

vi /var/lib/pgsql/9.3/data/pg_hba.conf

Add a line at bottom of the file to allow non-local connections, e.g.
host    all             dbmsuser        10.0.0.1/32            md5


Post installation
chkconfig postgresql-9.3 on

Ref: 

Thursday, February 20, 2014

Italian God Fathers May Run Open Source

In the current economic challenges, many countries are looking at saving cost via ICT and Italy is not an exception. Umbria, a region in the centre of Italy that produces cheese, lentils, truffles and have a relatively large number of small industries. This 900,000 strong population region is home to an active GNU/Linux User Group Perugia.

In 2012, Umbria saw the start of a revolution to switch to LibreOffice, which is LGPL or open source software (OSS) licensed. LibreOffice provides office productivity tools that include a word processor (like MS Word), presentation (like MS Powerpoint), spreadsheet (like MS Excel) and more. Advantages of this software is that it is free to download and install for almost all computers as it supports MS Windows, Linux and Mac platforms. Most popular editable document formats can be open and edited and its interface is rather intuitive and easy to use. It comes with a portable version where users can install it on a USB drive and carry it around to run LibreOffice any where. A built in PDF converter allows any edited file to be frozen and to be distributed with read only access and consistent format.

MS Office have been introducing its OOXML format through the docx formats which will eventually required every organisation to purchase an upgrade license for MS Office and this will incur la high upgrade cost. LibreOffice by default save files in Open Document Format or ODF (International document standards ISO/IEC 26300:2006) and it also supports past versions of MS Word, Excel and Powerpoint.

Through LibreUmbria, schools were introduced to use LibreOffice as their primary document editing applications before it was expanded further further to other organisations. This also received the government's top innovation award for Italian Government Projects in 2012/2013. Will the rest of the Italian Government and private organisations follow suit?

Read up news on the region of Umbria to switch over from MS Office to LibreOffice.

Jan 16, 2014 from ZDNet
Sep 26, 2013 from LibreOffice
Jun 5, 2013 from Document Foundation Blog

List of open standards can be found at ISO Public site

Wednesday, February 5, 2014

Passwordless root SSH Public Key Authentication on CentOS 6

Need to remote login to linux servers?

Create a public key and store it in the remote server. By default it is recognised as authorized_keys but this is fully configurable. The ssh-keygen generated the public key with RSA that is by default called id_rsa.pub

A well written article to do this can be found at Passwordless root SSH Public Key Authentication on CentOS 6

An alternative sshpass command as mentioned in January 31, 2014 Linuxpromagazine seems to force users to make the password visible. Good that this is no available in a default Centos 6, as this will help to maintain good password practices. I.e. do not have password kept where anyone can read it.

Monday, January 20, 2014

Top 10 Database Engines based on appearance in Internet

Ever wonder how to justify choice of database engines? Some have opted on comparison of specifications and limitation of the system. Now through manual use of ahem.."big data" we can see a list of top 10 database engines.

 DB-ENGINES.COM

Among some of its criteria includes appearance in Google and Bing search engine. Frequency in technical discussion in Stack Overflow and DBA Stack Exchange. Then there are LinkedIn, Indeed and Simply Hired.

Information and table above above is from DB-Engines.com.


Monday, November 18, 2013

Backup Samsung S3 with KIES

Time to send the Samsung Galaxy S3 to the workshop as its difficult to charge despite changing several chargers. Problem: Need to wriggle the USB connection to charge.

Attempting to use KIES from Samsung.

A) Install KIES

Step 1. Download and install from http://www.samsung.com/my/support/model/GT-I9300RWDXME-downloads?downloadName=SW

Step 2. Update the KIES for PC (Final part of the installation above for 18 Nov 2013, version 2.6.1.13105_6_1 (See diagram below)


B) Run Backup
Step 1. Start Samsung KIES (not the LITE)

Step 2. Click the tab "Back up/Restore". Yes, they put a space between Back and up.


Step 3. Click "Select all items".

Step 4. Select which directory to store the backup. Click "Tools" ->Preferences ->Browse

Step 5. Click "Backup". Now they decided there is NO space between in this word.






Wednesday, October 16, 2013

Moodle support for Tin Can and SCORM 2004

If anyone have been said to implement SCORM 2004 engine, its never been highly compliant and Moodle is no exception. On Oct 2004, Moodle has officially abandoned further development of its SCORM 2004 engine. Details of its SCORM module can be found at
http://docs.moodle.org/24/en/SCORM_module

Surely lots of users will be in the lost or may drop SCORM development. Moodle News suggest the use of Tin Can SCORM for future development of learning objects. Moodle site suggest use of the SCORM cloud from Rustici Software where the SCORM Cloud plugin is free, but not the account.

The SCORM Cloud free trial account provides 100MB and 10 active registration (what does that mean?) at https://cloud.scorm.com/sc/user/PostSignUp

Following are helpful links to setup the SCORM Cloud

1. Getting the Moodle package
http://scorm.com/scorm-solved/scorm-cloud-features/app-integrations/moodle-integration/

2. Integrate with Moodle
http://support.scorm.com/entries/21366321-Installing-the-SCORM-Cloud-Moodle-Module

Wednesday, September 18, 2013

Manage log files from getting too big

Log files in Linux can be managed via the logrotate command (See man pages). If the log files start growing too big, it can be difficult to audit these log files.

Here is an example to create a new log file each week as the weekly cron (See man pages) service runs.

Following is an example where the cakephp application is installed. It will create a new file each week for 52 times before deleting the oldest file. Each file will be appended with a running number starting with "1". If the log file is missing, no errors will be printed/emailed and nothing will be done if the log file is empty.

Step 1: Create the configuration file

Create the file /etc/logrotate.d/cakephp with permission 644 (owned by root) and following contents;

/var/www/html/mymesyuarat/*/tmp/logs/*.log {
    weekly
    missingok
    rotate 52
    compress
    dateext
    delaycompress
    notifempty
    create 640 root root
    sharedscripts
}

Step 2: Ensure that the logrotate service is running.

The above configuration can be tested with the following command;

logrotate -s /tmp/logrotatestatus /etc/logrotate/cakephp


Monday, September 2, 2013

Maxis site not supporting Mozilla or Chrome

A sudden change in policy at Maxis, one of the main telco in Malaysia or is it just my network problem?

Either way, last Aug 2013, Maxis customer support just informed me to use Internet Explorer (IE) or they can help email my bills. They tried, but the bill never arrived.

Now in September, I still can't login to get my bills using Chrome or Firefox. But wait, I see an additional notice at their portal....interesting. I added a text bubble.



I guess they are expecting me to call them for help on my bills.

2 Sept. Just spoke to customer service. Seems their Firefox is able to login and the Firefox version 23.0.1 that I am using not current enough. Huh? Is there a newer version since as of today?

On Firefox version 23.0.1, have disabled pop-up blocker, block reported attack sites/web forgeries, nothing happens when I click the "login" button. Ran IE (finally) and the login button works. Still not working on Google Chrome and Firefox.

Anyone else with this problem?

Saturday, August 24, 2013

Sony Tablet S

Sony finally released update for Sony Tablet S?

It says for US but am looking forward for its arrival.

https://blog.sony.com/2013/04/jelly-bean-for-xperia-tablet/

Tuesday, August 20, 2013

User Identities in Thunderbird

Thunderbird have see lots of changes but the basic features for email have been retained. One of this, is being able to choose different ways to compose a message before it is sent out.

Example case 1; I have different signatures for friends, customers, special clients and for the general use. Switching signatures is so easy.

Example case 2; Some sent emails must be save to my SPECIAL folder.

Example case 3: Some emails must contain a CC or BCC to specific persons.

Example case 4: When I replay some quote of previous email is at the top and some at the bottom.

We can get this done is a few simple steps (I list the general steps here);

Step 1: In TB, click Tools ->Account settings...
Select the Email account and set the default email settings for

Your name:
Email Address:
Reply-to Address:
Organization:
Signature Text:

Step 2: Strongly suggest to create a text file and place the signature and name. 
Use the option for
Attach the signature from a file instead (text, HTML, or image)

Step 3: Configure following settings;
Copies and folders
Composition & Addressing
Security

Step 4: Click the Email account (selected in step 1)
Click button Manage Identities...
Click Add...

Enter the alternative email configuration. E.g. The alternative email signature.

Click OK, Close. You can continue to create as many identities as you like.
Click OK

DONE!
Try to send an email, click Write button.

Notice the "From" have a drop down list of all the different styles and configuration that you have created.

Wednesday, August 14, 2013

Using Handlerbars and JQuery in PhoneGap

Here is the very basic steps to use a template model in a PhoneGap application. I won't be going in details in this note.
"Those attending the PhoneGap class should incorporate the database as a practice. Thank you"

Ensure that the following steps have already been taken
  1. Creating Android App with PhoneGap
  2. Using Alert Pop-up
Step 1: Install the Handlebars and JQuery scripts
Download
  1. Handlerbars from http://handlebarsjs.com
  2. JQuery 1 from http://jquery.com/download/
Extract and copy the .js files to the Project's assets/www/lib folder

Step 2: Update the index.html
Replace the the contents within the body tags with the following;

 <h1>Hello PhoneGap</h1>  
  <script id="a-comment" type="text/x-handlebars-template">  
   <p><b>{{name}}</b> on {{date}}</p>  
   <ul>  
   {{#each comment}}  
   <li>{{description}}  
   {{/each}}  
   </ul>  
 </script>  
 <script src="lib/handlebars.js"></script>  
 <script src="lib/jquery-1.10.2.min.js"></script>  
 <script src="js/main.js"></script>  

Step 3: Update the js/main.js
Remove the initialize: function() and add following codes;


      renderHomeView: function() {  
      var today = new Date();  
      var dateTxt = today.getDate() +   
      "." + (today.getMonth()+1) +  
      "." + today.getFullYear();        
      var data = {  
      name: "I am the One",   
      date: dateTxt,  
      comment: [  
           { description: "walking with you."  
           },   
           { description: "eating together."  
           },  
           { description: "driving around town."  
           },  
      ] };  
   $('body').html(this.homeTemplate(data));       
   },  
   initialize: function() {  
        var self = this;  
        var source = $("#a-comment").html();  
     self.showAlert('This is how its done','Info');  
     this.homeTemplate = Handlebars.compile(source);  
     this.renderHomeView();  
   }  

Alert Pop-up in PhoneGap

Using the native notification or browser alert pop-up

This is a continuation from the Previous notes: Creating an Android App with PhoneGap and Eclipse
Purpose: Display the Alert pop-up before the application display its contents.

Step 1: Create the main.js
In the project's assets/www create js folder, then create a new text file and name it as main.js
Place the following contents in assets/www/js/main.js

 var app = {  
      showAlert: function (message, title) {  
    if (navigator.notification) {  
     navigator.notification.alert(message, null, title, 'OK');  
    } else {  
     alert(title ? (title + ": " + message) : message);  
    }  
      },  
   initialize: function() {  
        var self = this;  
     self.showAlert('This is how its done','Info');  
   }  
 };  
 app.initialize();  

Step 2: Load main.js from index.html
Edit index.html. Immediately after the body tag place the following 1 line.

 <script src="js/main.js"></script>  

Step 3: Test the application.
See previous posting on how to do this.

Creating an Android App with PhoneGap and Eclipse

This is the basics on creating a HelloWorld using PhoneGap, Cordova and Eclipse (provided by ADT).

I have downloaded and extracted:
  1. Android Development Toolkit (ADT): adt-bundle-windows-x86_64-20130729.zip
  2. Phonegap kit: phonegap-2.9.0.zip
Note: ADT provides the Eclipse IDE.

In order to start development, an Android project is created in Eclipse.

Step 1: Create an Android Project
Open Eclipse (Its in the ADT/eclipse folder) and choose File ->New ->Android Application Project

Application Name: Hello World (This is the name that will appear in the Play Store)
Project Name: HelloWorld (This is the name used by Eclipse to separate each project)
Package Name: com.example.HelloWorld

Select the default option for the remainder screens.

Step 2: Insert the Android/PhoneGap Libraries
In the project, left click on assets and create a new folder: www

Open the extracted PhoneGap/lib/android folder and do the following;

  1. Copy PhoneGap/lib/android/cordova.js to Project's assets/www folder
  2. Copy PhoneGap/lib/android/cordova-2.9.0.jar to Project's libs folder
  3. Copy PhoneGap/lib/android/xml folder to Project's res folder
In the Project's lib/cordova-2.9.0.jar right click and choose Build Path ->Add to Build Path

Step 3: Create the starting page
In assets/www folder, create the text file index.html with following contents
 <!DOCTYPE HTML>  
 <html>  
 <head>  
 <title>PhoneGap</title>  
  <script type="text/javascript" charset="utf-8" src="cordova.js">  
  </script>  
  </head>  
  <body>  
  <h1>Hello PhoneGap</h1>  
  </body>  
  </html>  

Step 4: Configure to load the index.html
Edit the Project's src/com.example.HelloWorld/MainActivity.java

Before the first import statement, add
import org.apache.cordova.*;

Change extends Activity 
to extends DroidGap
or to extends PhoneGap

Change setContentView(R.layout.activity_main);
to

super.loadUrl("file:///android_asset/www/index.html");

Step 5: Configure Android specific configurations
Edit the AndroidManifest.xml (if unsure where, just place it before the Activity Application tag)
 <uses-permission android:name="android.permission.READ_PHONE_STATE" />  
 <uses-permission android:name="android.permission.INTERNET" />  
 <uses-permission android:name="android.permission.READ_CONTACTS" />  
 <uses-permission android:name="android.permission.WRITE_CONTACTS" />  

Edit the Activity tag by adding configChanges
 <activity  
  android:name="com.tboxmy.simpledisplay.MainActivity"  
  android:label="@string/app_name"   
  android:configChanges="orientation|keyboardHidden|screenSize" >  

Step 6: Test the application
Right click the project name and choose Run As ->Android Application

Unless you have a fast machine with huge RAM, some waiting time is required for the Application to start, after the Android Emulator starts.

Friday, August 2, 2013

Cordova basic usage

Time to compile Phonegap using Cordova.
Basic commands;

1. Create an Android project called com.example.hello in folder hello.

cordova create hello com.example.hello 

2. Include Android platform for cordova. In the project folder, type;

cordova platform add android

3. Compile the project (some call this build). In the project folder, type;

cordova build

2. Start the android emulator with the compiled cordova project. In the project folder, type;

cordova emulate android

Thursday, August 1, 2013

Install Android Emulator on Centos 6


Why would I want to have the Android Emulator? Well, I needed to test several custom Android  Packages and also develop apps for Android. This meant, I could keep testing the Android Packages without having to install on a physical Android phone such as the Sony Ericsson X10 or Samsung S3.

I have written on this topic for Centos 64bits, before and seems like it still depends on 32bit libraries:


A good reference for everything Android is at http://developer.android.com/sdk/index.html

Here are steps for Centos 6.4 (64bits), open up a terminal as root;

Step 1: Install Java development kit (JDK)
# yum update
# yum install java-1.7.0-openjdk-devel.x86_64

Verify installation with following command:
# javac -version

Step 2a: Install library for 32bits 
yum install glibc.i686 ncurses-libs.i686 libstdc libstdc++.i686 libzip.i686 SDL.i686 gegl.i686  mesa-libGL.i686

Note: Optional package to install: 
libX11.i686 libXrandr.i686

Step 2: Install the Android SDK and ADT
Get the latest Android ADT from the Android Developer site or use following:
wget http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20130729.zip

This will provide us with (Size if 440MB):
  1. Eclipse + ADT plugin
  2. Android SDK Tools
  3. Android Platform-tools
  4. The latest Android platform
  5. The latest Android system image for the emulator
Note: If you are in Malaysia and cant download because of Internet problem (Some day this will improve) and really have no other way of getting the ADT and JDK for Centos 6 64bits, just email me your contact details (e.g. address) and we can work something out.

Allow groups named devel to access development. Create the directory /opt/android and extract adt-bundle-linux-x86_64-20130729.zip

# mkdir /opt/android
# useradd -m devel
# chown devel.devel /opt/android
# chmod g+rwsx,+t /opt/android
# unzip -d /opt/android/ adt-bundle-linux-x86_64-20130729.zip

Step 3: Post installation.
What can we do after installation? Well, you can run the Eclipse IDE to develop application and there is also the Android Emulator (to test APK). Info on the Android Emulator can be found at http://developer.android.com/tools/devices/emulator.html

I suggest that you login as the devel user or a user with that group access to continue (Represented as $ in steps below).

Start Eclipse with
$ /opt/adt-bundle-linux-x86_64/eclipse/eclipse

Starting with the emulator
1. Listing the available emulators
$ cd /opt/android/adt-bundle-linux-x86_64/sdk/tools
$ ./android list targets

Available Android targets:
----------
id: 1 or "android-18"
     Name: Android 4.3
     Type: Platform
     API level: 18
     Revision: 1
     Skins: WSVGA, WVGA800 (default), WVGA854, WQVGA432, WQVGA400, WXGA800, QVGA, WXGA720, HVGA, WXGA800-7in
     ABIs : armeabi-v7a

2. Creating an instance of the emulator
Here it is called practiceandroid4.3 with the target id 1 (as above). Items in RED are optional. For further details see http://developer.android.com/tools/devices/managing-avds-cmdline.html
$ android create avd -n practiceandroid4.3 -t 1 --skin WVGA800
$ emulator -avd practiceandroid4.3


APK can be installed into the Android emulator
$ adb install bin/MyFirstApp-debug.apk


Trouble shooting:

  • If there is a problem running Eclipse or the Emulator, try the Step 2a above.
  • For error "./emulator: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory", ensure the step 2a is done.
  • When upgrade Centos 6.3 to Centos 6.4 on Virtualbox, it hangs at the boot progress bar. Fix is at http://bugs.centos.org/view.php?id=6306



Sunday, June 30, 2013

Install MCRYPT for Centos 6.3

MCRYPT is used to encrypt data. For example, user login passwords.

The EPEL repository provides for the mcrypt package.

Step 1: Download and install the files to support EPEL repository
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
wget  http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6
rpm --import RPM-GPG-KEY-EPEL-6
rpm -i epel-release-6-8.noarch.rpm

Step 2: Install mcrypt package

yum install php-mcrypt

Tuesday, June 25, 2013

Autoconfiguration ipv4 address

A funny thing happen on a newly installed MS Windows 8. After setting the fixed IP on the network interface (cable), it kept getting a an IANA ip of 196.254.x.x.

Although, the fixed IP was entered correctly, 10.x.x.x, the command ipconfig showed that it was still using the 196.254.x.x. Driving me mad, this don't happen on Linux as far as I know.

Resolve this by disabling the interface that is causing the problem.

At the command prompt as Admin follow the steps given below;

Step 1: Identify the interface name (Idx)
> netsh interface ipv4 show inter

Step 2: Disable the interface, replaceing the XXX below with the Idx found in Step 1.

> netsh interface ipv4 set interface XXX dadtransmit=0 store=persistent

Thanks to Lyngtinh

Tuesday, June 11, 2013

Install Clamav antivirus on Centos

Clamav is a much misunderstood software, at least from the response of people I know.

This is a follow up of previous posting http://tboxmy.blogspot.com/2011/06/open-source-software-antivirus-called.html

A simple to read manual can be found at
http://www.clamav.net/doc/latest/clamdoc.pdf

However, here are steps I took for the installation on Centos 6.3 and Centos 5.6

Step 1: Install required repository for clamav
http://tboxmy.blogspot.com/2013/06/install-yum-repo-for-centos.html

Step 2: Install the clamav software
yum install clamd clamav clamav-db

Step 3: Edit the configuration files with your own preferences
/etc/clamd.conf
/etc/freshclam.conf

Step 4: Test the scan with an example directory [/tmp/samples] and save the results in [output.scan]
clamscan -r -l output.scan /tmp/samples

You should notice a warning that the virus database is outdated.

Step 5: Update the virus database. Make sure the server has internet access, then type
freshclam

By default update is done daily, but can be changed by moving the /etc/cron.daily/freshclam to another cron folder.

Step 6: Schedule the scan with crontab
Use the command in step 4 as an example

Step 7: Manage how files detected as virus are handled

e.g. use perl-File-Scan-ClamAV



Install Yum repo for Centos

Adding additional source of packages (software) for Centos will greatly reduce the need to recompile OSS packages. Epel provides open source software that is free for use. This includes clamav, atop, cacti,

Here are step to add a common repository.

Centos 5

Step 1: install and enable epel repo
rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm


Centos 6

Step 1: install and enable epel repo
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm

Step 2: Enable priorities
yum install yum-priorities

Edit /etc/yum.repos.d/epel.repo
add under [epel]
priority=10


Friday, June 7, 2013

TinyMCE

One of the widely used WYSWIG for web forms is called TinyMCE. Currently it is at version 3.5.8 and version 4.0 is in Beta. Licensed as LGPL, it is available for download freely from tinymce.com website.

I like its highly configurable options. Some of these are listed at http://www.tinymce.com/wiki.php/TinyMCE3x:Buttons/controls

Here is how it looks like from the demo site.


Thursday, June 6, 2013

Backup selected rows from MyMSQL database

Just needed a few rows of data, after confirmed its existence with

> select count (*) from `attendances` where `meeting_id`=82;

Using mysqldump

mysqldump --opt -uroot -p development attendances --where='meeting_id'=19700 > outputrows.sql

Reviewed the extensive contents then inserted back into the db.





Tuesday, May 21, 2013

OpenOffice.org templates to plan/schedule work

A great spreadsheet template to do planning for shift work. Its flexible and can be modified to suit different environments.

See http://templates.openoffice.org/en/node/9485

Should work for LibreOffice.

Thursday, May 2, 2013

SCAM using Fedex and Coca-cola names

Be careful of scams on the internet such as the one that says you have won some money through a lucky draw. Extract of the contents, I have seen, is shown below.



Header contents of that email

Read an article on this at Ripoffreport.

Blog Archive