Wednesday, July 25, 2012

List of trainings - Linux

Linux for Web Developers - I

Objective: An intensive program to provide Web developers knowledge to manage basic development on a Linux platform.
Pre-req: Participants must already know PHP programming.
Duration: 1day
Outline:
1. Introduction to Linux operating system
- Benefits of Linux, various distros, and the Centos Linux
2. Gnome, the Linux desktop
- Navigate common features of the desktop. Includes the file browsers, windows system, Systems configuration and start menu.
3. Editing text
- Use of the Gedit tool, saving files
4. The Linux Command Line Interface (CLI)
- Accessing the CLI, using BASH basic commands and text file editing
5. Getting help and the man
- Help from the windows, application, internet and man pages
6. Linux file system
- Basics of the folder convention, HOME folder, editing folders and folder permissions.
7. Software management - I
- Basics on package managers, YUM and RPM. Identify software packages installed, add and remove.
8. Manage development services - I
- Monitor status, start and stop Apache, MySql. Identify configuration files for Apache, MySql and PHP (AMP)
9. Troubleshooting the AMP in LAMP.
- Determine disk space utilisation, access Linux and Apache log files. Writing a web page to show phpinfo.

Linux for Web Developers - II

Objective: Manage tools used for web application development on Linux platform.
Include graphic editors, manage installation of software, work with Eclipse editor. Writing php codes and installing additional php modules.
Connecting to a remote linux to access the shell commands and transfering files.

Saturday, July 21, 2012

Blogger app from Google Inc needs a lot more of work.

Just installed the app on ICS.

It doesn't provide numbering list and other basic formatting.

My previous postings all appear in html edit view. No options visible to switch editing modes.

Option for tagging as labels are not very intuitive.

Possibly the developer is a single person from Google payroll or was it out sourced to India? Hmm....

Develop Android Apps with Eclipse on Centos 6

This is an update to my previous post.
[Update for Centos 6.3]

Installing Eclipse Indigo for Android on Centos 6.


Pre-installation check list:

  1. Java JDK 1.6 or higher is installed
  2. PATH and CLASSPATH has been configured 
The Centos was installed as 64bits, but Android tools require 32bit libraries. Add them via following;
yum install glibc.i686 ncurses-libs.i686 libstdc libstdc++.i686 \
   libzip.i686 libX11 i686 libXrandr.i686 SDL.i686 gegl.i686

Steps 1. Eclipse Indigo

yum install eclipse-emf eclipse-jdt
Download and install the Indigo version of Eclipse.
Default yum install from Centos 6.3 provided only the older version of Eclipse (Helios) which have too many dependency problems after install.

2. Android SDK
a) download and run installer from http://developer.android.com/sdk/index.html
Current version is named android-sdk_r20.0.3-linux.tgz size of which is about 78Mb.

tar -xvzf android-sdk_r20.0.3-linux.tgz
mv android-sdk /opt/android-sdk
chmod -R a+w /opt/android-sdk

Open the user's $HOME/.bash_profile and add before the last l
PATH=$PATH:/opt/android-sdk/tools:/opt/android-sdk/platform-tools


Follow instructions from http://developer.android.com/sdk/installing/index.html

b) Run the Android SDK Manager
Currently target for API 10 (Android 2.3.3) and API 16 (Android 4.0.1).


3. Eclipse's ADT plugin
a) Start Eclipse and select Help-> Install New Software, click Add (top right)

b) At right of "Work with:", Click Add... and enter the ADT Plugin repository details
https://dl-ssl.google.com/android/eclipse/

c) In Available Software, check Developer Tools and install.
Accept all license agreement.

d) Restart Eclipse

e) Eclipse may assign the Android SDK directory
or
Choose preferences and point to the Android SDK folder (see Section 2). 
e.g. /opt/android-sdk

4. Create your first App, see http://developer.android.com/training/basics/firstapp/index.html

Installing msttcorefonts on Centos 6.3

Documents received may require MS Fonts to display format correctly, and these MS Ffonts are not available by default in Centos 6.2.

Install tools to create fonts and directories (fake ones for compatibility).
yum install ttmkfdir rpmdevtools

note: ensure all RPM building tools have been installed (see my previous post).

Install ATRPMS repository and MS Fonts.
wget  http://dl.atrpms.net/el6-x86_64/atrpms/stable/atrpms-repo-6-5.el6.x86_64.rpm
wget http://pkgs.org/centos-6-rhel-6/atrpms-x86_64/atrpms-repo-6-6.el6.x86_64.rpm/download/

(for i686 machines, replace x86_64 with i386 as in line below)
wget  http://dl.atrpms.net/el6.3-i386/atrpms/stable/atrpms-repo-6-5.el6.i686.rpm



(I am using, x86_64 for remainder of notes)
rpm -ivh atrpms-repo-6-5.el6.x86_64.rpm
yum install chkfontpath
wget http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec
rpmbuild -bb msttcorefonts-2.0-1.spec
(download MS Fonts and compile into packages)
rpm -ivh rpmbuild/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm
(open Libreoffice or Character Map, see if the Arial, Georgia and Times New Roman are available)

If fonts are not appearing, run following then relog-in (Do not run these if above steps work)
mkfontscale
mkfontdir

References: http://corefonts.sourceforge.net/

Installing Centos 6 on HP Probook 4420s

Finally found time to install Centos 6.2 on the HP Laptop.

Laptop specs:
RAM 4Gb
CPU: i3 ...

Installed (default)
Linux kernel 2.6.32-220.el6.x86_64

Gnome 2.28.2
Mozilla Firefox 10.0.5

Add RPMFORGE software repository (libary of software)
(download the rpm)
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -ivh ~/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
yum update
(Total 371 files, 385MB downloaded)

(reboot)

Post-Installation
Login as root at the terminal and first few software to be installed (type this out):

yum groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"
yum install madwifi
(reboot)
yum install flash-plugin
yum install vlc
yum install libreoffice
(total 25 package, 103Mb download)
yum install libreoffice-ogltrans


Notes: wifi can only be configured easily when linux is in graphical screen/desktop.

Prepare to build from source

yum install cabextract rpm-build



Other observations
  1. The touchpad (black square at center of laptop that helps to move the mouse) is having a soft LEFT and RIGHT button (not working correctly)
    • To drag windows, press bottom half of the Touchpad until a click is felt. Then drag without leave finger from the Touchpad.
    • To RIGHT click in window, you need to press bottom half then do a second click without lifting the first finger.
    • Install from (HP) or better still to use a mouse pointer.
  2. Music
    • Default "Totem Music Player" doesn't support MP3. Need to install gstreamer-plugins-ugly
  3. Webcam
    • Runinng "Cheese" I can adjust to higher resolutions but its frames per seconds is very little. This causes the video to seem very poor quality. 
  4. Option to edit the menu bar (add new items manually) is missing. Installed alacarte package, logout then back in to enable editing of menu items.
  5. If boot was to only command line (a black screen), switch to graphical. Type init 5.

Thursday, July 5, 2012

Out of phone storage space on x10i

On the Sony Experia X10i, with Android 2.3.3 (Gingerbread) I am currently getting the message
"Phone storage space is getting low."

So, I did a backup (see HERE) then a factory reset to clear all data. Maybe some of the slowness issues on the X10i will be resolved. 
Note: Free apps may not be automatically reinstalled. I have not figured out why.

Here are steps for the factory reset.
Step 1: Start the reset
On the X10i, Left click, and in menu choose "settings".

Choose "Factory data reset"

Do not choose "Erase SD card", because all my photos and backup is there.

Click "Reset phone"
Click "Erase everything"

The phone will power off (shut down)

Step 2: Start the x10i
The phone will restart, press the middle button and unlock the phone.

Choose Language,
Choose step 2/6 and change the date and time.
Choose step 5/6, set up the google, email account. What about Sony Ericsson sync (not working)?


Sony Ericsson sync was asking to select your country, but listed only 8 names and didn't list mine. It then says service is discontinued


Click in step 6/6 click "Finish".

Backup X10i phone with Gingerbread

In cases where the X10i needs to be fully cleared, such as a fresh reinstall or upgrade, user data needs to be backup. If you are using contacts, calendar from google services, then it can be easily recovered anytime.

Several Android apps are available for backup of the Android 2.3.3 (Gingerbread) and this includes;

  1. Titanium Backup * root
  2. MyBackup pro (RERWARE, LLC), with free limited 30 trial
  3. SMS Backup & Restore (RITESH SAHU)
What to backup? Well there is the;
  1. Contact numbers,
  2. SMS,
  3. APN settings,
  4. SDCard data, 
1. Contact numbers
Step 1: Start the dialer
On the X10i launch the phone dialer. Click LEFT button, choose Backup contacts, then Memory card.

This will prompt the name and location of the back up file, choose OO. E.g.
/sdcard/System/PIM/PIM000001.vcf

Step 2: Verify
Once the progress bar has completed saving all the address book, browse to the SDCard and copy the vcf file to your PC or USB disk.

2. SMS
Step 1: Install from Android Play Store the app, "SMS Backup & Restore"
This saves SMS in XML format. 
Launch the app, click on the "Tools" icon at the top. Select the Backup folder which is by default
/mnt/sdcard/SMSBackupRestore/

For advanced users, explorer the other options. For basic needs, I find that there isn't any need to change the other configurations.

Step 2: Do the backup.
Read and accept the screen prompts.
Click "Backup" and enter the backup file name. 
Click OK.

My 5,230 SMS was backup and verified in 45 seconds.

Click "Close"

Step 3: Donate
Oh...its optional and I have no idea who developed this app, but it does a pretty good basic backup of SMS. As for the Adds, its not too big to obstruct the buttons.

3. APN Settings
Step 1: Install from Android Play Store the app, "APN Backup & Restore"
This saves SMS in XML format. 

^^^Launch the app, click on the "Tools" icon at the top. Select the Backup folder which is by default
/mnt/sdcard/SMSBackupRestore/

For advanced users, explorer the other options. For basic needs, I find that there isn't any need to change the other configurations.

Step 2: Do the backup.
Click "Backup APNs" and enter the backup file name. E.g. default filename is apns-.xml

Click "Close".
It doesn't say where its backup to, but search for it in /mnt/sdcard/ApnBackupRestore/

4. Backup SD Card
Firstly, if you already have a PC backup software, you can perform Step 1, then continue with that backup software.

Step 1: Plug the X10i USB cable.
The PC should be installed with the Sony PC Companion software. This will launch the windows explorer.

Step 2: Copy files to your PC
Using Windows Explorer, drag all files from the SD Card to your PC.


Installing PHPMYADMIN on Centos 6


PHPMyadmin is a web front end to manage MySQL databases. It can be installed on the same server as the database or on a separate server.


Step 1: Open a Linux command line terminal (CLI)
Login as root or administrator.


Step 2: Increase the software repository with rpmforge
Browse for the packages and download from http://packages.sw.be
or

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm


Select the 64bit version if your machine supports it.


Install the keys from DAG.
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt


Install the rpmforge files to access the repository.
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm


Refer to http://wiki.centos.org/AdditionalResources/Repositories/RPMForge/ for details



Step 3: Install phpmyadmin
yum --enablerepo=rpmforge install phpmyadmin


Step 4: Using a web browser point to the server installed with phpmyadmin.
E.g.
http://localhost/phpmyadmin

where is the server's IP address.

You should be able to see the main page of phpmyadmin.



Develop Android 4 Apps with Eclipse

Before starting this article, it must be mentioned that the eclipse is preferable be on a 64-bit machine that has relatively big RAM, L2 cache, fast hard disk. This is because of the slowness and constant errors that I am encountering in the past few months with an old pc. This is why I have not been doing any development on android and it will most probably this way until I can get my hands on a better PC.

So, you want to start on Android Programming? Read on...


Installing Eclipse Indigo for Android on MS Windows 7.


Pre-installation check list:

  1. Java JDK 1.6 or higher is installed
  2. PATH and CLASSPATH has been configured 

Steps
1. Eclipse Indigo
a) download and extract Eclipse
http://www.eclipse.org/downloads/download.php?

file=/eclipse/downloads/drops/R-3.7.2-201202080800/eclipse-SDK-

3.7.2-win32.zip

b) Move to the Program files folder
e.g. c:\Windows\Program Files\eclipse

2. Android SDK
a) download and run installer_r18-windows.exe
http://developer.android.com/sdk/index.html

Follow instructions from http://developer.android.com/sdk/installing/index.html

b) Run the Android SDK Manager
Currently target for API 10 (Android 2.3.3) and API 15 (Android 4.0.3).
Accepted all package to install but HTC OpenSense SDK.

3. Eclipse's ADT plugin
a) Start Eclipse and select Help-> Install New Software, click Add (top right)

b) At right of "Work with:", Click Add... and enter the ADT Plugin repository details
https://dl-ssl.google.com/android/eclipse/

c) In Available Software, check Developer Tools and install.
Accept all license agreement.

d) Restart Eclipse

e) Eclipse may have problem locating the Android SDK directory
Choose preferences and point to the Android SDK folder (see Section 2). 
e.g. c:\Windows\Program Files\Android\android-sdk

4. Create your first App, see http://developer.android.com/training/basics/firstapp/index.html

Blog Archive