Archive for the ‘System Configuration’ Category

Bed Setup: Kubuntu 12.10 32-bit, AMD Athlon x64 X2 processor, ASUS Motherboard, HP Scanjet 2410 (Another last generation hardware!!! :P)

Friction in your System: You connect the scanner to your system, and launch some imaging application. However, you fail to see your scanner listed out in your scan/imaging hardwares’ list.

Cranking Your System:

Well, there are lots of sources out there to get your scanner to work. However, they could mean that you get your hands dirty installing many packages, editing various conf files and so on. However, this is a one step process. All you gotta do is install xsane imaging application. The following code should do the trick.

sudo apt-get install xsane

DYS now:

Connect your scanner now and launch the xsane application from your favorite application launcher and you are ready to scan your first page on Ubuntu.

Under the Bonnet:

As you launch the xsane scanning application, the application looks for the connected scanners and Scanjet 2410 in this case. And bam, you are presented with a preview/scan image page.

Advertisements

Welcome to the 1st post of #DYS series.

Bed Setup: Kubuntu 12.10 32-bit, AMD Athlon x64 X2 processor, ASUS Motherboard, Lexmark Z603 InkJet printer (I know this printer is a generation old. :))

Friction in your System: You connect the printer to your system, and try attempt to print a doc, but you fail to see your printer configured in printer configuration settings. If you have connected your printer for the 1st time, you might have also come across printer configuration dialog with Lexmark in it, but you don’t get to pick z600 series from it. It’s not listed there.

Cranking Your System:

1. Install this Debian package.

2. Launch ‘System Settings’ from the Application Launcher.

system_setting

3. Navigate to ‘Printer Configuration’ dialog from the ‘Hardware’ section.

system_setting_dialog

4. Click on the ‘New Printer’ button from the ‘Add New Printer’ section.

printer_configuration

5. Select ‘Lexmark Z600 Series’ from the ‘Select Connection’ column and click on ‘Forward’.

select_connection

6. Select ‘Select printer from database’ section and select ‘Lexmark’ from the list box and click on ‘Forward’.

select_printer_from_db

7. Select ‘Z600 v1.0-1’ from ‘Models’ list box and ‘Lexmark Z600 v1.0-1 [en]’ from the ‘Driver’ list box, click on ‘Forward’ and complete the printer configuration.

models_driver

You should find ‘Lexmark_Z600_Series’ added to the ‘Local Printer’ item in the list box in the ‘Printer Configuration’.

lexmark_z600_series

8. Click on ‘Lexmark_Z600_Series’ and check ‘Enable’ and ‘Accepting’ options in the ‘Printer Status’ section. Check ‘Sharing’ option as well if you want the printer to be available to other users connected to your system.

DYS now:

1. Click ‘Print Test Page’ option get a glimpse of your printer working.

Below is a snapshot of my printer and test page.

printer

2013-03-23 15.56.10

Demo to code and save a Python file, and execute the Python Program, all via Ubuntu Terminal or Shell prompt.

Video Outline:
– Create a sample directory structure
– Write the Python program by making use of “vim” editor
– Execute the Python program

Drop in your comments/suggestions below and I should try incorporating them in my upcoming videos and Please DO NOT FORGET TO SUBSCRIBE to my Channel “HashBoard“. 🙂

Outline of the video:

  • Extracting the downloaded tar file to an appropriate directory of your system
  • Building the extracted files
  • “Hello World” program

Additional Tips not covered in the Video:

Running Python 3:

  • Launch the Terminal
  • Key in “python3” without quotes at the Terminal prompt. This should ideally launch Python 3.2.3

Note: The video instructs you to key in “python” at the Terminal prompt. This launches Python 2.7.3.

This is my first narrative video. So please be gentle with your comments. 🙂

Thank you for watching the video. I appreciate your time.

Back again after a long pause. I was in process of installation of Netbeans 7.1.2 yesterday (about half an hour back before this post :). Its 12:07 in the midnight when I’m keying in this post).

Every time I tried to run the Netbeans installer, I came across the warning message stating that the JDK was not detected. I exit the installation wizard, made a couple of restarts after running the apt-get updates in the terminal. However, the installer fails to detect the JDK installed in the system.

Note: The JDK installed in in Ubuntu 12.04 by default is OpenJDK.

Then finally concluded that will go ahead installing the tried/tested/trusted Oracle-java JDK. There begins the problems. Initially downloaded an rpm package from the Oracle-java site. Extracted the files and copied/pasted them into usr/lib/jvm folder. The NetBeans installer still seemed to be reluctant in detecting the JDK. (Not sure if I was right with this approach).

Then tried converting it to .deb package using alien and still the package failed to dpkg. :(. After being done with all the those manual extractions, I was soon on a look out for an installer package or a method to install it from the terminal with auto-download.

It was then that I came across a couple of sites suggesting to add the repositories and then install the package which too began failing.

Then came this QA site which turned out to be a saver.

It initially asks us to clean up the junk and begin with a fresh installation and this was successful after hours of R&D.

sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Hope this helps anybody with Ubuntu 12.04 to get over with the issue with installation of Oracle Java 7 and in turn set up IDE's such as NetBeans. I was able to proceed with the installation of NetBeans successfully thereafter.

Welcome back. Its been quite a while since I posted something here. Today I am gonna deal with configuration of APC Smart UPS (APC Back-UPS ES 650 in my case) in your Ubuntu machine.

This applies to all those “Smart UPS” of APC where your computer can monitor your UPS via a USB interface (which comes bundled along with the product). By default you get a Software CD namely PowerChute which is meant for Windows and OS X by MAC.

Let me point out that this works out well with even other Linux OSs. So you need not flip this post away. It is just that you might have to use the appropriate commands required by your Linux system which might or might not be different from Ubuntu commands.

So lets begin.

I hope all your items present in your Update Manager is up-to-date. Though I don’t find any reasons for this to cause any issues but it is always recommended you keep it updated as and when possible (this is my personal suggestion as well).

Open your Terminal window. (Applications > Accessories > Terminal)

Type in the following:

sudo apt-get install apcupsd

You might be prompted to enter your password. So enter it and hit return. (Never mind if those * characters do not appear while you are entering your password, its hidden for added security purpose).

Once the process is completed successfully, type in the following:

sudo gedit /etc/default/apcupsd

This must open the file in a gedit Text Editor window.

Find the following line:

ISCONFIGURED=no.
Now replace ‘no’ with ‘yes’ without quotes.

Save and close the file.

Now return back to your Terminal window.

Type in the following command:

sudo gedit /etc/apcupsd/apcupsd.conf

Now make the following changes in the text editor that has just opened:

Find the line:

UPSCABLE <some default value already exists here>

Replace that <default value> with usb.

So your line should now be read as:

UPSCABLE usb

Similarly make changes to all these lines so that they are read as follows:

UPSTYPE usb
DEVICE
BATTERYLEVEL 5
MINUTES 3
NETSERVER on
NISPORT 3551

Please note that some the parameters mentioned above could have the default values as I have mentioned above. So you need not make any changes to those parameters such as NETSERVER and NISPORT. And some the values such as BATTERYLEVEL and MINUTES can be set to the values of your convenience and your device specifications. However it is not suggested that you reduce the values to lesser than those that I have suggested above as the time and power remaining might not be sufficient for your system to complete the process of shutdown or hibernation. Hence you can always increase it, but not suggested to reduce it any further.

Once these changes are made, please save file and close the editor.
We will run a few more commands to verify the outputs.

Verify the Setup

Run the following in your terminal:

sudo apcupsd start
sudo apcaccess status

You could even restart your system and then run the commands to make sure that apcupsd is running.

Final Setup
Unplug the UPS and wait for the process to take place. In my case the system should initiate and complete the shutdown process when the battery level or the time remaining is 5% or 3 minutes.

If you are system is not able to complete the process before your battery runs out, you could increase the above set parameters to say 8% or 5 minutes suiting your UPS’s needs.

Monitoring your Power Management System the GUI way
Finally, to monitor your system the GUI way as in Windows you could install the gapcmon package. This even provides you with handy graphs as well.

Run the following command:

sudo apt-get install gapcmon

Restart your PC and then you can this application from Application > System Tools > APCUPSD Monitor.

Rest of the features in this application is self-explanatory.

So hope this helps you and you could be well prepared in cases of expected or unexpected power outages. Please drop in your comments/suggestions/doubts if any in the comment boxes below. I will do my best help you out in case of any issues.

Here are some simple steps that can be carried out to set up your Mobile Broadband in your Ubuntu 10.04 version.

Some of the advantages of this Mobile Broadband are :

  • It is mobile!!! as its name suggests.
  • No roaming charges (as of now).
  • Pretty reasonable speed. I have touched peaks of 150-170kB/s(i.e. about >1Mb/s) at times, not always.
  • Instant Activation.

Well I didn’t mean all praises to these companies. There are so many disadvantages/drawbacks as well which cannot be left out.

  • 1st of all, Unreasonable/Illogical tariff plans. You have a fair usage policy that limits your usage to 15GB a month for unlimited plans, and unlike BSNL or Airtel who cut down your speeds when you cross their fair usage limits(which are about 500GB or something), these mobile broadband companies charge you for the extra usage. So is it actually unlimited? I ended up paying a hefty bill of Rs.2900 last month!!!)
  • Horrible customer service – There is absolutely no regard for the feelings of the hapless customer.
  • Fluctuating speeds which irritates a lot a when you are browsing.

Anyways, griefs apart, lets get back to work.

1st of all I am assuming you already have some source of internet connection like you must be working on dual boot OS where you must be having windows installed or you are looking at this post from your friend’s place. (Else you wouldn’t be reading this blog right!?!). If possible get a copy of this post printed so that you can refer to at the time of set up. And u gotta get d following two packages already downloaded (again i mean you should have some prior access to internet as I mentioned above):

The default program in the device is only compatible with windows. So here we will instruct the Ubuntu machine to recognize the device as a Mobile Broadband device, whereas normally Ubuntu or any other linux distribution for that matter detects it as a usb-storage device.

This can be usually understood by creating a mobile broadband connection using Network Manager. Once plugged, the device will probably appear as a usb storage device, but it is important that your system and hence the network manager recognize it as a usb-modem.

Check if your device is being detected as a usb-modem
You can check it at the first step of creating a mobile broadband connection using Network manager.

    1. Right click on the Network manager icon and select “edit connections”.
    2. Now, go to “mobile broadand” tab and click on the add button.
    3. If the wizard shows you the name of the detected device, then congrats! otherwise you might need to take some extra measures to make that happen. In the screenshot below, the device is detected by NM.
New Mobile Broadband Connection

New Mobile Broadband Connection Wizard

The reason for your device not being detected as a usb-modem but a usb-storage device is best explained in the description of the package usb-modeswitch.

Several new USB devices have their proprietary Windows drivers onboard, especially WAN dongles. When plugged in for the first time, they act like a flash storage and start installing the driver from there. If the driver is already installed, the storage device vanishes and a new device, such as an USB modem, shows up. This is called the “ZeroCD” feature.

On Debian, this is not needed, since the driver is included as a Linux kernel module, such as “usbserial”. However, the device still shows up as “usb-storage” by default. usb-modeswitch solves that issue by sending the command which actually performs the switching of the device from “usb-storage” to “usbserial”.

So, you will have to install usb-modeswitch package. Since, we are dealing with Huawei EC 1261 here, I was able to get it to work with the latest usb-modeswitch package(version 1.1.2), rather than the one available in 10.04 repo(1.1.0).

Please note that, the usb-modeswitch package in Ubuntu 10.10, Meerkat’s repos are 1.1.4. So, direct installation from synaptic for Meerkat users, should work without any trouble.

Cont- for Ubuntu 10.04 or earlier – In order to install the latest version, you will have to download and install the squeeze(testing) packages from debian.

Let me request you, don’t try installing the debian packages by double-clicking on them and then installing them with the help of some package manager. This might not be effective enough (I won’t rule out its success though). So try using the following commands below in your terminal window.

sudo dpkg -i usb-modeswitch-data_20100418-1_all.deb

Note: See don’t just blindly copy paste the above commands. Replace the file names above with the recent versions you have downloaded and also mention the complete. In my case, the packages are assumed to be present in the current working directory. If for example if it is located on the desktop then replace “usb-modeswitch-data_20100418-1_all.deb” with “/home/revindran/Desktop/usb-modeswitch-data_20100418-1_all.deb” in the above command.

So your command could look something similar to this with the full path:

sudo dpkg -i /home/revindran/Desktop/usb-modeswitch-data_20100418-1_all.deb

Similarly follow the above steps for the following commands.

sudo dpkg -i usb-modeswitch_1.1.2-3_i386.deb

Now plug in usb-modem and this time your computer should be able to recognize it as a usb-modem. Go to the Network Manager follow the 1 steps which I have mentioned at the start of the process. Get your internet working. 🙂 This must work for about 75% users out there.

Those who unsuccessful, don’t lose hope. Please try the following steps further. Hopefully, this should get you started.

Run this command:

cd /etc/usb_modeswitch.d/

Then run the following:

ls | grep 12d1

This should give you the names of the files that have 12d1 in them.

Here is a screenshot of the results that I received.

checking the contents of 1446 file

checking the contents of 1446 file

Now plug in your device again and run the following command:

lsusb | grep 12d1

This will should give you a single line output. Read whats mentioned after “12d1:”, if its 140b, it should work directly, if its 1446 then you probably should try modifying a file.

Open the file, run this command

sudo gedit /etc/usb_modeswitch.d/12d1:1446

This will open the file in the text editor. Now, you will see a line in that file TargetProductList=”1001,1406,140c,141b,14ac”. Just add 140b to the list, save the file and try again. Restart if necessary(I would suggest you restart), plug in the usb and see in Network Manager if the device is detected and create the connection. Since, it was working earlier, it should work now too.

Again, if this doesn’t solve, try this last step out. Safely remove your device (I mean you right click and select the safely remove device option.). Then plug in your device back. Again check if it is detected in your Network Manager.

If it doesn’t still, do not lose hope. I myself had to try out till the following step. Again unplug the device safely and plug it in back. Now run the last and only remaining weapon (as far as my knowledge goes).

sudo usb_modeswitch -c /etc/usb_modeswitch.d/12d1:1446

You must get a result as shown in the screenshot below if successful.


For those who have obtained a result or similar as shown in the screenshot, click on the Network icon present in your panel (taskbar present at the top).

You must have something called as New mobile broadband connection or something similar. Click on it. Set up your network by following the wizard and happy browsing.

Those who are still unsuccessful, the last resort is upgrade your distro to Ubuntu 10.10 Maverick. That should help you run your device without much hassles. But before you begin with upgradation, just ensure that you have followed all the above steps without any fault. Only then proceed with your upgradation as a last resort because Ubuntu 10.10 is not meant to be a production environment. It is actually development environment. Instead try extending yourself till Ubuntu 11.04 releases which will again be production environment. However I did not mean that development environments are all that bad, but it would be slightly unreliable compared to the production environments.

So happy internetworking!!! Have a good day!!!