System « Intelligrape Groovy & Grails Blogs

Posts Tagged ‘ System ’

Fetching File From FTP in Background With Curl.

Posted by on May 9th, 2012

Last night I had to restore file with size greater than 220GB from our backup FTP server to our main server after OS re installation.

Now I could have simply done “get” after logging into ftp out server, but that would have required my machine to stay awake all night unattended. Seems simple but everything I tried didn’t seem to work .

In comes curl, literally saved my night. With simple command written below I was able to transfer file from ftp server to local machine.

 curl ftp://name:password@server/file.tar > file.tar

And then it was piece of cake running it in background with nohup

nohup curl ftp://name:password@server/file.tar > file.tar &

Thanks to curl, me and my system were able to get good nights sleep :)

_________________________________
Hitesh Bhatia
Mail LinkedIn,Facebook,Twitter
_________________________________
Tags: , , ,
Posted in System

Multiple Bootable OS in Single USB

Posted by on April 19th, 2012

Recently I have been knee deep into Linux installations. Installing through  USB is great process, there is no hassle of CD and its faster too. But problem is first we need bootable USB. Up till now I used “Start Disk Creator”, which is bundled in Ubuntu and is great for creating bootable USB, major problem with it is that it creates single boot USB, that is If I have bootable USB for Ubuntu 11.04, it will be erased when I create a bootable stick for Ubuntu 11.10.

This was a problem for me, and I found a solution to this problem in Multisystem, which creates a single bootable USB for multiple OS.
Here are steps to install And Use Multisystem
1) Download From PenDriveLinux.com, Extract the package .. change the permission of extracted file “install-depot-multisystem.sh” to make it executable.

2) Execute this file and it’ll download some files, and complete its installation. After Its Done, lets move to actually creating Pen Drive with multiple bootable OS.

3) Run Multisystem and it’ll ask you to confirm any USB drive if inserted. Once confirmed it  should look as following images, but there would be no OS pre configured. (it shows some as I configured them, it also tells me that I have  4live CDs already configured.)
MultisystemMultisystem Home Screen
4) Click on icon at bottom in middle (Which has “Select .iso or .img “written on top of it). And Select  image file of OS for which bootable USB need to be created. It’ll again ask for password and within  less than a minute bootable will be ready.

5)Same process (step 4) can be repeated to add multiple OS to bootable USB stick.

6) It also lets you test how bootable stick will work.Just Click on “Q” button and see the magic. Below are the images of me testing ArchBang from my bootable USB.
Multisystem Boot
Archbang 1
Archbang 2

Posted in Linux, System

Increasing the connection timeout between browser and the tomcat server

Posted by on December 21st, 2011

Hi,

There is a case stuck recently in my project where i need to increase the connection timeout between browser and the server, because of the reason before the response get completed server leave the connection which result in no response. My colleague Himanshu told me to change the setting in server.xml, which help in my purpose.

To increase the connection timeout on tomcat server follow the following steps :

1. Open the file server.xml residing in tomcat6/conf/.
2. You just need to set variable connectionTimeout in it to Value in Milliseconds.(i.e 1000 milliseconds = 1 second)

For example :

File : server.xml

<Connector port="8080" protocol="HTTP/1.1"  connectionTimeout="20000" URIEncoding="UTF-8"            redirectPort="8443" />

I thought it will be useful to share, hope it helps.
 

Thanks,
Tarun Pareek
tarun@intelligrape.com
http://in.linkedin.com/in/tarunpareek

Posted in System

Setting System property from command line in grails

Posted by on August 24th, 2011

Hi,

In one of my recent grails project, i needed to set System property from command line while running the grails application.
I looked for it and found a simple solution to do so and found it worth sharing.


Suppose we want to set any property, say app.property=”propertyValue”, then the command to set the property in grails application would be:

  grails  -Dapp.property="propertyValue" run-app

Similarly to retrieve the value of System property, we use

String myPropertyValue= System.getProperty("app.property")

It helped me a lot..
Hope it helps


Vishal Sahu
vishal@intelligrape.com
www.intelligrape.com

Tags: ,
Posted in Grails, Java tools, Linux, System

Linux Trick for screen collaboration or shell sharing

Posted by on November 14th, 2010

In recent week, i got to know about really good way of collaborating the screen in a linux.
 
Let us take a scenario, Suppose User having name ‘B’ on the 5th floor of the company is having a problem/difficulty related to code execution, unable to figure out what to do?, and then he call the fellow guy who can help him out, but he is on 1st floor his name is ‘Lazy A’.
 
Lazy A guy is really lazy, so here come handy screen collaboration trick to help him out and save him from walking 4 Floors to reach 5th one (:phew!:)
 
Lazy A support guy open its terminal and perform the following tricks consisting of 4 steps:
 
1. ‘Lazy A’ remote login into the User B system through following command:

lazyA# ssh B

2. After that Lazy A logged in as super user B, on B machine

B# su - B

3. Now Lazy A is on the B machine logged in as super user B, and ‘Lazy A’ runs the following command,

B# screen -S sos

4. Then Lazy A guy ask B to run following command on his/her system :

B# screen -x sos

 
Note that same alias ‘sos’ is being used by both in last 2 commands, and both guy are logged in as same user.
 
Actually the last two command cause both user session joined together in linux shell and now both users can type on there shell and see what other is typing or doing to fix the issue, and this is how lazy A help out the B without walking to 5th floors.
 
After providing help, ‘Lazy A’ terminate the session by performing ctrl-C and then ctrl-D command on its terminal. Thats the way they get detach from each other and get back to there respective work.
 
And code happily ever after :)
 
Example to Test command on your machine:
 
To test the ‘screen -S’ and ‘screen -x’ command you can open two separate terminal or shell on your linux system, then run following command on your 1st terminal or shell
 
Terminal 1:

# su - tarun
tarun# screen -S mytest

And run another command on Terminal 2:

tarun# screen -x mytest

Then type on any screen you will see what you are doing on one is appearing on both the shells. To terminate session use ctrl-C and then ctrl-D. :)
 
Regards,
Tarun Pareek
LinkedIn

Posted in Linux, System