Category Archives: General

Red Hat Linux 6.6 configuring firewall

Found a superb command for configuring firewall in redhat linux

system-config-firewall-tui

Thanks http://ask.xmodulo.com/open-port-firewall-centos-rhel.html

Advertisements

Postgresql 9.5 and Red Hat Enterprise Linux 7.0

I used to use Postgresql 9.5 with Red Hat Enterprise Linux 6.6.

As quite a long time passed using them, I had change my server configuration. So, I tried to start using Postgresql 9.5 and Red Hat Enterprise Linux 7.0 . When started installing them, I found out that these completely new command set.  Here it goes,

wget https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
rpm -ivh pgdg-redhat95-9.5-3.noarch.rpm
yum install postgresql95-server.x86_64

Read more of this post

JSF : Check Version

JSF : Check Version

String version = FacesContext.class.getPackage().getImplementationVersion();

Postgresql : moving data from windows to linux

I was trying to move my database from Windows server to Linux server. I thought it will be a simple process. But, it is not. It took backup from windows server via pgAdmin III. and tried to restore the backup to linux server via command line.

pg_restore -d dbname -U username -C /home/back1.backup

Then I got peer authentication error. so i fixed my pg_hba.conf file. It was

local   all             all                                     peer

I changed it to

local   all             all                                     trust

Then again I tried to run restore command. I got the following error.

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 2021; 1262 16483 DATABASE dbname dbname
pg_restore: [archiver (db)] could not execute query: ERROR: invalid locale name: “English_United States.1252”
Command was: CREATE DATABASE dbname WITH TEMPLATE = template0 ENCODING = ‘UTF8’ LC_COLLATE = ‘English_United States.1252’ LC_CTYPE = ‘Engli…
WARNING: errors ignored on restore: 1

Read more of this post

JDK installation in Redhat Linux

I had OpenJDK installed in my Redhat Linux. That openJDK was 1.6, i wanted to install jdk 1.7 from http://www.oracle.com/technetwork/es/java/javase/downloads/jdk7-downloads-1880260.html

So at first I had to uninstall OpenJDK. So,

yum remove java-1.6.0-openjdk.x86_64

Then I downloaded jdk-7u79-linux-x64.rpm from the above oracle.com link.

I copied the rpm to /usr/java and issued command as root

rpm -ivh jdk-7u79-linux-x64.rpm

after installation I issued

java -version

To check the installation.

The result. hmmmm….

java version “1.7.0_79”
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

Looks like we are cool.

Making an executable jar file

Process

Right click on your Java Project and select Export.

Select Java -> Runnable JAR file -> Next.

Select the Launch Configuration and choose project file as your Main class

Select the Destination folder where you would like to save it and click Finish.

Execute

java -jar <jar-file-name>.jar

Why do many software engineers not like Java?

Interesting experience shared.

Answer by Costya Perepelitsa:

Let me answer by telling you about a programming test I evaluated this week. All things considered, it was solid, even succinct Java. The candidate had a ton of industry experience with Java, and it showed.
Bear in mind that none of the examples I'm about to give are what I'd call bad or dumb or unnecessarily complex; these are all, for the most part, what Java and the industry call sensible, standard practice.

Spoiled as I am with inferred typing, every time I see a line like…

HashMap
<
String
, 
Set
<
String
>> 
depMap 
= 
new 
HashMap
();

…I die a little on the inside. Because to me, that says, "depMap is a map, which is a map."
52 characters just to define a common data structure? Come on. Indentation included — and this kind of definition must be indented at least twice — this kind of crap takes up the majority of my terminal width.
Reading through basic declarations is a minor undertaking in and of itself. And when there's a block of declarations like this, my eyes glaze over and my ADD kicks in, and I suddenly and strongly want to do absolutely anything else with my time.
I would honestly rather read overly-clever and terse Perl, because I would rather put my brain to use figuring something out than push it through this kind of mind-numbing tautological filler.

And for anything even slightly more complicated, especially APIs written by card-carrying members of the Cult of Design Patterns, you see things like this:

private static final 
Logger LOGGER 
= 
LoggerFactory
.
getLogger
(
Main
.
class
);

This initializes a very basic logger from SLF4J: the Simple Logging Facade for Java.
Did you catch that word "simple"? This 73-character (69 plus the length of your class' name) monstrosity, in which the word "logger" appears no fewer than four times, is how you do simple logging in Java. It's all uphill from there.

This submission also followed the standard Java package naming convention of stress-testing my filesystem with entirely too many nested directories, most of which contained only the next nested directory:

src/main/java/com/[company]/[program]/[author]/*.java

7 directories deep, that code is. That's the number of times I had to press tab in my

cd

command just to get to the code.
And this is just for a simple one-off program; it gets all the deeper with each small step of complexity. I have seen, in my career, upwards of 20 nested directories that could not reasonably have been shortened.
With most languages, an IDE is a useful tool for managing a sufficiently complicated project; with Java, an IDE is a necessity for navigating an unavoidable labyrinth created by even the simplest of projects.

Since it used third-party libraries, as most any Java program in the industry is bound to do, my choices for compiling what was otherwise an extremely basic program were:

  • download all JARs myself and write classpaths in my compile and run commands that stretched several lines in my terminal
  • use Ant
  • use Maven

And after briefly reliving the utter insanity that come with those latter two, the first option ended up being the least painful.

The candidate was nice enough to include a

pom.xml

, so I naturally tried Maven first. Since I hadn't used it in a while, I first ran

mvn

and desperately hoped it would Do The Right Thing. But after downloading roughly half of the Internet, not to mention flooding my terminal with literally hundreds of lines describing each step it was taking, Maven informed me that I needed to specify one of its entirely too many (30, by my count) ambiguously named "goals". I spotted at least four or five that could plausibly have meant "just compile the fucking thing," but I got very sick, very quickly, of watching Maven download the same half of the Internet it had already downloaded, every single time it ran, even when it could easily have stopped early with an error message when I gave it invalid input, as I iterated through that list of possible goals. It didn't help that the output was so criminally long with each run that I lost track of where it had dumped that mega-list of goals; if my terminal continued out the top of my monitor, I'm willing to bet that list would be in outer space. I wasn't feeling like scrolling into outer space that day, and I definitely didn't feel like running

mvn

with no arguments again just to print another copy, so I looked into my other options in the vain hope that they'd be simpler.

Skimming through the Apache Ant manual revealed that I'd have to write XML to use it. I honestly believe I saved myself an aneurysm by proclaiming, "fuck that noise," and closing the browser tab.
(PROTIP: The key is hearing yourself say it out loud. Otherwise, your brain might still suspect that you're willing to try writing XML just to compile a single-file, <200 line Java program and try to end its own existence before being forced to comply.)

And thusly did I find myself Googling class names in compilation errors to find the projects that had the source to make the JARs to give the compiler to build the fucking program.
And it gave me much less of a headache than Maven did, because I at least felt like I was making progress.

This happens pretty much every time I try to do something with Java.
Writing it is a tedious, painful exercise in patience.
Reading it is a tedious, painful exercise in patience.
Compiling it is, you guessed it, a tedious and painful exercise in patience.
And even running it is somehow precisely as painful and tedious as compiling it.

Every task in Java — every task — is like filling out endless tax forms.
And I know, and you know, and Java knows, that it doesn't have to be this way, because you can some-crazy-how accomplish exactly what you can in Java using other languages that are just as portable, performant, and commonly known, but considerably less of a Byzantine clusterfuck.
And yet these problems persist.
And so I continue to keep my distance.

Why do many software engineers not like Java?

What is GitHub for a beginner and how to get started with it?

Answer by Mayuresh Waykole:

Hello,

I understand what you have been facing.
Lets start with a few basics shall we ?
Terminology :

Repository : A repository is a folder inside which you are going to store                            every piece of your code
Fork : Copying someones repository into your account is called forking.
Upstream : The guy or organisation which owns the code that you forked.
 

1. What is Git ?

Version Control System ( Keep reading and this will make sense towards the end ) .
Lets say you have a project you want to work on.
Now you have 2 primary motives.
          (a)  To write some code
          (b)  To take up the project as a team , meaning that more than  one                           people are going to be responsible for writing the code.

So suppose you write a "Hello World!" program and then your friend/other developer decides that it should say "Hello, I am awesome"
instead of the original "Hello World!".

Even for this little piece of code, you will have a copy in your PC and your friend will have one in his PC.
Lets say you change the code, now at this point your friend wouldn't know the changes you have made and vice versa.

This is where the Git magic comes. 
    1. Git lets you save your code online.
    2. Git will allow all the developers of a project to see what changes                         the  other one has made.
    3. It allows you to discuss issues in your code with other developers.
     And a lot more…

I think now you have a decent idea of what git is.

2. Getting Started

First, Signup on Github.
-> Next, Download git for you OS from this page Git – Downloads
-> Next you go and do this   Create A Repo · GitHub Help

So now you have created a repository Online, and you have installed git on your PC. Until now they are not linked to each other.

-> To do that follow the instructions under "setting up git" Set Up Git · GitHub Help

Setting Up is done !!

3. One step ahead

If you forked someones repository ( Forked , explained under terminology, scroll up ) then follow these instructions Fork A Repo · GitHub Help and then the commands below.

If you are the upstream yourself ,( ie. you are the guy who created the original repository ) then follow the instructions below

$ git clone <add the repository address here>
( Clones/copies everything from that repository to your local machine )
$ git add filename.extension
(this adds the file you want to change on the server)
$ git commit
(this commits your changes to the repository with an explanation message)
$ git push origin master
(this finally sends all your changes to the server. This is the final step of changing the code on your repository on the server)

You just started using github. Congratulations 😀

What is GitHub for a beginner and how to get started with it?

2012 in review

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

600 people reached the top of Mt. Everest in 2012. This blog got about 8,900 views in 2012. If every person who reached the top of Mt. Everest viewed this blog, it would have taken 15 years to get that many views.

Click here to see the complete report.

Serial Killing Based Movies list

The Silence of the Lambs (1991)


Young FBI agent Clarice Starling is assigned to help find a missing woman to save her from a psychopathic serial killer who skins his victims. Clarice attempts to gain a better insight into the twisted mind of the killer by talking to another psychopath Hannibal Lecter, who used to be a respected psychiatrist. FBI agent Jack Crawford believes that Lecter who is also a very powerful and clever mind manipulator have the answers to their questions to help locate the killer. Clarice must first try and gain Lecter’s confidence before he is to give away any information.

Director: Jonathan Demme

MPAA: R

Running Time: 1 hr. 58 min.

Release Date: Feb 13, 1991

Cast: Anthony Hopkins, Jodie Foster, Kasi Lemmons, Scott Glenn, Ted Levine, Anthony Heald, Frankie Faison, Brooke Smith, Dan Butler, Tracey Walter, Charles Napier.

Read more of this post