Showing posts with label Computer. Show all posts
Showing posts with label Computer. Show all posts

Sunday, November 7, 2010

Set up Toshiba L650 laptops after ubuntu installation

This article explains how to set up device drivers after installing Ubuntu in Toshiba laptops. Most probably Ubuntu will not support LAN, WiFi, Bluetooth and in some systems, anomaly in working of fan, battery are reported. Some of my problems like LAN setup, WiFi and Bluetooth have overridden and my battery is still showing some problems. I hope these instructions will be helpful for Toshiba Laptop users. Note that this article is a "how I did" type article rather than a "how to".
Some models of Toshiba Satellite are preloaded with Windows and some are not. In pre-installed models, try to make the system dual boot. There are a lot of tutorials for that and in Ubuntu, this is pretty easy compared to other distros. Anyway, I assume you have Toshiba system with a fresh Ubuntu installed. I used Ubuntu 10.04 LTS on by Toshiba L650-i5310.
Setting up Ethernet
My ethernet card was from Atheros Communications. A driver for Atheros is available from http://linuxwireless.org/download/compat-wireless-2.6 . Download and unzip the file. Then in terminal, cd into that folder. Then type the following code:
scripts/driver-select atheros
make
sudo make install

Then reboot the system.
Setting up Wireless
My Wireless LAN card was from Broadcom Corporation. The driver is readily available from ubuntu repository.
sudo apt-get install bcmwl-kernel-source
echo wl | sudo tee -a /etc/modules

Reboot the system.
Setting up Bluetooth
In bluetooth, I did nothing in Ubuntu and I installed a bluetooth driver from Toshiba in Windows 7. After that incident, my Ubuntu also start detecting bluetooth adapter and don't know how this happened.

Friday, February 5, 2010

Kolibri : Just 3MB size for this OS!


I am a fan of small operating systems, because, I really suffered the problems of bulky operating systems. I used puppy Linux (It's something great), Damn small Linux etc. Damn small Linux is only 50MB in size and works much fine. Some floppy Linux comes in 1.44MB but it has no GUI at all. A normal user need GUI with some office applications, media player, internet browser, email client, need some programming, and games. But all of the listed above is not included in the floppy linux at all, but almost all are covered by Puppy Linux and DSL. Average of 50MB is happy for me, but for some users, it is too high!. This is what the reason of development of ultra small OS with a size of only 3MB.
The 3MB sized OS is named 'Kolibri' which means humming bird- world's smallest bird. Kolibri is moderately fare OS for eyes with very high performance. In order to increase efficiency of code, OS itself is written is assembly language. I installed Kolibri in my pen drive. The boot up time is less than 3 seconds. I really shocked while seeing the stuff included in just a 3MB. About 30 classic games, text editor, image viewer, text based internet browser, hex editor, assembler,music player, of course a shell and many more. kolibri argues that, it is not windows, linux or anything. It's shell which can accept only 20 commands. But I found all are linux/unix cmmands. There is a bunch of 3D demoes which are excellent.
Go to Kolibri official wesite.
How to install?
You can download iso image and write it to a CD. But I felt ashamed to write 3MB sized iso image to CD. So I opted my pen drive. Installed it using windows XP. It can be installed using linux also. Download image for floppy/hardware first and unzip it. You probably need 7zip for that. Then copy Kolibri.img into thumb drive. Before copy, you need to fromat your thumb drive/pen drive to FAT32. After copying, go to HD_load->USB_Boot directory and run inst.exe then, run setmbr.exe. You need to reboot now and boot from usb. If you don't know how to boot from usb port, you need to read my old post: Booting from CR-ROM or USB devices
Sometimes, you need bulk operating systems to get your job properly done. But this type of efforts of developers seems really appreciable.

Saturday, January 16, 2010

Swathanthra Malayalm Computing

Note:- Malayalam is the mother tongue of Kerala (India). I don't know people other than keralites interested in it.

I will be a little verbose, if I am telling about my childhood and my mother tongue - Malayalam. It intrude in my words, however I try to hide that. Everything I first heared in Malayalam - stories, poems everything and of course, I first read the Holy Bible in Malayalam. Now what about Malayalm computing?? Now the Open source community offers "Swathanthra Malayalam Computing" for Linux Systems. Just see the Ubuntu malayalam desktop below(this picture is not captured by me. Thanks to http://arunmvishnu.com/).Visit official website of SMC.
You can turn your desktop into full fledged Malyalam desktop if you follow the instructions in the official page. I am not intended to copy the same instructions in the official page.But the following links will be useful:
  • If you can't read anything from SMC, your browser probably haven't the malayalam font installed. I purposefully doesn't added any malayalam words in this post in order to clearly read those who haven't their firefox installed with malayalam plug in. Today onwards, you can easily read any malayalm websites on your firefox. Here is the solution.
  • Mozhi:You can write malyalam articles of your own using Varamozhi. I personally felt a little difficulty in writing malayalam in Mozhi compared to blogger. But Mozhi offers a unique english character bunch to represent a malayalam letter.
  • A guide for malayalam in computer.
  • Download Debian Lenny in malayalam.
  • Have a look at Wikipedia in malayalam.
Some malayalm blogs:
http://berlytharangal.com/
http://karinkallu.blogspot.com/
http://workersforum.blogspot.com/
http://vellezhuthth.blogspot.com/
http://rajvengara.blogspot.com/
http://marjaaran.blogspot.com/
This is a small list and you can see several hundreds  of Malayalam blogs by searching with a keyword something like 'malayalam blogs list' or in this link.

Saturday, January 2, 2010

How to hack passwords in windows XP?

Warning!
Things here explained can be used in extremely nasty things. They are not recommended by Opentechlab. Use everything in your own risk. Also Opentechlab suggest some tips to avoid password hacking.

Here I am going to say something cumbersome to somebody. Here is a guide to hack the login passwords in windows XP. Also given how to avoid such hacking and keep your PC maximum protected from crackers. Opentechlab does not crack, it will hack only!

Password hacking using Backtrack
You first download the following file

Backtrack 3 Final (BT4 is also available, but I suggest BT3)

BT3 is an opensource Linux OS. BT3 consists of just a slax and the hacking and network security software. Since Slax uses lzm module mechanism, it is easy to install and remove the modules we need to. You ca download it as a bootable iso image or as USB pen drive installation file. I downloaded iso and write it to a CD and everything going perfect. Once you installed BT3, you just need to boot up from CD-ROM. Within minutes, linux kernel loads and backtrack desktop appears. Now you need to do the following things:

bkhive /mnt/hda1/WINDOWS/system32/config/SYSTEM key

(result is the boot key)

samdump2 /mnt/hda1/WINDOWS/system32/config/SAM key
samdump2 /mnt/hda1/WINDOWS/system32/config/SAM key >~/Desktop/password.txt
john ~/Desktop/password.txt -users=Administrator

now the hashed password will be showing below

Here, it is assumed that hda1 is C: drive (where MS windows XP is intalled). If not, that should be repaced with the actual one. The password.txt is file which contain passwords of all users, but they are no readable, they are hashed. To remove hash, you need to call a program called john.
john ~/Desktop/password.txt -users=Administrator
only gives the password of Administrator. If you want to know the password of another user, type:
john ~/Desktop/password.txt -users=username
You can simply do this:
john ~/Desktop/password.txt
to get passwords of all users, but it is time consuming. Knowing what you want is ponentially advantageus than knowing everything. And it will not eat much of your time. Somethimes if the password to be hacked is much complex, you get a leisure time to drink a cup of coffee!

How to use rainbow tables in backtrack?
You can use rainbow tables while hacking passwords. You can download lot of rainbow tables from freerainbowtables. I think downloading all rainbow tables in your hard disk is frustrainting (more than 1000GB!). Download some simple tables to experiment with. To use rainbow tables, BT3 provides a program called 'rainbowcrack'. It can be accessed from:
Main menu -> Backtrack -> privilege escalation ->All -> Rainbow crack
But rainbow crack only supports tables of type *.rt. But rainbow tables with type *.rti is abundant over internet to free download. Solution is to download *.rti tables and conver it to *.rt using rti2rto.exe. Here you are able to use rainbow crack instead of john. All other steps are same.

Using Ophcrack
Ophcrack is also opensource and is also useful. I personally didn't tried that, however many of my friends work successfully with that.

Download Ophcrack
You need to download rainbow tables also.
Read more about rainbow tables

How to prevent password hacking?
Here again, prevention is better than cure. If you care about how much your data secure to be, you should keep your passwords be secure first. First of all, you do not store your passwords anywhere other than your brain. Every time you enter your passwords at login, is boring, but you should aware of the consequences. I said it generally, but here this is not possible. Use more than 10 characters for your password. For each addition of a new character, you can see that how much extra time BT3 takes to find out the password. Add symbolic characters and numbers. Finding a password with symbolic characters and numbers are very frustrating, and a cracker work hard for hours on such computer until he get a message 'Failed to find password'. Don't enter a password with meaningful words. If your password is a sentence such as 'Mary had a little lamb' and others password is 'asdfiuerh', then it is very easy to find out the former even though it is lengthy in character. Use different passwords for diffenrnt internet accounts. If you feel difficulty to memorise all passwords, you requre a good password manager (I recommend Keepass). Change your passwords periodically. It will save you a lot. If you have a top secret information, and is not to be revealed to the world for any reason, I have a good idea but is not guaranteed. Just copy the thing to any portable device and put it in a Bank locker and through your computer to fire and keep watching until it get into ashes.

Wednesday, December 23, 2009

Parallel port programming using C/C++

Parallel port programming is easy with C or C++. Even other languages integrate C/C++ codes to their codes in order to program parallel ports. If you are a beginner in parallel port programming and know nothing about it, just go through this intro page. Nevertheless the efficiency of code, the code may be different for different platforms and need to be compiled with some change in the code.Here we see how to program parallel port(printer port or LPT) in both GNU/Linux and MS Windows platform.
Parallel port programming in GNU/Linux
I am not intended to make a wide description. I am directly give an example and this is what you want. If you are experienced the taste of C, you can easily catch what the program code mean.(We use LEDs to check whether our program run. You can see a simple circuit in the intro page). Connect the circuit described in intro page. to the parallel port properly. Then make new file parport.c and edit the file as shown:

#include stdio.h
#include stdlib.h
#include asm/io.h
#include unistd.h

#define base 0x378 /* printer port base address */
#define value 255 /* numeric value to send to printer port */

main(int argc, char **argv)
{
if (ioperm(base,1,1))
fprintf(stderr, "Couldn't get the port at %x\n", base), exit(1);

outb(value, base);
}



The above program is copied from epanorama. You should compile the program as su (super user) since ioperm() function needs root access. But in my system the above program didn't work. Many of my friends got error while compiling. The solution is to change the 4th line
#include asm/io.h
to
#include sys/io.h

You change the line and recompile only if you get a linking error. Sometimes you get an error like "Couldn't get the port at 378". But this is not a problem due to the port address. You probably may not be su.

Parallel port programming in MS windows
Converse the subtitle suggests, this program is not working in the windows environment, but in the MS DOS environment. I think you have basic knowledge of how to compile a C program.

#include stdio.h
#include conio.h
#include dos.h

/********************************************/
/*This program set the parallel port outputs*/
/********************************************/

void main (void)
{
clrscr(); /* clear screen */
outportb(0x378,0xff); /* output the data to parallel port */
getch(); /* wait for keypress before exiting */
}


The above program is also from epanorama. If you try to compare those programs, you can see a very little difference between those codes. Parallel port is a hardware and surely it is depended upon the OS you are using. So you can't write a cross-platform code for the parallel/printer port control. Please note that you can read inputs as well as write as output however, the example only shows the output control. Sometimes your port address may be different, however in most cases it will be 0x378. If it fails try 0x278 and 0x3BC. Read more here.
You can check your program by simply inserting an LED connected in serial with 1K ohm resistor.

Read my post on parallel port control on python

Monday, December 7, 2009

How to simulate PyS60 in your PC

You can do your experiments in PyS60 without touching your mobile phone. The experimentation is easy while you set up everything in your PC. Here I am explaining how to set up the PyS60 environment in WinXP platform. I didn't try this attempt on my Linux yet. I will surely post about it if I get some good mobile stuff on Linux. This will be a boon for python developers in Nokia S60 mobile phones. But rarely it can be seen that some python scripts works neatly on simulator may cause strange responses on your real world system. I would like to here about it if you get any funny experience on your S60 device.
Download the required things:

1)Download S60_3rd_Edition_SDK_Feature_Pack_2_v1_1_en.zipfrom the following link:
http://www.forum.nokia.com/info/sw.nokia.com/id/807ec36d-0a8e-4bda-8e10-4d5e5bb4764a/S60_3rd_Edition_SDK_Feature_Pack_2_v1_1_en.zip.html


2)You can find ActivePerl 5.6.1 build 635 here:
http://downloads.activestate.com/Act...SWin32-x86.msi

3)Download PythonForS60 _1_4_5_SDK_3rdEdFP1.zip from http://sourceforge.net/projects/pys60/files/

First install ActivePerl because S60 SDK requires it.
Then install S60 SDK. Please note to install it in C:\ drive to avoid confusion.
Extract PythonForS60_1_4_5_SDK_3rdEdFP1.zip. Then you get another archived file sdk_files.zip.
Extract it again and you get a directory named 'epoc32'.
Copy this directory into "C:\S60\devices\S60_3rd_FP2_SDK_v1.1"
Then probably Windows XP asks to replace the already existing folder 'epoc32'. Click yes.
You have done. Cheers!

Saturday, November 28, 2009

Puppy Linux : Give life to your Thumb drive

If you didn't tried Puppy Linux - one of the smallest Linux, core's yet-remember, you have only one life, try Puppy today itself. Puppy Linux - the name is not much inspiring for geeks, but I found it is the most stable and useful OS in the pocket Linux category.
It has the following advantages over other less-sized Linux operating systems.
  • Small sized. Ranges between 80MB to 150MB
  • Install anywhere - HDD, USB Pen drive, biz. card sized CDs. (You can use ordinary CDs, DVDs, Blu-ray discs - but it is too big for puppy.)
  • Easy to use.
  • Official website offers boot time of less than 1 minute. But it is typically less than 15s in my Intel P4 with 2GB RAM.
  • Puppy is beautiful than any other pocket OS.
  • Smart and crash free. I used more than 10 Linux flavors. Everything crashed, but I haven't experienced Puppy's crash.
  • Puppy sessions are saved in *.sfs file. It can be placed everywhere. Puppy search for it at boot time to recover the previous session. There are a number of fundamental advantages for that. I found many of my friend's computers not supporting USB boot. Of course they can boot from a CD-RW but it is not writable. Puppy offers several ways to overcome it. One is that, it can write previous sessions in CD as a multi session write. But it can be used until CD size limits. Another way is to write *.sfs file in HDD (for home usage) or USB pendrive ( for portability) and puppy kernel file in a a CD. So CD can be booted easily and can save sessions.
  • You can resize puppy save session file while running.
  • Comes with almost all drivers.
  • A wide variety of Puppy flavors are officially and unofficially available. These flavors are called 'Pupplets'. Pupplets are intended for a particular task - ie, it supports a task greatly. There are pupplets for painters, gamers, processionals, children, students and so on.
  • Brief and understanding tutorials, quick replying forums, community etc.
Once you downloaded Puppy, you have a lot of questions about installation, usage etc. Most of them answered in the official website and associated forums. Otherwise just google for that.

Saturday, October 10, 2009

Mouse gestures for Mozilla Firefox


Mozilla Firefox one of the leading power of internet browsers, shows its real power and beauty only when the appropriate add on-s are installed. You can download and use them from Firefox add on page. There are a plenty of add-ons available and no need to specify which is good because it greatly depend upon your tastes. Recently I installed an add-on named All-in-one gestures and I feel it very interesting. You can install by clicking 'add to Firefox' button as you usually do while installing add-on. There provision to change the gesture pattern in the 'preferences' mode. Mouse gesture means that, some operations you done in Firefox such as 'back', 'forward', 'refresh' etc can be done simply by moving your mouse. I experienced no problem with both Windows and Linux platforms. There are tons of interesting add-ons like this. It is really fun to experiment with Firefox add-ons.

Friday, October 2, 2009

Booting from CD ROM or USB devices

Booting from resources other than HDD is very simple, but the way in which configure your system for boot from a particular task may differ. First of all, you should know that, the boot configuration appearing on your monitor is independent of the OS, or any other peripherals connected to your system and it is occupied in your BIOS and it may vary for various type of mother boards. Nowadays, many people use liveCDs or liveUSB loaded with their favorite Linux OS for the sake of portability. So I think this tutorial will be useful to you.

After you power on your PC properly, a splash image will appear within few seconds on your monitor probably mentioning about your motherboard vendor or vendor logo. Some keys and their function may be mentioned on the screen.
For example: F9 : Boot menu F2 : Setup
The keys used for boot setup and boot menu will greatly varied. But the major problem is that this splash screen appears for less than a second in some systems so that you can't even recognize what is written on the screen. Here you should do is that press 'Pause/Break' key in your keyboard (It is positioned in between alphabetic keypad and numeric keypad). Then the screen pauses. Then you can configure as you like it. If you now want to boot system normally, press 'Enter'. Each of the operation will be explained while you are attempting to change this. This will not be explained here because this is different for different systems. But in most systems, if you think that you did something and don't know what is the consequence press 'Esc' continuously and probably one dialog box asks you to save changes. Press n/N for No or y/Y for Yes if you want to save changes.

If you want to just boot from CD ROM or like external devices, good option is that select one resource form the boot menu. The way how to navigate to the boot menu will be specified on the splash screen. If not, try F8 because, many systems having F8 as the boot menu key may not be explicitly shown. In boot menu, you can see several sources. 1.FLOPPY 2.HDD 3. CD-ROM 4.USB HDD .Select one which you want to and press 'Enter'. The system try to boot from the source. If fails, system may try a normal boot or a restart. Sometimes some devices for example USB HDD will not be listed until you inserted your memory stick or pen drive to the system before power up. In this case you should insert the USB device and try a restart and do the same procedure. Similarly, you should insert CD ROM to your drive before selecting boot device. One more thing is that if you are attempting to boot from a pend drive (or memory stick or thumb drive), you should select USB HDD. Some other options like USB FDD, USB ZIP may also be listed. One more problem associated with USB boot is that if you didn't enable USB boot in the boot setup (the key for boot setup will be displayed on splash screen), USB boot will be failure. In some systems you have options to enable/disable USB 2.0. All you need to do is that if a USB boot failure occurs, you should navigate through the boot setup menu and do as your need. In this case, the boot selection will not be saved and need to do the same procedure every time you boot time. Otherwise a normal boot will occur.

To permanently setup a boot configuration, you navigate to the boot setup menu and change the 'boot priority'. In normal case, first boot device will be HDD. You can change it to CD- ROM or USB HDD. One thing be noted is that you should give a priority to HDD as second or third device. Hence, if a boot error occur on the first device, system try on the second device (here HDD), so a normal boot will occur. Change the boot priority to CD-ROM as the first device and second device as HDD is a good practice in order to debug your OS, in case of permanent system crash. Here the system ask to save changes. Press y/Y to say Yes, and this configuration is saved on BIOS for future.

If you do the configuration permanently, every time system checks for first priority device and may feel time consuming if you are waiting for a normal boot. If you are doing it in temporary, every time you need to select boot device. It is recommended that you permanently change boot setup in your Home PC while temporarily do in office PCs.

In the worst case, your motherboard will be entirely different thing and you need o read motherboard users manual. If you didn't got any manual on purchase, you can freely download it from the vendor's website. Probably you need to search by the part number. The part number of your mother board can be found on the top side of your motherboard (Hmmm..Best chance to hack your PC).USB boot is not allowed in some old PCs. But all general purpose motherboards not older than 3 or 4 years can have USB boot capabilities.

Monday, September 14, 2009

Battle Game - The computer thinks!

Recently I built a game and named 'Battle' as a consequence of my studies in the field of artificial intelligence. As a first step, I built a mathematical model instead of more flexible neural network model. The work on neural model is on the way and the work is very slow. The mathematical model also not much efficient but I took care to make the program 'act' as intelligent (I know intelligence is needed to act!). Rarely the program may crash. I not interested to make this game for commercial use and I am givin it under GPL. The program is not much pretty both in efficiency and it's intelligence. Since I am not a proffessional programmer, the rules for a good program may not be satisfied. I compiled it in C++, but the entire structure is like C.
The game is like ordinary 'Tic Tac Toe'. but has a little difference that maximum number of players is limited to 3 and If you placed your all three players, you can move them to adjacent places to align the players in a line. For the simplicity of learning the game I have put a video of how to play the game.



I have built a Qt (which is cross platform) GUI for my game for beginners but have put also the CUI mode game for code diggers. Even though this game is not intended for entertainment surely it provide some entertainment if you read the code. I need you comments to speed up the development of neural model of the game. I did all the work in win32 platform and linux users also can compile the code because, Qt is cross platform. But you need to install Qt on your distro.
Here's the download links:
GUI BattleGame (Recommended)
CUI version 1a.0
CUI version 1b.0

Hackthissite.org A hacker's university!

Hackthissite.org seems like a hacker's university. This website provides a good stuffs useful for hackers (crackers also). The hackers community is really powerful and active. Only you have to do is facing different types of hacking problems and find a quick and easy way to solve it. If you are a perl programmer or a javascript hacker, it is a plus. Innovative php users get the points more. A deep knowledge in html is not needed. Above all, the most important thing is your common sense. The problem phase is broadly classified in to:
personally I felt basic and javascript is good for beginners, but advanced problems like programming missions are needed to eat more points. Earning points is not for just earning points, but it will give you some reputation. You are ranked by your points:

Pentitioner-0 Points
Script Kiddie-700 points
Apprentice-1700 points
Wiseman-3200 points
Master-5400 points
Hacker-7000 points
Elite-8400 points
Sage-10000 points

W3schools help you a lot in learning web programming. Navigate to hackthissite.org and show who you are.

Wednesday, September 2, 2009

Bhuvan, still have a lot of void


ISRO(Indian Space Research Organization), launched Bhuvan , a Google earth for India (But more than Google earth) after the successful launching of Chandrayan-1. In the first sight, it is like Google earth, but tons of information is there and covering almost all over India. Bhuvan is a strong rival for Google earth, and seems better view than Google earth and have some good features, and is more informative. Currently, Bhuvan works only on Win32 platform. You need a program (about 15MB) and a need a good broad band internet. Bhuvan works fairly well in my system with 2GB RAM. All you need to play with Bhuvan is included in their website.
Bhuvan has enough tools to find exact area, length and other terrestrial info. Bhuvan works well even though you have low bandwidth network because it is designed such a way that it covers almost Indians. I personally don't know Bhuvan supports current GPS systems.

Thursday, August 13, 2009

Resize images in Gimp



Resizing pictures is quite easy and there are several free programs available for this purpose. Resizing images by mouse is quite easy, but here is how to resize images in a professional way. It is quite easy.

Here is two images, one is the resized form of the other. To know the actual size difference, please download these images.

step1: Open GIMP
Applications->Graphics->GIMP in Linux (you can enter command 'gimp' in your terminal window as geeks do)
start->programs->GIMP in Windows

step2: Open image in Gimp

step3: Rigt click on the image and select image->scale image..
step4: Change width and height. If you change any one of them, the other will automatically be changed.

step5: Click 'scale' button

step6: Save yoiur image

Saturday, August 8, 2009

World's Smallest "Hello World" program

It's quite formal way to start with a "hello world!" program while introducing a new programming language. It is convinient by starting from "hello world" because the program may run properly and is helpful in gaining the confedence. Also it gives a proper output - Prints "hello world!" on the monitor. The programmer becomes happy while seeing this output. Here is a simple "hello world!" program in C.

#include
main()
{
printf("hello world!");
}
//output is
//hello world!


Quite simple?
But I think it is not at all simple. The special characters present in the program really offer some disturbances for the beginner, however a C program is not redundant and it is extreamly powerful.

In Python, I found a much more convenient way.

print "hello world!"


Simple?
It seems good but there is still void to shrink.

Take a look at Ruby,

"hello world"


That's it. I didn't found any void to shrink here. Just put the string you want to print in quotes (" ") and it is pretty easy. But this is not the standard way of printing a string on the monitor, as far as the offcial website of Ruby is concerned. They recommends,

puts ("hello world!)


Then the output will be,

Hello World
=> nil

nil stands for there is nothing to return.

Saturday, August 1, 2009

Introduction to parallel port (LPT) interfacing


Warning!:Usage of parallel port without care may cause serious impact on your PC.

Nowadays programing parallel ports (also known as printer port LPT (DB25 female on the back of IBM type PC) are prone to disappear from newer PC's. But, as far as computer based control engineering is concerned, parallel port is the easy way. So many people stick on parallel port. There are a plenty of programming languages offers convinent control over parallel port by high leve l of abstraction.In order to control things through your parallel port,you need a simple hardware also. Don't need to buy, just build one in your home. Before you dig into parallel port, just know what is a parallel port. If you are confedent that you have some knowledge of parallel port, just skip the links below.

Assuming you acquired basic operation of parallel port. Now let's begin to dig. Here I tried to describe maximum of how to work with parallel port in different systems and different platforms. You can read all of them in posts tagged in Parallel Port.

Read my post on parallel port control using python
Read my post on parallel port control using C/C++

Thursday, July 30, 2009

A programming language in my name!

While googling in a sleepless night, I found something intersting (interesting for me and all other Toms!). A good looking programming language named "Tom" which is my name. I just went through the official website and found it was cool. I liked some of its specialities available, and also it's license.-Yes, it's under GPL (GNU General Public License). Some of the pecularities are: (I just copied it from the official site)
  • TOM sports extensibility of objects: a class is not just defined by its main definition: classes can be adjusted, even at run time. A prime example of this is to modify in your program a class offered by a shared library, just to make it suit your program better.
  • TOM methods employ default argument values and multi-valued returns;
  • TOM has multiple inheritance - with semantics much simpler than in C++ or Eiffel and obviating the need for interfaces (Java) or protocols (Objective-C);
  • TOM offers reflectivity on objects, their classes, member variables, and methods;
  • TOM discerns classes and a few basic types - like Java and Objective-C;
  • TOM has conditions modeled after CLOS conditions;
  • TOM, as compiled by Tesla, the first TOM compiler written in TOM, adds blocks to the language;
  • The TOM standard libraries offers time-constrained garbage collection, multi-threading, distributed objects.
In their FAQ, I found a question "What does the name "Tom" mean?
The answer given was like this: "The name TOM is a name. Names don't need to have a meaning. :)"
Well, here is simple "Hello Tom" program in TOM which resembles C and Java.

int
main Array arguments
{
[[[stdio out] print "hello, Tom!"] nl];
}


Currently Tom is available for Linux,BSD platforms. An unsupported version of win32 platform also
Visit official TOM website

Sunday, July 26, 2009

Parallel port programming using python

Setup parallel port in linux (Debian/Ubuntu)
You should have installed python on your distro. You must have the previlages of 'su' to do the following installation

# apt-get install python-parallel
# rmmod lp
# modprobe ppdev
# python

>>> import parallel
>>> p = parallel.Parallel()
>>> p.setData(0xFF)


Assuming you have some basic python knowledge. If you didn't install pyhton -parallel, you can't import parallel. Now p.setData(oxFF) sets every outputs of parallel port to ON. Try different values instead of 0xFF. (To do this you require basic knowledge of hexadecimal representation of binary numbers). Try this chaser program.

x=[1,2,4,8,16,32,64,128]
while(1):
for i in x:
p.setData(0xFF)
time.sleep(2) #Good night for 2 seconds


The program will work until you force to quite python or an unexpected UPS failure. That may be funny ;-) But Intentionally did that for the program simplicity.

No Linux? Windows only? :-( Just try it out

There is nothing to do in windows. Download latest python first. Install it. Then download pyparallel for windows fron sourceforge. Install it Now everything OK. Open python either by command or open IDLE (It will be installed with python core in windows). Then type the following:

>>> import parallel
>>> p = parallel.Parallel()
>>> p.setData(0xFF)


The example chaser program is also applicable for windows platform.

Read my post on parallel port programming in C/C++

Wednesday, July 22, 2009

Teach your computer how to speak!

It is good idea to teach computer to speak!. There a number of programs available for winXP paltform, but here is a unique program "espeak" for your linux. Just enter the command in terminal,

$espeak "Boss, I can speak now"

will work fine. It is useful for some scripts in linux to remind some status of computer to the user like a personal assistant. espeak is not an internal bash command and need to be installed. I simply installed in my Debian from repository.

#apt-get install espeak


The command above will work well with ubuntu systems also. If you are using any other distro, you need to download and install it manually. Click here to know more.

Here is a simple python program which uses espeak as system command. To use it you require python and espeak installed.

#! /usr/bin/python
# File: speak.py

import os
from Tkinter import *

class App:

def __init__(self, master):

frame = Frame(master)
frame.pack()
self.button = Button(frame, text="Click", command=self.activate)
self.button.pack(side=LEFT)


def activate(self):
os.system('espeak "Boss, I can speak now"')
print "Boss, I can speak now"

root = Tk()

app = App(root)

root.mainloop()

Just copy the above program into a new file named speak.py and 'cd' into the directory and enter,

python speak.py


You are free to use this program anywhere since espeak is under GPL.

Saturday, June 13, 2009

Portable programs for your pen drive

Nowadays, there is no need of an introduction to portable applications, but I am starting from introduction before going to some useful portable application links.

Most of the computer application programs are to be installed in your system. It is not a problem in Windows platform just click next->next->.......finish. Quite complicated but amazingly interesting way in Linux. There are several Java programs which is intended for direct work instead of initial installation setups. The problem arises in installable applications comes to play if you are working in your office, college in computer. The computer administrator may prohibit to install your favorite Firefox in the office computer. These problems can be avoided by using some portable versions of your favorite applications. Just download an unzip it in into your pen drive and use it every where. Currently, most applications support portability in MS Windows OS. If you are a Linux user, Linux OS itself become portable to follow you!

Some good links for MS windows:

http://portableapps.com/

http://www.pendriveapps.com/

Here follows a junk of pen drive Linux:

http://www.pendrivelinux.com/