Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Tuesday, October 2, 2012

[Linux] Copy files faster cp command


Every Linux user is familiar with file copy command, cp (copy). As an user who uses this frequently in a day, I can't help but wonder about possible alternatives to cp. CP is terrible when copying large number of files that are small in size. So, after digging in the internet, I found the following command to be a little more faster than cp command when it comes to copying smaller files.




tar cf - dir1 | (cd dir2; tar xf -)

With this, you can move an entire directory from dir1 to dir2. Here's an example.




tar cf - images/ | (cd /media/gentoo_/images/ tar xf -)


Monday, September 17, 2012

HOW TO INSTALL VLC 2.0 IN UBUNTU 11.10


Did you know that the latest VLC player version they can get is 1.1.12?  As of today, the most recent version available is 2.0.4 which is able to install from Ubuntu 12.04. So, VLC users have to either have to upgrade Ubuntu version, or be stick with an older 1.x versions.

But there is a way to install VLC via a PPA from VLC Daily Build of master branch. It's ppa:videolan/master-daily . I first tried ppa:n-muench/vlc, but it never worked for me. This worked flawlessly. The technically savvy people may now go ahead and install VLC by using this PPA. Others or if you are just interested, follow the instructions below to get it installed.

First enter the following command to add this PPA to your software sources


sudo add-apt-repository ppa:videolan/stable-daily


Now, you can update your software indexes, and install VLC.


sudo apt-get update && sudo apt-get install vlc


Now, you have a nice looking VLC at your hand. They say the performance is improved too among other new features. But I'm yet to test those! :-)


Wednesday, September 12, 2012

Linux commands I can not afford to lose



HTTP Requests -
GET - wget blog.kasunbg.org


GET request - curl --request GET http://localhost:9763/services/StudentService.StudentServiceHttpEndpoint/student/kasun




POST request - curl -d "age=01&name=kasun&subjects=unix" http://localhost:9763/services/StudentService.StudentServiceHttpEndpoint/student/kasun


SOAP POST request to a SOAP 1.2 endpoint -
curl -d '<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><p:echoString xmlns:p="http://echo.services.core.carbon.wso2.org"><in>kasun</in></p:echoString></soapenv:Body></soapenv:Envelope>'   -H "Content-Type: application/soap+xml"    http://localhost:9443/services/echo


Other commands - PUT, DELETE


SCP - 
scp -r -P 2200 /home/kasun/docbook-webhelp/  kasun@example.com:/home/kasun/public_html/
rsync


grep -ri "example" ../../ --include "*xml" -A5 -B5
find ../.. -iname "*xml"
tail -f target/carbontmp/wso2as-4.1.0-SNAPSHOT/repository/logs/wso2carbon.log


Replace a given word with a new one from a set of files - Here, I'm replacing the word 'oldWord' with 'newWord' of a set of files that ends with .xml in the current folder.

find . -name "*.xml" -exec sed -i "s/oldWord/newWord/g" '{}' \;


to replace the word "<webXml>${basedir}/../../web.xml</webXml>" with newWord. Note the escape charater (\) before $ and /. Used : for easy writing.

find . -name "pom.xml" -exec sed -i "s:<webXml>\${basedir}/../../web.xml<\/webXml>:newWord:g" '{}' \;


Find running Java processes - ps ax | grep java
Kill a process - kill -9 <process-id>

Subversion
Get only the modified files - svn status | egrep  "^M"
Create patch - svn diff > my-contribution.patch
Apply patch - patch -p0 < my-contribution.patch

Extract files -
tar -xjf my-archive.tar.bz2
tar -xzf my-archive.tar.gz
unzip my-archive.zip

Get the disk usage of a directory, sorted - du -s ./* | sort -g
Shutdown - sudo shutdown -h now
Reboot - reboot

The archive reader - file-roller
PDF reader - evince
Partition editor - gparted

Find the VGA driver in the machine - lspci -v | grep -i vga
Find attached USB devices - lsusb

Only copy a set of symbolic links in the current directory, and copy those to a separate folder. I did this in Ubuntu.
cp `l -1 | grep -ri @ | grep -ri "[^@]*" -o` ../my-symlinks/ -P

l -1 | grep -ri @ | grep -ri "[^@]*" -o - Selects outputs the file names of the symlinks. Then we copy it using cp with the parameter -P. -P means that cp won't follow the symlinks.

Bash for loop - in one line

for file in `fn pom.xml`; do echo $file; done

iPhone

Mount in Linux/Ubuntu

ifuse <mount_point> --root   - Only add --root if the phone is jail broken. Only jail broken phones can access the root / location.
ifuse /mnt/iPhone --root



Wednesday, July 25, 2012

Install Wireless / USB HP Printer in Ubuntu



Installing/Verifying the Drivers

The HPLIP software

HPLIP is an interface developed by HP to give Linux printing, scanning and fax functionalities.
The last version available at the moment (2.8.9) supports 1.445 models of HP printers and most probably the printer you're going to install is listed there.
To be sure of this, you just need to check the page that contains the entire list of the supported printers.
After having identified your model of printer in the list, pay attention to the first parameter, Min. HPLIP Version, which represents the minimum version of HPLIP that you need.
Every Ubuntu system contains a version of HPLIP (i.e. mine is the 2.8.2) by default. To verify this, type the following command on terminal:

dpkg -l hplip


You shall get a message similar to this:


Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                 Version                              Description
+++-====================================-====================================-========================================================================================
ii  hplip                                3.11.7-1ubuntu3.1                    HP Linux Printing and Imaging System (HPLIP)


If in the first column you read the "ii" characters, it means that the version showed in the third column is currently installed on your computer.
If the installed version of HPLIP is lower that the minimum version that you require, keep reading, or skip to the next paragraph about the installation of a printer.


Installing the Printer

Enter `sudo hp-setup -i` and follow the instructions accordingly. -i is for interactive mode.
Here, I have listed how my interactive conversion with hp-setup went. :-) I needed to setup a printer via wireless. Setting up the USB connection is also pretty easy.



$ sudo hp-setup -i

HP Linux Imaging and Printing System (ver. 3.11.7)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

(Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.)


--------------------------------
| SELECT CONNECTION (I/O) TYPE |
--------------------------------

  Num       Connection  Description                                            
            Type                                                                
  --------  ----------  ----------------------------------------------------------
  0*        usb         Universal Serial Bus (USB)                              
  1         net         Network/Ethernet/Wireless (direct connection or JetDirect)
  2         par         Parallel Port (LPT:)                                    

Enter number 0...2 for connection type (q=quit, enter=usb*) ? 1

Using connection type: net

Using device: hp:/net/HP_LaserJet_Professional_M1212nf_MFP?zc=NPI915B32


Setting up device: hp:/net/HP_LaserJet_Professional_M1212nf_MFP?zc=NPI915B32



------------------------
| PLUG-IN INSTALLATION |
------------------------


HP Linux Imaging and Printing System (ver. 3.11.7)
Plugin Download and Install Utility ver. 2.1

Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

(Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.)

/
-----------------------------------------
| PLUG-IN INSTALLATION FOR HPLIP 3.11.7 |
-----------------------------------------

  Option      Description                                    
  ----------  --------------------------------------------------
  d           Download plug-in from HP (recomended)          
  p           Specify a path to the plug-in (advanced)        
  q           Quit hp-plugin (skip installation)              

Enter option (d=download*, p=specify path, q=quit) ? d

--------------------------
| DOWNLOAD CONFIGURATION |
--------------------------

Checking for network connection...
Downloading configuration file from: http://hplip.sf.net/plugin.conf
Downloading configuration: [\                                                                                                                      ] 0%  

-------------------
| DOWNLOAD PLUGIN |
-------------------

Checking for network connection...
Downloading plug-in from: http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-3.11.7-plugin.run
Downloading plug-in: [****************************************************************************************************************************] 100%  8.0 KB   Receiving digital keys: /usr/bin/gpg --no-permission-warning --keyserver pgp.mit.edu --recv-keys 0xA59047B9


----------------------
| INSTALLING PLUG-IN |
----------------------

Verifying archive integrity... All good.
Uncompressing HPLIP 3.11.7 Plugin Self Extracting Archive.........................................

HP Linux Imaging and Printing System (ver. 3.11.7)
Plugin Installer ver. 3.0

Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Plug-in version: 3.11.7
Installed HPLIP version: 3.11.7
Number of files to install: 36

You must agree to the license terms before installing the plug-in:

LICENSE TERMS FOR HP Linux Imaging and Printing (HPLIP) Driver Plug-in                                                                                                


These License Terms govern your Use of the HPLIP Driver Plug-in Software (the "Software"). USE OF THE SOFTWARE INCLUDING, WITHOUT LIMITATION, ANY DOCUMENTATION, IS    
SUBJECT TO THESE LICENSE TERMS AND THE APPLICABLE AS-IS WARRANTY STATEMENT. BY DOWNLOADING AND INSTALLING THE SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THESE TERMS. IF
YOU DO NOT AGREE TO ALL OF THESE TERMS, DO NOT DOWNLOAD AND INSTALL THE SOFTWARE ON YOUR SYSTEM.                                                                      


1. License Grant. HP grants you a license to Use one copy of the Software with HP printing products only. "Use" includes using, storing, loading, installing, executing,
and displaying the Software. You may not modify the Software or disable any licensing or control features of the Software.                                            


2. Ownership. The Software is owned and copyrighted by HP or its third party suppliers. Your license confers no title to, or ownership in, the Software and is not a sale
of any rights in the Software. HP's third party suppliers may protect their rights in the Software in the event of any violation of these license terms.              


3. Copies and Adaptations. You may only make copies or adaptations of the Software for archival purposes or when copying or adaptation is an essential step in the    
authorized Use of the Software. You must reproduce all copyright notices in the original Software on all copies or adaptations. You may not copy the Software onto any
public network.                                                                                                                                                        


4. No Disassembly. You may not Disassemble the Software unless HP's prior written consent is obtained. "Disassemble" includes disassembling, decompiling, decrypting, and
reverse engineering. In some jurisdictions, HP's consent may not be required for limited Disassembly. Upon request, you will provide HP with reasonably detailed      
information regarding any Disassembly.                                                                                                                                


5. No Transfer. You may not assign, sublicense or otherwise transfer all or any part of these License Terms or the Software.                                          


6. Termination. HP may terminate your license, upon notice, for failure to comply with any of these License Terms. Upon termination, you must immediately destroy the  
Software, together with all copies, adaptations and merged portions in any form.                                                                                      


7. Export Requirements. You may not export or re-export the Software or any copy or adaptation in violation of any applicable laws or regulations.                    


8. U.S. Government Restricted Rights. The Software has been developed entirely at private expense. It is delivered and licensed, as defined in any applicable DFARS,  
FARS, or other equivalent federal agency regulation or contract clause, as either "commercial computer software" or "restricted computer software", whichever is      
applicable. You have only those rights provided for such Software by the applicable clause or regulation or by these License Terms.                                    


9. DISCLAIMER OF WARRANTIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, HP AND ITS SUPPLIERS PROVIDE THE SOFTWARE "AS IS" AND WITH ALL FAULTS, AND HEREBY      
DISCLAIM ALL OTHER WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF TITLE AND NON-INFRINGEMENT, ANY IMPLIED
WARRANTIES, DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE, AND OF LACK OF VIRUSES ALL WITH REGARD TO THE SOFTWARE. Some                
states/jurisdictions do not allow exclusion of implied warranties or limitations on the duration of implied warranties, so the above disclaimer may not apply to you in
its entirety.                                                                                                                                                          


10. LIMITATION OF LIABILITY. Notwithstanding any damages that you might incur, the entire liability of HP and any of its suppliers under any provision of this agreement
and your exclusive remedy for all of the foregoing shall be limited to the greater of the amount actually paid by you separately for the Software or U.S. $5.00. TO THE
MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL HP OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,                                              
INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF PROFITS OR CONFIDENTIAL OR OTHER INFORMATION, FOR BUSINESS          
INTERRUPTION, FOR PERSONAL INJURY, FOR LOSS OF PRIVACY ARISING OUT OF OR IN ANY WAY RELATED TO THE USE OF OR INABILITY TO USE THE SOFTWARE, OR OTHERWISE IN CONNECTION
WITH ANY PROVISION OF THIS AGREEMENT, EVEN IF HP OR ANY SUPPLIER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND EVEN IF THE REMEDY FAILS OF ITS ESSENTIAL    
PURPOSE. Some states/jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so the above limitation or exclusion may not apply to
you.                                                                                                                                                                  

Do you accept the license terms for the plug-in (y=yes*, n=no, q=quit) ? y

Done.

Done.

---------------------
| PRINT QUEUE SETUP |
---------------------

warning: One or more print queues already exist for this device: 59-4th-floor-HP-LaserJet-M1212nf.

Would you like to install another print queue for this device (y=yes, n=no*, q=quit) ? y

Please enter a name for this print queue (m=use model name:'HP_LaserJet_Professional_M1212nf_MFP'*, q=quit) ?
Using queue name: HP_LaserJet_Professional_M1212nf_MFP
Locating PPD file... Please wait.

Found PPD file: drv:///hpcups.drv/hp-laserjet_professional_m1212nf_mfp.ppd
Description:

Note: The model number may vary slightly from the actual model number on the device.

Does this PPD file appear to be the correct one (y=yes*, n=no, q=quit) ?
Enter a location description for this printer (q=quit) ?
Enter additonal information or notes for this printer (q=quit) ?4th floor printer

Adding print queue to CUPS:
Device URI: hp:/net/HP_LaserJet_Professional_M1212nf_MFP?zc=NPI915B32
Queue name: HP_LaserJet_Professional_M1212nf_MFP
PPD file: drv:///hpcups.drv/hp-laserjet_professional_m1212nf_mfp.ppd
Location:
Information: 4th floor printer


-------------------
| FAX QUEUE SETUP |
-------------------


Please enter a name for this fax queue (m=use model name:'HP_LaserJet_Professional_M1212nf_MFP_fax'*, q=quit) ?q
OK, done.

Sunday, July 8, 2012

How to share 3G Internet connection on Ubuntu

I've been looking everywhere, reading tens of articles on how to share internet connection using WiFi via my 3G internet connection. I wanted connect my iPhone 3GS to Ubuntu Wifi such that I can download apps larger than 20MB easily. Finally, I found this post in ubuntu forum that fixed the my issue. Things were straight forward, so nothing big to worry. Though the post is for 9.10, it worked in Ubuntu 11.10 for me. http://ubuntuforums.org/archive/index.php/t-1384085.html

I'd like to keep things in one place for later reference, so I'm stating it here with some customizations.

I tried this with Huawei E173 3G modem, and the Wireless connection of my laptop.
Here,
3G modem -  accesses internet.
Wireless (WiFi) AdHoc network - for sharing the internet connection with other computers.

You'll need only need Firestarter. The Operating System I tested is Ubuntu 11.10 (Oneiric Ocelot).

Type in the terminal
`sudo apt-get install firestarter`


This guide assumes a basic understanding of ip addresses...gateways dns servers etc.

This solution does not provide dhcp ....but hey I don't want that anyway.

Make sure your 3G modem, and wireless card already works (may be on windows or OS X).... if not install their software and activate your card...verify it works etc...

Now plug the card into the ubuntu box and set it up with network-manager. Right click the connection and select new cdma modem (or similar) and input your details as neccesary. This is for the MODEM.

Once connected unplug any ethernet...turn off any wifi and verify you have internet access.

Then right click the network manager icon and select "Create New Wireless Network" to create an ad-hoc wifi connection. There, given a network name you prefer (say MyWifi). Set Wireless security to "WEP 40/128-bit...", and give a 5 letter key/password (0-9A-Z).

Now, go to network-manager -> "Edit Connections". In the Wireless tab, you'll find your wireless connection (MyWifi). Select it, and click on edit.

Then click ipv4 settings tab

Change from dhcp to manual and enter the following details

address = 192.168.13.1
netmask = 255.255.255.0
leave gateway blank

That's done. Now, start firestarter. 
`gksudo firestarter`

Use the wizard and select ppp0 as your internet device. You may want to set `IP Address assigned via DHCP` for this connection if that's the case. Check with your ISP for more info.

Select connection sharing and then use wlan0 as your sharing device. This is the your wifi network device. We don't need dhcp here. 

Connect to MyWifi connection, and to your 3G broadband connection.

Now, start firestarter firewall...

Now configure your iPhone/another computer to use this gateway in Static tab ..

set your ip address to be 192.168.13.101
netmask 255.255.255.0
router (or default gateway) 192.168.13.1

IMPORTANT you need to enter DNS servers... I used Google DNS. You may use openDNS if you need. The Google DNS I set was.

8.8.8.8

If you really want OpenDNS, register for their free service, and use these DNS addresses. 208.67.222.222,208.67.220.220

Thats it!

Save everything and you should have a working internet connection that is shareable! obviously everyone needs their own ip address and setup is a little cumbersome but hey it works!

if you want dhcp you can probably get this to work using ubuntu server, wvdial, and the great help by googling ubuntu easyrouter.

but hey this works for me....and I like having network manager deal with the usb modem.

Have a good day. Welcome your thoughts/questions in the comments section. :-)

Saturday, June 9, 2012

Speed Up 3G Broadband in Sri Lanka



Here I'm providing an optimal solution to have a faster 3G broadband connection in Ubuntu/Linux. As  many of you have experienced, the connection speed is really bad especially at peak times in most of the 3G networks. Here I'm providing  a set of configurations I have tried that seems to work great. This way, you will be able surf only on 3G (UMTS/HSPA) without falling back to slower protocols like EDGE. Further, this will reduce the domain look-up time, and speed up authentication.

The settings were configured using network-manager that comes with Ubuntu by default. The network-manager is available at the systray (top-right corner of top panel). The instructions are for Dialog Service Provider in Sri Lanka, but apply for other providers with minor changes. I have adopted some of these using resources 1, and 2.

Now, click on the network-manager icon in systray, and go to "Edit Connections...". This will open up a dialog box that looks like the following. I have selected the "Mobile Broadband" tab here.

If you want to optimize an existing connection, click on Edit to open the edit window. Otherwise, create a new connection which will open the edit window as well.




There are three tabs which you can change.

  1. PPP Settings tab - Click on "Configure Methods...". Uncheck all the checkboxes except PAP. Click on OK.




2. Mobile Broadband tab - For Type: field, select 3G (UMTS/HSPA). The Number field should be "*99#", and the APN should be Dialogbb which are the defaults.




3. IPv4 Settings tab - For DNS Servers, enter 8.8.8.8, 8.8.4.4 . These are for the DNS service provided by Google. There are alternatives like OpenDNS as well. Resources for these available in web, and these two are quite reliable.







Sunday, March 13, 2011

How to run Java applets in Google Chrome under Ubuntu


I found that Google Chrome doesn't auto-detect Java applets in Linux. Following commands will link the Java applet plugin to Chrome. Enter these in Terminal. Make sure you put the correct path for the JRE in /usr/lib/jvm/<jdk1.6.0_22>/jre/lib/i386/libnpjp2.so.

sudo mkdir /opt/google/chrome/plugins
cd /opt/google/chrome/plugins
Now, link the plugin  libnpjp2 to /opt/google/chrome/plugins directory by running the following. Double check whether the JRE path is correct.
sudo ln -s /usr/lib/jvm/jdk1.6.0_22/jre/lib/i386/libnpjp2.so

Like to know whether this solution works in other Linux distros as well. Let us know in the comments.

Friday, July 2, 2010

Install/Update Mozilla Firefox 3.6.6


Mozilla launched a new update for Mozilla Firefox. This new release is a update for crash protection feature, which was first introduced in Mozilla Firefox 3.6.4. Mozilla blog says the crash protection feature,

"protects Windows and Linux users from crashes and freezes caused by third party plugins such as Flash and Silverlight. When a plugin crashes, users can reload the Web page to restart the plugin and continue browsing. When a plugin freezes, making the whole browser unresponsive, Firefox 3.6.4 terminates the unresponsive plugin after waiting 10 seconds. These changes were tested with a beta audience of close to one million users."
 I just installed on my machine, which runs Ubuntu 10.04 Lucid Lynx. I found this nice article which describes how to do a update for it: How to update Firefox to 3.6.6 on Ubuntu 10.04, Lucid Lynx

NOTE: When updating if you don't want to have all updates (for other packages) you should uncheck them. This will reduce the size of the download. The easiest way to uncheck all at once is double clicking the update titles in "Update Manager". For example: "Recommended Updates", "Proposed Updates" etc. Then, just click on check-boxes Firefox packages.
 

Saturday, May 15, 2010

Fix for 'Ubuntu Lucid Touchpad not working'

Ubuntu 10.04 is intended as a Long Term Support (LTS) release, but surely it's not less of bugs. Touchpad stopped working when disable button is pressed, is surely one major bug of Lucid by usability wise. My friend Subash and I both faced this problem when we install Lucid. We both have HP Pavillion Series Laptops. In theory, this should work on any laptop/touchpad. Based on user comments, this fix was successful in both Acer and Lenovo, (and of course HP). Does this applies to later versions of Ubuntu as well? Just let me know. I'm using Gentoo Linux now for a change!

There's a fix for Ubuntu 11.04, 11.10 (Unity) as well. Read to the end. 

The Synaptic Touchpad driver of touch-pad is installed, and it's Recognized. The problem is sometimes it gets disabled for no reason. Subash's Touchpad didn't work just after the fresh install, forcing him to reinstall again, as the reason was unclear at the moment. Later we found the problem and the fix.

What we have to do is enable the touchpad by setting the touchpad_enabled property to true. Here's the command to do it in one step.
gconftool --type Boolean --set /desktop/gnome/peripherals/touchpad/touchpad_enabled true
This changes the touchpad_enabled property to true in ~/.gconf/desktop/gnome/peripherals/touchpad/%gconf.xml file. This will fix the issue.

Alternative to above, you may edit the file manually and restart gnome. Change the touchpad_enabled property to true (see screenshot), and enter following command in terminal:
killall gnome-session



As I've said, this has fixed the issue in my laptop, HP DV-5, Synaptic Touchpad, Ubuntu 10.04. Share the model of your laptop as well if this fix worked for you too.

The above solution is for GNOME, and probably won't work on Unity Desktop Environment (ie. Ubuntu 11.04, 11.10). For that, try the following.

  • unity --replace
Wait for few minutes until it loads all back in to place. If this didn't work, try the following command. My issue was solved by the following command on Ubuntu 11.10. But I tried the above one first.


  • sudo modprobe -r psmouse && sudo modprobe psmouse

Does this fix work for you? I haven't extensively checked this. So, value your feedback.

UPDATE 1: After the touchpad issue, it's quite difficult to navigate. So, I created a simple script for it. Save it to your home(~/)  folder. Then, you can run it by following command from terminal.
sh ~/touchpad-fix.sh
Download touchpad-fix.sh

(You can get the terminal by pressing ALT+F2. Type "gnome-terminal" without quotes and press Enter. Or just press Ctrl + Alt + T)

UPDATE 2: Sometimes, when touchpad disable button is pressed, Keyboard starts to not work. But, still (fortunately) some key combinations works. The reason for keyboard not functioning is unknown for me, but there's a workaround for this problem. The work around which fixed this keyboard issue is the following.

That is, go to console tty1 and come back! Strange, but it does work.
  • Press CTRL+ALT+F1  (This will bring you out of X Window for a moment)
  • Then, CTRL+ALT+F7  (This brings back the X )

Wednesday, May 12, 2010

Fixing the error in installing Maven plugin in Netbeans 6.8

I yesterday installed Ubuntu family newest OS release Ubuntu Lucid Lynx (Ubuntu 10.04) and then gone through the step of installing softwares. (Tried upgrade option of Ubuntu from Karmic Koala, but got screwed up! anyway it's another story.)
Ubuntu Lucid comes with Netbeans version 6.8. But there's a bug in it which prevents users from installing Maven plugin in it. It gives an error saying,
 Some plugins require plugin Utilities API to be installed. The plugin Utilities API is requested in version >= 8.0 but only 7.31.1.1 was found.

 This is a bug Netbeans and it is reported in Launchpad. Luckily, a workaround is available. It's listed under #2. What you have to do is,
1. Click on "Settings" tab in "Plugins"
2. Activate "NetBeans" (if not activated) and deactivate "Ubuntu Specific" (or "NetBeans for Ubuntu" in case of 6.8-0ubuntu4)
3. Go back to "Available Plugins" and Reload the catalog.
4. Then install Maven.
 

Wednesday, March 10, 2010

Install IntelliJ IDEA on Linux

Here's a simple way to install IntelliJ IDEA on Ubuntu. I've done this on all Ubuntu Karmic Koala, Lucid Lynx and Maverick Meerkat. This worked just fine on Gentoo Linux too.

1). Install Java (Use Sun JDK. OpenJDK is NOT recommended as the JDK.)
sudo apt-get install sun-java5-jdk
It seems sun-java5-jdk is no longer available now. Refer Oracle Java SE Downloads for Linux and it's installation instructions. Keep the path in your memory; you'll need it when setting up $JDK_HOME path variable.

Then, to make sure that it is installed properly, type
java -version
if the version shows, then it is installed successfully.

2) Now, install IDEA
Download IntelliJ IDEA from the below link
 http://www.jetbrains.com/idea/download/index.html#linux
 Unpack the downloaded archive (ideaIU-9.0.3.tar.gz) by,
     tar xfz ideaIU-9.0.3.tar.gz
(match the file name to your version!)

 Move the extracted archive to /usr/lib
     sudo mv idea-IU-95.429 /usr/lib

3) Configure PATH variables for JDK_HOME and IDEA
     sudo gedit ~/.bashrc
Add following for JDK_HOME to the file, make sure to change the path to reflect your java installation directory.
export JDK_HOME=/usr/lib/jvm/java-6-sun
Append the line for PATH variable with this, /usr/lib/idea-IU-95.429/bin . Finally, it should look like this.
export PATH=$PATH:/usr/lib/idea-IU-95.429/bin
Now, run `source ~/.bashrc` to take effect the changes.

4) Run IDEA  by entering following in the terminal
   idea.sh (or sh idea.sh)

NOTE: If you get permission denied error, then you will have to set the correct permissions to idea.sh file by `sudo chmod 755 /usr/lib/idea-IU-95.429/bin/idea.sh

For easier execution, create a "Custom Application Launcher" at top panel. Access it via; right-click the top Panel -> "Add  to Panel" -> double click "Custom Application Launcher". Browse and give an icon if you like. Then, use a command similar to,
sh /usr/share/idea-IU-95.66/bin/idea.sh


Custom Application Launcher Properties




If you have any problem in setting up this, drop a comment below. Well, even if you got right, just tell me so. Love to hear that too! :). Good Luck!
 

Friday, February 12, 2010

Make Windows XP drivers work under Linux through ndiswrapper

Ndiswrapper is a wrapper that can be used to wrap windows drivers enabling them to use under Linux environment. This is available for drivers of wireless network devices. The supported devices can be found here.

Here, I will tell you how to configure D-Link DWA-120 wireless USB adapter to work under Linux. I did this in Ubuntu 9.10. As I've seen this should work for D-Link DWA-110 adapter as well.

  1. Plug the device
  2. Enter following commands in the terminal.
sudo su
-Perform following in root.
apt-get update
apt-cache search ndiswrapper
-In it you can find ndiswrapper-common, ndiswrapper-utils-1.9 packages. Install them by,
apt-get install ndiswrapper-common
apt-get install ndiswrapper-utils-1.9
-Change the folder to where the windows XP drivers for your network device is.
ndiswrapper -i filename.inf
-Give the name of .inf file for the driver. For DWA-120 it is netA5AGU.inf
ndiswrapper -m
modprobe ndiswrapper
Add the line "ndiswrapper" (without quotes) at the end of the file /etc/modules using command "sudo gedit /etc/modules" to load the driver every time the system loads. If you do not want to load the driver automatically, do not edit this file. Instead, enter following command at terminal to turn on the adapter.
sudo modprobe ndiswrapper
3. reboot the machine

All done. You can check whether your device working by typing "iwconfig".


This is how I enabled my wi-fi adapter to connect to wi-fi network. Does this helped you to as well? Any particular issues you encountered? Let us know in the comments.