Monday, June 30, 2008

Battey Stats

There are ready made panel applets available for viewing your battery remaining, current state and others.. Well here I give you more geekier an efficient way of doing that .. CLI ofcourse :
  1. Know your battery's specification :
    $ cat /proc/acpi/battery/BAT0/info

  2. Know your current battery status :
    $ cat /proc/acpi/battery/BAT0/state
    NOTE: BAT0 may differ as per your Laptop model, look for what you have got in /proc/acpi/battery directory.


I have made a small script for Battery Status :
#!/bin/bash
# Battery Status by GNUger

current=`grep remaining /proc/acpi/battery/BAT0/state | awk {'print $3'}`
total=`grep "design capacity:" /proc/acpi/battery/BAT0/info | awk {'print $3'}`

percent=$[100*$current/$total]

echo `grep charging /proc/acpi/battery/BAT0/state | awk {'print $3'}` $percent%
Attached the script file here

TIP: You can add this script in conkyrc file

Sunday, June 29, 2008

Ctrl + Alt + Del

Sometimes users get annoyed with not having their favorite Windows key combination "Ctrl + Alt + Del" working on Linux Box. Well here's how to view your process manager for "Ctrl + Alt + Del" :

GNOME :
  1. Start gconf-editor via terminal / Alt+F2 & navigate to : apps > metacity > global_keybindings

  2. Double click on run_command_1 and change its value to <Control><Alt>Delete

  3. The navigate to : apps > metacity > keybinding_commands

  4. Double click on command_1 and change its value to gnome-system-monitor

Fluxbox
  1. With any text editor edit you ~/.fluxbox/keys file, Example:
    $ vim ~/.fluxbox/keys

  2. Append this at the end of the file:
    Control Mod1 Delete :ExecCommand xterm -e top
    You can use gnome-system-monitor instead of xterm -e top, but I have used it to retain Fluxbox's spirit of minimalism


Relogin to check its effect...

Cyber-shot DSC-S650

SONY Cyber-shot DSC-S650
Specifications :
  • Brand : SONY, S-Series Cyber-shot camera
  • Mega pixels : 7.2 Mega pixels
  • Zooming : 3x Optical Zoom
  • 2 inch. LCD Monitor
  • Media Type : Memory Stick Duo, Memory Stick PRO Duo
  • High Sensitivity ISO 1000
  • Spot Metering, Scene Selection Modes
  • Looks : Cool and Sleek
  • Accessories : Sony Original 1GB Memory Stick
  • Recommended goodies : Original Sony Nickel-Metal Hydride, Rechargeable Batteries, Sony CycleEnergy Battery Charger, Sony Carrying Case LCS-BDA.
"It is easy to use and likely to appeal to anyone looking for a less expensive camera from one of the leading brands" by http://www.cameras.co.uk/
I myself use this Camera and simply cannot resist myself in adoring its high picture quality and a option for lot of custom settings for professional quality snapshots.

For More Info. & do check out the Pictures/Videos taken from DSC-S650

Saturday, June 28, 2008

File transfer to/from Mobile Phone

With new distros its very simple to do file transfer using bluetooth. Just a matter of few clicks :
  1. Insert your Bluetooth Dongle, and a bluetooth icon will appear in the notification area, otherwise start your bluetooth service by executing : bluetooth-applet

  2. Right click on that icon and Browse Device > Select your Mobile > Connect

  3. If your device is not paired up, it will pop up pairing up menu on your phone and then on your PC. Then it will mount your phone's directory on your computer which you can browse using a Nautilus.

Else there is a geekier way too using CLI based obexftp :
  1. Discover your mobile's MAC address and its channel for Object Push
    $ obexftp -b

  2. Browse your phone's directory
    obexftp -b mac address -B channel -l
    You can also change the current directory to browse its content
    $ obexftp -b mac address -B channel -c directory -l
    NOTE: Replace mac address, channel & directory with your own value

  3. Now upload file :
    $ obexftp -b mac add -B channel -c phone directory -p file
    And retrieve file :
    $ obexftp -b mac add -B channel -c phone directory -g file

For more on Bluetooth check this page

Mario, Contra, Ice Climber play them all

I remember the days when I was addicted to TV video games, so thought of bringing them back. After a bit of googling I got a open source NES emulator named Nestopia, but was unable to download it because the links for Linux download were dead. Then I turned to NTSC and PAL Famicom/NES emulator called FCE Ultra whose packages are easily available in Ubuntu Repositories.

Free Image Hosting at www.ImageShack.us

Install it :
$ sudo apt-get install gfceu

Start the Emulator from Menu > Games > GFCE Ultra NES Emulator
Configure the keys : GFCE Window > Input > Gamepad 1 then press keys on your keyboard as per your convenience.
Execute a game : GFCE Window > Main > Browse then locate your .nes file.

For more documentation : FCE Ultra: General Documentation

Download the game files from NES Rom

Friday, June 27, 2008

Feeling Geeky...

Fed up with GNOME/KDE resource hogging Desktop Environment, but do not want to loose GUI! So now its time when you turn to fluxbox. Call this page "HowTo forge a simple geeky environment"..

Packages Recommended :
Other light-weight applications as per your requirement, there are many pages on it just Google.

Install them :
 # yum install fluxbox pcmanfm imagemagick mplayer epiphany

Start Fluxbox :
After finishing off with installation just log out and select fluxbox in the Session Type and Login.

Start Configuring :
  • Generate a perfect menu, it will take some time
    $ fluxbox-generate_menu -kgB -is -ds -t xterm -b epiphany
    You can also add custom items to your menu : Editing Menu

  • Set Wallpaper :
    $ fbsetbg /path/to/wallpaper
    Now edit you ~/.fluxbox/init file with any editor and search for session.screen0.rootCommand: and add fbsetbg -l beside it.

  • Binding your ~/Desktop folder with your desktop, use PCMan FM :
    Start your pcmanfm file manager and navigate to Edit>Preference>Desktop and mark "Show files on Desktop", "Wallpaper" and "Allow window manager to decide right click". Edit you ~/.fluxbox/init file with any editor and search for session.screen0.rootCommand: and add pcmanfm beside it (replace fbsetbg -l).

  • Use a animated wallpaper instead!
    You can use your screen-saver as a wallpaper. Edit your ~/.fluxbox/init file with any editor and search for session.screen0.rootCommand: and add /usr/lib/xscreensaver/gears -root beside it (you can use other screen-savers too). Actually you have to choose between normal wallpaper, desktop with icons or animated desktop.
    For having icons on desktop check this : Idesk

  • System Monitor widget : install conky, get its readymade configuration files (conkyc) here

  • Choose your default applications :
    Image Files : display
    Media Files (Audio/Video) : xterm -e mplayer
Further keep experimenting with the CLI commands, it makes you make proficient with Linux platform and do check this link (Linux Command Line).

Saturday, June 21, 2008

Webcam and MPlayer

Ubuntu really shocked me today when it recognized my integrated webcam automatically, which I discovered via Ekiga application.. Ok so drivers set, what I need now is record videos and take snapshots.. Mplayer as the title indicates does this all, the versatile player which can load video devices too. Lets begin with our task :


Viewing :


Fireup this command to bring up your video streamer:
$ mplayer -fps 15 tv:// -tv  driver=v4l2:device=/dev/video0

You can replace your video fps(frames per second), device and driver value as per your convenience.

Specify the video dimensions :
$ mplayer -fps 15 tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0

Horizontally inverse the stream i.e. mirror effect :
$ mplayer -vf mirror -fps 15 tv:// -tv  driver=v4l2:device=/dev/video0

View Fullscreen :
$ mplayer -aspect 16:10 -fps 15 tv:// -tv  driver=v4l2:device=/dev/video0
$ mplayer -aspect 16:10 -vf mirror -fps 15 tv:// -tv driver=v4l2:device=/dev/video0

Then press 'f' key to enter Fullscreen. NOTE: Enter aspect value as per your screen resolution ratio eg. 4:3, 16:9, 1:1


Snapshots:


Take snapshots while streaming by pressing 's' :
$ mplayer -vf screenshot -fps 15 tv:// -tv  driver=v4l2:device=/dev/video0

Mirrored :
$ mplayer -vf mirror,screenshot -fps 15 tv:// -tv  driver=v4l2:device=/dev/video0

The files will be saved in your current directory with name "shot####.png", where #### is for index number.


Video Capturing:


For video capturing you will need a companion of mplayer named "mencoder", install it if you don't have one. So here is the way you start your recording:

Without sound:
$ mencoder tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -nosound -ovc lavc -o filename.avi

With sound:
$ mencoder tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0:forceaudio:adevice=/dev/dsp -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o filename.avi

You can combine other subtags like vf, aspect, fps to enhance your video.

This is all, you can try a different short program too for video/photo capturing : VideoView.

This post took from me a lot of manual reading and googling but am happy to present it before you. Here are the major sources : Gentoo Wiki, Mencoder -vf and mplayer manuals.

Friday, June 20, 2008

Compaq Presario C773TU Notebook PC


Today I bought a new Notebook : Compaq C773TU as the title says, so here I present a brief review on it.

Specifications:
  • Intel Core 2 Duo T5550 (1.83 GHz)
  • Intel 965GM Express Chipset
  • 2 MB L2 Cache
  • Memory - 2 GB PC2 DDR2 (667 MHz)
  • Hard Drive - 160 GB, 5400 RPM
  • CD/DVD RW, 8x Double Layer DVD Writer
  • 15.4" Widescreen TFT, 1280x800 WXGA
  • FreeDOS
My computer aka gnutop which I thought was appropiate name for it, has a good sound quality with a powerful integrated Web camera. I have installed Ubuntu 8.04 on it along with pre-installed FreeDOS (I will remove it later 5 GB is not a big deal for me now). Ubuntu is running fine with its default Gnome Environment + Compiz Effects. I plan to install Fedora 9 on it once I get its DVD, till then enjoying the interface of Ubuntu and power of apt.

I picked this laptop because of its powerful configuration, it didn't bundled Vista for which I had to pay extra bucks, and at last but never the least is its low cost. In all a perfect laptop for a college going student.

Thursday, June 5, 2008

Formatting USB Drive with Linux

This is a guide to format a Thumb drive in Linux. After a bit of Googling I got mkfs, which is used to build a Linux file system on a device. Now for thumb drive we use FAT32 or VFAT filesystem, so we use mkfs.vfat instead.

Syntax (quick format) :
# mkfs.vfat -F32 {device}

For Fedora/RedHat based :
 # /sbin/mkfs.vfat -F32 {device}


I have made a script for easy formatting :

1> Open Terminal :
$ nano format.sh

2> Paste this and save :
#!/bin/bash
# Bash Script for formatting USB drives by GNUger

if [[ $EUID -ne "0" ]]
then
echo "You must be root"
exit 1
fi

device=$(df | tail -n1 | awk '{ print $1; }')
read -p " Is device ($device) correct(y/n) : " opinion1
if [[ $opinion1 == 'n' ]] || [[ $opinion1 == 'no' ]]
then
read -p "Enter device name : " device
fi
echo
echo "Formatting : $device"
echo
read -p "Proceed with formatting(y/n) : " opinion2
if [[ $opinion2 == 'y' ]] || [[ $opinion2 == 'yes' ]]
then
umount $device
read -p "Volume label : (Enter for none) " label
if [[ ${#label} == 0 ]] ; then
/sbin/mkfs.vfat -F32 $device
else
/sbin/mkfs.vfat -F32 -n "$label" $device
fi
exit 1
fi

Attached the file here

3> Then allow the file to execute:
$ chmod +x format.sh

4> Insert your thumb drive and execute :
# ./format.sh


You can also use GParted for formatting and resizing.