Well no big deal:-). The battery information can be easily got by clicking on the battery icon in your Ubuntu's taskbar. The good thing here is you will know from which file the information of the battery is fetched.
To know the current state of the battery:
pradeep@pradeep-laptop:~$ cat /proc/acpi/battery/BAT0/state
present: yes
capacity state: ok
charging state: charging
present rate: 0 mA
remaining capacity: 3599 mAh
present voltage: 12578 mV
To know all the info regarding your laptop battery:
pradeep@pradeep-laptop:~$ cat /proc/acpi/battery/BAT0/info
present: yes
design capacity: 4400 mAh
last full capacity: 3789 mAh
battery technology: rechargeable
design voltage: 10800 mV
design capacity warning: 185 mAh
design capacity low: 129 mAh
capacity granularity 1: 56 mAh
capacity granularity 2: 3604 mAh
model number: VE06047
serial number: 453
battery type: LION
OEM info: STL-LG22
Ahh, 3789mAh/4400mAh = 87%, Not bad after 1.5 years of torture to my lappy;-). Let me know your' s too.
Monday, August 24, 2009
Know your Battery status the command line way
Labels: cool, linux, tricks, ubuntu
Save to del.icio.us
with 0 happy readers :)
Twittering the command line way
As you might have noticed my previous post was browsing the command line. Now lets see how to twitter the command line way:-);-)
At first you need to install cURL.(a client for getting files from servers) to post to Twitter through the Terminal which can be installed using the following command:pradeep@pradeep-laptop:sudo apt-get install curl
With cURL installed, you can post to Twitter from the terminal window by using the following syntax:
pradeep@pradeep-laptop:curl -u yourusername:yourpassword -d status="Your Message Here" http://twitter.com/statuses/update.xml
You will receive a response containing the XML coding for your post which acts as a confirmation that your post was submitted.
So have fun twittering the command line way:-)
Post in your reviews:-)
Wednesday, August 19, 2009
The command line way of browsing
One of the best things in Linux I like is the command line way of doing things. Well now I can do almost all my work from the terminal and the latest being browsing and chatting. The only thing I cannot do is viewing images and watching videos which soon might be possible:-).
So how do I browse from my terminal??? I thought was it possible? I have realised lately there's help for everything and anything on Linux. After doing a small research I found out this cute command line app called "Elinks"(command line browser)
Ever wondered how fast the browser Elinks is ??? No pop ups, no images, but absoultely cool plain test views,option to see images using eog(Eye Of Gnome) , tabbed browsing, history, bookmarks, history : everything one might need in a modern day browser. It doesn't crash , doesn't require any extra plugins for working. Actually above anything else its the speed of browsing is what that beats me ! Brilliant! Don know what adjective would describe the power of elinks. Check out the google page opened on elinks.
Accessing my Gmail account is fun in elinks. So damn fast!!
"finch" is a command line chat client which is the same as pigdin.:-)
elinks can be installed on your ubuntu as follows:
#pradeep@pradeep-laptop: sudo apt-get install elinks
PS: I agree that GUI way of doing things is friendly,easy and all. But after a few tries the command liners are easy to use , more productive and damn cool!!!
Always try and do things differently:-);-)
Labels: cool, linux, tricks, ubuntu
Save to del.icio.us
with 0 happy readers :)
Monday, August 17, 2009
Bash SpellChecker
Reason for this post is that i tend do a lot of typing mistakes while typing at the terminal:-).
Spell checking in bash can be enabled adding the following line below into your bashrc file
shopt -s cdspell
#pradeep@pradeep-laptop:gedit ~/.bashrc
Add the command mentioned above to the end of the file and save.
That’s all :)
If you want to enable this for all the users, then append this to your /etc/bash.bashrc (in Ubuntu) or /etc/bashrc (in Fedora). Of course, you need the root privilege to edit the files in /etc.
Now try these
cd /hoem
cd /hoe
Ain't it cool.
Ok in short it is a script which is run by the bash shell when ever a terminal is invoked once you login.
To know more please see /usr/share/doc/bash/INTRO.gz as in "Ubuntu 9.04". Not sure about other versions. It should be the same according to me.
Saturday, August 8, 2009
Vim plugin you must install
Ok why I am writing this post.Two reasons for it: snipMate.vim Introductory Screencast from Michael Sanders on Vimeo.
1) We have a Web Programming Lab this semester
2) I hardly use windows now:-). Using windows has exponentially decreased:-)
Snipmate.vim is probably the best snippets plugin for vim. A snippet is a piece of often-typed text or programming construct that you can insert into your document by using a trigger followed by a tab. It was written by Michael Sanders.
Here is an example usage of snipmate.vim. If you are a C programmer, then one of the most often used forms of a loop is “for (i=0; condition ; i++) {}”. Without snippets you’d have to type this out every time. Even though it takes just another second, these seconds can add to minutes throughout the day and minutes can add to hours over longer periods of time. Why waste your time this way? With snippets you can type just “for tab” and snipmate will insert this whole construct in your source code automatically! If “i” or “n” weren’t the variable you wanted to use, you can now use tab and shift-tab to jump to next/previous item in the loop and rename them!
Michael also created an introduction video for his plugin where he demonstrates how to use it. Check it out:
How to install snipmate.vim?
To get the latest version:
1. Download snipmate.zip.
2. Extract snipmate.zip to ~/.vim (on Unix/Linux) or ~/etc/vim (wherever vim is installed)
#pradeep@pradeep-laptop: sudo unzip snipmate.zip -d ~/etc/vim (provided snipmate.zip is in your HOME folder else provide the desired path)
3. Run :helptags ~/.vim/doc or ~/etc/vim/doc
4. Restart Vim.
The plugin comes with predefined snippets for more than a dozen languages (C, C++, HTML, Java, JavaScript, Objective C, Perl, PHP, Python, Ruby, Tcl, Shell, HTML, VimScript). Be sure to check out the snippet files in the “snippets” directory under your ~/.vim or ~\vimfiles directory.
If you need to define your own snippets (which you most likely will need), create a new file named “language-foo.snippets” in the “snippets” directory. For example, to define your own snippets for C language, you’d create a file called “c-foo.snippets” and place snippets in it.
To learn about snipmate snippet syntax, type “:help snipmate” and locate the syntax section in the help file.
Have Fun!
Post in your comments if any queries!
Labels: cool, linux, plugin, tricks
Save to del.icio.us
with 0 happy readers :)
Wednesday, August 5, 2009
Install Apache webserver,mysql,perl and php
For all those who dont have apache server,mysql,perl and php on your Linux OS here's a way you can install.
People who have installed Fedora 8/9[Full installation] all the above gets installed automatically. But if you have installed other distributions like Ubuntu, Open SUSE, Red Hat etc, here is a way you can do.
If you install the above softwares separately its a very tedious job believe me. But you need not do that. The idea was suggested by my class mate Abdul Munim. There is a package by name XAMPP which installs everything including many cool things.So how do you go about it
So wat is XAMPP??
XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.
So how do you go about it?
At first you need to download the package file.You can find the file: here
Now copy the file to your home directory.Now you are three steps away:-)
Step 1: Installation
Go to a Linux shell and login as the system administrator root:
#su
Extract the downloaded archive file to /opt:
#pradeep@pradeep-laptop:tar xvfz xampp-linux-1.7.1.tar.gz -C /opt
Warning 1: Please use only this command to install XAMPP. DON'T use any Microsoft Windows tools to extract the archive, it won't work.
Warning 2: already installed XAMPP versions get overwritten by this command.
Step 2: Start
To start XAMPP simply call this command:
pradeep@pradeep-laptop:/opt/lampp/lampp start
You should now see something like this on your screen:
Starting XAMPP 1.7.1...
LAMPP: Starting Apache...
LAMPP: Starting MySQL...
LAMPP started.
Step 3: Test
OK, that was easy but how can you check that everything really works? Just type in the following URL at your favourite web browser:
http://localhost
Now you should see the start page of XAMPP containing some links to check the status of the installed software and some small programming examples.
You are done now. If you any queries/problems regarding the installation,please post in the comments and i will try to fix the problem:-)
Labels: linux, tricks, tutorials, ubuntu
Save to del.icio.us
with 0 happy readers :)


