Category Archives: Tips & Tricks

Fix Toshiba battery issue for Linux

Its been a year since I made my last post and have been thinking about what I could write  to start posting again. I have finally found a perfect one. Yepieeee, Its about vexing Toshiba battery conflict with the kernel.  I have got my battery issue fixed after a long wait. First of all let me thank Steve who proposed the perfect resolution for this issue and many thanks to other people who were also part of this seeking for a resolution.

Here was the scenario.

Laptop Made : Toshiba L650 X5310

OS : Ubuntu, Centos, BackTrack Linux

Issue : None of them detects and show my battery status.

I have tried different versions of Ubutnu, distros, Kernels and none of them helped and hence raised a bug report at https://bugs.launchpad.net/ubuntu/+source/linux/+bug/703302

Surprisingly the thread got replies/responses from many people who were having the same issue and none had a clue about the fix. But reply no:16 by George Moutsopoulos helped me to find the solution.

Old Results :

[bash]efheem@tuxjockey:~$ cat /proc/acpi/battery/BAT1/*
present:                 no
present:                 no
present:                 no
efheem@tuxjockey:~$ dmesg | grep batt
[    1.370268] ACPI: Battery Slot [BAT1] (battery absent)[/bash]

The cause of issue is because Toshiba included two sets of boot data that tell the OS what hardware exists in the machine. Windows reads the correct one whereas Linux doesn’t. We will need to build our own kernel to make this happen. We will need to extract the DSDT (Differentiated System Description Table) from the machine, the ASL modified, and a new AML DSDT can be compiled. The sections below show the way to tell Linux to use this modified DSDT instead of the version that came with the BIOS.

Get the original DSDL of machine:

[bash]# cat /sys/firmware/acpi/tables/DSDT > DSDT.dat[/bash]

Disassemble it

[bash]# iasl -d DSDT.dat[/bash]

Make the changes:

[bash]# vi DSDT.dsl[/bash]

search for line : OperationRegion (EMEM, SystemMemory, 0×FF808001, 0×FF)
and replace it with : OperationRegion (EMEM, EmbeddedControl, 0×00, 0×FF)
save the file.

Build it:

[bash]# iasl -tc DSDT.dsl[/bash]

This will create a file DSDT.hex (This file is used for kernel recompilation)

I received the below two errors during this compilation

N:B :- You can actually ignore these errors, this works even having these error unfixed. But if interested you can work out to get those fixed.  Else directly goto ‘Kernel Recompilation’ section.

———————————-

[bash]DSDT.dsl  2656:                     0×00000000,         // Length
Error    4122 -                              ^ Invalid combination of Length and Min/Max fixed flags

DSDT.dsl  2663:                     0×00000000,         // Length
Error    4122 -                              ^ Invalid combination of Length and Min/Max fixed flags[/bash]

———————————-

Fix : (If you didnt receive any error please skip this part )

open DSDT.dsl file and go to the line where iasl indicated the error. In my case I go to lines 2656 and 2663.

iasl is complaining about the “Length” line “0×00000000″. This is wrong. Look at the “Range Minimum” and “Range Maximum”. Open up your Kcalc or whatever you Gnome people use and change it to Numeral System Mode. Make sure HEX is selected and now we subtract the minimun range from the maximun range and then we add 1. Since the minimum range is 0 (And you can’t subtract 0) I will input  FEAFFFFF and then add 1 which gives me FEB00000  (Don’t get confused, I’m simply omitting “0x”, the calculator doesn’t need this). I change 0×00000000 to 0xFEB00000 by Length. So now it looks like this:

0×00000000,         // Granularity
0×00000000,         // Range Minimum
0xFEAFFFFF,         // Range Maximum
0×00000000,         // Translation Offset
0xFEB00000,         // Length

Line 2663 changed to

0×00000000,    // Granularity
0xFED40000,         // Range Minimum
0xFED44FFF,         // Range Maximum
0×00000000,         // Translation Offset
0×00005000,         // Length

compile again.

Kernel Recompilation :

Install necessary packages:

[bash]apt-get install fakeroot kernel-wedge build-essential makedumpfile kernel-package libncurses5 libncurses5-dev[/bash]
[bash]apt-get build-dep –no-install-recommends linux-image-$(uname -r)[/bash]
[bash]mkdir /root/source

cd /root/source

apt-get source linux-image-$(uname -r)[/bash]

NB: My uname -r was 2.6.38.2-generic

[bash]cd linux-2.6.38[/bash]

(replace this with your kernel version)

copy kernel config file from your current kernel:

[bash]cp -vi /boot/config-`uname -r` .config[/bash]

now copy the DSDT.hex file to the include folder inside kernel source

[bash]cp DSDT.hex /root/source/linux-2.6.38/include[/bash]

open .config file we have just copied

[bash]vi /root/source/linux-2.6.38/.config[/bash]

Make the below changes

[bash]CONFIG_STANDALONE=n
CONFIG_ACPI_CUSTOM_DSDT=y
CONFIG_ACPI_CUSTOM_DSDT_FILE="DSDT.hex"[/bash]

save and quit.

My pwd : /root/source/linux-2.6.38

start compiling the Kernel:

[bash]make menuconfig[/bash]

load the .config file, save the menu file and exit.

We are about to start the compile process . A little trick you can do is to set the CONCURRENCY_LEVEL variable to speed up the compile of the kernel. The number should be the number of processors you have plus one. So in my case I have a Intel Core i5 processor so I will add one with the 4 available.

[bash]cat /proc/cpuinfo | grep -i processor
processor    : 0
processor    : 1
processor    : 2
processor    : 3[/bash]

I have got 4 processors, so concurrency will be 4+1

[bash]# export CONCURRENCY_LEVEL=5[/bash]

Start Building :

Here I named my custom kernel as tuxsage, replace it with the one you wish.

[bash]# make-kpkg clean[/bash]
[bash]# fakeroot make-kpkg –initrd –append-to-version=-tuxsage kernel-image kernel-headers[/bash]

(This will take some time)

Once this is completed you will find the built kernel one directory up from your present directory

[bash]# cd /root/source
# dpkg -i linux-image-2.6.38.(This part will be whatever name you gave it).deb
# dpkg -i linux-headers-2.6.38.(This part will be whatever name you gave it).deb[/bash]

Make initramfs:

[bash]# update-initramfs -c -k 2.6.38+tuxsage (replace tuxsage with correct name)[/bash]

Update Grub :

[bash]#update-grub[/bash]

Reboot to the New Kernel :)

UPDATE : If you are using latest Ubuntu (11.10) with kernel 3.0.0-12-generic then you can get my custom compiled kernel with battery fix downloaded directly from http://www.4shared.com/file/O8CRV1qo/Toshiba-kernel-304-tuxsagetar.html which you can install and use. Have a look at ReadMe.txt for install instructions.

N:B : This post was made very soon after I got this fixed and you may find typos and other errors. Will proofread and fix those soon if any :-)

References :

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/703302

https://bugzilla.kernel.org/show_bug.cgi?id=34532
https://bugzilla.kernel.org/show_bug.cgi?id=15707

http://homeport.org/~bcordes/satellite-l500-install.html

http://www.insanelymac.com/forum/lofiversion/index.php/t189272-100.html

http://en.gentoo-wiki.com/wiki/ACPI/Fix_common_problems

http://www.lesswatts.org/projects/acpi/overridingDSDT.php

http://www.question-defense.com/2010/09/26/how-to-recompile-your-ubuntu-10-10-kernel-for-patching-or-to-add-support-for-a-specific-device

How to Hide Text in Notepad !!

Well who knew we could hide files with notepad?  Often you do all the coding for webpages in notepad and you gotta keep some of those hidden. What you do is look for a utility to hide your text. You simply don’t need it. There’s an easy hack to hide the notepad files. Let’s see how?

Before I begin let me tell you the text files you create with this hack won’t show up even with Windows or DOS whatever be the file settings. These files will only be accessible if you know the exact file name used while creating the file. Let’s begin with the steps,

Step 1

Launch the command prompt. Go to Run and Type cmd and press Enter.

Step 2

Use DOS command to get to the desired folder.

Step 3

Type in the notepad VisibleFile.txt:HiddenFile.txt and hit Enter. (These are just examples change the VisibleFile.txt or HiddenFile.txt filenames according to your choice)

When you are prompted to Create a New file, click Yes.

Step 4

Enter the data you want to hide. Next save the file and close the notepad.

Step 5

Go to the location where you have saved the file. You can see the VisibleFile.txt file (non-hidden) there. Now you can add any text of your choice.

Step 6

In order to open and read/write the hidden file. Type inVisibleFile.txt:HiddenFile.txt in the command prompt and press Enter.

That’s done and you hidden file HiddenFile.txt will not be visible under Windows Explorer or DOS. Remember deleting the visible file or the hidden (VisibleFile.txt)) will also delete the file (HiddenFile.txt).

How to transfer a cPanel account to DirectAdmin.

The file structure and back-ups for both control panels are entirely different and its quite difficult to restore the files transfered from one to another control panel manually. There is a script available which can convert a cPanel back-up to the format that of a DirectAdmin. The convert process is quite simple.

Download the conversion script from here .

*You can download it using the terminal :

wget -c http://kade.nu/da/da.cpanel.import.9.4.tar.gz

*Create two directories import and export :

mkdir import export

*untar the script

tar -xzf da.cpanel.import.9.4.tar.gz

You will get two files da.cpanel.import.pl and defaults.conf. da.cpanel.import.pl is conversion script and defaults.conf is the configuration file.

*Copy the cPanel back-up into the import directory.

*Edit defaults.conf to match the DA server IP and nameservers.

*Execute the script to get the back-up converted.

perl da.cpanel.import.pl

*Back-up could be found inside export directory and you may get it restored.

Configure Windows XP to Automatically Login!

Click Start, Run and type CONTROL USERPASSWORDS2, and click Ok. Select the user account from the list (the account to which you want to automatically logon). Uncheck Users must enter a user name and password to use this computer option, and click Ok. Type the user account password and complete the process.

For Windows XP Home, don’t try to auto-login as the built-in Administrator, as you’ll receive an error message.

social networking all together by Digsby.

I spend more time on social networking sites and have accounts on different ‘SN’ sites.  I found digsby-logomyself difficult to login each and every accounts and check for updates and this is also eating up more internet resources. If you are having the similar situation, then digsby is my sugestion for you.

digsby is a social networking tool that alerts you of events like new messages and gives you a live Newsfeed of what your friends are up to.

You can have one combined buddy list for all your AIM, MSN, Yahoo, ICQ, Google Talk, Jabber, and Facebook Chat Accounts. You can manage your Hotmail, Gmail, Yahoo Mail, AOL/AIM Mail, IMAP, and POP accounts right from digsby and stay up to date with everything happening on your Facebook, Twitter, MySpace and LinkedIn accounts. This also supports file transfers.

Digsby

digsby chat client with different themes

digsby is highly customizable , can change skin, look and feel and way it alerts and is embedded with multitasking pop-ups.

Get digsby from here . Currently digsby is only available for windows users. Linux users, digsby is coming soon for us . Visit www.digsby.com/signup/maclinux/?os=linux

List of keyboard shortcuts for windows.

When speed counts, the keyboard is still king. Almost all the actions and commands you can perform with a mouse you can perform faster using combination’s of keys on your keyboard. These simple keyboard shortcuts can get you where you want to go faster than several clicks of a mouse. You’ll work faster on spreadsheets and similar documents, too, because you won’t lose your place switching back and forth between mouse and keys. Here are some of the most useful keyboard shortcuts:

KEYBOARD SHORTCUTS YOU CAN USE WITH MS WORD

Ctrl+Shift+> -Increase selected text in increments like the drop down font menu Ctrl+Shift+< -Decrease selected text in increments like the drop down font menu

Ctrl+] -Increase selected text one point

Ctrl+[ -Decrease selected text one point

Sift + F3 -Change case of the letters

Ctrl+Shift+W -Underline words but not spaces

Ctrl+Shift+D -Double underline text

Ctrl+E -Center a paragraph

Ctrl+J -Justify a paragraph

Ctrl+L -Left align a paragraph

Ctrl+M -Indent a paragraph

From the left Ctrl+T -Create a hanging indent

GENERAL KEYBOARD SHORTCUTS

Copy -CTRL+C

Cut -CTRL+X

Paste -CTRL+V

Undo -CTRL+Z

Delete -DELETE

Delete selected item permanently without placing the item in the Recycle Bin -SHIFT+DELETE

Copy selected item -CTRL while dragging an item

Create shortcut to selected item -CTRL+SHIFT while dragging an item

Move the insertion point to the beginning of the next word -CTRL+RIGHT ARROW

Move the insertion point to the beginning of the previous word -CTRL+LEFT ARROW

Move the insertion point to the beginning of the next paragraph -CTRL+DOWN ARROW

Move the insertion point to the beginning of the previous paragraph -CTRL+UP ARROW

Highlight a block of text -CTRL+SHIFT with any of the arrow keys

Select more than one item in a window or on the desktop, or select text within a document -SHIFT with any of the arrow keys

Select all -CTRL+A

View properties for the selected item -ALT+ENTER

Close the active item, or quit the active program -ALT+F4

Opens the shortcut menu for the active window -ALT+SPACEBAR

Close the active document in programs that allow you to have multiple documents open simultaneously -CTRL+F4

Switch between open items -ALT+TAB

Cycle through items in the order they were opened -ALT+ESC

Display the shortcut menu for the selected item -SHIFT+F10

Display the System menu for the active window -ALT+SPACEBAR

Display the Start menu -CTRL+ESC

Display the corresponding menu -ALT+Underlined letter in a menu name carry out the corresponding command

Open the next menu to the right, or open a submenu -RIGHT ARROW

Open the next menu to the left, or close a submenu -LEFT ARROW

View the folder one level up in My Computer or Windows Explorer – BACKSPACE

Cancel the current task – ESC

To prevent the auto play -SHIFT

Continue reading

Speed Up your XP : # 1

Extra or unwanted items in the startup list

will definitely increase your startup time in Windows XP,perhaps
by several minutes.

Here is a simple trick to speed up your pc

1. Go to Start button ? Run
2.  Type “msconfig”, without quotations
3. Hit enter key or click the OK button
4. A System Configuration Utility window will show up
5. Click the Startup tab
6. In the Startup tab you will see several boxes and some of them
will selected (checked). All you have to do is to uncheck
extra items that are of no use. If you run an antivirus
program it is not recommended to uncheck it.
7. After making you choices press the OK button, you will be
prompted to restart computer to apply changes.
8. After restarting your computer a dialogue will be displayed.
You can check the option for not showing this dialogue every
time your PC reboots.

#2: Remove Spyware, Adware, and Malware

Scan your system for spyware, adware and other
unwanted pests.

Use high
quality anti-spyware programs like XoftSpy Pro, which gives the
ability to scan and repair these problems in seconds.

Stand-alone programs
do a much better job than the “all-in-one” packages (eg. Norton
Internet Security) at detecting spyware, adware, and malware.

#3: Optimize Display Settings


Displaying all the visual items can
waste system resources.

To optimize:

1. Click the Start button
2. Select Control Panel
3. Double-click the System icon
4. Click the Advanced tab
5.  In the Performance box click Settings
6. Leave only the following ticked:
a.  Show shadows under menus
b. Show shadows under mouse pointer
c.  Show translucent selection rectangle
d.  Use drop shadows for icons labels on the desktop
e.  Use visual styles on windows and buttons
7. Finally, click Apply and OK

#4: Speed-Up File Browsing

Every time you open “My Computer” to
browse folders that there is a slight delay. This is because Windows
XP automatically searches for network files and printers every time
you open Windows Explorer. To fix this and to increase browsing
speed significantly:

1.  Double-click on My Computer
2.  Click the Tools menu
3.  Select Folder Options
4.  Click on the View tab.
5.  Uncheck the Automatically search for network folders and
printers
check box
6.  Click Apply
7.  Click OK
8.  Reboot your computer


Increase Your Internet Speed : A hidden trick!

About 20% of your available bandwidth is reserved by MICROSOFT for their own purposes like Windows Updates and interrogating your PC etc To get it back:

Click Start > Run and type “gpedit.msc” without quotes.

This opens the group policy editor.

Then go to: Local Computer Policy  >  Computer Configuration >Administrative Templates

> Network >  QOS Packet Scheduler > Limit Reservable Bandwidth.

Double click on Limit Reservable bandwidth.

It will say it is not configured, but the truth is under the ‘Explain’ tab i.e. “By default, the Packet Scheduler limits the system to 20 percent of the bandwidth of a connection, but you can use this setting to override the default.

” So the trick is to ENABLE reservable bandwidth, then set it to ZERO. This will allow the system to reserve nothing, rather than the default 20%.”

ENJOY the full Bandwidth !!

Speed Up your Torrent Downloads !!!


P2P file sharing is one of the widely used applications now days. The Torrent search engine is the utility which is excessively used in this context. As the young generation says “impatience is the new world”, means the generation can’t afford anything too slow, same is the case with torrent download. But there are some tips which can really help to improve your download speed. Let’s have a quick glance at these tips.

1. Choose your ISP wisely

The basic rule is that the maximum Torrent download speed that you can get can’t cross the upper limit of the bandwidth provided by your ISP. Usually ISP’s specify the upload and download maximum for the connections. So it is always better to have an ISP who provides better Download and Upload limits for an affordable price.

2. Choose the right BitTorrent client

Always choose the latest versions among the available BitTorrent clients. mTorrent, Vuze etc are some of these latest versions available now. The latest versions are equipped with provisions for obtaining the highest download speed and an overall smooth downloading experience.

3. Check the seeds and peers

A peer is a computer which participates in the P2P sharing either for downloading or uploading. A seed is a computer who has got a complete copy of the file and is sharing that file in the network. A leech is a computer who doesn’t have a complete copy of the file, and is downloading the file at the moment. A leech becomes a seed when it completes the download and shares it over the network. It is always advisable to choose the files with more number of seeds and less no of leeches. That means the file with the highest seed to leech ratio.

4. Altering the firewall configuration

By default the firewalls block all the BitTorrent connections coming through. This can adversely affect the downloading speed. So you must make sure that your firewall is configured in such a way that it allows the BitTorrent connections through it. This can be done by checking the box ‘Add Windows Firewall Exception” in the firewall settings following the path options/preferences/connection. For ease some users may disable the firewall, but it is strongly advised that you shouldn’t disable your firewall that it will open your computer to serious threats. (www.techinterplay.com)

5. Limiting your upload rate

A peer to peer sharing is all about simultaneous upload and download. So every BitTorrent clients must upload some data at the same they are downloading some other data through torrent. For obtaining a high download speed you should vary your upload speed accordingly. Usually the upload maximum by the ISP is very much less than the download maximum. It is only 50Kbps for a 2Mbps connection. For fast downloading you can set your uploading speed to 80% of your maximum uploading speed. You must vary the speed as the download progresses for an efficient downloading. Keep the uploading limit maximum in the beginning and then slightly decrease it as the download progresses. In mTorrent the upload limit can be set from the option Global Upload Rate.

6. Selecting a different port

The default port for the BitTorrent file sharing is one between 6881 and 6999. As BitTorrent sharing involves high bandwidth usage the ISP’s usually throttle traffic on these ports. So you can increase the downloading speed by selecting some port above 10000. Usually mTorrent randomly assign the port as the application starts. So set a specific port with a number above 10000, by disabling the Randomize port checkbox.

7. Increasing the number of Maximum Half Open TCP Connections

Usually the maximum no of half open TCP connections in Windows XP with SP2 is set as 10 for blocking the virus multiplication. But torrent needs more. To facilitate this a patch TCPIP.sys is available. Through this patch you can set the maximum no of open TCP connections. Set it to any number between 50 and 100.

8. Protocol encryption

Some ISP’s constrict the bandwidth for P2P sharing. Protocol encryption can be used to override this restriction. Check the Allow incoming legacy connections box and make the outgoing  Encryption as Disabled for getting maximum speed on Torrent downloads. Between non-encryption is not advisable as it may lead to some encrypted client to be left as undiscovered.

9. Connections and bandwidth

The BitTorrent client you are using will allow you to enter values for Global maximum no of  connections: It is the maximum no of connections BitTorrent client can make for any P2P sharing. Setting this no to a very high value will take up useless bandwidth, and to a very low value will miss out some peers. For a 256kbps connection you can set this number to 130.

Maximum no of connected peers per torrent: Set this no to one which is closer to the no of available peers for the file. No of upload slots per torrent: It gives the maximum no of peers to which the BitTorrent client uploads at a time. Since a low settings may affect the download set it to a moderate low value.

10. Miscellaneous

Disable the individual files for download along with a particular file, if we don’t want them at the beginning of download. Be familiar with your BitTorrent client settings from the users manual or web.