Best operating system to run older configuration PC – Lubuntu

Choosing Lubuntu:

LatelyI was pushed to use my 7 year old PC for an emergency which had Windows 7 in it. It was very tough for me to use the old PC as compared to my latest one, even though it had 1.5GB or RAM and Dual Core Processor. I even had thoughts to install Windows XP to achive better performance.

Before starting anything, did some research to if I can find a Linux distro that could consume very less resources. I was always fond of the Ubuntu distros for as long as 10 years.
I was very fond of receiving the Ubuntu distro CDs that was transported freely to my remote village earlier in 2004 or 2005.
With that fondness I searched the latest distro and then came the Lubuntu (Lite-Ubuntu). I installed it in my PC with dual boot configuration. I should say that the performance is very impressive.

About Lubuntu:

Lubuntu is a good operating system for many old computers, but not for all of them.
Some computers have too little horsepower or memory. A rule of thumb is that the computer should not be more than 10 years old.
Lubuntu is recognized as a member the Ubuntu family by the developers of Ubuntu and has the same release nomenclature.

System Requirements, as per Lubuntu site:

We have done many tests and we've found out that Lubuntu can be installed on a Pentium II or Celeron system with 128 MB of RAM, but such a system would not perform well enough for daily use.
With 256MB - 384MB of RAM, the performance will be better and the system will be more usable.
With 512MB of RAM, you don't need to worry much.

If you like to use the system for normal activities like general browsing, viewing mails etc., the above config would be great.
But if you intend to use it for video watching like using Youtube, I must warn you, the browser you use could eat up all all memory.

Differences between Lubuntu and Ubuntu:

1. Different Desktop Environment (DE) – Lubuntu uses LXDE (Lightweight X11 Desktop Environment) while Ubuntu uses Unity as the default DE.

  • Both Lubuntu and Ubuntu share two major important things: same Core System and same Repositories.
  • Lubuntu and Ubuntu belong to the same family and talking about each as totally different two systems is not correct since they have some things in common.
  • They even share the same Forum Area and share many Wiki Pages. Other than that, they are the same.
  • The DE is what makes Lubuntu a lightweight OS, and of course the selected applications too because we make sure to use the lightest applications which are not resource hungry.
  • However, you are still free to use any application available in Ubuntu’s repositories, as long as your computer can run it.

2. Different Default Applications

Lubuntu Application Function
Xpad Stickies
Evince PDF Viewer
Gnumeric Spreadsheet
Abiword Docs
Simple-scan Scanner
Gnome-disk-utility Partition Editor
Light-locker Screensaver
Guvcview Webcam Utility
Gucharmap Character Map
Scrot Screenshot
Hardinfo System info
Mtpaint Image Editing
Xfburn Cd Burning
Pcmanfm File Manager
Gcalculator Calculator
Audacious Audio Player
Gnome-mplayer Video Player
Transmission Torrent
Pidgin Instant Messaging
Sylpheed Email Client
Mozilla Firefox Web browser
Leafpad Editor
File-roller (De)Compress files
Lxterminal Terminal
Gpicview Image Viewer

Download Lubuntu:

http://lubuntu.me/downloads/
https://help.ubuntu.com/community/Lubuntu/GetLubuntu

Official Websites:

http://lubuntu.me/
http://lubuntu.net/
https://wiki.ubuntu.com/Lubuntu

Installing OpenStack on AWS

1. Prerequisites – Minimal requirements for hosting in AWS, but not limited to:

  • Ubuntu Server 14.04.3 LTS – 64bit
  • Minimum 2VCPU – Cores
  • Minimum 8 GB RAM for just OpenStack (m4.large), Minimum 16 GB RAM for Sahara and clustering (m4.xlarge)
  • Atleast 40 GB of diskspace

2. Install Ubuntu if you dont have one

3. Verify installed version using

lsb_release -d
free -m
df -h

4. Update to the latest binaries

sudo apt-get update

5. Create a SUDO user – alternatively you can use the /devstack/tools/create-stack-user.sh to create a user after step 8

sudo -i
adduser stack			
	Enter new UNIX password:
	Retype new UNIX password:
	passwd: password updated successfully
	Changing the user information for username
	Enter the new value, or press ENTER for the default
	Full Name []:stack
	Room Number []:
	Work Phone []:
	Home Phone []:
	Other []:
	Is the information correct? [Y/n] Y

6. Add user to SUDOERs group

usermod -aG sudo stack 
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

7. Switch to the new stack user

su - stack
check if the user can do sudo operations without password prompts
sudo ls -la /root

8. Switch to user home and install GIT and checkout devstack

cd ~
sudo apt-get install git
git clone https://github.com/openstack-dev/devstack

9. Configure devstack – update local.config and move to /devstack

cd /devstack
cp sample/local.conf .

* Update the passwords for the accounts

ADMIN_PASSWORD=St@ckNewPwd1
DATABASE_PASSWORD=St@ckNewPwd1
RABBIT_PASSWORD=St@ckNewPwd1
SERVICE_PASSWORD=St@ckNewPwd1

* If you are running on a physical machine with a static IP you can update the following property. On AWS its better to leave it commented as the local IP will be changed on each restart, unless the Elastic IP is assigned to the instance

HOST_IP=172.31.26.172

* And add the following line at the end of the file. These entries will add the Sahara plugin (Data Processing) in OpenStack UI

echo "enable_plugin sahara git://github.com/openstack/sahara" >> local.conf
echo "enable_plugin sahara-dashboard git://github.com/openstack/sahara-dashboard" >> local.conf
echo "enable_plugin ceilometer git://github.com/openstack/ceilometer" >> local.conf

10. Start the stack services

./stack.sh

* This takes up sometime and logs will be available at /opt/stack/logs. On successful completion you will find details something similar as below.

=========================
DevStack Component Timing
=========================
Total runtime         1169
run_process            57
test_with_retry         3
apt-get-update          3
pip_install           299
restart_apache_server  10
wait_for_service       11
git_timed             244
apt-get                69
=========================

This is your host IP address: 172.31.26.172
This is your host IPv6 address: ::1
Horizon is now available at http://172.31.26.172/dashboard
Keystone is serving at http://172.31.26.172/identity/
The default users are: admin and demo
The password: St@ckNewPwd1
stack@ip-172-31-26-172:~/devstack$

11. To access the dashboard hit http://172.31.26.172/dashboard in browser (with the ip as displayed in the above step). If you are running in local PC you can directly access with the above url. But if you are running on AWS, this is the internal IP and will not be available to the outside world. In this case, allow HTTP access on 80 port for the outside world and access the service with the Public IP or DNS hostname allocated to your instance. This in my case http://54.23.123.43/dashboard.

Enable Registration in WordPress

In WordPress custom installations, the option for Registration of new users is disabled by default. To enable the registrations and allow logins for public you can follow the below steps.

Single site installation:

As soon as the installation is completed go to the WordPress Dashboard -> Settings

You will find an option Allow new registrations, you may need to select the Default Role for the newly registered members.

wp-user-registeration-single-site

Multi-site/Network installation:

In case if you have installed WordPress in Multi site mode go to the Network Admin -> Settings and select the options under Allow new registrations section.

wp-user-registeration-multi-site

Once the registration is enabled it may be needed to add login options at places to find it easily. Follow these methods to do the same.

Method 1:

Add Meta widget in the sidebars or in footers. Select Appearance -> Widgets and select the Meta Widget.  Note that the menu will be available in Individual Site Dashboard, not in the Network Admin dashboard in case of Multi-site installation.

wp-user-login-widget

 

Method 2:

Add the login link in your Posts/Pages and it should be in the pattern, http(s)://HOSTNAME(:PORT)/(SUBDOMAINS)/wp-login.php.

Examples:

  1. http://itechgenie.com/myblog/wp-login.php – MultiSite installation
  2. http://itechgenie.com/wp-login.php – SingleSite installation

Maven and Cloud Foundry Integration

Cloud Fountry provides as easy integration plugins to move the build packages to its servers through Maven. Here is the sample configuration.

Add Servers to settings.xml

<settings> 
	...
	<servers>
		... 
		<server>
			<id>cloud-foundry-credentials</id>
			<username>cf_user_id_you_created</username>
			<password>cf_password_you_created</password>
		</server>
	</servers> 
</settings>

You can encrypt you password in MAVEN settings. Check out here on how to do it.

Add Dependency and Plugin settings in pom.xml

</project>
	...	
	<build>
		...
		<plugins>
				<groupId>org.cloudfoundry</groupId>
				<artifactId>cf-maven-plugin</artifactId>
				<version>1.1.3</version>
				<configuration>
					<server>cloud-foundry-credentials</server>
					<target>https://url.to.cloud.foundry.com</target>
					<memory>512</memory>
					<appname>application-name</appname>
					<org>ORG_NAME</org>
					<space>SPACE_NAME</space>
					<instances>1</instances>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>push</goal>
						</goals>
					</execution>
				</executions>
		</plugins>
	</build>
</project>

Thats it !!. Build you project using Maven and check if you application gets deployed into your Cloud Foundry server.

Activiti REST in Weblogic

When trying to deploy the Activiti REST WAR in WebLogic servers, we found that the requests are reaching the server, but are filtered by the WebLogic server. To make sure your requests reach the Application bypassing the WebLogic filters, you must set the enforce-valid-basic-auth-credentials property in config.xml -> security-configuration to false

...
<enforce-valid-basic-auth-credentials>false</enforce-valid-basic-auth-credentials>
</security-configuration>

From WebLogic servers 9.2 and above, client requests that use the HTTP BASIC authentication must pass WebLogic Server authentication, even if access control is not enabled on the target resource.

The setting of the Security Configuration MBean flag enforce-valid-basic-auth-credentials determines this behavior. (The DomainMBean can return the new Security Configuration MBean for the domain.) It specifies whether or not the system should allow requests with invalid HTTP BASIC authentication credentials to access unsecured resources.

More info at “Understanding BASIC Authentication with Unsecured Resources“.

Installing Oracle JDK in Amazon AWS EC2 Ubuntu

Lately I tried to install Oracle JDK in one of my Ubuntu servers on Amazon EC2 instance. Unfortunately the inbuilt installers support the installation of OpenJDK.

For some requirements, I was in need of installing a specific version of JDK and test my application, you could get the older version from Oracle Site. I used the following script from one of the blogs, hope it helps someone.

#!/usr/bin/env bash
wget -O 'jdk-7u80-linux-x64.tar.gz' --no-cookies --no-check-certificate --header 'Cookie:gpw_e24=http://www.oracle.com; oraclelicense=accept-securebackup-cookie' 'http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz'
tar -xvf jdk-7u80-linux-x64.tar.gz
sudo mkdir /usr/lib/jvm
sudo mv ./jdk1.7* /usr/lib/jvm/jdk1.7.0
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1
sudo chmod a+x /usr/bin/java
sudo chmod a+x /usr/bin/javac
sudo chmod a+x /usr/bin/javaws

The Key here is Oracle need you to accept the license terms before using the any version of Oracle JDK. You could do the same from the scripting by just adding --no-cookies --no-check-certificate --header 'Cookie:gpw_e24=http://www.oracle.com; oraclelicense=accept-securebackup-cookie' params to the WGET.

Alternative, you could download the installers/zip files from external CDNs, like REUCON, move it to EC2 instance through SFTP and install it.

Adding Oracle Datasource to JBoss EAP server

To add a Oracle Datasource to the JBOSS server, follow the steps

1. In the standalone.xml or in standalone-full.xml

<subsystem xmlns="urn:jboss:domain:datasources:1.2">
		<datasources>
			<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
				<connection-url>jdbc:h2:tcp://localhost/~/jbpm-db-new;MVCC=TRUE;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
				<driver>h2</driver>
				<security>
					<user-name>sa</user-name>
					<password>sa</password>
				</security>
			</datasource>
			<datasource jndi-name="java:jboss/datasources/JbpmDS" pool-name="JbpmDS" enabled="true" use-java-context="true">
				<connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
				<driver>oracle</driver>
				<security>
					<user-name>username</user-name>
					<password>password</password>
				</security>
			</datasource>
			<drivers>
				<driver name="h2" module="com.h2database.h2">
					<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
				</driver>
				<driver name="oracle" module="com.oracle.jdbc">
					<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
					<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
				</driver>
			</drivers>
		</datasources>
</subsystem>

2. In $JBOSS_HOME/modules/com/oracle/jdbc/main I have copied the ojdbc6.jar and created the module.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.oracle.jdbc">
  <resources>
    <resource-root path="ojdbc6.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
  </dependencies>
</module>

3. Now you could use the JNDI “java:jboss/datasources/JbpmDS” in your application

Android device showing offline with USB debugging

When I tried to run Android application in my mobile from Android Studio, I stuck with the error stating the application my Device was Offline.

When I run the command adb devices the error as follows

List of devices attached
00b445g34****** offline

To Enable the USB debugging option in Android device

1. Go to Settings, and select Applications > Development
2. Enable USB debugging
3. For Devices with Android KitKat and go to Settings > About devices > Tap 7 times on “Build Number”
4. Once Developer Option is enabled in the Settings, Enable USB debugging
5. Update the Android SDK Tools in Android SDK Manager
6. Traverse to \android-sdk\platform-tools and run adb devices
7. If still the problem exists restart the ADB server

adb kill-server
set ADB_TRACE=all
adb nodaemon server
adb devices

8. The ADB_TRACE will help you trace and resolving the issues like permission and others.
9. If still the problem exists kill the adb process killall adb in linuxoids and taskkill /IM adb.exe
10. Disconnect your mobile, Developer option > Revoke USB debugging authorizations (KitKat and above)
11. Restart your mobile and connect to PC. You will be asked to verify the RSA, do the same and add the device
12. Now try running adb devices, boom the device is online

List of devices attached
00b445g34****** device

The same scenario happened when I tried to run debug my AIR application in Flash developer, follow all the steps above in addition the next few steps too.

1. Copy the following files from \android-sdk\platform-tools aapt.exe, adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll, dx.jar (dx.jar from lib folder)
2. Paste them into \lib\android\bin
3. Run the command adb version from the same folder in command prompt
4. Result should be as follows
Android Debug Bridge version 1.0.31
5. Version should be greater or equal to 1.0.31

Errors running builder ‘JavaScript Validator’ on project

I got this annoying exception on every auto build of my Dynamic Web Project.

“Errors occurred during the build.
Errors running builder ‘JavaScript Validator’ on project ‘GenieAlert’.
java.lang.NullPointerException”

I was trying to stop the validation of Javascript in the Eclipse properties with the following options,

Windows -> Preferences -> Validation -> Client-side JavaScript Validator -> Checked Manual & Unchecked Build.

This option didn’t work out, then I realized that it happens only on the Build time. The following option came in handy to do that.

Project -> Properties -> Builders -> Unchecked ‘Javascript Validator’

Sometimes when you try to run the Web projects from eclipse on servers these JavaScript validation stops the deployment of the project on servers stating “JavaScript Validation Exception found”. I hope the above solutions will help in those situations too.

Must have Android apps for developers (Non Android developers)

The below list of apps are note rated or ordered in any ways.

1. AndroIRC – An IRC client application
2. Chrome – Mobile browser
3. Mozilla Firefox – Mobile browser
4. SSH/SFTP Server – Exposing your mobile as a SSH/SFTP server
5. AndFTP – FTP client
6. JuiceSSH – SSH client
7. aLogcat/aLogrec – Logger apps to view or save Android logs
8. Network Info II – Shows info about the phone and the current network, Bluetooth, IPv6 and Cell connection
9. kWS – Android Web Server
10. Google Analytics – Mobile client for Google Analytics
11. WordPress – Mobile client for WordPress dashboard
12. Control Panel for cPanel – Mobile client for cPanel Dashboard
13. File Expert – All in one File manager supporting Windows Samba, FTP, SFTP, FTPS, Webdev, Bluetooth OBEX client

Note: The above app list is used by me and has nothing to do with the other users.