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.
Looking at alternative computer software solutions for a variety of reasons. This includes price, computer security, virus prevention and reliability. Here are my notes and great that if it helps you, otherwise please understand what you are doing and not follow blindly. All works expressed are my own and does not necessarily express the products or organisations mentioned here.
Wednesday, February 5, 2014
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.
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)
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
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
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?
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/
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.
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
"Those attending the PhoneGap class should incorporate the database as a practice. Thank you"
Ensure that the following steps have already been taken
Step 1: Install the Handlebars and JQuery scripts
Download
- Handlerbars from http://handlebarsjs.com
- 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;
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
Step 2: Load main.js from index.html
Edit index.html. Immediately after the body tag place the following 1 line.
Step 3: Test the application.
See previous posting on how to do this.
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:
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;
or to extends PhoneGap
Step 5: Configure Android specific configurations
Edit the AndroidManifest.xml (if unsure where, just place it before theActivity Application tag)
Edit the Activity tag by adding configChanges
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.
I have downloaded and extracted:
- Android Development Toolkit (ADT): adt-bundle-windows-x86_64-20130729.zip
- Phonegap kit: phonegap-2.9.0.zip
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;
- Copy PhoneGap/lib/android/cordova.js to Project's assets/www folder
- Copy PhoneGap/lib/android/cordova-2.9.0.jar to Project's libs folder
- 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
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
<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
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:
- http://tboxmy.blogspot.com/2012/04/installing-java-on-centos-6.html
- http://tboxmy.blogspot.com/2012/07/develop-android-apps-with-eclipse-on.html
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):
- Eclipse + ADT plugin
- Android SDK Tools
- Android Platform-tools
- The latest Android platform
- The latest Android system image for the emulator
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
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
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
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
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.
rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
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
Here are step to add a common repository.
Centos 5
Step 1: install and enable epel reporpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Centos 6
Step 1: install and enable epel reporpm -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.
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.
> 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.
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.
Header contents of that email
Read an article on this at Ripoffreport.
Tuesday, April 30, 2013
Tables in Moodle appear without border lines.
Tables in Moodle 2 will tend to have this issue where users just can't get the grid lines to appear. Another description for this, is the border lines appear during editing, but is not displayed when it is saved and viewed as a normal content page.
The misleading choice was to right click and edit using "Table properties". Did not work in what ever combination that was made.
Following are steps that can be taken when creating a standard table from scratch in Moodle.
Step 1: Right click on the existing table. Choose Cell ->Table cell properties.
It does look like we are changing one cell, but bear with me to get this applied to the whole table.
Step 2: Choose the Advanced tab. Click on the Border color's colour selection box.
Step 3: Choose a colour. Better still click on Palette or Named tabs to choose a standard colour. Click Apply. In this example, Black or #000000 is choosen as the border line colour.
Step 4: At the dropdown box choose "Update all cells in table", click "Update".
Step 5: Save changes to the page where the table is added and view the table with the border lines.
The misleading choice was to right click and edit using "Table properties". Did not work in what ever combination that was made.
Following are steps that can be taken when creating a standard table from scratch in Moodle.
Step 1: Right click on the existing table. Choose Cell ->Table cell properties.
It does look like we are changing one cell, but bear with me to get this applied to the whole table.
Step 2: Choose the Advanced tab. Click on the Border color's colour selection box.
Step 3: Choose a colour. Better still click on Palette or Named tabs to choose a standard colour. Click Apply. In this example, Black or #000000 is choosen as the border line colour.
Step 4: At the dropdown box choose "Update all cells in table", click "Update".
Step 5: Save changes to the page where the table is added and view the table with the border lines.
Monday, April 22, 2013
Samsung S3's Android update March 2013
Just did an OTA update from Jan 2013 to Mar 2013.
Among changes known at this moment;
Lock screen security patch. Previously there is a 5 step hack to by pass the login for the lock screen.
Camera. The menu at sides now have transparent borders. Now missing 3 scene modes, which include the fireworks, backlit.
Among changes known at this moment;
Lock screen security patch. Previously there is a 5 step hack to by pass the login for the lock screen.
Camera. The menu at sides now have transparent borders. Now missing 3 scene modes, which include the fireworks, backlit.
Friday, April 19, 2013
Faces of Clouds
Cloud is a big thing these last few months. Just to clear some terms that is of interest and where even so called IT experts are not able to agree on. This means, that its my personal view based on resources published by industry experts.
3 items are of interest. The first, is naming of a cloud based on its deployment. Second, clouds can further be classified based on services it provide to users. And lastly, a case study. Think of your plan to build a cloud and how it would be shaped.
3 items are of interest. The first, is naming of a cloud based on its deployment. Second, clouds can further be classified based on services it provide to users. And lastly, a case study. Think of your plan to build a cloud and how it would be shaped.
A) A cloud is named based on its location or deployment.
- Public - Applications, storage and services made available to the general public for free or for a fee.
- Private - For a single organisation and decisions made centrally on resources.
- Community - Shared infrastructure having several organisation with specific interest that is managed internally or by a 3rd party.
- Hybrid - Combination of either Public, Private or Community, or all three.
B) A cloud can then be named based on its services.
- IaaS (Infrastructure-as-a-Service)
- Users install own operating system and maintain its own patches, IP addresses. - Rackspace, Amazon EC2.
- Users can leverage resources to sell as a service provider to their clients.
- PaaS (Platform-as-a-Service)
- Run your own application on a provider's platform
- Develop on a provider's platform - Google AppEngine, Oracle Cloud Platform, OpenShift.
- SaaS (Software-as-a-Service)
- Full web application - E.g. Googledocs, SalesForce, Gmail
- Web services (consumed by other web application) - GoogleMaps API, PayPal
C) A case study
How would you shape a cloud based on above (A) and (B) for following situation?
Lets say a government wants to setup a TeleHealth cloud. It allows any application for hospitals, clinics and government. Some of these applications are built and some bought. Geographically users are very dispersed throughout the country.
A) Community
Why? Organisations apart from the Ministry of Health, clinics and hospitals would also include 3rd party resources for pharmaceutical, research, assets, payments.
B) PaaS
- By providing one or two standard platforms, all development can be better managed. Deployed applications can be made to meet security and other standards set.
- Many new applications/web services can be introduced by users.
Tuesday, April 9, 2013
Dangers in copy and paste to CLI
A reminder for those who are trying to be smart and copy commands found on the internet or via unknown emails, the PASTE may contain dangerous commands.
See http://thejh.net/misc/website-terminal-copy-paste
WARNING, do not try the following if you do not understand dangers of hidden codes. Here below is an attempt to simulate that line to be copied.
Just copy the 1 line below and paste to the CLI, watch what happens.
See http://thejh.net/misc/website-terminal-copy-paste
WARNING, do not try the following if you do not understand dangers of hidden codes. Here below is an attempt to simulate that line to be copied.
Just copy the 1 line below and paste to the CLI, watch what happens.
/dev/null; clear; echo -n "Hello ";whoami|tr -d '\n';echo -e '!\nThat was a bad idea. Don'"'"'t copy code from websites you don'"'"'t trust!
Here'"'"'s the first line of your /etc/passwd: ';head -n1 /etc/passwd
git clone git://git.kernel.org/pub/scm/utils/kup/kup.git
Monday, April 8, 2013
Howto troubleshoot Virtualisation with RHEVM
In the event to do troubleshooting, some of these were carried out for a recent RHEVM;
Only item I do not see is the %TEMP%/manager_hostname/log as mentioned from the RHEV website.
Additional references: http://www.howtoforge.com/virtualization-with-kvm-on-a-centos-6.2-server
- In the RHEVM Administration Portal, check out the events.
- The command rhevm-log-collector collect download logs including from hypervisors to the /tmp folder.
- Collect only RHEVM logs rhevm-log-collector collect --no-hypervisors
- Look at logs in /var/log/rhevm
- Need to check the RHEVM database? Try pg_dump engine -U postgres -W -f /tmp/cu_rhevm.dump -F t
- Check the multipath
- Check configuration with rhevm-config --list
Only item I do not see is the %TEMP%/manager_hostname/log as mentioned from the RHEV website.
Additional references: http://www.howtoforge.com/virtualization-with-kvm-on-a-centos-6.2-server
Tuesday, March 5, 2013
Installing JDBC on MS Windows 7
Basics on getting data from remote MySQL database requires installation of a Java driver.
The JDBC drivers is provided through the current Connector/J 5.1. This is a type 4 driver and works for MySQL 4.1, 5.0, 5.1, 5.5. MySQL reference for the driver can be found at http://docs.oracle.com/cd/E19957-01/mysql-refman-6.0/connectors-apis.html#connector-j-versions
Step 1. Ensure JDK 1.6 or 1.7 is already installed.
At the command prompt check the version, see below example where it was installed in C:\Program Files\Java\jre7
> java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) Client VM (build 22.1-b02, mixed mode, sharing)
Step 2. Download the driver from Maven2 project.
Download from http://mirrors.ibiblio.org/maven2/mysql/mysql-connector-java/5.1.19/
the file mysql-connector-java-5.1.19.jar
And save to C:\Program Files\Java\jre7\
Step 3. Tell Java where to find the driver
Click on Start ->Control Panel ->System
On the left menu choose, Advanced system setting
Choose Environment variables, in the System variables box click on CLASSPATH and choose Edit.
At the end of the text box, append a semi colon followed by location and the name of the drivers, e.g.
;C:\Program Files\Java\jre7\lib\mysql-connector-java-5.1.19.jar
Choose Ok until all boxes are closed.
If you have any command prompt or Java application, they need to be restarted.
Useful information in order to use the driver;
OpenOffice / LibreOffice Base
Step 1. Add the classpath
Open Writer and in the menu choose
Tools ->Option ->Java
Click on the JRE installed; Click Classpath ->Add Archive
Choose location of the driver (In this case C:\Program Files\Java\jre7\lib\mysql-connector-java-5.1.19.jar), click OK until all windows are closed.
Step 2. Close all OpenOffice / LibreOffice applications.
Test using the OpenOffice / LibreOffice Base
The JDBC drivers is provided through the current Connector/J 5.1. This is a type 4 driver and works for MySQL 4.1, 5.0, 5.1, 5.5. MySQL reference for the driver can be found at http://docs.oracle.com/cd/E19957-01/mysql-refman-6.0/connectors-apis.html#connector-j-versions
Step 1. Ensure JDK 1.6 or 1.7 is already installed.
At the command prompt check the version, see below example where it was installed in C:\Program Files\Java\jre7
> java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) Client VM (build 22.1-b02, mixed mode, sharing)
Step 2. Download the driver from Maven2 project.
Download from http://mirrors.ibiblio.org/maven2/mysql/mysql-connector-java/5.1.19/
the file mysql-connector-java-5.1.19.jar
And save to C:\Program Files\Java\jre7\
Step 3. Tell Java where to find the driver
Click on Start ->Control Panel ->System
On the left menu choose, Advanced system setting
Choose Environment variables, in the System variables box click on CLASSPATH and choose Edit.
At the end of the text box, append a semi colon followed by location and the name of the drivers, e.g.
;C:\Program Files\Java\jre7\lib\mysql-connector-java-5.1.19.jar
Choose Ok until all boxes are closed.
If you have any command prompt or Java application, they need to be restarted.
Useful information in order to use the driver;
- The classname: com.mysql.jdbc.Driver
- The connection string: jdbc:mysql://server-name:server-port/database-name
- Username and password to the database
- Default port 3306
OpenOffice / LibreOffice Base
Step 1. Add the classpath
Open Writer and in the menu choose
Tools ->Option ->Java
Click on the JRE installed; Click Classpath ->Add Archive
Choose location of the driver (In this case C:\Program Files\Java\jre7\lib\mysql-connector-java-5.1.19.jar), click OK until all windows are closed.
Step 2. Close all OpenOffice / LibreOffice applications.
Test using the OpenOffice / LibreOffice Base
Monday, February 4, 2013
Android 4.1.2 on Samsung S3
Update from Android 4.1.1 to 4.1.2 on Samsung S3 was straight forward. There were not many noticeable changes so I am listing what were the initial encounters;
- Pull down Notification bar have 2 new buttons
- AllShare cast - to share the screen with other S3 devices. Yet to get a chance to test it.
- Multi window - Allow a menu on the left side of the screen to appear with a list of apps. Two of these apps can be dragged to the screen and viewed at the same time. One app appears at top half and the other at bottom half. Click the horizontal bar at the centre and there are options to switch both app locations or to use the full screen.
- Pull down Notification bar doesn't have the Sync button - Looks like have to sync emails and calendars manually from the settings as the "Auto Sync" button is lost. If you really have the battery and want to leave the sync on, try editing Notification bar or follow this; Left button, choose "System settings" ->"Data Usage". Left button, choose "Auto sync data".
- Edit buttons on Notification bar - Default install have omitted the Sync button, but it can be added back to the Notification bar. To add or remove buttons, Click the Menu button (Left button), Choose "System settings" ->"Display" ->"Notification Panel". Drag additional buttons from the Available Buttons bar into empty spaces in the Notification panel bar.
- Keyboard includes a predictive feature that I could only disable when it appeared the first time I tried to use the keyboard. This include words from all the Facebook, ChatOn, social networking tools. I do not see the option to change the settings anywhere.
- Chrome web browser is included. If you use Chrome on your desktop, and signed in, the same apps open and saved bookmarks can be seen on the S3.
- The Gallery app provides 3 different views to show photos in an Album. In Gallery, choose the top right corner button to switch views.
- Coming soon...
Sunday, January 6, 2013
Getting started with Symfony2 - Part 1
After installing Symfony 2.1 and going through the documentations, everything seems simple enough. To start developing an application from scratch, first create a project, next create a Bundle and start adding codes.
Several assumptions;
A. Create a Bundle
Step 1: Generate the Bundle
Respond to the wizard's questions;
Step 2: Create the routing.
Still in the symfony directory, edit the file src/Sample/HelloBundle/Resources/config/routing.yml
hello:
pattern: /hello/{name}
defaults: { _controller: SampleHelloBundle:Hello:index }
Step 3: Create the controller file.
namespace Sample\HelloBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class HelloController extends Controller
{
public function indexAction($name)
{
return $this->render('SampleHelloBundle:Hello:index.html.twig', array('name' => $name));
}
}
Step 4: Create a view template
vi src/Sample/HelloBundle/Resources/views/Hello/index.html.twig
{% extends '::base.html.twig' %}
{% block body %}
Hello {{ name }}!
{% endblock %}
Step 5: Access the final application
In a web browser, enter the location or URL as
http://localhost/mysymfony/web/app.php/hello/malaysia
---
B. Delete a Bundle
Step 1: Delete the Bundle directory
rm -rf src/Sample/HelloBundle/
Step 2: Remove Bundle routing in /app/config/routing.yml
Example, delete
sample_hello:
resource: "@SampleHelloBundle/Resources/config/routing.yml"
prefix: /
Step 3: Remove Bundle from app/AppKernel.php
Example, delete
new Sample\HelloBundle\SampleHelloBundle(),
Step 4: Clear Symfony cache
or
php app/console cache:clear --env=prod --no-debug
Note to self: No promises when Part 2 will be published.
Several assumptions;
- Installation was done as in my previous posting, including creating the project called mysymfony.
- The Bundle is called HelloBundle in Sample. All Bundle names must end with the word Bundle.
- All Bundles will be under the vendor named "Sample".
A. Create a Bundle
Step 1: Generate the Bundle
cd mysymfony
php app/console generate:bundle --namespace=Sample/HelloBundle --format=yml Respond to the wizard's questions;
- [Enter]
- HelloBundle
- [Enter]
- [Enter]
- [Enter]
- [Enter]
- [Enter]
- [Enter]
Step 2: Create the routing.
Still in the symfony directory, edit the file src/Sample/HelloBundle/Resources/config/routing.yml
hello:
pattern: /hello/{name}
defaults: { _controller: SampleHelloBundle:Hello:index }
Step 3: Create the controller file.
vi src/Sample/HelloBundle/Controller/HelloController.php
namespace Sample\HelloBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class HelloController extends Controller
{
public function indexAction($name)
{
return $this->render('SampleHelloBundle:Hello:index.html.twig', array('name' => $name));
}
}
Step 4: Create a view template
vi src/Sample/HelloBundle/Resources/views/Hello/index.html.twig
{% extends '::base.html.twig' %}
{% block body %}
Hello {{ name }}!
{% endblock %}
Step 5: Access the final application
In a web browser, enter the location or URL as
http://localhost/mysymfony/web/app.php/hello/malaysia
---
B. Delete a Bundle
Step 1: Delete the Bundle directory
rm -rf src/Sample/HelloBundle/
Step 2: Remove Bundle routing in /app/config/routing.yml
Example, delete
sample_hello:
resource: "@SampleHelloBundle/Resources/config/routing.yml"
prefix: /
Step 3: Remove Bundle from app/AppKernel.php
Example, delete
new Sample\HelloBundle\SampleHelloBundle(),
Step 4: Clear Symfony cache
php app/console cache:clear
or
php app/console cache:clear --env=prod --no-debug
Note to self: No promises when Part 2 will be published.
Saturday, January 5, 2013
Installing Symfony2 on Centos 6
Symfony2 framework looks like it provide many useful development tools.
All following codes require access to internet to download the respective files.
Pre installation check list for Symfony2.1.
Lots of resources available online.
Ensure additional php packages are installed, including
Check that /etc/php/ini timezone is edited.
Example;
date.timezone = "Asia/Kuala_Lumpur"
Install GIT
Install Composer for PHP
Install Symfony2.1
Step 1: Download from http://symfony.com/download and extract
tar xvzf Symfony_Standard_Vendors_2.1.6.tgz
Read the text file Symfony/README.md
Step 2: Basic configuration
Step 3: Create your first Symfony2 project
Where
http://localhost/mysymfony/web/config.php
If there is an error, please fix before continuing. I received 2 errors to fix the directory permission for app/cache and app/logs
chown -Rf apache.apache app/logs app/cache
Note: I found following discussion useful
http://forum.symfony-project.org/viewtopic.php?f=32&t=45892
All following codes require access to internet to download the respective files.
Pre installation check list for Symfony2.1.
- Installed and running Apache httpd
- Installed php 5.3 or higher
- Installed GIT 1.7 or higher
Lots of resources available online.
Ensure additional php packages are installed, including
- php-cli
- php-intl
- php-mysql (if you use MySQL database)
- php-gd
- php-pecl-apc
- php-mbstring
Check that /etc/php/ini timezone is edited.
Example;
date.timezone = "Asia/Kuala_Lumpur"
Install GIT
sudo yum install git-core
Install Composer for PHP
cd /var/www/html
curl -s https://getcomposer.org/installer | phpInstall Symfony2.1
Step 1: Download from http://symfony.com/download and extract
tar xvzf Symfony_Standard_Vendors_2.1.6.tgz
Read the text file Symfony/README.md
cp composer.phar Symfony
Step 2: Basic configuration
Step 3: Create your first Symfony2 project
cd /var/www/html/Symfony
php composer.phar create-project symfony/framework-standard-edition /var/www/html/mysymfony 2.1.6Where
- create-project is the command to create a project with 3 arguments
- symfony/framework-standard-edition is the framework to be installed
- /var/www/html/mysymfony is the new directory or project name to be created and installed with base project files
- 2.1.6 is the version
http://localhost/mysymfony/web/config.php
If there is an error, please fix before continuing. I received 2 errors to fix the directory permission for app/cache and app/logs
chown -Rf apache.apache app/logs app/cache
Note: I found following discussion useful
http://forum.symfony-project.org/viewtopic.php?f=32&t=45892
What you should not do for your online portal
At any time if you have launched a portal accessed publicly, its a bad idea to have links showing Minta Maaf.
Just found this on the Malaysian Road Transport Department Portal on 5 Jan 2013.
If its not ready, no need to put it online, right? Just my Opinion.
Just found this on the Malaysian Road Transport Department Portal on 5 Jan 2013.
If its not ready, no need to put it online, right? Just my Opinion.
The link kept directing to http://www.jpj.gov.my/mintamaaf for most of the options I picked.
Friday, December 28, 2012
Statistics on OSS
From time to time, the use of OSS needs justification. What better then information based on open source development model. This includes;
- Large number of contributors
- Frequency of updates (commits)
- Lines of codes
I found such info from Ohloh.net. Example for HTTP Server from Apache is at http://www.ohloh.net/p/apache
Saturday, December 15, 2012
Upgrade Sony Tablet S to Android 4.0.3 rel5
Just received notice of an upgrade. Current Android is 4.0.3 rel 1.
Info on updates is at http://www.sony-asia.com/support/faq/528949
Info on updates is at http://www.sony-asia.com/support/faq/528949
Thursday, December 6, 2012
Speedtest via Digi
Speedtest.net results for Digi on SE Xperia X10i with Android 2.3.3
Subscribed to Digi unlimited
[1st round] on 6 Dec 2012
Download: 558kbps, Upload: 377kbps
Ping 99ms
[2nd round] on 6 Dec 2012
Download: 1658kbps, Upload: 372kbps
Ping 90ms
Hmmm...
Subscribed to Digi unlimited
[1st round] on 6 Dec 2012
Download: 558kbps, Upload: 377kbps
Ping 99ms
[2nd round] on 6 Dec 2012
Download: 1658kbps, Upload: 372kbps
Ping 90ms
Hmmm...
Tuesday, December 4, 2012
Centos Linux and 7z
Files with the extension of .7z indicates its a 7-zip compressed files in unicode format. To access files within the 7z, you will need to uncompress or extract the 7z file. By default, compression uses LZMA or Lempel–Ziv–Markov chain algorithm, which is an algorithm used to perform lossless data compression.
The program used to access 7z files;
Main differences of 7z and tar, is that 7z is meant to be more portable. This includes dropping of the user/group permission of files. I will demonstrate based on Centos 6.
A. Creating a 7z file
Step 1: Installing p7zip
yum install p7zip
Step 2: Compress files in directory named "examples" into the file myfiles.7z
7za a myfiles.7z
Step 3: List files within myfiles.7z
7za l myfiles.7z
Example output as below (note - no user/group info)
Optional steps;
Verify 7z file
7za t myfiles.7z
B. Extracting a 7z file
Step 1: Extract to current directory
7za e myfiles.7z
The program used to access 7z files;
- Windows: 7-zip
- Centos Linux: p7zip
Main differences of 7z and tar, is that 7z is meant to be more portable. This includes dropping of the user/group permission of files. I will demonstrate based on Centos 6.
A. Creating a 7z file
Step 1: Installing p7zip
yum install p7zip
Step 2: Compress files in directory named "examples" into the file myfiles.7z
7za a myfiles.7z
Step 3: List files within myfiles.7z
7za l myfiles.7z
Example output as below (note - no user/group info)
7-Zip (A) [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)
Listing archive: scripts.7z
--
Path = scripts.7z
Type = 7z
Method = LZMA
Solid = +
Blocks = 1
Physical Size = 4319
Headers Size = 365
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2012-12-04 09:17:15 ....A 179 3954 examples/svn-auth-users
2012-12-04 09:17:15 ....A 35 examples/tboxmy.sh
2012-12-04 09:17:15 ....A 1004 examples/menusnapshot.sh
2012-12-04 09:17:15 D.... 0 0 examples
------------------- ----- ------------ ------------ ------------------------1218 3954 3 files, 1 folders
Optional steps;
Verify 7z file
7za t myfiles.7z
B. Extracting a 7z file
Step 1: Extract to current directory
7za e myfiles.7z
Saturday, November 24, 2012
Contributing to Libreoffice
well,
Patching of Libreoffice is a commitment from a wide range of users. Below is a response of a contributor on how he contributes.
=======
When I work, I frist create a branch out of a point in master (preferably a oen that build nicely :-) ) so nwo I'm on branch 'foo' for example. I code my patch, then I submity it to gerrit via git push origin foo:refs/for/master then I checkout out master again... and keep going... When the review comes and modification to my patch are needed, I checkout out the branch foo again... the I make the modifications and 'amend' the commit (which _is_ the commit I pushed to gerrit) and then push it again using the same command. rince and repeat until the patch is ready... then I let gerrit cherry pick it on top of master.. if ok, then I can delete the foo branch locally if the cherry pick failed because of a conflict... I fetch ./g fetch and then rebase foo : git rebase origin/master (while being on the foo branch) since the cherry pick from gerrit failed, that rebase should exibit some conflict, with I resolve using git mergetool then one can re-push the patch to gerrit, again using the same command as above.. rince and repeat until the cherry pick from gerrit works If one has commit right, then the last phase can be dealt by bringing the patch to master locally and simply pushing to master
When I work, I frist create a branch out of a point in master (preferably a oen that build nicely :-) ) so nwo I'm on branch 'foo' for example. I code my patch, then I submity it to gerrit via git push origin foo:refs/for/master then I checkout out master again... and keep going... When the review comes and modification to my patch are needed, I checkout out the branch foo again... the I make the modifications and 'amend' the commit (which _is_ the commit I pushed to gerrit) and then push it again using the same command. rince and repeat until the patch is ready... then I let gerrit cherry pick it on top of master.. if ok, then I can delete the foo branch locally if the cherry pick failed because of a conflict... I fetch ./g fetch and then rebase foo : git rebase origin/master (while being on the foo branch) since the cherry pick from gerrit failed, that rebase should exibit some conflict, with I resolve using git mergetool then one can re-push the patch to gerrit, again using the same command as above.. rince and repeat until the cherry pick from gerrit works If one has commit right, then the last phase can be dealt by bringing the patch to master locally and simply pushing to master
Thursday, November 22, 2012
Change MySQL database directory
Why do I need to change MySQL database directory or location?
- Current disk is out of space
- Current partition is out of space
- There is a better filesystem to improve disk IO performance.
Steps to do this on Centos 6 with SELinux enforced.
Step 1: Stop MySQL server
Step 2: Create the new directory
A new directory can be created in the new disk or partition.
Step 3: Copy existing database to new location
mv /var/lib/mysql/* /srv/mysql/
Step 4: Configure MySQL server
Edit /etc/my.cnf with following
datadir=
socket=
[client]
socket=
Save and close the file.
5. Configure SELinux to allow new database
View current settings
setstatus
ls -lZ /var/lib/mysql
ls -lZ
Edit settings with e.g. as /media/server/mysql
semanage fcontext -a -t mysqld_db_t "/media/server/mysql(/.*)?"
OR
chcon -R -t mysqld_db_t /media/server/mysql
restorecon -Rv /media/server/mysql
Check settings are in the config file
grep -i mysql /etc/selinux/targeted/contexts/files/file_contexts.local
6. Start up MySQL
I had to reboot the server and change selinux to permissive for all this to work.
Wednesday, November 21, 2012
Linux welcome messages
Securing the Linux terminal includes telling users that they may not access the system without authorisation.
Edit following files for this purpose;
Edit following files for this purpose;
- /etc/motd
- /etc/issue
- /etc/issue.net
For items 2 and 3, they only work if you are connected at the terminal or have client server setup. Those using SSH, messages can be set to point to item 3 in the configuration file /etc/ssh/sshd_config
Sunday, November 18, 2012
Howto Yii 1, a PHP framework
This framework seemed worth while to test out. Steps to get started is as follows;
Step 1: Install the framework.
From the www.yiiframework.com site, follow the instructions for pre-requisite to install the Yii framework. Typically you will need
Download Yii-1.1...tar.gz (in tar.gz format) from http://www.yiiframework.com/download/
Extract the tar.gz file to the web folder /var/www/html/yii1
It is also a good point to download the Yii-docs-1.1...tar.gz and extract it to follow its references and tutorials in PDF.
Step 2: Create the skeleton of a new web app.
At the prompt, access the framework's directory /var/www/html/yii1/framework
Type the following:
./yiic webapp ../testdrive
or in windows
yiic webapp ..\testdrive
Open a web browser and access the testdrive application
http://localhost/yii1/testdrive
Step 3: Configure the timezone for the web app.
If an error on the timezone appears, complete following steps
vi /var/www/html/yii1/testdrive/protected/config/main.php
Just before the last line, add the timezone.
'timeZone'=>'Asia/Kuala_Lumpur',
);
Access the testdrive application with the web browser, the error on timezone is gone. It does inform users the following;
You may change the content of this page by modifying the following two files:
View file: C:\Program Files\www\yii1\testdrive\protected\views\site\index.php
Layout file: C:\Program Files\www\yii1\testdrive\protected\views\layouts\main.php
Step 4. Understanding the structure
It is good to know the directories built for the testdrive web application under /var/www/html/yii1/testdrive. From here on, I will refer to the directory /var/www/html/yii1/testdrive as
/index.php
/index-test.php
/assets/ <=Empty
/css/ <=Contains 5 basic CSS files and a bg.gif file
/images/ <=Empty
/protected/ <=This is where your coding goes
/themes/ <=Several directories that is empty
Step 5. The database, mysql
Create a database named yii_testdrive, and load in the SQL from
/protected/data/schema.mysql.sql
By default it has the SQLLITE as its database, edit the file/config/main.php and comment out the following lines
'db'=>array(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
Uncomment the mysql lines below it and edit the database connection
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=yii_testdrive',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
),
Step 6. Generating the pages based on the database
Uncomment the GII web-based code generator and change the default password to MyPassword
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'MyPassword',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),
Open a web browser and point to the gii resource
http://localhost/yii1/testdrive/index.php?r=gii
A login page appears, type the password as
MyPassword
You are then presented with the following to auto generate codes based on your database.
Thats all for now...will continue when time permits.
Step 1: Install the framework.
From the www.yiiframework.com site, follow the instructions for pre-requisite to install the Yii framework. Typically you will need
- Apache web browser
- PHP 5.1 and newer
- PHP PDO
- A database
Download Yii-1.1...tar.gz (in tar.gz format) from http://www.yiiframework.com/download/
Extract the tar.gz file to the web folder /var/www/html/yii1
It is also a good point to download the Yii-docs-1.1...tar.gz and extract it to follow its references and tutorials in PDF.
Step 2: Create the skeleton of a new web app.
At the prompt, access the framework's directory /var/www/html/yii1/framework
Type the following:
./yiic webapp ../testdrive
or in windows
yiic webapp ..\testdrive
Open a web browser and access the testdrive application
http://localhost/yii1/testdrive
Step 3: Configure the timezone for the web app.
If an error on the timezone appears, complete following steps
vi /var/www/html/yii1/testdrive/protected/config/main.php
Just before the last line, add the timezone.
'timeZone'=>'Asia/Kuala_Lumpur',
);
Access the testdrive application with the web browser, the error on timezone is gone. It does inform users the following;
You may change the content of this page by modifying the following two files:
View file: C:\Program Files\www\yii1\testdrive\protected\views\site\index.php
Layout file: C:\Program Files\www\yii1\testdrive\protected\views\layouts\main.php
Step 4. Understanding the structure
It is good to know the directories built for the testdrive web application under /var/www/html/yii1/testdrive. From here on, I will refer to the directory /var/www/html/yii1/testdrive as
Step 5. The database, mysql
Create a database named yii_testdrive, and load in the SQL from
By default it has the SQLLITE as its database, edit the file
'db'=>array(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
Uncomment the mysql lines below it and edit the database connection
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=yii_testdrive',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
),
Step 6. Generating the pages based on the database
Uncomment the GII web-based code generator and change the default password to MyPassword
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'MyPassword',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),
Open a web browser and point to the gii resource
http://localhost/yii1/testdrive/index.php?r=gii
A login page appears, type the password as
MyPassword
You are then presented with the following to auto generate codes based on your database.
- Controller Generator
- Crud Generator
- Form Generator
- Model Generator
- Module Generator
Thats all for now...will continue when time permits.
Saturday, September 29, 2012
Howto Install OpenSIS on Centos 6
Step 1: Retrieve the package
Download from http://sourceforge.net/projects/opensis-ce/files/latest/download
Extract opensis-ce to /vcar/www/html
Step 2: Launch web installer
Start mysqld and httpd (apache web server). Open a web browser and point to the address
http://
Follow onscreen instructions to install database and sample database.
Friday, September 14, 2012
Installing Plone 4 on Centos 6
Plone 4 is based on Python and Zope and provides its own little database.
Installation on Centos 6.3 was pretty straight forward in the standalone mode. Alternative, mode is as ZEO Cluster or a single running instance.
Step 1: Download the Unified installer (comes with Python and Zope) for Plone.
Download from Plone.org (https://launchpad.net/plone/4.2/4.2.1/+download/Plone-4.2.1-UnifiedInstaller.tgz) with a file size of approx 50MB.
See http://plone.org/products/plone/releases/4.2.1
Step 2: Install dependency files.
Most of these are already installed if Centos was installed with the development tools.
Add the RPMForge repo;
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
yum install gcc gcc-g++ make tar bzip2 gzip
yum install readline libgsf
yum install wv
If there is problem with the wv package, download wv from EPEL or http://wvware.sourceforge.net and install with RPM.
rpm -ivh wv-1.2.7-2.el6.i686.rpm
Step 3: Extract & Install Plone
Enter the directory with the UnifiedInstaller (Download directory).
tar zxvf Plone-4.2.1-UnifiedInstaller.tar.gz
cd plone-4.2.1
./install.sh standalone
cd /usr/local/Plone/zinstance
Identify which port (default 8080) will be used for Plone. If needed, change the port then apply changes by typing
bin/buildout
Step 4: Start/Stop Plone
The Plone server can be started or stop with following command (replace the word start)
/usr/local/Plone/zinstance/bin/plonectl start
Step 5: Access Plone
Open a web browser (e.g. Firefox, Chrome) and enter following URL address;
http://localhost:8080
Default password is found in the file /usr/local/Plone/zinstance/adminPassword.txt
Create a Plone instance, then read the instructions at the main page of the Plone instance.
Additional notes:
Install following packages;
References: http://plone.org/documentation/manual/installing-plone/installing-on-linux-unix-bsd/referencemanual-all-pages
Installation on Centos 6.3 was pretty straight forward in the standalone mode. Alternative, mode is as ZEO Cluster or a single running instance.
Step 1: Download the Unified installer (comes with Python and Zope) for Plone.
Download from Plone.org (https://launchpad.net/plone/4.2/4.2.1/+download/Plone-4.2.1-UnifiedInstaller.tgz) with a file size of approx 50MB.
See http://plone.org/products/plone/releases/4.2.1
Step 2: Install dependency files.
Most of these are already installed if Centos was installed with the development tools.
Add the RPMForge repo;
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
yum install gcc gcc-g++ make tar bzip2 gzip
yum install readline libgsf
yum install wv
If there is problem with the wv package, download wv from EPEL or http://wvware.sourceforge.net and install with RPM.
rpm -ivh wv-1.2.7-2.el6.i686.rpm
Step 3: Extract & Install Plone
Enter the directory with the UnifiedInstaller (Download directory).
tar zxvf Plone-4.2.1-UnifiedInstaller.tar.gz
cd plone-4.2.1
./install.sh standalone
cd /usr/local/Plone/zinstance
Identify which port (default 8080) will be used for Plone. If needed, change the port then apply changes by typing
bin/buildout
Step 4: Start/Stop Plone
The Plone server can be started or stop with following command (replace the word start)
/usr/local/Plone/zinstance/bin/plonectl start
Step 5: Access Plone
Open a web browser (e.g. Firefox, Chrome) and enter following URL address;
http://localhost:8080
Default password is found in the file /usr/local/Plone/zinstance/adminPassword.txt
Create a Plone instance, then read the instructions at the main page of the Plone instance.
Additional notes:
Install following packages;
- Openoffice.org or libreoffice (headless) for better document conversion
- msttcorefonts for better formatting compatibility, see previous post.
References: http://plone.org/documentation/manual/installing-plone/installing-on-linux-unix-bsd/referencemanual-all-pages
Wednesday, September 12, 2012
PostgreSQL 9.2 improves
Latest PostgreSQL will support 64 cores, or 3x its current capability. Transactions per second increased to about 350,000 is over 4x its current speed.
Not bad for OPEN SOURCE!
see
http://www.databasejournal.com/features/postgresql/postgresql-9-2-open-source-database.html
Not bad for OPEN SOURCE!
see
http://www.databasejournal.com/features/postgresql/postgresql-9-2-open-source-database.html
Tuesday, September 4, 2012
Howto install Alfresco 4, the Community edition on Centos 6
Alfresco provides some very interesting functions. This includes support for networking with CIFS, WebDav and IMAP.
See https://www.alfresco.com/products/platform
Check following have been done.
Following are steps that I have taken to install Alfresco 4 on Centos 6.
Step 1. Create the database
At the CLI, login to MySQL and create database named "alfresco"
# mysql -u root -p
CREATE DATABASE alfresco;
\q
Step 2. Start LibreOffice as headless
soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" \
-nologo -headless
Step 3. Get the software and install
Download from http://wiki.alfresco.com/wiki/Download_and_Install_Alfresco
Double click on the file alfresco-community....bin and follow the onscreen instructions.
I choose the "Easy" method, and included the "Share"
Alternatively, installation can be done at the Linux CLI, just switch to root user, go to the directory where the file was downloaded and type
# ./alfresco-community-4.0.x-installer-linux-x64.bin ---mode text
Step 4. Start Alfresco, based on the Tomcat server port of 8080.
See https://www.alfresco.com/products/platform
Check following have been done.
- Linux must be 64bit. Why? they only provided Alfresco for Linux on 64 bits, thats why.
- Install LibreOffice (yum install libreoffice libreoffice-headless), version 3.4.5.2 was installed
- Install MySQL (yum install mysql-server), in my case version 5.1.61 was installed.
Following are steps that I have taken to install Alfresco 4 on Centos 6.
Step 1. Create the database
At the CLI, login to MySQL and create database named "alfresco"
# mysql -u root -p
CREATE DATABASE alfresco;
\q
Step 2. Start LibreOffice as headless
soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" \
-nologo -headless
Step 3. Get the software and install
Download from http://wiki.alfresco.com/wiki/Download_and_Install_Alfresco
Double click on the file alfresco-community....bin and follow the onscreen instructions.
I choose the "Easy" method, and included the "Share"
Alternatively, installation can be done at the Linux CLI, just switch to root user, go to the directory where the file was downloaded and type
# ./alfresco-community-4.0.x-installer-linux-x64.bin ---mode text
Alfresco started automatically, but is needed, got the the /opt/alfresco folder and type
alfresco.sh start
Access the application with a web browser and the following URLs/
alfresco.sh start
Access the application with a web browser and the following URLs/
http://localhost:8080/alfresco
and http://localhost:8080/share
Wednesday, August 22, 2012
Howto add menu to Gnome
Centos 6.3 defaults with the Gnome desktop. After installing / creating a custom application, how do you add it to the start menu?
Answer: Install alacarte
Step 1: Install Alacarte
# yum install alacarte
Step 2: Add the new program as a menu item.
Click System ->Preferences ->Main Menu
Choose the menu and add the new item.
Answer: Install alacarte
Step 1: Install Alacarte
# yum install alacarte
Step 2: Add the new program as a menu item.
Click System ->Preferences ->Main Menu
Choose the menu and add the new item.
Tuesday, August 21, 2012
Kubuntu - USB disk does not mount
Followup from the Kubuntu 10.04 installation, for those who have opted to stay on with Kubuntu 10.04, mounting of USB disk is done manually or alternatively, install usbmount.
Using the Package Manager or at the command line, install the following packages
Using the Package Manager or at the command line, install the following packages
- usbmount
- pmount
- ntfs-3g
Tuesday, August 14, 2012
Direct Apache access to SSL ports
Secure Socket Layer (SSL) provides an encrypted network connection and is seen to use the HTTPS protocol in the URL.
To ensure that the web server only servers HTTPS, the following needs to be enabled before the HTTPS VirtualHost tag.
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}:443%{REQUEST_URI}
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}:443%{REQUEST_URI}
What it means? turn off https if its https, then change the url to always use https.
Actually, you can put a lot more between the VirtualHost tag. E.g. choice of error pages to server and limiting which domain/IP address that can access the contents.
Thursday, August 2, 2012
Screen capture your Android phone
On the Xperia X10i with Android 2.3, and most other Android phones, you can screen capture for purpose of troubleshooting, development, presentation and article writing. Here is listed the instructions on MS Windows 7.
Step 1: Install the Android SDK.
Step 2: Switch the X10i debug.
Click "left" button, choose "Settings" ->"Applications" ->"Development".
Click to Check "USB Debugging".
Step 3: Plug USB cable between X10i and PC.
If asked to charge, choose that option.
Step 4: On the PC, start the Dalvik Debug Monitor (DDMS)
Click the Windows "Start" button, and type following and press "Enter" key.
cmd
Switch to the android directory and type following and press "Enter" key.
tools\ddms.bat
Ensure that you choose your phone from the left list. In my case its written as "XXX [SonyEricsson:X10i]". From the top menu of DDMS, click "Device" ->"Screen capture..."
Step 5: Capture the screen on the Android device (X10i)
On the X10i, select the screen to be captured (or saved).
Then on the PC, the DDMS should show the same screen as the Android, click "Copy". Start the graphics software such as GIMP or MS Paint and "paste" the screen capture. Save as the filename of your choice.
I have not used the "Save" button on DDMS, so I can't say where it saves to.
Step 1: Install the Android SDK.
Step 2: Switch the X10i debug.
Click "left" button, choose "Settings" ->"Applications" ->"Development".
Click to Check "USB Debugging".
Step 3: Plug USB cable between X10i and PC.
If asked to charge, choose that option.
Step 4: On the PC, start the Dalvik Debug Monitor (DDMS)
Click the Windows "Start" button, and type following and press "Enter" key.
cmd
Switch to the android directory and type following and press "Enter" key.
tools\ddms.bat
Ensure that you choose your phone from the left list. In my case its written as "XXX [SonyEricsson:X10i]". From the top menu of DDMS, click "Device" ->"Screen capture..."
Step 5: Capture the screen on the Android device (X10i)
On the X10i, select the screen to be captured (or saved).
Then on the PC, the DDMS should show the same screen as the Android, click "Copy". Start the graphics software such as GIMP or MS Paint and "paste" the screen capture. Save as the filename of your choice.
I have not used the "Save" button on DDMS, so I can't say where it saves to.
Subscribe to:
Posts (Atom)

















