Planet Ubuntu Nepal

February 06, 2010

888

Upside Down Web Cam Simple Fix


Many laptop put their webcam upside down resulting in flipped images in Ubuntu. There were fixes for some but for some you had to physically remount the camera. The webcam that comes with Lenovo Ideapad Y510 is also mounted upside down. Unluckily there wasn't any simple fix for this. (some people rotated the camera physically).

Fortunately Hans de Goede came with a beautiful solution.

Open Terminal and add libv4l ppa
sudo add-apt-repository ppa:libv4l/ppa
Update your software list
sudo aptitude update
Install libv4l
sudo aptitude install libv4l-0
You have to use the following command to open any application that uses webcam
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so application_name
If you use 64 bit system, use the following command
LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so application_name

by noreply@blogger.com (Techs Palace) at February 06, 2010 08:37 PM

Bibek Shrestha

His story

He wants to go away. Among people who he knows and who knows him, life will always be an unjustice. Full of complaints. They pin point your flaws but he already knows them. He asks them Why? They remain silent. He knows the "Why?" is a power yet meaningless questions. Whenever you feel like not making a conversation, just ask "Why?". If only they also knew they could complain less, he thinks.

by bibekshrestha at February 06, 2010 02:58 PM

February 05, 2010

Bibek Shrestha

Using custom php.ini in a cPanel server

Recently in our office at YIPL, we needed to increase the upload_max_filesize and post_max_size of one of our clients. We run on a virtual private server with WHM and cPanel.

The default php runs as a FastCGI with suexec enabled.

Here is how I configured apache to run custom php.ini.

1. Know where your existing php.ini file exists.

Just create a phpinfo.php file in your public_html or www folder. Use the phpinfo() function know the current location of default php.ini.

/home/username/public_html/phpinfo.php

<?php
phpinfo();
?>

Access the file with http://www.sitename.com/phpinfo.php.

2. Copy the file inside your cgi-bin folder

$ cp /usr/local/lib/php.ini /home/username/public_html/cgi-bin

3. Create a custom cgi executable to run php.

$ vim /home/username/public_html/php.cgi

Add following lines

#!/bin/sh
/usr/local/cpanel/cgi-sys/php5 -c /home/username/public_html/cgi-bin/
# Note, the parameter after -c is the location of new php.ini

Allow executable permission to the new php executable

$ chmod +x /home/username/public_html/cgi-bin/php.cgi

4. Modify .htaccess to run php with our new executable by adding the following lines at the top

$ head /home/username/public_html/.htaccess
Action application/x-httpd-php5 /cgi-bin/php.cgi

#.. other commands

5. Make sure new configuration is loaded.

The http://www.sitename.com/phpinfo.php file should now show /home/username/public_html/cgi-bin/php.ini as the loaded setting file.

6. Remove phpinfo.php for security purposes

$ rm /home/username/www/phpinfo.php

References

read more

by bibekshrestha at February 05, 2010 01:33 PM

February 04, 2010

Jwalanta Shrestha (jwala)

mpg123: Lightest mp3 player in Linux

If you are in search of the lightest barebone mp3 player in Linux, nothing can beat mpg123. Unless you want flashy visualizations and playlist management and such, mpg123 can save you a lot of memory and cpu horsepower.

Installation is easy. In Ubuntu,
sudo apt-get install mpg123

Mpg123 comes with loads of options. Check out the man page for details. Here I'm gonna share a few usage tips.

Shuffle-play a directory of mp3s:
mpg123 -CZ /path/to/mp3/folder/*

-Z option is for shuffle, -C is for control. From man page:
-C, --control
Enable terminal control keys. By default use ’s’ to
stop, ’p’ to pause, ’f’ to jump forward to the next
song, ’b’ to jump back to the beginning of the song,
’,’ to rewind, ’.’ to fast forward, and ’q’ to quit.
Type ’h’ for a full list of available controls.

Equalizer:

Don't fall off your chair! Yes, mpg123 also comes with 32-band equalizer. But there's no inbuilt graphical UI for that, you need to create the plain-text file. There's an editor though if you like, but creating one is not hard either. From man page:
-E file, --equalizer
Enables equalization, taken from file. The file needs to
contain 32 lines of data, additional comment lines may be
prefixed with #. Each data line consists of two floating-
point entries, separated by whitespace. They specify the
multipliers for left and right channel of a certain
frequency band, respectively. The first line corresponds
to the lowest, the 32nd to the highest frequency band.
Note that you can control the equalizer interactively
with the generic control interface.

I've made one with party feel: party.txt

Usage:
mpg123 -CZ -E party.txt mp3_file

Songs again and again:

Plus if you kind of person who listens to couple of songs again and again for weeks (instead of shuffled huge playlist), then hi5! :) and here's how to do that with mpg123:
mpg123 -CZ song1.mp3 song2.mp3

by Jwalanta Shrestha (noreply@blogger.com) at February 04, 2010 11:15 AM

February 03, 2010

888

Multiple profile in Google Chrome in Ubuntu


I'm talking on basis of Ubuntu. This may or may not work in other OS.
You can use Google Chrome with multiple profile to:
  • Open different email address at once. For eg: open abc@gmail.com in one window and xyz@gmail.com in another
  • Separate personal stuff and your work stuff
  • Allow your family member to login without you signing out
These are the main reasons I use multiple profile in google-chrome. If you don't want to go through this hassles, you can always open multiple browsers.
For case in point you are browsing facebook.com and your sister wants to open the same site for quick check, you can either open different browser or open the same browser that has different profile. (or open in private mode too)

Both my favorite browsers Chrome and Firefox supports multiple profile. For now I'll write instructions for Chrome:
  1. Right click your panel, select add to panel and select custom application launcher (if you want to add in panel)
    or
    Right click the menu, select edit menus and click new item (if you want to add to menu)
  2. Fill it as:
    • Type: Application
    • Name: Google Chrome Profile A
    • Command: google-chrome --user-data-dir=/home/userName/.config/google-chrome/newProfile (the text in picture isn't correct)
  3. Click close
  4. Thats it folks.

by noreply@blogger.com (Techs Palace) at February 03, 2010 03:06 PM

Jwalanta Shrestha (jwala)

Making DLink DWL-650+ PCMCIA Wireless card work under linux

The DLink DWL-650+ PCMCIA Wireless card doesn't work on recent Linux distros (I tried Ubuntu Hardy to Jaunty). After plugging in, the system hangs with CapsLock flashing.

Turns out the card is handled by acx module and the support is broken for this card. So use ndiswrapper instead.

First blacklist acx module. Open /etc/modprobe.d/blacklist.conf file and add the following line
blacklist acx
Now install ndiswrapper
sudo apt-get install ndiswrapper-common
Now get the Windows driver for the card from here. Extract the file, go to the winxp folder and,
sudo ndiswrapper -i AIRPLUS.INF
The card should work now.

by Jwalanta Shrestha (noreply@blogger.com) at February 03, 2010 08:19 AM

February 01, 2010

Ishwor Gurung

Eclipse, Pydev, Epic, Java, ErlIDE all in one, posted Jan. 23, 2010

Eclipse IDE, Pydev, Epic, Java IDE, ErlIDE is bundled up and available to download (117Mb) from <a href="/dl/eclipse+java+pydev+epic+erlide.tar.bz2"> here </a>. Kindly note, that all the packages and the dependencies were strictly downloaded and tested on Ubuntu 9.04 only. The versions includes: <ul> <li> Eclipse IDE- Galileo 3.5 SR1 </li> <li> Pydev Release: 1.5.4 </li> <li> Epic - Testing: 0.6.35 </li> <li> ErlIDE - 0.7.3 </li> </ul> All software belong to the respective projects. Kindly use it at your own risk. I am providing it merely because of convenience. <pre> [ishwor@muffin:~]$ sha256sum eclipse+java+pydev+epic+erlide.tar.bz2 8249ae3a489f00f2418b8c6d79d936e98d7d4dfc271093bfa52bf7515ea237e8 eclipse+java+pydev+epic+erlide.tar.bz2 </pre> Happy hacking! :)

February 01, 2010 12:06 PM

First post!, posted Jan. 4, 2010

New post using Djangle blogging engine :)

February 01, 2010 12:06 PM

January 30, 2010

Bibek Shrestha

Periodic monitoring connection to certain port of certain ip address

While running a kannel server, I need to make sure certain connections to telcos are up. And here is a simple technique taiyal from ##linux suggested me. It is pretty simple though.

$ netcat -z -w 2 192.168.10.1 5020 -v -n

Netcat is a very simple utility command to connect to a certain ip at certain port. The parameters are as follows.

-z              zero-I/O mode [used for scanning]
-w 2            timeout for connects and final net reads
                in our case try to connect for just 2 seconds
-v              verbose [use twice to be more verbose]
-n              numeric-only IP addresses, no DNS
                No need for dns resolution

Add this to a cron and redirect the output to log file and we're set.

Here is my crontab

$ crontab -e

# m h  dom mon dow   command
*/5 * * * * /home/monitor/bin/checksmsc.sh

And here is my checksmsc.sh code

$ cat /home/monitor/bin/checksmsc.sh
#! /bin/bash
datetime=`date`
log=`netcat -z -w 2 192.168.10.1 5020 -vn 2>&1`
echo $datetime $log >> /home/monitor/log/connection.log

Make sure you make the log folder

$ mkdir /home/monitor/log

Output is in the format as

Sat Jan 30 14:25:02 NPT 2010 (UNKNOWN) [192.80.10.1] 5020 (?) open

Besides netcat, you could also use nmap command

$ nmap 192.168.10.1 -p T:5020 -oG filename.txt

Where -oG specifies output in Greppable format and writes out to filename.txt

Simple tcp monitor :)

read more

by bibekshrestha at January 30, 2010 05:39 AM

January 27, 2010

Bibek Shrestha

Where do you find brilliant ideas?

Seriously, where do you find brilliant ideas? Do you have to brilliant, creative, active, thoughful, ..., ?? to get the ideas? Well it might be that being brilliant or creative or thoughtful is just a bi-product of having great ideas.

I have been in search of a great idea, a great *Product* idea to be specific. Last week I saw the video from David Heinemeier Hansson (http://www.loudthinking.com/) where he speaks about creating a profitable startup company. See the video here http://www.youtube.com/watch?v=0CDXJ6bMkMY . It is pretty impressive, thanks to Geshan (http://twitter.com/geshan). He talks about the small challenges startups face and the why not to fear for not being successful. It is not necessary to target to be the next facebook or twitter or google or microsoft and a startup should just focus on getting your own product up and build your own small client base and keep them happy. I've seen few other products, small but quiet useful. I think they should have a mediocre client base and have good revenue stream. 

Take the mockup tool Balsamiq for example. It costs 79$. That isn't much for a tool of such good use and a lot of people will actually prefer to pay for it. If you build something useful, people will pay for it. The same goes for the online source code hosting website github (http://github.org). Pretty awesome right?

A lof of these ideas aren't the very first time people have come up with. There must have been a lot of mockup tools before Balsamiq and a lot of source code hosting facilities other than GitHub, and there will be others too. The idea it seems is to not to focus to beat the other guy, but to start delivering products to your clients. If you focus on 5 clients today, it is very much possible to have 10 clients tomorrow if you have a good product. To constantly deliver and innovate should suffice one to stay in the business. Why not you stay in the business and let others do their own business. Take it small I guess.

And to once again come back to topic, it seems when nurturing a concept, its more of a we than I, when coming up with ideas. I alone might come up with 3 ideas and only one of it might actually be good enough, but when there is a group, innovation starts to flow. Two person with three ideas each will be six ideas to start of. Take one good idea from it, work on it, brainstorm and modify to make it better. Sounds interesting.

And to have the *we* thing, ie to build a good team there needs to be communication. That is where this post comes in. I have been lacking enough creativeness to really start blogging till now. And shall I now start blogging just to get my point out to open, no matter how small or how insignificant it is.

read more

by bibekshrestha at January 27, 2010 03:10 PM

Prasanna Gautam (SR71-Blackbird)

Removing editor swap files before commits in git

I use git a lot. And I use just about any text editor in my system to edit files. And they tend to come with baggages of their own. Albeit useful, the swap files tend to linger on and eventually end up in my git repository. Here's how to avoid ...

January 27, 2010 03:00 AM

January 25, 2010

888

gnome-shell In Karmic


The GNOME Shell redefines user interactions with the GNOME desktop. In particular, it offers new ways for the user to find and open applications and documents, switch between various activities, and view incoming information such as chat messages or system notifications. Later, it will introduce a framework for creating custom extensions. The GNOME Shell replaces functions handled by the GNOME Panel and by the window manager in previous versions of GNOME. The GNOME Shell has rich visual effects enabled by new graphical technologies.
In short its cool!

This will be included in Gnome-3.0 which is going to be released in September 2010. Nevertheless gnome-shell is already available as package in Karmic Koala. You can see the new look of gnome very easily.

In terminal type:
sudo aptitude install gnome-shell
This will install gnome-shell. Now to try it press ALT+F2 and type:
gnome-shell --replace
To get your regular gnome-desktop, press ALT+F2 and type:
compiz --replace
If you like gnome-shell and want to make it default while opening your computer, open terminal and type:
gconftool-2 --set /desktop/gnome/session/required_components/windowmanager --type string gnome-shell
To get rid of this, open terminal and type:
gconftool-2 --unset /desktop/gnome/session/required_components/windowmanager

by noreply@blogger.com (Techs Palace) at January 25, 2010 06:05 AM

'Pages' Available In Blogger Draft


Blogger pages let you to publish static information on stand-alone pages linked from your blog. For example, you can use pages to create anAbout This Blog page that discusses the evolution of your blog, or a Contact Me page that provides directions, a phone number, and a map to your location.

http://www.google.com/support/blogger/bin/answer.py?answer=165955

You can only have 10 pages. The guide above has instruction to enable page in custom template too.

For this you have to enable your blogger draft. This is some kind of beta version of blogger and new updates are rolled through this.

by noreply@blogger.com (Techs Palace) at January 25, 2010 05:44 AM

Install Firefox 3.6 In Ubuntu


Mozilla released Firefox 3.6 few days ago. It is fast to start and fast to do js things. More in release notes here.

Installing Firefox 3.6 is same as installing Thunderbird 3 which I have already covered here.

I'll just copy pate those things here. So to update your Firefox follow the steps below:

  1. Open Terminal
  2. Add Mozilla's sources by:
    • For Karmic:
      • sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa
    • For version older than Karmic:
      • echo 'deb http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu ubuntu_version main' | sudo tee -a  /etc/apt/sources.list
        sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 247510BE
  3. sudo aptitude update
  4. sudo aptitude install firefox-3.6 firefox-3.6-gnome-support firefox-3.6-branding
  5. sudo aptitude safe-upgrade (just in case you've missed anything)
  6. sudo rm /etc/apt/sources.list.d/ubuntu-mozilla-daily-ppa-karmic.list (Otherwise your update manager will show new updates each day)
  7. sudo aptitude update

by noreply@blogger.com (Techs Palace) at January 25, 2010 05:19 AM

January 18, 2010

Himanshu Chhetri (r11t)

Building a simple Google Chrome Extension

Building a simple Google Chrome Extension

18 January 2010

Google Chrome for Linux is my browser of choice for many reasons including speed and overall feeling of being “snappy” in comparison to Mozilla Firefox. I was going over the documentation for extension developers and realized it is fairly easy to build simple extensions. However, what makes developing Chrome extensions so much fun is the support for features like HTML5 local storage which provides persistent data storage of key-value pair data. This makes it possibly to conveniently store and retrieve data for you Chrome extension.


I decided to build a simple extension called H2O that you can download from this link to help you remember to drink eight glasses of water everyday by displaying an icon along with a counter next to the URL bar in Chrome. I was only experimenting and trying to build something vaguely useful, however the positive feedback and comments I have received from the users who bothered to install my extension have prompted me to further develop this extension with more features. I am considering adding features like displaying “graphs” of daily/weekly fluid consumptions.

I have also put up the source code for my extension @ Github for those interested in taking a look at it.

January 18, 2010 06:00 AM

January 15, 2010

888

Install Thunderbird 3 In Ubuntu


I am never the fan of mail client. They are difficult to use, slow and ugly.

Mozilla recently released 3rd version of their popular email software, Thunderbird.  As said earlier, I wasn't much excited. Nevertheless I gave it a try. Thunderbird has made major changes in its UI. They have added new features like tabs, archive, smart folder and so on. More here http://www.mozillamessaging.com/en-US/thunderbird/3.0/releasenotes/#

After using this for few days I must say they have made definitive improvement on this software. I highly recommend everyone to update to this version. There was some problem with 'lightning' extension but this is already fixed.

To install follow the steps below:
  1. Open Terminal
  2. Add Mozilla's sources by:
    • For Karmic:
      • sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa
    • For version older than Karmic:
      • echo 'deb http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu ubuntu_version main' | sudo tee -a  /etc/apt/sources.list
        sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 247510BE
  3. sudo aptitude update
  4. sudo aptitude install thunderbird-3.0 thunderbird-3.0-gnome-support
  5. sudo aptitude remove thunderbird-2.0 thunderbird-2.0-gnome-support
  6. sudo ln -s /usr/bin/thunderbird-3.0 /usr/bin/thunderbird

by noreply@blogger.com (Techs Palace) at January 15, 2010 04:37 PM

DockBarX - Windows 7 Like Task Bar For Ubuntu


Many People liked the new task bar introduced in Windows 7.  If you don't believe me you can see this lifehacker's poll on "Best Application Dock".

There is similar bar in Linux by the name "DockBarX".



I have been reading about it from long time back but I was very lazy to give it a try. Also I never believed it would be very smooth and bug free.

However, I decided to give it a try and believe it or not now I am very big fan of it. It is a powerful program in a sense that you can configure multiple options like grouping, pinning applications, themes, click actions and so on. It has worked flawlessly for me.

If you also want to give it a try install it by:
  1. Open terminal
  2. Add the dockbarx source:
    • If you are using Karmic



      • sudo add-apt-repository ppa:dockbar-main/ppa



    • If you are using older version than Karmic



      • echo 'deb http://ppa.launchpad.net/dockbar-main/ppa/ubuntu ubuntu_version main' | sudo tee -a  /etc/apt/sources.list
        sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 38BD81CA



  3. sudo aptitude update
  4. sudo aptitude install dockbarx
  5. killall -9 gnome-panel
  6. Now right click in the empty area of your gnome-panel and click 'Add to Panel'
  7. Select docbarx from the list
  8. You may wan to remove your window list by right clicking on the far left and selecting remove

by noreply@blogger.com (Techs Palace) at January 15, 2010 04:30 PM

January 14, 2010

Himanshu Chhetri (r11t)

My presentation on ZSH basics

My presentation on ZSH basics

14 January 2010

Click here to view my presentation on the basics of the Zsh shell which I will be presenting next week at the local Linux User Group at my university. You can use arrow keys to navigate the slides which are displayed in the browser created using the magic of Slidedown

Follow @zshtips on Twitter if you are further interested in Zsh and various hacks/customizations for it posted by me occasionally.

January 14, 2010 06:00 AM