Monthly Archives: June 2016

New Topics

  1. How to handle Time zone issues?
  2. SDN
  3. Developing scaleable application using stateless session/server and decoupling
  4. Scala portability in Java
  5. Functional programming and its advantages
  6. Java 8
  7. Jython
  8. Freshdesk Girish Mathrubotham
Advertisements

Backup postgres database and tables

Backup

#login as root

#For single table

pg_dump -U postgres -d TESTDB -t users > /tmp/users.sql

#For multiple tables

pg_dump -U postgres -d TESTDB -t users -t customer -t account > /tmp/testdb.sql

#For complete database
pg_dump -U postgres TESTDB > /tmp/TESTDB.sql

Restore

#login as postgres user

psql -U postgres -d TESTDB < /tmp/TESTDB.sql

 

 

install rar/unrar

[root@localhost bin]# wget http://pkgs.repoforge.org/unrar/unrar-4.0.7-1.el6.rf.x86_64.rpm
–2016-06-27 14:38:50–  http://pkgs.repoforge.org/unrar/unrar-4.0.7-1.el6.rf.x86_64.rpm
Resolving pkgs.repoforge.org (pkgs.repoforge.org)… 78.46.17.228
Connecting to pkgs.repoforge.org (pkgs.repoforge.org)|78.46.17.228|:80… connected.
HTTP request sent, awaiting response… 302 Found
Location: http://rpmforge.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/unrar-4.0.7-1.el6.rf.x86_64.rpm [following]
–2016-06-27 14:38:51–  http://rpmforge.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/unrar-4.0.7-1.el6.rf.x86_64.rpm
Resolving rpmforge.sw.be (rpmforge.sw.be)… 78.46.17.228
Connecting to rpmforge.sw.be (rpmforge.sw.be)|78.46.17.228|:80… connected.
HTTP request sent, awaiting response… 301 Moved Permanently
Location: http://tree.repoforge.org/redhat/el6/en/x86_64/rpmforge/RPMS/unrar-4.0.7-1.el6.rf.x86_64.rpm [following]
–2016-06-27 14:38:51–  http://tree.repoforge.org/redhat/el6/en/x86_64/rpmforge/RPMS/unrar-4.0.7-1.el6.rf.x86_64.rpm
Resolving tree.repoforge.org (tree.repoforge.org)… 78.46.17.228
Connecting to tree.repoforge.org (tree.repoforge.org)|78.46.17.228|:80… connected.
HTTP request sent, awaiting response… 301 Moved Permanently
Location: http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/unrar-4.0.7-1.el6.rf.x86_64.rpm [following]
–2016-06-27 14:38:52–  http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/unrar-4.0.7-1.el6.rf.x86_64.rpm
Resolving apt.sw.be (apt.sw.be)… 193.1.193.67
Connecting to apt.sw.be (apt.sw.be)|193.1.193.67|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 109432 (107K) [application/x-redhat-package-manager]
Saving to: ‘unrar-4.0.7-1.el6.rf.x86_64.rpm’

100%[=========================================================================================================================================================================>] 109,432     91.4KB/s   in 1.2s

2016-06-27 14:38:54 (91.4 KB/s) – ‘unrar-4.0.7-1.el6.rf.x86_64.rpm’ saved [109432/109432]

[root@localhost bin]# rpm -Uvh unrar-4.0.7-1.el6.rf.x86_64.rpm
warning: unrar-4.0.7-1.el6.rf.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
Preparing…                          ################################# [100%]
Updating / installing…
1:unrar-4.0.7-1.el6.rf             ################################# [100%]
[root@localhost bin]# wget http://pkgs.repoforge.org/rar/rar-3.8.0-1.el6.rf.x86_64.rpm
–2016-06-27 14:39:17–  http://pkgs.repoforge.org/rar/rar-3.8.0-1.el6.rf.x86_64.rpm
Resolving pkgs.repoforge.org (pkgs.repoforge.org)… 78.46.17.228
Connecting to pkgs.repoforge.org (pkgs.repoforge.org)|78.46.17.228|:80… connected.
HTTP request sent, awaiting response… 302 Found
Location: http://rpmforge.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rar-3.8.0-1.el6.rf.x86_64.rpm [following]
–2016-06-27 14:39:17–  http://rpmforge.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rar-3.8.0-1.el6.rf.x86_64.rpm
Resolving rpmforge.sw.be (rpmforge.sw.be)… 78.46.17.228
Connecting to rpmforge.sw.be (rpmforge.sw.be)|78.46.17.228|:80… connected.
HTTP request sent, awaiting response… 301 Moved Permanently
Location: http://tree.repoforge.org/redhat/el6/en/x86_64/rpmforge/RPMS/rar-3.8.0-1.el6.rf.x86_64.rpm [following]
–2016-06-27 14:39:18–  http://tree.repoforge.org/redhat/el6/en/x86_64/rpmforge/RPMS/rar-3.8.0-1.el6.rf.x86_64.rpm
Resolving tree.repoforge.org (tree.repoforge.org)… 78.46.17.228
Connecting to tree.repoforge.org (tree.repoforge.org)|78.46.17.228|:80… connected.
HTTP request sent, awaiting response… 301 Moved Permanently
Location: http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rar-3.8.0-1.el6.rf.x86_64.rpm [following]
–2016-06-27 14:39:18–  http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rar-3.8.0-1.el6.rf.x86_64.rpm
Resolving apt.sw.be (apt.sw.be)… 193.1.193.67
Connecting to apt.sw.be (apt.sw.be)|193.1.193.67|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 216720 (212K) [application/x-redhat-package-manager]
Saving to: ‘rar-3.8.0-1.el6.rf.x86_64.rpm’

100%[=========================================================================================================================================================================>] 216,720      125KB/s   in 1.7s

2016-06-27 14:39:20 (125 KB/s) – ‘rar-3.8.0-1.el6.rf.x86_64.rpm’ saved [216720/216720]

[root@localhost bin]# rpm -Uvh rar-3.8.0-1.el6.rf.x86_64.rpm
warning: rar-3.8.0-1.el6.rf.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
Preparing…                          ################################# [100%]
Updating / installing…
1:rar-3.8.0-1.el6.rf               ################################# [100%]
[root@localhost bin]#

Diverting focus from obvious ones to subtle things

Success of few leaders depend on how they diverting focus of their followers and common people from obvious things to tiny things.

I was wondering how people forgetting and forgiving corrupted politicians and giving another chance during the election time. Politicians are trying to distract common people focus from politicians bad past by offering money, exciting manefesto, freebies, other favours, etc… Common people would not think that freebies are subtle things and loose focus. This is the winning mantra for the bad politicians.

Leaders, business men, celebrities are often make news to divert common people focus from their mistakes.

I used to hear Birbal stories in my childhood. One day Akbar drew a line on the floor and ask others that they must make this line shorter without touching the line. Birbal had come forward and drew a longer line next to Akbar’s line. Now everyone agreed that Akbar’s line is shorter.This story may or may not justify the topic. But, the truth is anybody can divert sombody’s focus on obvious ones by doing some fancy job/news. This technic may not work with intelligent people 🙂

Changing Timezone in Centos

[root@localhost logs]# date
Thu Jun 23 20:52:10 IST 2016
[root@localhost logs]# ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
[root@localhost logs]# date
Thu Jun 23 17:22:59 CEST 2016

 

NOTE:

We need to remove the /etc/localtime if it is already present