Pages

Tuesday, September 23, 2008

Formating a undetectable flash drive

Here some more recent RnD done on one of flash drive of friend - Rishit. He was about to dump harddisk data to professional data recoverer.. Eventually settled down on party ;-)

A Transiant flash drive of 120GB space, which was undetectable on WindowsXp.
Condition :
  • Drive undetected on Windows
  • Mounted on Linux-FC6, but could not delete dirty partition sectors
  • Nor move corrupted data to other location.
  • Drive was almost in condition to dump


===========================================
[root@localhost ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
23520588 20259704 2046832 91% /
/dev/sda3 101105 16544 79340 18% /boot
tmpfs 512748 0 512748 0% /dev/shm
/dev/sda2 30701264 25927728 4773536 85% /home/mahendra/D_drive
/dev/sda1 20972824 15270744 5702080 73% /mnt/c
/dev/sdb1 117218240 3006620 114211620 3% /media/Rishit Shah
[root@localhost ~]# mkfs /dev/sdb1
mke2fs 1.39 (29-May-2006)
/dev/sdb1 is mounted; will not make a filesystem here!
[root@localhost ~]# mkfs -t vfat /dev/sdb1
mkfs.vfat 2.11 (12 Mar 2005)
mkfs.vfat: /dev/sdb1 contains a mounted file system.
[root@localhost ~]# mkfs -t vfat /dev/sdb1
mkfs.vfat 2.11 (12 Mar 2005)
mkfs.vfat: /dev/sdb1 contains a mounted file system.
[root@localhost ~]# mkfs /dev/sdb1
mke2fs 1.39 (29-May-2006)
/dev/sdb1 is mounted; will not make a filesystem here!
===========================================

[root@localhost ~]# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2611 20972826 7 HPFS/NTFS
/dev/sda2 2612 6435 30716280 c W95 FAT32 (LBA)
/dev/sda3 6436 6448 104422+ 83 Linux
/dev/sda4 6449 9729 26354632+ 5 Extended
/dev/sda5 6449 9729 26354601 8e Linux LVM

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 14593 117218241 7 HPFS/NTFS
[root@localhost ~]# fdisk /dev/sd
sda sda1 sda2 sda3 sda4 sda5 sdb sdb1
[root@localhost ~]# fdisk /dev/sdb1

The number of cylinders for this disk is set to 14592.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb1: 120.0 GB, 120031478784 bytes
255 heads, 63 sectors/track, 14592 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

This doesn't look like a partition table
Probably you selected the wrong device.

Device Boot Start End Blocks Id System
/dev/sdb1p1 ? 13578 119522 850995205 72 Unknown
Partition 1 does not end on cylinder boundary.
/dev/sdb1p2 ? 45382 79243 271987362 74 Unknown
Partition 2 does not end on cylinder boundary.
/dev/sdb1p3 ? 10499 10499 0 65 Novell Netware 386
Partition 3 does not end on cylinder boundary.
/dev/sdb1p4 167628 167631 25817+ 0 Empty
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

Command (m for help): d
Partition number (1-4): 1

Command (m for help): d
Partition number (1-4): 2

Command (m for help): d
Partition number (1-4): 3

Command (m for help): d
Selected partition 4
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

===========================================
Tried deleting all partitions but w command in fdisk dosnt work. Its bad man.

[root@localhost ~]# mkfs.vfat -F 16 /dev/sdb1
mkfs.vfat 2.11 (12 Mar 2005)
mkfs.vfat: /dev/sdb1 contains a mounted file system.

Final try for umounting & then formating the drive

umount -f /dev/sdc1
[root@localhost ~]# mkdosfs -F32 -I /dev/sdc1
mkdosfs 2.11 (12 Mar 2005)
[root@localhost ~]#



Wow !!! I removed the drive & reconnected

[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
23G 20G 2.0G 91% /
/dev/sda2 30G 25G 4.6G 85% /home/mahendra/D_drive
/dev/sda3 99M 17M 78M 18% /boot
tmpfs 501M 0 501M 0% /dev/shm
/dev/sda1 21G 15G 5.5G 73% /mnt/c
/dev/sdc1 112G 16K 112G 1% /media/disk-1

It works !


Thursday, September 18, 2008

Remote Printer on Linux - FC6

Had encounter with printer configuration on Dell laptop. I did it myself as we had no system admin for linux

Lets see how we can install/config remote printer :
  1. Make sure cup daemon is running
  2. /etc/init.d/cups restart , u can check by ps -eaf | grep cup
  3. Add printer from System-->Administration-->printing
  4. Select valid driver/model. General linux printer driver list/ dtd file list comprise most of standard printers. If some printer name is not available, select closed cousin of it. Eg HP Deskjet 5500 is not present in FC6, select Deskjet 3300. It works !
  5. Select host-name (ip addr) of printer machine. Put port 9100 as its default port.
  6. Device URL should look like socket://<-ip->:9100
  7. Do finish once u see correct URL.
  8. Try printing test page
  9. Wow ! It works!!!
First time opening printer adding wizard may hang your machine. May be due to huge resource use.

I got +ve results on FC6 on Dell D520 and CentOS 5.0 on Dell D630

Problems welcome !!!


Monday, September 15, 2008

Thunderbird mail backup/moving/shifting to other machin

Hi All,

Another post to save your mails.

Mozilla - Thunderbird always get installed at its location but keeps mails & configs in user's home.

On Linux/Unix system :
/home/mahendra/.thunderbird

while on windows :
C:\\Document & Se...\mahendra\.Thunderbird\

structure in /home/mahendra/.thunderbird :
[mahendra@localhost .thunderbird]$ pwd
/home/mahendra/.thunderbird
[mahendra@localhost .thunderbird]$ ls -1
17jgza7q.default
appreg
profiles.ini
[mahendra@localhost .thunderbird]$
17jgza7q.default is directory for default mail address.

[mahendra@localhost .thunderbird]$ cd 17jgza7q.default/
[mahendra@localhost 17jgza7q.default]$ ll
total 5936
-rw-rw-r-- 1 mahendra mahendra 0 Apr 14 15:39 abook-1.mab
-rw-r--r-- 1 mahendra mahendra 202839 Sep 15 17:29 abook.mab
-rw-r--r-- 1 mahendra mahendra 248 May 28 11:22 blocklist.xml
-rw------- 1 mahendra mahendra 65536 Sep 15 11:17 cert8.db
-rw------- 1 mahendra mahendra 144 Apr 7 10:33 compatibility.ini
-rw-rw-r-- 1 mahendra mahendra 169297 Apr 7 10:34 compreg.dat
-rw------- 1 mahendra mahendra 235 Aug 22 2007 cookies.txt
-rw-r--r-- 1 mahendra mahendra 4118 Sep 15 15:55 downloads.rdf
drwxr-xr-x 6 mahendra mahendra 4096 Jan 24 2008 extensions
-rw-r--r-- 1 mahendra mahendra 604 Apr 7 10:34 extensions.cache
-rw-r--r-- 1 mahendra mahendra 527 Apr 7 10:34 extensions.ini
-rw-r--r-- 1 mahendra mahendra 8889 Apr 7 10:34 extensions.rdf
-rw-r--r-- 1 mahendra mahendra 1438 Aug 20 2007 history.mab
drwxr-xr-x 3 mahendra mahendra 4096 Aug 20 2007 ImapMail
-rw------- 1 mahendra mahendra 16384 Sep 15 11:17 key3.db
-rw-r--r-- 1 mahendra mahendra 33265 Sep 15 17:29 localstore.rdf
lrwxrwxrwx 1 mahendra mahendra 15 Sep 15 11:22 lock -> 127.0.0.1:+6722
drwxr-xr-x 5 mahendra mahendra 4096 May 27 18:29 Mail
-rw-r--r-- 1 mahendra mahendra 477 Jan 17 2008 mailViews.dat
-rw-r--r-- 1 mahendra mahendra 8161 Jul 22 13:05 mimeTypes.rdf
-rw-r--r-- 1 mahendra mahendra 46531 Sep 15 17:52 panacea.dat
-rw-r--r-- 1 mahendra mahendra 45 Aug 7 20:11 persdict.dat
-rwxr-xr-x 1 mahendra mahendra 14641 Sep 15 11:17 prefs.js
-rw------- 1 mahendra mahendra 16384 Jan 17 2008 secmod.db
-rw------- 1 mahendra mahendra 269 Jul 21 11:26 signons.txt
-rw-r--r-- 1 mahendra mahendra 18922 Aug 29 16:39 training.dat
-rw-r--r-- 1 mahendra mahendra 0 Aug 20 2007 urlclassifier2.sqlite
drwxr-xr-x 2 mahendra mahendra 4096 Aug 20 2007 US
-rw-r--r-- 1 mahendra mahendra 10 Sep 15 11:17 virtualFolders.dat
-rw-r--r-- 1 mahendra mahendra 1083041 Feb 28 2008 XPC.mfasl
-rw-rw-r-- 1 mahendra mahendra 109260 Apr 7 10:34 xpti.dat
-rw-r--r-- 1 mahendra mahendra 4144667 Sep 2 18:23 XUL.mfasl



Actual mails are present in :
/home/mahendra/.thunderbird/17jgza7q.default/Mail/Local Folders


Whenever u want to change the machine/laptop OR want to backup state of mails at that pertucular time. Zip the /home/mahendra/.thunderbird/17jgza7q.default/Mail and save it to backup locations.

To replicate the mails on other machine. Install Thunderbird & unzip the Mail folder at same location.
Similar stuff is also possible for other Mozilla products like Firefox...
Addons, Plug-ins , bookmarks can be saved in similar fashion.

C U :)

Friday, September 12, 2008

Twittering with world!!

We would always love to be in touch with all. Here is the asap way to be updated & to update other about what you are doing?

Yes. I'm talking about "Twitter" with Widset http://www.widsets.com/

I 've been using Widset from last 2 months. It been always in very frequently used programs.

My updates : http://twitter.com/mahenT
Somemore details http://friendfeed.com/mahent

I'm sure you 'll love to be connected & updated with your mobile phone. :)
There 1000 things u can do with your widset. You can create own widset, rss feed reader, whether updates, games, list is huge....

Wednesday, September 10, 2008

SSH connection reuse

It really speedup my ssh connection & never prompt passwd for second connection to same host.
Very handy to use.

Open ~/.ssh/config file (ssh client configuration file). If you need system wide settings add to /etc/ssh/ssh_config file:
$ vi ~/.ssh/config
Append following code to reuse ssh connection for all hosts:

host *
controlmaster auto
controlpath /tmp/ssh-%r@%h:%p

Where,

  1. controlmaster auto: Set controlmaster to auto
  2. controlpath /tmp/ssh-%r@%h:%p: Specify the path to the control socket used for connection sharing. In the path, ‘%h will be substituted by the target host name, %p the port, and %r by the remote login username. It is recommended that any ControlPath used for opportunistic connection sharing include at least %h, %p, and %r. This ensures that shared connections are uniquely identified.

You can also match any host in the 192.168.0.[0-9] network range with following pattern:

Host 192.168.0.?
controlmaster auto
controlpath /tmp/ssh-%r@%h:%p

For any host in the ".co.in" set of domains, reuse the connection:

Host *.co.in
controlmaster auto
controlpath /tmp/ssh-%r@%h:%p

Save and close the file. Now connect as usual,
$ ssh vivek@vpn.nixcraft.co.in
Next, time you connect again it will use connection socket /tmp/ssh-vivek@vpn.nixcraft.in:22 to speed up things. You don't have to input password or anything else. You need one connection to be active for the second to be accelerated. This also works with scp / sftp etc:
$ scp /path/to/file.txt vivek@vpn.nixcraft.co.in:/tmp


Welcome if still its not working on your machine.


You can have ~/.ssh/config file configured as
===============================================

host lin
hostname 172.16.13.20
user root
port 22

host Lin
hostname 172.16.13.20
user mahendra
port 22

host *
controlmaster auto
controlpath /tmp/ssh-%r@%h:%p

===============================================

Comments welcome !!!

Friday, September 5, 2008

Getting Hardware information without opening Box on LInux

With Linux- FC6 running on Dell machine, How can I get hardware info of my machine?

"dmidecode " is the key command to fetch such info.

Command is readily available on most of Linuxes

Here is some more details on same command :
-t, --type TYPE
Only display the entries of type TYPE. TYPE can be either a DMI type number, or a comma-separated of type numbers, or a keyword from the following list: bios, system, baseboard, chassis, pro cessor, memory, cache, connector, slot. Refer to the DMI TYPES section below for details. If this option is used more than once, the set of displayed entries will be the union of all the given types. If TYPE is not provided or not valid, a list of all valid keywords is printed and dmidecode exits with an error. Mutually exclusive with --string.

[root@localhost drive_c]# dmidecode -t1
# dmidecode 2.7
SMBIOS 2.4 present.

Handle 0x0100, DMI type 1, 27 bytes.
System Information
Manufacturer: Dell Inc.
Product Name: Latitude D520
Version: Not Specified
Serial Number: DV9SQ1S
UUID: 44454C4C-5600-1039-8053-C4C04F513153
Wake-up Type: Power Switch
SKU Number: Not Specified
Family:


We can use type in below format :
Type Information
----------------------------------------
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply

Keywords can be used instead of type numbers with --type. Each keyword is equivalent to a list of type
numbers:

Keyword Types
------------------------------
bios 0, 13
system 1, 12, 15, 23, 32
baseboard 2, 10
chassis 3
processor 4
memory 5, 6, 16, 17
cache 7
connector 8
slot 9

Keywords are matched case-insensitively. The following command lines are equivalent:

· dmidecode --type 0 --type 13

· dmidecode --type 0,13

· dmidecode --type bios

· dmidecode --type BIOS



Here is some more command info , very frequently used :

top - I guess u know ;)
vmstat - Virtual memory stats
iostat - I/O stats
uptime - load avg
sar - system activity report
lspci - show all PCI peripherals attached to system


Welcome !!!

Monday, June 16, 2008

Finding a home on rent in Pune

Social

One can't imagine how much effort one need to take for getting a good 3-4 room residential flat on rent in city like Pune or Mumbai. Indian cities are getting denser and denser with major population moving from village to urban area.


Day 1 :

I was full of enthusiasm to get a proper broker/agent and hence proper flat in area I wished. Yesterday, I ad searched a lot on Internet to get rented flat in Pune. I found magic bricks and other sites helpful to get contact info of agent & other flat owner. While leaving office I made a long list with mobile numbers & names of brokers who can help me in last moment

I moved from Mumbai in early morning (in my case its 9.00 am). Got a travels vehicle of Konduskar (famous tours & travels in Maharashtra) with a window sit wort Rs 280/- . Person sitting next to me : Mr Satyajit was cool dude like me. He wasn't feeling well. Had fever and improper health. But was good in chit-chatting while traveling. We shared good amount of each others domain knowledge. He was working in garment industry working for brands like Zodiac & Pentloon. Shared good memories of interests, carriers, society, fashion and fun.

By the grace of rain fall and mild traffic conditions I reached Pune at 1.00 o'clock in noon. First thing I targeted was Shivaji nagar. Met the first person in the list Mr Rajesh, a typical Punekar in early 40's , blackish complexion with very strong voice and commitment.


Questions asked for searching :

Name :

1BHK or 2 BHK (bedroom, hall & Kitchen)

who's living family/bachelors :

No. family members :

Who/ What they do:

Is family vegetarian or non-veggi :

Rent budget :

When to take keys and give token money :

I felt very embarrassing when he asked me my surname & cast, here comes the bad human nature in Pune. More due to some Brahman community in Pune.

Pune has been well known for culprits who prefer to see surname (which very good indication of the somebodies cast in India). Thats what is in NAME and its not what great Shakasphere had said, “ Whats in name”, rather I would say its all revolves around your name.

Let me proceed from cyclone of religion and cast ism. Mr Gosavi shown me few flats around the area, varying from 8K to 13K. I like one of them, but still rent around was more as compare to my budget. The day went on traveling and contacting new people/ agents and finally ended with nothing decided at last moment.

At 9.00 pm, I was dropped to Kothrud by Mr Gosavi. Thanks a lot for the same. I met my friend Mangesh, Satyawan & Nilesh, who were waiting for me eagerly to have party meet. As usually we celebrate with toss of pegs of Royal Stag. I don't remember when I felt sleepy and went off. I remember I had good time chatting with Nilesh. He really explained how he searched his girl for marriage. We shared very good moments of our last few bachelor parties. I also had talk with his fiancee. I shared very core memories my & Nilesh friendship with her. She understood me very well. Lucky chap Nilya. With my best wishes. Just before sleeping, I had very serious talk with Mangesh about life and stuff like that. I can't recollect such thoughts & chats again. That was pretty volatile. Anyways enjoyed the evening after very hectic day.


Day 2 :

Again wake up early in morning at 8.30 am. Met my cousin Mr Arjun, nick named Bandu daji (big brother). He introduced me very interesting character called Mr Ashok. A typical Beed kar, very talkative, pheku (who lies many things), a aspirational MBA passout from Bharati Vidyapith (as he said, I still doubt whether he had or not) but works as a sales person for Idea Tel com. He had good contat with other brokers & friends around the place.

Day went on calling other brokers, looking few more new locations. Finally decided one near Bharati Vidyapith on Satara road.

Friends, by the end of the day I was drained out of energy. Bandu daji arranged fish in evening. I took lot of time in filtering out the thorns from fins of fish. Slept in midnight. It was Sunday night. I was suppose to be in office on Monday morning.


Day 3:

Wake up too early at 7.30 am. Got ready to go Mumbai. But plan changes as we were still not finished with perfect place to stay in Pune. I was suppose to be in office, took urgent leave for a day. Thanks my company provide such facility. I called up one more broker.

I was badly screwed with the rain and conditions. Finally I fixed a place in Upper -Sukhsagar area with help of Bandu daji..

It was overall good experience rather adventure i would say...


Worst part of it was, when the agent ask from surname,cast, veg/non-veg like things..I don't think anybody 'll like such things. Would you still say India is a non-racial, cast independent country?
Best part is, many people help you around without any money expectations.

Thank a ton to all...

Thursday, June 5, 2008

Stay Connected to the world

These days, it's all about staying connected. Sometimes you're stuck at your desk and you need to ask someone an urgent question. Sometimes you're on unfamiliar turf and you need a guide. This month, we look at an improved instant messenger and a Wi-Fi service that helps you find local businesses from your laptop or mobile. Both are as free as air.

nimbuzz
twitter
ebuddy
meebo
yahoo online chat for mobile


The Loki Toolbar allows you to do location-based search and navigation right from your browser. The Toolbar combines GPS-like location, local search and one-button access to location-based content, making the Internet revolve around you

www.loki.com

How media going more n more vulgar

Can you imagine kids watch (don't read) English newspapers to see sexy babes..
I could remember 6-7 years before, things were different. We could hardly see some really vulgar stuff in any news paper. One has to go n get something very relevant magazine or paper.

Pic from TOI : date 5 June '08 , Mumbai News Paper release, Second-last page of main print.

On daily basis I can see at least 2-3 such semi-nude pics. This is good enough to ignite small minds.

I would say : rather then just blaming TOI or some other news agency. We should think of how society
is liking.

Its not only TOI, rather we as nation should think to change the way people think

Don't you think some portion of blame also come to us. After all its your child who is gonna suffer.


Pls think why something is so?
comments Welcome !!!

Wednesday, May 28, 2008

My Mobile surfing

I Hope this 'll be of great help when you are alone at some lonely place. You can go ahead and get in touch with help of WAP portal which are helping mobile user in great extend. I feel it's more like a Internet of Mobile world, which is growing like anything.


Google http://wap.google.com/
Google http://mobile.google.com/
Gmail - http://www.nodrm.com/gmail
Google Maps http://wap.mgmaps.com/
Yahoo http://us.m.yahoo.com/?tsrc=rawfront
Yahoo - http://wap.yahoo.com
Yahoo Messenger - http://mm.yahoo.com
Rediff - http://mobile.rediff.com
Cellfun http://wap.cellufun.com/
GCalSync http://wap.gcalsync.com/
WAP community http://www.wap.com/
Mobiile Content http://wap.mobile9.com
Mobile Softwares Download wap.getjar.com
Send Email Anonymously - http://webcab.de/sm.wml#WSM
Live Cricket Scores - http://wap.ananova.com/sport
Dictionary - http://dictionary.reference.com/wml/#dict
Free Greeting cards - http://www.wapcardz.com
Hotmail - http://mobile.msn.com
MSN Messenger - http://mob.e-messenger.net
Symbian Softwares - http://wap.my-symbian.com/wap
Pocket Doctor - http://wap.pocketdoctor.co.uk
BBC UK - http://bbc.co.uk/mobile
Browser Spy - http://wap.gemal.dk
BSE India - http://wap.bseindia.com
Check Domain Name - http://wap.checkdomain.com

AOL wap.aol.com/
JIMM wap.jimm.org/
USA Today wap.usatoday.com
Swiss Info wap.swissinfo.org/
MLB wap.mlb.com/
http://www.getjar.com/software/
http://www.mobile9.com/

And list goes on increasing...