Archive

Archive for the ‘Ubuntu’ Category

Copying Keystore files across computers corrupting the keystore file

March 1st, 2011

I had a java project in my ubuntu netbeans, that used a keystore file created using keytool for secured communication with the server. When i deployed the project into a windows server it didnt work. When I tracred i was getting this exception

java.io.IOException: Keysize too big

Some times googling just doesnt work. I know only sometimes, most times it helps. I thought, it could be some JVM memory issue, then thought Windows OS issue. Finally decided to list the keystore using keytool in the server itself. I got the error,

keytool: java.io.IOException: Keysize too big

Now came to a conclusion its the keystore file is corrupted. WIth some help from IRC and stack over flow narrowed the problem. It was the way i copied the file to the server, i had used normal TEXT MODE FTP, which will mess the keystore file. As TEXT MODE copies line by line, few characters will be interpreted wrongly like ‘\n’. Using sftp, scp or binary mode is best. I used scp and it worked. I couldnt just accept i had been spending hours to trace the issue. Let me call it a day.. cheers.

A Nice reasoning in stackoverflow for my post: FTP programs try to convert between different line-ending modes, so one 10 byte on the unix side gets converted to one 10 and one 13 byte on the windows side – by Pa?lo Ebermann

http://stackoverflow.com/questions/5142396/java-io-ioexceptoin-keysize-too-big-in-windows-2003-server

Java, Programming, Ubuntu ,

Huawei Modem not detecting in Ubuntu 10.04 Lucid – Fix

July 17th, 2010

I always like to do thinks in terminal, let me explain you in my way.  Use lsusb command to find if the modem is detected.

If detected use lsusb -v, to find the product id and vendor id of the modem.

In my case I am using Huawei EC168C – the vendor id is “12d1″ and product id is “1446″.

Open the terminal and follow the instructions

#sudo gedit /etc/udev/rules.d/15-huawei-115x.rules

Now paste the following content as follows and save.

SUBSYSTEM==”usb”,
SYSFS{idProduct}==”1446″,
SYSFS{idVendor}==”12d1″,
RUN+=”/lib/udev/modem-modeswitch –vendor 0x12d1 –product 0×1446 –type option-zerocd”

Save the file. Unplug and plug the modem. Now right click the network icon , goto Mobile Broadband and click Edit. Enter the phone and username.

In my case I am in Zantel network. The phone number is #777 and username is @zantel.com. Click the network icon again and click the detected modem to enjoy surfing.

Ubuntu , ,

Ubuntu 9.10 Wireless Issue Dell 1330 or BCM4312

January 1st, 2010

To solve this issue you should make sure you have installed the right driver and also you should make sure you removed all the conflicting drivers. Because if there is any conflicting drivers installed it will not allow the kernel to load the right driver.

Packages to be intalled

bcmwl-kernel-source

bcmwl-modaliases

Packages that should not be installed or removed

b43-fwcutter

linux-backports-modules-karmic

linux-backports-modules-karmic-generic

actually no backports-modules need not be installed.

Problems solved

  • detecting wireless connections, but not able to connect.
  • Wireless not working
  • wireless is enabled but doesnt work.

Linux, Ubuntu , ,

Connecting Zantel’s Z-Connect modem to Internet in Linux(Ubuntu)

December 27th, 2009

Z-Connect is one of the fastest wireless modem in Tanzania. Connecting it in Linux was a challenge. Here is the configuration file to connect to the Internet in Linux. I am using Ubuntu.

  • In your terminal give the command

#wvdialconf

  • Edit the file /etc/wvdial.conf with your favorite text editor and overwrite the entire contents with the following

Init2 = AT+CRM=1
Dial Command = ATM1L3DT
Modem Type = Analog Modem
Phone = #777
ISDN = 0
Username = “@zantel.com”
Init1 = ATZ
Password = ” ”
Modem = /dev/ttyUSB0
Baud = 519600

  • Now come to the terminal and type the command

#wvdial

Enjoy Browsing.

Bash, Internet, Linux, Ubuntu ,

Installing Ruby on Rails in Ubuntu 8.04(Hardy)

January 31st, 2009

Ruby on Rails is a web application programmers based on Ruby. It helps the programmers creat best web applications easily.

Here are the steps to set up Ruby on Rails in your Ubuntu or Debian based systems

Step 1: First step is to install some inportant packages that are recured,

sudo apt-get -y install build-essential libssl-dev libreadline5-dev zlib1g-dev

Step 2: Install ruby

RUBY="ruby-1.8.6-p111" //Current stable version

wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/$RUBY.tar.gz

tar xzf $RUBY.tar.gz cd $RUBY

./configure --prefix=/usr/local --with-openssl-dir=/usr --with-readline-dir=/usr –with-zlib-dir=/usr

make clean

make

make install

make install-doc

make clean will clear any make files in that folder, previosly created that was configured without right options Checking whether ruby is installed properly

ruby -ropenssl -rzlib -rreadline -e "puts :success"

Step 3: Install Gem

Gem is a installer similar to apt, for ruby and ruby related packages

RUBYGEMS="rubygems-1.0.1" //Current stable version
wget http://rubyforge.org/frs/download.php/29548/$RUBYGEMS.tgz
tar xzf $RUBYGEMS.tgz
cd $RUBYGEMS
/usr/local/bin/ruby setup.rb
	

Step 4: Install Rails

gem install rails //This will install rails successfully.

Or gem install <paths to rails gem file>

Main Errors during Installation:

Error 1:

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’: no such file to load — zlib (LoadError)

using the following step for configuring ruby, that is before make, will remove this problem

./configure --prefix=/usr/local --with-openssl-dir=/usr --with-readline-dir=/usr –with-zlib-dir=/usr

Error 2:

no such file to load — mysql

undefined symbol: rb_Digest_MD5_Init – /usr/local/lib/ruby/1.8/i686-linux/digest/md5.so (LoadError)

Installing the mysql dev package and mysql library for ruby will clear this error,

sudo apt-get install libmysqlclient15-dev

sudo gem install mysql

Applications, Ubuntu

Installing XMMS in Ubuntu Hardy

January 6th, 2009

XMMS2 is not a replacement to XMMS in the Ubuntu Hardy (8.04)  repo. There is an offical ubuntu xmms pacakage, unfortunately wich is not available in Ubnuntu repo. We have to manually download and install it. You can download from the link

https://launchpad.net/ubuntu/hardy/i386/xmms/1:1.2.10+20070601-1build2

There are both soruce packages and ubuntu build deb packages in the above link…
But inturn dont mistake that installing XMMS2 from the repo is the XMMS player. After intallation there may be some combatibility problems. But there wont be any probleming in playing songs.

Applications, Ubuntu ,

Samba File sharing between two ubuntu systems in LAN

November 3rd, 2008

With two systems connected in LAN is so easy to share files and folders in Ubuntu. Here i tell you how to share files and folders with samba file server between two ubuntu systems with few clicks. The Ubuntu Iam using here is Hardy.

The system that has source contents to be shared should have Samba server, (That can be installed in course of the procedure how to share). And the remote system that wish to access the source contents should have the Samba client. Samba client will installed be default in ubuntu, if not install it with the command

$sudo apt-get install smbclient

Here comes the procedure how to share.

Soruce Side

  1. On the source system login to ubuntu, right click on the folder you wish to share and select ‘Sharing Options’.

  2. In the Dialog box that apears select ‘Share this Folder’ check box, you will be prompted to install a service. Clicking on Install will open synaptic package manager and install the Samba Server packages.

  3. On successful Installation of the packages, the part in the server side is over.

    This will create a share automatically in Samba server on the the username you have logged in (here ‘rosario’) with its password.

Destination Side

  1. Check whether the smbclient package is installed, if not install it with the above command.

  2. Use the command like
  3. $sudo smbclient \\\\192.168.1.33\\photos -U rosario

    • where rosario is the username of the source system,
    • 192.168.1.33 is the IP address of the source system
    • photos is the name of the folders shared in the source system(In small characters)
  4. The above command first will prompt the local system password as sudo is used. And then it will prompt for the password of the remote samba server for the username rosario
  5. On giving the right password, it will take to the samba promt.

Smb: \>

Some usefull commands

  • help- To know all possible commands
  • dir- To list out all the shared directories, or contents inside the current directory
  • cd- Change Directory
  • get- To copy a specified file from the source system to the local system
  • put- To copy contents from local system to the server system

Enjoy Easy File Sharing With Ubuntu…

Linux Networking, Ubuntu ,

Set GRUB Password after the Installation of any Distro

October 1st, 2008

If you forgot to set the password during the time of installing the linux distribution, and if you feel to set the password for your grub boot loader. Then here is the answer…

Switch to root using ‘su’ command and execute ‘grub’ command in terminal/konsole. Prompt will change to ‘grub>’
execute md5crypt to generate password hash.

grub> md5crypt

it will prompt you for password, enter the password which you are going to set for GRUB. it will display encrypted password hash.

Password: *******
Encrypted: $1$X2jZi$KeCC6NuRp0BJDt32jCvnw0

note down encrypted password hash or copy it and exit grub mode using the grub command.

grub> quit

Now edit the
edit /boot/grub/menu.lst file and insert encrypted password above the “title” lines or insert near commented examples of password line.

password –md5 <password-hash>
## ## End Default Options ##
title        Ubuntu 8.04.1, kernel 2.6.24-19-generic

save edited file and reboot.

Bash, BootLoader, Ubuntu ,

nVidia Driver Problem with Hardy Solved- EnvyNG

September 30th, 2008

Hi folks, if you are still in a head ache of searching a driver for your nvidia graphics card, your head ache is solved here. Iam using my Dell XPS 1530 Lap, and the problem with the driver installation for nvidia graphics card is solved here.

EnvyNg in a package that searches the packages and required driver and installs it, reducing our head ache of finding a right driver.

Update the repositories list in Synaptic Package Manager, using the command

$sudo apt-get update

Now install the following the packages

  • envyng-gtk
  • envyng-qt
  • envyng-core

using the command

  • $sudo apt-get install envyng-gtk
  • $sudo apt-get install envyng-qt
  • $sudo apt-get install envyng-core

Now go to the Main menu, Applications->SystemTools->EnvyNG, and select whether nVidia or ATI and click Apply. Your driver will be installed and restart your computer.

Other debian derivative distros and other ubuntu versions donwload the envy package clicking below.

Click here to Download

Applications, Ubuntu ,

Fight with Ubuntu Hardy for a complete night

September 12th, 2008

While i was working with my hardy in Virtual Box, after installing few pacakages my hardy started mis behaving, my lap was looking fine, but i couldnt open any of my softwares not even i could open my Open Office writter in user mode. But i could open them in terminal with sudo. So i restarted my lap. After booting in, my hardy displayed a message like

Loading, pease wait…
Kinit: name_to_dev_t(/dev/disk/by-uuid/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)= sda(8,8)
kinit: No resume image, doing normal boot…

After which, i will get a login message, which would login to shell.

I tried so many things, i could solve the problem. I switched on my desktop and connected net and went to IRC to #ubuntu channel for help, but in vain. And then googled so long to get so many solutions but none of them worked.

Solutions were,

  1. $fdisk -l | grep swap

$swapoff /dev/sdax

$mkswap /dev/sdax

$update-initramfs -u

  1. $sudo aptitude install update-usplash-theme usplash-theme-ubuntu

$sudo update-usplash-theme usplash-theme-ubuntu

  1. $sudo apt-get install ubuntu-desktop

None of the solutions worked, in IRC only one person gave a response, he too told to use a rescue cd. While googling i learned few things,

What is Resume Image?

Resume image is nothing but a file that stores the state of the machine while shutting down or suspending and is kept in the swap space while shutting down or suspending and gets back to the same state when rebooted of resumed.

So finally after trying so hard last my patience and decided to reinstall, took the Ubuntu 8.04 LTS dvd and installed it over night. After installing it and all my required packages from net, i say the clock it was 5.30 am. Went to bed…

Hi viewers do you have solution….

Ubuntu