My Google Plus Page

Electricity Bill Calculator

Electricity Bill Calculator

Electricity Bill Cost Calculator. Electricity Usage Consumption Calculator.

Select Country:  
Typical Appliance:
Power Consumption:
Hours Of Use Per Day: Hrs/Day
One Unit Cost (1 kWh ):
 
Electricity Cost Per Day:  
Electricity Cost Per Month:  
Electricity Cost Per Year:  

Note:- 1 Unit = 1 kwh (Kilo Watt Hour)

HTML tutorial

EBC-Ads

Social Message

Social Message
Social Message Useful Health Tips

Friday, July 31, 2015

USB Disk Storage Format Tool

USB Disk Storage Format Tool

  • USB Disk/Drive Format Utility is a Windows based software used to format flash drives to FAT, FAT32 and NTFS partition types.
  • USB Disk format failure in Windows , Try this tool easily formatted and without any issue.
  • The format options provided all type USB Disk / Flash Drives.
  • All drives connected through the USB port of the computer is recognised and can be formatted using this software.
  • The additional option available is that the user can locate the system files from the default internal MS-DOS location or from the files located at an alternate location. 

1.Right click HP USB Disk Storage Format Tool icon and click Run as Administrator options.

2. Select Correct USB Device and File system type.



3. Type USB Disk Volume label name (example: MOHAN)

4. Select format options and click Start option.



5. USB Device format successfully completed with below results






Monday, July 27, 2015

File and Data Compression Free Tool

File / Data Compression Free Tool


7-Zip compresses to 7z format 30-70% better than to zip format. 


7-Zip compresses to zip format 2-10% better than most of other zip compatible programs.

All kind of compression format support, 


  • Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM.
  • Unpacking only: ARJ, CAB, CHM, CPIO, CramFS, DEB, DMG, FAT, HFS, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, RAR, RPM, SquashFS, UDF, VHD, WIM, XAR and Z.

7-Zip works in Windows 10 / 8 / 7 / Vista / XP / 2013 / 2008 / 2003 / 2000 / NT. There is a port of the command line version to Linux/Unix.



Note:- Compression ratio results are very dependent upon the data used for the tests.


Click Here to Download Windows Version




Free Anti Virus for Windows, Android , Desktop , Laptop & Smart Phone

Free Anti Virus for  Windows / Android 

Desktop , Laptop & Smart Phone


  • Tested AVG Anti Virus free edition 2015 my self.

  • Blocks viruses & removes viruses & malware , Protects against unsafe web links.

  • Won't slow your PC , AVG consumes less CPU and Memory.

  • Completely license free , Virus definition update available every day.

Click Here to Download

If download Not available Please visit AVG site http://www.avg.com/



Sunday, July 26, 2015

Processor Identification Utility

Processor Identification Utility 

Processor Identification Utility is provided by Intel to identify characteristics of a processor inside a system  ( Laptop / Server / Desktop ).



Sample Screenshot:-




SIMPLE MONITORING ON LINUX

SIMPLE Monitoring on Linux 

Simple Monitor Disk Usage and CPU Load Usage shell Scripts

Threshold Value    0 : OK    1 : Warning   2 :Critical

mohan# vi disk.sh


#!/bin/bash

##checks the used disk space for nagios
##usage disk.sh mountpoint critical_used%value warning_used%value
size=`df -Ph $1 | tail -1 | awk '{print $5}'`
size=$(echo ${size%\%})

if [ $size -gt $2 ]
then
echo "Critical $1 size exceeded $2 % current size $size "
exit 2;
fi

if [ $size -gt $3 ]
then
echo "Warning $1 size exceeded $3 % current size $size"
exit 1;
fi

echo "OK $1 curent size $size %"
exit 0;


mohan# vi load.sh

#!/bin/bash
##checks last 15 minutes load average, if more than 3 critical, more than 2 warning
##usage load.sh
loadavg=`uptime | awk '{print $11}'`
# bash doesn't understand floating point
# so convert the number to an interger
thisloadavg=`echo $loadavg|awk -F \. '{print $1}'`
if [ "$thisloadavg" -ge "3" ]; then
 echo "Critical - Load Average $loadavg ($thisloadavg) "
 exit 2
else
if [ "$thisloadavg" -ge "2" ]; then
 echo "Warning - Load Average $loadavg ($thisloadavg) "
 exit 1
else
 echo "Okay - Load Average $loadavg ($thisloadavg) "
 exit 0
fi
fi


NIC teaming in ESXi and ESX

NIC teaming in ESXi and ESX

Purpose

A NIC team can share the load of traffic between physical and virtual networks among some or all of its members, as well as provide passive fail over in the event of a hardware failure or network outage.

Resolution

To configure NIC teaming for standard vSwitch using the vSphere / VMware Infrastructure Client:

  • Highlight the host and click the Configuration tab.
  • Click the Networking link.
  • Click Properties.
  • Under the Network Adapters tab, click Add.
  • Select the appropriate (unclaimed) network adapter(s) and click Next.
  • Ensure that the selected adapter(s) are under Active Adapters.
  • Click Next > Finish.
  • Under the Ports tab,highlight the name of the port group and click Edit.
  • Click the NIC Teaming tab.
  • Select the correct Teaming policy under the Load Balancing field.
  • Click OK.

To configure NIC teaming for standard vSwitch using the vSphere Web Client:

  • Under vCenter Home, click Hosts and Clusters.
  • Click on the host.
  • Click Manage > Networking > Virtual Switches.
  • Click on the vSwitch.
  • Click Manage the physical network adapters.
  • Select the appropriate (unclaimed) network adapter(s) and use the arrow to move the adapter(s) to Active Adapters.
  • Click Edit settings.
  • Select the correct Teaming policy under the Load Balancing field.
  • Click OK.


Microsoft SQL Server DB Performance Issue Due to RAID Levels

Microsoft SQL Server DB Performance Issue Due to RAID Levels 

Different type of RAID levels with Tested DB Performance Load

Tested with  32 GB RAM , Windows 2008 R2 64bit

No RAID  Single Disk , No fault tolerance - Higher read and write performance

1st  Run – 26 seconds
2nd Run – 24 seconds
3rd Run – 24 seconds

RAID – 5  Fault tolerance  - Improves read and write performance

1st  Run – 1 Minutes 45 seconds
2nd Run – 1 Minutes 28 seconds
3rd Run – 1 Minutes 40 seconds

RAID –  1   Disk Mirroring - Read performance high but may degrade write performance

1st  Run –  27 seconds
2nd Run –  26 seconds
3rd Run –  26 seconds

RAID 10 (1+0)

Highest read-and-write performance of any one of the other RAID levels, but at the expense of using two times as many disks.


Power BI Transforms Data Into Rich Visuals (Android , iPhone and Windows Platform)

Power BI Transforms Data Into Rich Visuals
 (Android , iPhone and Windows Platform)

Power BI transforms your company's data into rich visuals for you to collect and organize so you can focus on what matters to you. Stay in the know, spot trends as they happen.


Power BI helps you start measuring the health of your business in less than 5 minutes.
Power BI Tool free 1GB/User.
Try This Products,

https://powerbi.microsoft.com/downloads

Amazon S3 returns HTTP response code 404 Not Found (or) Access Denied (or) 403 Forbidden

Amazon S3 returns HTTP response code 404 Not Found (or)  Access Denied  (or)   403 Forbidden 


When you configure a bucket as a website, you must make the objects that you want to serve publicly readable. To do so, you write a bucket policy that grants everyones3:GetObject permission. On the website endpoint, if a user requests an object that does not exist, Amazon S3 returns HTTP response code 404 (Not Found). If the object exists but you have not granted read permission on the object, the website endpoint returns HTTP response code 403 (Access Denied). The user can use the response code to infer if a specific object exists or not. If you do not want this behavior, you should not enable website support for your bucket.


Solutions:-

Add a new policy or edit an existing bucket policy in the text area below.

Bucket Policy:-

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucketname/*"
}
]
}


And add a CORS policy or edit an existing CORS policy in the text area below.

CORS Configuration:-

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
    </CORSRule>
    <CORSRule>
        <AllowedOrigin>http://www.mohansundaram.com</AllowedOrigin>
       <AllowedOrigin>https://www.mohansundaram.com</AllowedOrigin>
       <AllowedOrigin>www.mohansundaram.com</AllowedOrigin>
        <AllowedMethod>PUT</AllowedMethod>
        <AllowedMethod>POST</AllowedMethod>
        <AllowedMethod>DELETE</AllowedMethod>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>


Reference Screen Attached:-


Saturday, July 25, 2015

How To Install and Use Redis on AWS

How To Install and Use Redis on AWS


ubuntu@ip-192-168-100-46:~$ sudo apt-get update
ubuntu@ip-192-168-100-46:~$ sudo apt-get install build-essential
ubuntu@ip-192-168-100-46:~$ sudo apt-get install tcl8.5
ubuntu@ip-192-168-100-46:~$ wget http://download.redis.io/releases/redis-2.8.9.tar.gz
ubuntu@ip-192-168-100-46:~$ tar xzf redis-2.8.9.tar.gz
ubuntu@ip-192-168-100-46:~$ cd redis-2.8.9
ubuntu@ip-192-168-100-46:~/redis-2.8.9$ make
ubuntu@ip-192-168-100-46:~/redis-2.8.9$ make test
\o/ All tests passed without errors!

Cleanup: may take some time... OK
make[1]: Leaving directory `/home/ubuntu/redis-2.8.9/src'
ubuntu@ip-192-168-100-46:~/redis-2.8.9$ sudo make install
cd src && make install
make[1]: Entering directory `/home/ubuntu/redis-2.8.9/src'

Hint: To run 'make test' is a good idea ;)

    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
make[1]: Leaving directory `/home/ubuntu/redis-2.8.9/src'


ubuntu@ip-192-168-100-46:~/redis-2.8.9$ cd utils
ubuntu@ip-192-168-100-46:~/redis-2.8.9/utils$ sudo ./install_server.sh

Welcome to the redis service installer
This script will help you easily set up a running redis server

Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port           : 6379
Config file    : /etc/redis/6379.conf
Log file       : /var/log/redis_6379.log
Data dir       : /var/lib/redis/6379
Executable     : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
 Adding system startup for /etc/init.d/redis_6379 ...
   /etc/rc0.d/K20redis_6379 -> ../init.d/redis_6379
   /etc/rc1.d/K20redis_6379 -> ../init.d/redis_6379
   /etc/rc6.d/K20redis_6379 -> ../init.d/redis_6379
   /etc/rc2.d/S20redis_6379 -> ../init.d/redis_6379
   /etc/rc3.d/S20redis_6379 -> ../init.d/redis_6379
   /etc/rc4.d/S20redis_6379 -> ../init.d/redis_6379
   /etc/rc5.d/S20redis_6379 -> ../init.d/redis_6379
Success!
Starting Redis server...
Installation successful!


ubuntu@ip-192-168-100-46:~/redis-2.8.9/utils$ sudo service redis_6379 stop
Stopping ...
Redis stopped

ubuntu@ip-192-168-100-46:~/redis-2.8.9/utils$ sudo service redis_6379 start
Starting Redis server...


ubuntu@ip-192-168-100-46:~/redis-2.8.9/utils$ sudo update-rc.d redis_6379 defaults


ubuntu@ip-192-168-100-46:~$ redis-cli
127.0.0.1:6379> SET users:GeorgeWashington "job: President, born:1732, dislikes: cherry trees"
OK
127.0.0.1:6379> GET users:GeorgeWashington
"job: President, born:1732, dislikes: cherry trees"
127.0.0.1:6379>


Reference:-

http://redistogo.com/documentation/resque

How to Configure a Site-To-Site IPsec VPN to the Amazon AWS VPN Gateway

How to Configure a Site-To-Site IPsec VPN to the Amazon AWS VPN Gateway

If you are using the Amazon Virtual Private Cloud, you can transparently extend your local network to the cloud by connecting both networks with a site-to-site IPsec VPN tunnel. The Amazon virtual private gateway uses static routing and two parallel IPsec tunnels, of which only one tunnel is used when connecting with the Linux system.


Site - A ( AWS Cloud VPC Side):-

root#sudo yum install openswan

root#sudo vi /etc/ipsec.conf

# /etc/ipsec.conf - Openswan IPsec configuration file
#
# Manual: ipsec.conf.5
#
# Please place your own config files in /etc/ipsec.d/ ending in .conf

version 2.0 # conforms to second version of ipsec.conf specification

# basic configuration
config setup
# Debug-logging controls: "none" for (almost) none, "all" for lots.
# klipsdebug=none
# plutodebug="control parsing"
# For Red Hat Enterprise Linux and Fedora, leave protostack=netkey
protostack=netkey
nat_traversal=yes
virtual_private=
oe=off
# Enable this if you see "failed to find any available worker"
# nhelpers=0

#You may put your configuration (.conf) file in the "/etc/ipsec.d/" and uncomment this.
include /etc/ipsec.d/*.conf


root#sudo vi /etc/ipsec.d/vpc1-to-vpc2.conf

conn vpc-to-asa
type=tunnel
authby=secret
left=%defaultroute
leftid=54.173.90.212  <Site A Public IP address>
leftnexthop=%defaultroute
leftsubnet=192.168.100.0/24  <Site A Private subnet>
right=52.74.103.204  <Site B Public IP address>
rightsubnet=200.3.2.0/24     <Site B Private subnet>
esp=aes192-sha1
keyexchange=ike
ike=aes192-sha1
salifetime=43200s
pfs=yes
auto=start
dpdaction=restart

root#sudo vi /etc/ipsec.d/vpc1-to-vpc2.secrets
54.173.90.212 52.74.103.204: PSK "q1w2e3r4t5y6u7i8o9p0zaxscdvfbgnh"

Ref: <Site A Public IP address> <Site B Public IP address>: PSK "Put a Preshared Key here!!"

root#sudo service ipsec start
root#sudo chkconfig ipsec on
root#sudo vi /etc/sysctl.conf
net.ipv4.ip_forward = 1

root#sudo service network restart

[root@ip-192-168-100-248 ~]# ping 200.3.2.221
PING 200.3.2.221 (200.3.2.221) 56(84) bytes of data.
64 bytes from 200.3.2.221: icmp_seq=1 ttl=64 time=230 ms
64 bytes from 200.3.2.221: icmp_seq=2 ttl=64 time=231 ms
64 bytes from 200.3.2.221: icmp_seq=3 ttl=64 time=231 ms


Site -B (Customer Side or Office end VPC)

root#sudo yum install openswan

root#sudo vi /etc/ipsec.conf
# /etc/ipsec.conf - Openswan IPsec configuration file
#
# Manual: ipsec.conf.5
#
# Please place your own config files in /etc/ipsec.d/ ending in .conf

version 2.0 # conforms to second version of ipsec.conf specification

# basic configuration
config setup
# Debug-logging controls: "none" for (almost) none, "all" for lots.
# klipsdebug=none
# plutodebug="control parsing"
# For Red Hat Enterprise Linux and Fedora, leave protostack=netkey
protostack=netkey
nat_traversal=yes
virtual_private=
oe=off
# Enable this if you see "failed to find any available worker"
# nhelpers=0

#You may put your configuration (.conf) file in the "/etc/ipsec.d/" and uncomment this.
include /etc/ipsec.d/*.conf

root#sudo vi /etc/ipsec.d/vpc1-to-vpc2.conf

conn vpc-to-asa
type=tunnel
authby=secret
left=%defaultroute
leftid=52.74.103.204  <Site B Public IP address>
leftnexthop=%defaultroute
leftsubnet=200.3.2.0/24   <Site B Private subnet>
right=54.173.90.212       <Site A Public IP address>
rightsubnet=192.168.100.0/24    <Site A Private subnet>
esp=aes192-sha1
keyexchange=ike
ike=aes192-sha1
salifetime=43200s
pfs=yes
auto=start
dpdaction=restart

root#sudo vi /etc/ipsec.d/vpc1-to-vpc2.secrets
52.74.103.204 54.173.90.212: PSK "q1w2e3r4t5y6u7i8o9p0zaxscdvfbgnh"

Ref: <Site A Public IP address> <Site B Public IP address>: PSK "Put a Preshared Key here!!"

root#sudo service ipsec start

root#sudo chkconfig ipsec on
192.168.100.248) 56(84) bytes of data.
64 bytes from 192.168.100.248: icmp_seq=1 ttl=64 time=231 ms
64 bytes from 192.168.100.248: icmp_seq=2 ttl=64 time=231 ms
64 bytes from 192.168.100.248: icmp_seq=3 ttl=64 time=231 ms


Reference:-

https://aws.amazon.com/articles/8800869755706543
http://houseoflinux.com/vpn/vpn-site-to-site-openswan-x-asa-cisco/page-2
https://techlib.barracuda.com/bfw/configamazonvpngateway

Install and Configure Nginx

Install and Configure Nginx


ubuntu@ip-172-31-15-122:~$ cd

ubuntu@ip-172-31-15-122:~$ sudo apt-get install nginx

ubuntu@ip-172-31-15-122:~$ sudo service nginx restart
 * Restarting nginx nginx                                                                                                                             [ OK ]
ubuntu@ip-172-31-15-122:~$

http://23.254.124.45/

** Nginx Welcome Page open **


buntu@ip-172-31-15-122:~$ sudo vi /etc/nginx/sites-available/default

upstream app {
    # Path to Puma SOCK file, as defined previously
    server unix:/home/ubuntu/sample2prod/shared/sockets/puma.sock fail_timeout=0;
}

server {
    listen 80;
    server_name localhost;

    root /home/ubuntu/sample2prod/public;

    try_files $uri/index.html $uri @app;

    location @app {
        proxy_pass http://app;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
    }

    error_page 500 502 503 504 /500.html;
    client_max_body_size 4G;
    keepalive_timeout 10;
}

ubuntu@ip-172-31-15-122:~$ sudo start puma app=/home/ubuntu/sample2prod

ubuntu@ip-172-31-15-122:~$ sudo stop puma app=/home/ubuntu/sample2prod

ubuntu@ip-172-31-15-122:~$ sudo service nginx restart

Create Rails Application for Production

Create Rails Application for Production


// Need to be perform DB User id creation steps if required new user production //


sudo -u postgres createuser -s sample2prod

ubuntu@ip-172-31-6-116:~$ sudo -u postgres psql
psql (9.3.6)
Type "help" for help.

postgres=# \password sample2prod
Enter new password:
Enter it again:

\q


ubuntu@ip-172-31-15-122:~$ rails new sample2prod -d postgresql

ubuntu@ip-172-31-15-122:~$ cd sample2prod/

ubuntu@ip-172-31-15-122:~/sample2prod$ vi config/database.yml

  host: 172.31.15.122
  username: sample2prod
  password: <%= ENV['APPNAME_DATABASE_PASSWORD'] %>

ubuntu@ip-172-31-15-122:~/sample2prod$ cd ~/.rbenv/plugins
ubuntu@ip-172-31-15-122:~/sample2prod$ git clone https://github.com/sstephenson/rbenv-vars.git

ubuntu@ip-172-31-15-122:~/.rbenv/plugins$ cd ~/sample2prod
ubuntu@ip-172-31-15-122:~/sample2prod$


ubuntu@ip-172-31-15-122:~/sample2prod$ rake secret
c8061a577faf655b8b97d01adbb872d26d28b115c0c97bd4654895eefe21ca4dfababa67fc6d9481405d7fe7c5fdc02e456accfd26694c485c16bad3c4e6e0b8
ubuntu@ip-172-31-15-122:~/sample2prod$


ubuntu@ip-172-31-15-122:~/sample2prod$ vi .rbenv-vars

SECRET_KEY_BASE=c8061a577faf655b8b97d01adbb872d26d28b115c0c97bd4654895eefe21ca4dfababa67fc6d9481405d7fe7c5fdc02e456accfd26694c485c16bad3c4e6e0b8
APPNAME_DATABASE_PASSWORD=sample2prod

ubuntu@ip-172-31-15-122:~/sample2prod$  rbenv vars
# /home/ubuntu/sample2prod/.rbenv-vars
export SECRET_KEY_BASE='c8061a577faf655b8b97d01adbb872d26d28b115c0c97bd4654895eefe21ca4dfababa67fc6d9481405d7fe7c5fdc02e456accfd26694c485c16bad3c4e6e0b8'
export APPNAME_DATABASE_PASSWORD='sample2prod'

ubuntu@ip-172-31-15-122:~/sample2prod$ APPNAME_DATABASE_PASSWORD=production rake db:create
ubuntu@ip-172-31-15-122:~/sample2prod$ rails generate scaffold Task title:string note:text

      invoke  active_record
      create    db/migrate/20150412075433_create_tasks.rb
      create    app/models/task.rb
      invoke    test_unit
      create      test/models/task_test.rb
      create      test/fixtures/tasks.yml
      invoke  resource_route
       route    resources :tasks
      invoke  scaffold_controller
      create    app/controllers/tasks_controller.rb
      invoke    erb
      create      app/views/tasks
      create      app/views/tasks/index.html.erb
      create      app/views/tasks/edit.html.erb
      create      app/views/tasks/show.html.erb
      create      app/views/tasks/new.html.erb
      create      app/views/tasks/_form.html.erb
      invoke    test_unit
      create      test/controllers/tasks_controller_test.rb
      invoke    helper
      create      app/helpers/tasks_helper.rb
      invoke      test_unit
      invoke    jbuilder
      create      app/views/tasks/index.json.jbuilder
      create      app/views/tasks/show.json.jbuilder
      invoke  assets
      invoke    coffee
      create      app/assets/javascripts/tasks.coffee
      invoke    scss
      create      app/assets/stylesheets/tasks.scss
      invoke  scss
      create    app/assets/stylesheets/scaffolds.scss

ubuntu@ip-172-31-15-122:~/sample2prod$ APPNAME_DATABASE_PASSWORD=production rake db:migrate
== 20150412075433 CreateTasks: migrating ======================================
-- create_table(:tasks)
   -> 0.0091s
== 20150412075433 CreateTasks: migrated (0.0093s) =============================


ubuntu@ip-172-31-15-122:~/sample2prod$ APPNAME_DATABASE_PASSWORD=production rails server --binding=192.168.100.46


=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://172.31.15.122:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-04-12 07:55:36] INFO  WEBrick 1.3.1
[2015-04-12 07:55:36] INFO  ruby 2.2.1 (2015-02-26) [x86_64-linux]
[2015-04-12 07:55:36] INFO  WEBrick::HTTPServer#start: pid=22555 port=3000


Started GET "/" for 103.8.194.117 at 2015-04-12 07:55:49 +0000
Cannot render console from 103.8.194.117! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
  ActiveRecord::SchemaMigration Load (0.3ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Processing by Rails::WelcomeController#index as HTML
  Rendered /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/templates/rails/welcome/index.html.erb (1.3ms)
Completed 200 OK in 14ms (Views: 6.2ms | ActiveRecord: 0.0ms)
^C[2015-04-12 07:55:58] INFO  going to shutdown ...
[2015-04-12 07:55:58] INFO  WEBrick::HTTPServer#start done.
Exiting

http://34.234.76.122:3000

**If you see the "Welcome aboard" Ruby on Rails page**

Create New Rails Application Development

Create New Rails Application Development


ubuntu@ip-172-31-15-122:~$ cd ~

ubuntu@ip-172-31-15-122:~$ rails new sample1 -d postgresql

ubuntu@ip-172-31-15-122:~$ cd sample1

ubuntu@ip-172-31-15-122:~/sample1$ vi config/database.yml

  host: 172.31.15.122
  username: pguser1
  password: pguser1

Need to be perform on   postgres DB Server --> Required

ubuntu@ip-172-31-15-122:~$ sudo vi /etc/postgresql/9.3/main/postgresql.conf
listen_addresses = '*'

ubuntu@ip-172-31-15-122:~$ sudo /etc/init.d/postgresql stop
 * Stopping PostgreSQL 9.3 database server                                                                                                            [ OK ]

ubuntu@ip-172-31-15-122:~$ sudo /etc/init.d/postgresql start
 * Starting PostgreSQL 9.3 database server                                                                                                            [ OK ]

ubuntu@ip-172-31-15-122:~$ telnet 172.31.15.122 5432
Trying 172.31.15.122...
Connected to 172.31.15.122.
Escape character is '^]'.

ubuntu@ip-172-31-15-122:~/sample1$ sudo vi /etc/postgresql/9.3/main/pg_hba.conf
# TYPE DATABASE USER CIDR-ADDRESS  METHOD
host  all  all 0.0.0.0/0 md5

ubuntu@ip-172-31-15-122:~$ sudo /etc/init.d/postgresql stop
 * Stopping PostgreSQL 9.3 database server                                                                                                            [ OK ]

ubuntu@ip-172-31-15-122:~$ sudo /etc/init.d/postgresql start
 * Starting PostgreSQL 9.3 database server  

ubuntu@ip-172-31-15-122:~$ sudo /etc/init.d/postgresql disable ---> Optional



ubuntu@ip-172-31-15-122:~/sample1$ rake db:create
ubuntu@ip-172-31-15-122:~/sample1$

rails server --binding=172.31.15.122  -->  Private IP address

ubuntu@ip-172-31-15-122:~/sample1$ rails server --binding=172.31.15.122
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://172.31.15.122:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-04-12 07:40:01] INFO  WEBrick 1.3.1
[2015-04-12 07:40:01] INFO  ruby 2.2.1 (2015-02-26) [x86_64-linux]
[2015-04-12 07:40:01] INFO  WEBrick::HTTPServer#start: pid=22134 port=3000


Started GET "/" for 103.8.194.117 at 2015-04-12 07:40:08 +0000
Cannot render console from 103.8.194.117! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by Rails::WelcomeController#index as HTML
  Rendered /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/templates/rails/welcome/index.html.erb (1.2ms)
Completed 200 OK in 14ms (Views: 6.2ms | ActiveRecord: 0.0ms)


Started GET "/" for 103.8.194.117 at 2015-04-12 07:40:13 +0000
Cannot render console from 103.8.194.117! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by Rails::WelcomeController#index as HTML
  Rendered /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/templates/rails/welcome/index.html.erb (0.1ms)
Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)
^C[2015-04-12 07:40:24] INFO  going to shutdown ...
[2015-04-12 07:40:24] INFO  WEBrick::HTTPServer#start done.
Exiting

http://54.250.74.188:3000

**If you see the "Welcome aboard" Ruby on Rails page**

PostgreSQL with Your Ruby on Rails Application on Ubuntu


// Run below commands on $ Prompt// --> Required

cd

ubuntu@ip-172-31-15-122:~$ sudo apt-get update

ubuntu@ip-172-31-15-122:~$ sudo apt-get install postgresql postgresql-contrib libpq-dev

ubuntu@ip-172-31-15-122:~$ sudo -u postgres createuser -s pguser1

ubuntu@ip-172-31-6-116:~$ sudo -u postgres psql
psql (9.3.6)
Type "help" for help.

postgres=# \password pguser1
Enter new password:
Enter it again:

\q

Install Ruby on Rails with rbenv on Ubuntu

sudo apt-get update

sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev

cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
exec $SHELL
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile
exec $SHELL

// Logout putty session and try // --> Required

rbenv install 2.2.1

ubuntu@ip-172-31-15-122:~$ rbenv install 2.2.1
Downloading ruby-2.2.1.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5a4de38068eca8919cb087d338c0c2e3d72c9382c804fb27ab746e6c7819ab28
Installing ruby-2.2.1...
Installed ruby-2.2.1 to /home/ubuntu/.rbenv/versions/2.2.1


// rbenv uninstall 2.1.2 // --> Optional If Required

rbenv global 2.2.1   --> In case not working try below commands

//or//

ubuntu@ip-172-31-15-122:~$ sudo apt-get install rbenv global 2.2.1


// Logout putty session and try // --> --> Optional If Required

ubuntu@ip-172-31-15-122:~$ ruby -v
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
ubuntu@ip-172-31-15-122:~$


echo "gem: --no-document" > ~/.gemrc
gem install bundler

gem install rails -v 4.2.0

rbenv rehash

ubuntu@ip-172-31-15-122:~$ rails -v
Rails 4.2.0
ubuntu@ip-172-31-15-122:~$


sudo add-apt-repository ppa:chris-lea/node.js

sudo apt-get update

sudo apt-get install nodejs

// Ruby on Rails is now installed on your system //

//Create a Test Application//

cd ~

ubuntu@ip-172-31-15-122:~$ rails new sample

Installing web-console 2.1.2
Bundle complete! 12 Gemfile dependencies, 55 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
         run  bundle exec spring binstub --all
* bin/rake: spring inserted
* bin/rails: spring inserted
ubuntu@ip-172-31-15-122:~$

ubuntu@ip-172-31-15-122:~$cd sample

ubuntu@ip-172-31-15-122:~/sample$ rake db:create
ubuntu@ip-172-31-15-122:~/sample$

ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'

172.31.15.122
fe80::814:6aff:fe1c:dd2b


rails server --binding=172.31.15.122   -->  Private IP address

ubuntu@ip-172-31-15-122:~/sample$ rails server --binding=172.31.15.122
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://172.31.15.122:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server


Started GET "/" for 103.8.194.117 at 2015-04-11 17:23:28 +0000
Cannot render console from 103.8.194.117! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by Rails::WelcomeController#index as HTML
  Rendered /root/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/templates/rails/welcome/index.html.erb (1.2ms)
Completed 200 OK in 13ms (Views: 5.6ms | ActiveRecord: 0.0ms)

Started GET "/" for 103.8.194.117 at 2015-04-12 07:15:56 +0000
Cannot render console from 103.8.194.117! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by Rails::WelcomeController#index as HTML
  Rendered /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/templates/rails/welcome/index.html.erb (1.1ms)
Completed 200 OK in 14ms (Views: 6.4ms | ActiveRecord: 0.0ms)
^C[2015-04-12 07:16:05] INFO  going to shutdown ...
[2015-04-12 07:16:06] INFO  WEBrick::HTTPServer#start done.
Exiting

Orange HRM Attachment Size Exceeded Solutions



There are symfony validators that restrict the size of the uploading files. If you remove these restrictions, you'll be able to upload files of higher size (since you have already increased the PHP/MySQL/Apache settings related to file uploads). 

You can try the following steps:

STEP: 1

C:\Program Files\OrangeHRM\3.3.1\htdocs\orangehrm-3.3.1\symfony\plugins\orangehrmPimPlugin\lib\form\EmployeeAttachmentForm.php

change max size  100000 to 10000000.

'max_size'=>10000000), array('max_size' => __('Attachment Size Exceeded'))),

Restart Apache tomcat server.

STEP: 2

C:\Program Files\OrangeHRM\3.3.1\htdocs\orangehrm-3.3.1\symfony\plugins\orangehrmPimPlugin\modules\pim\templates\_attachments.php

change <input type="hidden" name="MAX_FILE_SIZE" value="1048576" />  to 
<input type="hidden" name="MAX_FILE_SIZE" value="5242880" /> 


STEP: 3

EDIT my.ini file on XAMPP
C:\program files\orangehrm\3.3.1\mysql
max_allowed_packet = 1M to max_allowed_packet = 5M


More Reference:-

http://sourceforge.net/p/orangehrm/discussion/660860/thread/9fa92842/
http://forum.orangehrm.com/viewtopic.php?f=12&t=10007

Good System Performance on Ubuntu / Linux


The default value of swappiness in Ubuntu is 60, and it recommends swappiness=10 for Ubuntu to improve overall performance.

Temporarily change swappiness’ value to 10 using following command, and it will be reverted in next restart.

ubuntu@ip-192-168-100-222:~$ sudo sysctl vm.swappiness=10

Increasing this causes file-caches to be thrown away rather than swapped out to disk. Opening files will be a tiny amount slower, but switching between applications will be faster.

Temporarily change cache value to 50 and it will be reverted in next restart.

ubuntu@ip-192-168-100-222:~$ sudo sysctl vm.vfs_cache_pressure=50


To permanently change this value, using:

ubuntu@ip-192-168-100-222:~$ sudo vi /etc/sysctl.conf

vm.swappiness = 10
vm.vfs_cache_pressure = 50

How To Add Swap on Ubuntu

If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM,it should not be considered a replacement for more RAM.It will improve the system performance.



Faster way to Add Swap Space on Ubuntu

non-root account command:-

ubuntu@ip-192-168-100-222:~$ sudo dd if=/dev/zero of=/swapfile bs=1G count=4
4+0 records in
4+0 records out
4294967296 bytes (4.3 GB) copied, 83.598 s, 51.4 MB/s

root account command:-

ubuntu@ip-192-168-100-222:~# dd if=/dev/zero of=/swapfile bs=1G count=4
4+0 records in
4+0 records out
4294967296 bytes (4.3 GB) copied, 83.598 s, 51.4 MB/s


Standard Way to Add Swap Space on Ubuntu

non-root account command:-

ubuntu@ip-192-168-100-222:~$sudo fallocate -l 4G /swapfile

ubuntu@ip-192-168-100-222:~$ ls -lh /swapfile
-rw-r--r-- 1 root root 4.0G Apr 30 03:37 /swapfile

ubuntu@ip-192-168-100-222:~$ sudo chmod 600 /swapfile

ubuntu@ip-192-168-100-222:~$ sudo mkswap /swapfile
Setting up swapspace version 1, size = 4194300 KiB
no label, UUID=7d048ff0-2908-4c4b-9759-d0f59563684f

ubuntu@ip-192-168-100-222:~$ sudo swapon /swapfile

ubuntu@ip-192-168-100-222:~$ sudo swapon -s
Filename                                Type            Size    Used    Priority
/swapfile                               file            4194300 0       -

ubuntu@ip-192-168-100-222:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          2000        908       1092         16        129        676
-/+ buffers/cache:        102       1897
Swap:         4095          0       4095

****auto mount swap space after restart / shut down *****

ubuntu@ip-192-168-100-222:~$ sudo vi /etc/fstab
/swapfile   none    swap    sw    0   0