Archive

Archive for the ‘ubuntu’ Category

Installing Groovy-Grails on Ubuntu

February 13, 2011 4 comments

Now a days I am working with Groovy/Grails. This is really awesome language. Installing this in Ubuntu is very easy and this can be done very fast and in easy way. So how I installed Groovy/Grails up and running.

First install openjdk and groovy. Since in ubuntu these 2 packages are already available. So install it via apt-get.

sudo apt-get install openjdk-6-jdk
sudo apt-get install groovy

java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1)
OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)

groovyConsole

Now for installing Grails. We need to install via binary zip file.
Get the latest Binary Zip file and save to some of your location.
Unzip the folder and move to /usr/share/grails/
I just moved grails to /usr/share/ because ubuntu install Groovy at /usr/share/groovy so making the similarity.

Now Set the JAVA_HOME and GRAILS_HOME path for your profile. Since we are installing Grails via zip binary so we need to tell the system that where is Grails and where is JAVA.

Open ~/.profiles file and add these lines at the top.

JAVA_HOME=/usr/lib/jvm/java-6-openjdk
GRAILS_HOME=/usr/share/grails
PATH=$PATH:/usr/share/grails/bin
export JAVA_HOME PATH
export GRAILS_HOME PATH

And logout and login again and do

printenv

This will show you that Grails path is set for our profile.

Now just say

ganu@ganu:/usr/share/grails$ grails
Welcome to Grails 1.3.6 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /usr/share/grails

Use ‘grails help’ for more info or ‘grails interactive’ to enter interactive mode

DONE !! WOW.

How to check where Groovy-Grails combination is working.

Go to your development Grails folder.

ganu@ganu:~/grails$ grails create-app wpdemo
Welcome to Grails 1.3.6 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /usr/share/grails

Base Directory: /home/ganu/grails
Resolving dependencies...
Dependencies resolved in 2867ms.
Running script /usr/share/grails/scripts/CreateApp_.groovy
Environment set to development
...........
Executing tomcat-1.3.6 plugin post-install script ...
Plugin tomcat-1.3.6 installed
Plugin provides the following new scripts:
------------------------------------------
grails tomcat
Created Grails Application at /home/ganu/grails/wpdemo
ganu@ganu:~/grails$ cd wpdemo/
ganu@ganu:~/grails/wpdemo$ ll
total 28
-rw-r--r--  1 ganu ganu  178 2011-02-13 03:43 application.properties
drwxr-xr-x 10 ganu ganu 4096 2010-12-15 08:22 grails-app
drwxr-xr-x  2 ganu ganu 4096 2011-02-13 03:43 lib
drwxr-xr-x  2 ganu ganu 4096 2011-02-13 03:43 scripts
drwxr-xr-x  4 ganu ganu 4096 2011-02-13 03:43 src
drwxr-xr-x  4 ganu ganu 4096 2011-02-13 03:43 test
drwxr-xr-x  7 ganu ganu 4096 2010-12-15 08:22 web-app
ganu@ganu:~/grails/wpdemo$ grails run-app
Welcome to Grails 1.3.6 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /usr/share/grails

Base Directory: /home/ganu/grails/wpdemo
Resolving dependencies...
Dependencies resolved in 2986ms.
Running script /usr/share/grails/scripts/RunApp.groovy
Environment set to development
...........
Running Grails application..
Server running. Browse to http://localhost:8080/wpdemo

Groovy/Grails SEtup

Groovy/Grails SEtup

Happy Programming.

Quick Tutorial – How to zip and unzip files under unix environment

October 20, 2010 Leave a comment

Linux support zip and unzip facility.
All you need to install zip and unzip via apt-get in your debian/ubuntu linux.
The same is available via yum or zypper.

Some examples for zip and unzip.

1. Creates the zip archive and put all the files of the current directory in the compressed form.

ankur@ankur:~> cd test/
ankur@ankur:~/test> ll
total 0
-rw-r--r-- 1 ankur users 0 2010-10-20 10:03 1.txt
-rw-r--r-- 1 ankur users 0 2010-10-20 10:03 2.txt
-rw-r--r-- 1 ankur users 0 2010-10-20 10:03 3.txt
ankur@ankur:~/test> zip zipthis *
 adding: 1.txt (stored 0%)
 adding: 2.txt (stored 0%)
 adding: 3.txt (stored 0%)
ankur@ankur:~/test> ll
total 4
-rw-r--r-- 1 ankur users   0 2010-10-20 10:03 1.txt
-rw-r--r-- 1 ankur users   0 2010-10-20 10:03 2.txt
-rw-r--r-- 1 ankur users   0 2010-10-20 10:03 3.txt
-rw-r--r-- 1 ankur users 382 2010-10-20 10:05 zipthis.zip
ankur@ankur:~/test>

This command will automatically put the zip extension when the process will done.

2. Now try for zipping the subdirectory also..
Here I have created the subdirector as “subtest”.

ankur@ankur:~/test> ll
total 8
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 1.txt
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 2.txt
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 3.txt
drwxr-xr-x 2 ankur users 4096 2010-10-20 10:14 subtest
-rw-r--r-- 1 ankur users  382 2010-10-20 10:05 zipthis.zip
ankur@ankur:~/test> zip -r subzipthis *
 adding: 1.txt (stored 0%)
 adding: 2.txt (stored 0%)
 adding: 3.txt (stored 0%)
 adding: subtest/ (stored 0%)
 adding: subtest/sub1.txt (stored 0%)
 adding: subtest/sub2.txt (stored 0%)
 adding: zipthis.zip (stored 0%)
ankur@ankur:~/test> ll
total 12
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 1.txt
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 2.txt
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 3.txt
drwxr-xr-x 2 ankur users 4096 2010-10-20 10:14 subtest
-rw-r--r-- 1 ankur users 1306 2010-10-20 10:15 subzipthis.zip
-rw-r--r-- 1 ankur users  382 2010-10-20 10:05 zipthis.zip
ankur@ankur:~/test>

To use unzip to extract all files of the archive pics.zip into the current directory & subdirectories:

3. Listing of your files from a zip folder.

ankur@ankur:~/test> ll
total 8
-rw-r--r-- 1 ankur users 1306 2010-10-20 10:15 subzipthis.zip
-rw-r--r-- 1 ankur users  382 2010-10-20 10:05 zipthis.zip
ankur@ankur:~/test> unzip -l subzipthis.zip
Archive:  subzipthis.zip
 Length     Date   Time    Name
 --------    ----   ----    ----
 0  10-20-10 10:03   1.txt
 0  10-20-10 10:03   2.txt
 0  10-20-10 10:03   3.txt
 0  10-20-10 10:14   subtest/
 0  10-20-10 10:14   subtest/sub1.txt
 0  10-20-10 10:14   subtest/sub2.txt
 382  10-20-10 10:05   zipthis.zip
 --------                   -------
 382                   7 files
ankur@ankur:~/test>

4. To test about your zip archive that archive is OK or not:

ankur@ankur:~/test> unzip -tq subzipthis.zip
No errors detected in compressed data of subzipthis.zip.
ankur@ankur:~/test> unzip -tq zipthis.zip
No errors detected in compressed data of zipthis.zip.

5. Unzip your data

ankur@ankur:~/test> unzip zipthis.zip
Archive:  zipthis.zip
 extracting: 1.txt
 extracting: 2.txt
 extracting: 3.txt
ankur@ankur:~/test> ll
total 8
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 1.txt
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 2.txt
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 3.txt
-rw-r--r-- 1 ankur users 1306 2010-10-20 10:15 subzipthis.zip
-rw-r--r-- 1 ankur users  382 2010-10-20 10:05 zipthis.zip

6. Now you want to extract only the specific files from your zip folder. You can use like this…

ankur@ankur:~/test> unzip zipthis.zip 1.txt
Archive:  zipthis.zip
 extracting: 1.txt
ankur@ankur:~/test> ll
total 8
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 1.txt
-rw-r--r-- 1 ankur users 1306 2010-10-20 10:15 subzipthis.zip
-rw-r--r-- 1 ankur users  382 2010-10-20 10:05 zipthis.zip

7. To extract all files to some specified directory.

ankur@ankur:~/test> unzip zipthis.zip -d /home/ankur/test/
Archive:  zipthis.zip
 extracting: /home/ankur/test/1.txt
 extracting: /home/ankur/test/2.txt
 extracting: /home/ankur/test/3.txt
ankur@ankur:~/test> ll
total 8
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 1.txt
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 2.txt
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 3.txt
-rw-r--r-- 1 ankur users 1306 2010-10-20 10:15 subzipthis.zip
-rw-r--r-- 1 ankur users  382 2010-10-20 10:05 zipthis.zip

8. Unzip files one by one with confirmation.

ankur@ankur:~/test> unzip -q subzipthis.zip
replace 1.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
replace 2.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
replace 3.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
replace zipthis.zip? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
ankur@ankur:~/test> ll
total 12
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 1.txt
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 2.txt
-rw-r--r-- 1 ankur users    0 2010-10-20 10:03 3.txt
drwxr-xr-x 2 ankur users 4096 2010-10-20 10:14 subtest
-rw-r--r-- 1 ankur users 1306 2010-10-20 10:15 subzipthis.zip
-rw-r--r-- 1 ankur users  382 2010-10-20 10:05 zipthis.zip

9. Zip and Unzip version and liceance.

zip -v
zip -L
unzip -v

10. Help from zip and unzip

zip -h
unzip -h

install tweetdeck on ubuntu 10.04

October 2, 2010 3 comments

I usually use twitter and facebook from web only. Today i thought to use some client. I found TweetDeck. I thought it must be awesome. So I installed it.

Its very easy to install on Ubuntu 10.4 thanks to TweekDeck and Ubuntu Team.

TweetDeck – http://www.tweetdeck.com/desktop/

It goes like this

  • Download Adobe AIR from http://labs.adobe.com/downloads/air_linux.html
  • Get the .deb file from above page.
  • Use dpkg -i .deb file and this will automatically install Adobe AIR in your computer.
    ganu@ganu:~$ sudo dpkg -i /tmp/adobeair.deb
    Selecting previously deselected package adobeair.
    (Reading database ... 219838 files and directories currently installed.)
    Unpacking adobeair (from /tmp/adobeair.deb) ...
    Setting up adobeair (2.0.3.13070) ...
    
  • Download TweetDeck AIR from from there website or from direct link at http://www.tweetdeck.com/beta/TweetDeck_0_35.1.air
  • You can also directly download the latest air file from TweetDeck website page. It will download the latest version.
  • Run the air file, double click it and follow the instructions.
  • Yea its done.

Attached are some photos.



Happy Social Networking. :P

How to Play DVD in Ubuntu 9.10 Karmic Koala

November 29, 2009 2 comments

Today I got the little problem where I was not able to run the DVD to my this laptop.

I searched and found the tips to run it in my 9.10 karmic KoalaUbuntu.
First, I have read that why this is happening… and I got this link
https://help.ubuntu.com/community/RestrictedFormats
It says why some of the formats are not suitable sometime.

Second, then I installed Ubuntu-restricted-extra package to my system. Somewhre it says that these packages are by default installed but I installed again.

Third, still there is no sign of my work, so then you need to run this shell file…

apt-get install ubuntu-restricted-extras
cd /usr/share/doc/libdvdread4/
sudo ./install-css.sh

Thats it, now the DVD is running in my laptop.

quick ffmpeg audio-video encoding usage help

July 18, 2009 2 comments

o from last 2-3 days I spent my so much time on file conversion with ffmpeg and mencoder.

After work done, I got some good links to follow for my future help and for all other readers.

The command what I tried for my use is like this

For High Quality and FFMPEG and libx264 vcodec i used this.

/usr/bin/ffmpeg -i /home/ganu/public_html/video/316.mp4
-b 1M -bt 4M -vcodec libx264 -pass 2 -vpre hq -acodec libfaac
-ac 2 -ar 44100 -ab 192k -threads 0 -s 552x311 -bufsize 200000000
-f flv -y /home/ganu/public_html/flvideo/316x.flv

Finally I used this this is working fine.

/usr/bin/ffmpeg -i /home/ganu/public_html/video/316.mp4
-r 30000/1001 -b 2M -bt 4M -acodec libfaac -ac 2 
-ar 44100 -ab 192k -s 552x311 -f flv -y /home/ganu/public_html/flvideo/316x.flv

/usr/bin/ffmpeg -i /home/ganu/public_html/video/316.mp4
-f image2 -ss 00:00:1 -s 120x90 -vframes 2
-y /home/ganu/public_html/tmp/thumbs/316/%08d.jpg

For metadata injection i used like this.

/usr/bin/flvtool2 -Uv
/home/ganu/public_html/flvideo/316x.flv
/home/ganu/public_html/flvideo/316.flv

So first say the file 316.mp4 is converted to 316x.flv. And after flvtool2 the meta information is injected and final file will be 316.flv

So this is how, the flv conversion is done.

Happy Programming. :)

gnome-blog for wordpress.com blogs

February 16, 2009 6 comments

This post will prove that, what I am writing from gnome-blog is successfully updated and uploaded.

editing again to say its success, and some more changes.

Directly this will not support ???.wordpress.com blogs. So for that in the preferences set

Blog Type : Self-Run Other
Blog Protocol : MetaWeblog
XML-RPC URL : http://{blogname}.wordpress.com/xmlrpc.php

Actually I am talking about this – gnome-blog

Happy Quick Blogging. :D

Issue with my Acer laptop battery, its says not productive.

December 28, 2008 1 comment

I got this –

ganu@ganu:~$ cat /proc/acpi/battery/BAT1/info
present:                 yes
design capacity:         4000 mAh
last full capacity:      1522 mAh
battery technology:      rechargeable
design voltage:          11100 mV
design capacity warning: 300 mAh
design capacity low:     60 mAh
capacity granularity 1:  32 mAh
capacity granularity 2:  32 mAh
model number:            Chapala
serial number:           20080
battery type:            LION
OEM info:                SONY

so when I start my laptop it says, its not with full capacity. Its only using 38% capacity only.

My CD-ROM is also not working

But I am in warranty period so I think I will get replacement. Lest see.

But I trusted Acer. :(

Categories: ubuntu Tags: , , , , , ,
Follow

Get every new post delivered to your Inbox.