Archive

Archive for the ‘KnowHow’ Category

Tamil Steganography

December 3rd, 2010 No comments

A nice discussion on Tamil steganography that is worth sharing.. :)

Udayasankar said:

Came via shakty’s blog, interesting note on tamil and cryptography.  would like to know of any specific instances where a cryptic text and associated decipher key is available in Tamil. Are there known historical incidents in Tamil History where a use of cryptographic keys and texts are available, say similar to English Queen Mary’s use of cipher text which indirectly led to her execution. Or the Caesar cipher for instance. Any incidents you can point out.

Sudarshan, as in your comments on the blog, I am aware that the siddhas and mystics used indirect language and metaphors to express themselves to their select cliques, but then that does not amount to more than children making up their own dialects to bypass their elders.  could you point out any place where a real mathematical technique is used? for instance are there kalvettukkal or temple inscriptions which are in code?

I was wondering if the tamil language did indeed have a crypto concept that has mathematical backing as sakthy seemed to imply on his blog.  From what he wrote I took it to mean that this was a possibility rather than an established practice. However, the need to hide data is a universal impulse and i wondered if indian science and math did have some background in this. as to why specifically tamil, I will explain in a later mail. i am already aware that the mystics both Tamil and others, (much like the scientists of the eighteenth and earlier centuries.  Leornado, Newton, Leibnitz) coded their discoveries in cryptic text.

My response is:

i am not of an opinion that tamil were doing mathematical modeling on things that they practiced naturally like breathing.  the concept of mathematical modeling and theoretical proofs are the ideas of the west. if i am correct, our forefathers were men of practice, primarily based on observation sciences.   people observed the neighborhood carefully and identified interesting patterns. and these patterns are then connected to suitable inferences that were derived based on more observation and tuning..  if i have equate that to the current technology, the word is “statistical machine learning” without the approximations and model fitting.

i strongly believe that our men had insights which are passed on to their students as experiences on insights instead of mathematically explaining their insight like the west did.  our men had methods to conceive and transmit ideas without words (ex: bhagavath geetha 800 stanzas transmitted from the krishna “character” to the arjunan “character”).  our men understood non-linear time that exists, unlike the linear time definition of the west.  our men believed and practiced thought process instead of scripts.

ofcourse encryption was used heavily in the past, just in term of metaphors, symbols.  our guys did not work at the character by character level, instead at the context and semantics level.  anything that is semantic is difficult to model because of the heavy polysemous tamil language.

How to Tune 4S Motorcycle Carburetor

October 27th, 2010 No comments
Tuning a motor cycle carburetor could not be as easy as it could get.  All one should know for doing the tuning oneself is to guess the speed of the engine motor (the rotations per minute).  Have you ever wondered about the sound a motor makes when it starts and stops ??  I am meaning the MMRRMMRRMmrrmrrmrrmmm….. sound :)   If you know about that you can tune your motorcycle yourself.


The Basics

The motorcycle carburetor is meant for atomizing (converting the liquid to gas state) the petrol and send the gaseous fuel into the engine cycle for combustion.  So, a carburetor gets the petrol fuel from the petrol tank, mixes that with atmospheric air (after filtering it using air-filter) to atomize the fuel in to a fuel charge using the venturi float setup.  The fuel charge is fed into the engine cylinder for combustion.  The quality of combustion is a function of the air-fuel mixture ratio.  The air-fuel mixture is the ratio of quantity of fuel to the quantity of air.  When there is too much air in the charge, the mixture is called “lean mixture“, and when fuel is more than air it is called “rich mixture“.  For complete combustion, there should be enough air for combustion.  Complete combustion enhances mileage.  For pickup tuned bikes, the fuel is kept little higher than air.  Also for cold starts, one needs rich mixture for quick firing up.

Modern day bikes are equipped with Constant Vacuum Carburetors which ensure best air-fuel mixture by adapting to conditions.  The carburetor adjusts the air flow automatically based on the load on the engine despite the accelerator position.  This is done by the baloon and back-pressure setup in the CV carburetors.  The CV carburetors come with two adjustments, a) Idling b) Air-Fuel mixture.  The Idling setup is trivial, it is just a offset setting of the accelerator wire.  Adjusting the idling screw (the screw with a spring) is just like you accelerating a bit.  The air-fuel mixture setting is just a screw near the idling screw, most likely the screw with have dirt on it (I mean more dirt). The air-fuel mixture screw controls the air-fuel ratio.  Full tight means low or no air flow and Full loose means more air.

The Method

  1. Set the idling screw for little more throttling, meaning the engine should rev faster than before.  Typically, 10% more than the idling speed that you are used to.
  2. Set the air-fuel mixture screw to full close (tight, don’t tight it too hard). You should feel that the engine speed has reduced a lot now.
  3. Open the air-fuel screw slowly and observe that the engine speed is increasing.
  4. There will be a point, which if you cross by opening it further, the engine speed will start to decrease.
  5. You will have to adjust the screw to find the point where your engine speed is higher. Consider the following graph for better understanding.

The graph (indicative) shows the trend of the engine speed for various air-fuel screw positions and various idling speeds.  The green line is the locus of all the peak engine speeds.  To the left of the green line, you see the enriched mixture condition and to the right of the green line you can observe lean mixture condition.

Pre-Conditions

  1. Don’t tune the engine when it is cold (cold start conditions). You may rev it for a while and tune it.  Basically, the engine oil has to pass through all the chambers and gears (otherwise too much friction is offered).  The dynamics of the engine are different when it is cold and hot.  If you tune when it is cold, you may supply lean fuel  mixture when the engine gets hot. Because while cold start, the engine needs enriched fuel charge.
  2. Set the idling to a reasonable value when you tune.  Too low or high idling can get you local maxima conditions, where you would not get the best peak point (refer graph).
  3. Check whether the air-filter is in good condition.  If the air-filter is blocked, tuning will not help.  Likewise, engine oil level and viscosity should be good.

Tobacco Helps!

October 25th, 2010 No comments
There is very nice use for tobacco even for the non-smokers!  Most of the LMV, MMV, HMV drivers would know about this  trick, so I am just documenting a world’s secret. 

If you had driven your car on high ways on a rainy day, despite having a nice wiper, you might have had severe problems with water staying on the wind shield glasses.  When the windshield gets wet, water stays there for long to deplete the clarity of driver’s vision on the roads.  If it is night and raining, highways and high beam lamps, you would know how bad it feels to drive.

This is where Tobacco comes for help.  When tobacco is wiped on glass, it gives glass repulsion to water.  Assume that you have wiped a bit of oil on glass and sprinkle water over glass.  You would see that the water droplets are never attached to the glass, rather they roll out faster without disturbing the surface of the glass.  Likewise, tobacco adds a thin layer of protection against water without disturbing the transparency of glass.   So, if it rained, take some tobacco and apply it over the glass, following by wiping the glass with tobacco.  You would witness water droplets running on your windshield rather than sticking on it. 

Disclaimer: Test the acceptance of tobacco on your glass in small scale before applying it in full.  Because tobacco can stain your windshield glass permanently, if inappropriately used.  Also, the application of tobacco is one-time use only.  If it rained very heavily, this trick may not work as the force water would remove the layer created by the application.

மழை நீர் சேகரிப்பு தொட்டி

October 23rd, 2010 No comments

நான் இருக்கும் அடுக்கத்தில் தண்ணீர் தட்டுபாடு வெயில் காலங்களில் அதிகம், பல நூறு ரூபாய்கள் கொடுத்துதான் தண்ணீர் வாங்கவேண்டியிருக்கும். கடந்த ஆண்டு ஒரு தொட்டி (சுமார் 10000லி) தண்ணீருக்கு ரூ 750 வரை கொடுத்து கொள்முதல் செய்தோம். சக குடியிருப்போர், என்னுடைய உந்துதலின் பெயரில் மழை நீர் சேகரிப்பு செய்ய ஒப்புதல் மற்றும் உபயமும் செய்தனர். என்னுடைய தொட்டியில் வரைபடத்தை இங்கு தொகுத்துள்ளேன்.

முயற்சி #1

சுமார் 4000 ரூபாய் செலவில் அமைத்த தொட்டி கீழே கொடுக்கப்பட்டுள்ளது. இந்த திட்டத்தில் நன்மைகளும், தீமைகளும் இருந்தன. நன்மையெனில், செலவு குறைவு, திட்டப்பணி வேகமாக முடிக்கமுடிந்தது, தண்ணீர் சுத்தமாக வந்தது; தீமைகளெனில், பராமரிப்பு கடினம், compressor motor உடன் ஒத்துபோகவில்லை (மணற்படுகை பிரண்டது), தண்ணீர் வேகம் குறைவு.

முயற்சி #2

சுமார் 8000 ரூபாய் செலவில் அமைத்த தொட்டி கீழே கொடுக்கப்பட்டுள்ளது. இந்த திட்டத்தில் நன்மைகள் மட்டுமே இருந்தன. முதல் திட்டத்தின் தீமைகள்யாவும் களையப்பட்டன. செலவு மட்டும் இரண்டு மடங்கு ஆனது, இருந்தாலும் பராமரிப்பு சுலபம், கப்பிரஸர் மோட்டாருடன் ஒத்துபோதல், தண்ணீரின் வேகம் அதிகமாக இருப்பதால் செலவு பெரதாகத் தெரியவில்லை.

Powered by ScribeFire.

Fitting LED Strip to Getz Radiator Grill

August 15th, 2010 No comments

White (Blueish) LED strips with 3M water proof stickers are available for 300-350Rs/30cm.  These LED strips are pretty bright when illuminated and draws lesser power when compared to incandescent lamps.

Step 1: Open the Bonnet of the Car

Step 2: Identify the Parking Lamp + Head Lamp Positioning Motor Power Line

Step 3: Remove the Parking Lamp, Lamp Positioning Motor Power Connector

Step 4: Remove the Connector Shield to find the Power lines

Step 5: Find and Tap the Parking Lamp Line.

Step 6: Put the connector shield back on the connector
Step 7: Put the connector back on the Lamp assembly
Step 8: Turn on Parking Lamp; Hurray LED Strip is AWESOME.

Powered by ScribeFire.

CRB Plus Vs Active 4T

August 9th, 2010 No comments

I had been using CRB Plus for my Thunderbird bike for the engine compartment and the clutch case. For the gear section I am using a 90 grade oil.  Lately, I found that the clutch case was getting overheated within few minutes.  When I enquired about this to my mechanic, he advised me to try Active 4T oil.  Later that day, the oil from the clutch case was drained and refilled with Active 4T. Wow, the heat dynamics is much better now.  I am able to touch the case with my bare foot even after 1 hour of driving.  Thanks to Active 4T.

BSNL Broadband Connectivity Issue on Noise phone lines

April 10th, 2010 No comments

If you are an exclusive BSNL broadband user, you might not have attached the telephone to the phone line.  I have connected my Netgear modem to the DSL/Phone line splitter and left the other connection floating.  Lately, when I noticed that the Netgear modem was not able to make the connection with BSNL servers, originally I thought the telephone line is dead.  To my surprise the telephone line was fine, but I perceived the lines to be little noisy.  I made a complaint to the BSNL portal and as usual nothing much happened.  Accidently, I had to connect my telephone to the splitter for making a local call.  To surprise, the Netgear modem managed to connect to the server this time.  So, the hypothesis is;

When the telephone line is noisy, attach the telephone to the splitter along with the modem connection to get connected to the BSNL Servers.  Most likely it could be because of the Reactive load offered by the telephone on the phone line ends up conditioning the Phase modulated signals for the Netgear modem to connect to the Servers.

Powered by ScribeFire.

BSNL Broadband Unlimited usage

April 4th, 2010 No comments

Are you a BSNL Broadband user enjoying the 2AM-8AM unlimited access ?  Are you a person who has automated downloads programmed between 2AM – 8AM IST ? Are you seeing higher bill amount despite your carefully planning internet downloads during the unlimited access times ?  You should read this article for sure.

Do you know, you could track your internet usage on daily basis ? If not, register yourself at http://www.data.bsnl.in/. If you send the webmaster an email requesting for user account, you promptly get response within a couple of days with the required credentials.  You could login to the website to check your usage on a daily basis.  Infact, you can see your usage data for the past months also.  It is really very useful.  Alternately you could register your mobile number with BSNL and activate the notification service.   Upon activation, BSNL would send you SMS if your usage crosses the set-limit for your account.  See the following excerpts from BSNL website about this service.

If you are an user of BSNL Broadband and are not on any one of the unlimited plans, then you must keeping tabs on the data usage you have done. But what if you are on the move and not able to access the internet to check the data usage?

Simple, Send an SMS.

Yes, BSNL has now introduced a new feature where in you can now know your broadband usage via SMS.

How to Register for this New Feature?

Just SMS “REG Landline Number” prefixed with your STD code (For Example REG 080 23456789) to the following numbers:

52295: For Bsnl Mobile Customers.

9448077777: For Any Other Mobile Customers other than BSNL.

After Registering your landline number, you will receive a Thank you message and from then onwards, you can check the broadband usage of your account anytime by just sending an SMS.

How to Check the Broadband Usage of My Account?

Just SMS “BBU Landline Number” prefixed with the STD Code (EG BBU 080 23456789) to the following numbers:

52295: For Bsnl Mobile Customers.

9448077777: For Any Other Mobile Customers other than BSNL.

Note: This service is completely free, and you will be charged only for the SMS, based on your operator’s sms charges.

Coming back to the billing issue.  Lately, I noticed that I get very high BSNL broadband usage bills.  I wanted to keep a tab on that and sent a couple of complaint mails to BSNL billing.  But I did not get any response from them.  Following that I registered on the Broadband Usage statistics website mentioned before and was surprised to see that I had indeed used beyond my 2.5Gb limit (I have subscribed to 500C+ plan). 

When I looked the data usage pattern, I could figure out something very interesting about the way BSNL charges.  Consider that I have my automated download scheduled to start at 2:05 AM and stop at 7:55 AM.  I generally keep my machine in Sleep mode and have enabled the Scheduler application to wake up the machine for downloads.  Sometime, I keep the machine on over night.  I figured out that whenever I kept my machine on, I was charged for the usage even for the free-usage timespan.

Consider the case of a machine running over night.  When the machine is running the router to BSNL connection stays in “connected” state.  If the machine was in sleep mode, the connection is “offline” and whenever the machine wakes up, the connection is reestablished.  BSNL has setup the usage measurement exclusion only for the connections started after 2AM. Meaning if a computer was running over night and the connection status is “connected”, one may not get the free usage time-span.  Because the current connection is active and it was started before 2AM and hence the current connection is billable, as per the BSNL usage algorithm. 

The thumbrule here is: “Unlimited usage only for connections start at or after 2AM”.But interestingly, the 8AM connection is correctly handled by BSNL.  If you connection stretches beyond 8AM, the usage is billable for all the bytes transferred from 8AM onwards.

The following are the action points:

  1. Avoid running the computer over night with the connection is “connected state”. Because if the connection stretches beyond 2AM, you would not get the benefit of unlimited usage.
  2. Prefer to put the machine on sleep mode and make the scheduler wake up the machine for running your download tasks.
  3. Make the time of your computer synchronized with a standard time server like in.ntp.pool.org or time.windows.com
  4. Plan to start the download at 2:05 AM and stop at 7:55 AM
  5. Register on http://www.data.bsnl.in and keep a tab on your usage
  6. Register for SMS notification service

Powered by ScribeFire.

Restrict MSN file transfer

November 27th, 2009 No comments

MSN uses port 1863 to transmit messages and for file transfer.

Lot of people have said that the file-transfer using MSN happens via port range 6891-6900.  But when I experimented, I found that MSN is using same 1863 port.  Linux machines are able to identify this port as “msnp”.  I used “tcpdump” to verify this.  Whenever MSN attempts to send a file across the Internet, I creates several smaller packets (typically in the range of 536-1350 bytes) and sends them one after the other.  During the file transfer process, if there are messages (text or IM) to be transmitted, the message data block is piggy-backed on the file-transfer packets and sent across.

I was desperately looking for filtering the MSN based file-transfer for some official purposes and wrote some iptables rules based on the Internet literature that said file transfers happen via 6891-6900 by TCP.  Then, to validate the rules, I used tcpdump again on the gateway machine to monitor the packets that are originated from my machine. 
tcpdump src host dev02 -i eth1 -vvv
To my surprise, the file transfer was still happening also the ports are blocked.  Then I made an “iptables” rule to drop all the packets other than 1863 and repeated the experiment.  Still the file-transfer was happening.  I could see using tcpdump that the packet transfer is happening via port 1863.
tcpdump src host dev02 and dst port 1863 -i eth1 -vvv
So, it became apparant that the file-transfer and the text messaging are all happening via port 1863 instead of the port range 6891-6900.  I then decided to write an iptables rule to filter the packets using the packet size constraint.  A rule was written to drop packets that are more then 600 bytes assuming that the IM packets shall never reach the limit.

iptables -A FORWARD -i eth1 -m length -p tcp –length 600:65535 –dport 1863 -j DROP
iptables -A FORWARD -i eth1 -p tcp –dport 1863 -j ACCEPT
iptables -A FORWARD -i eth1 -p tcp -j DROP

I did see that the packet size is around 1350 bytes when files are transferred and that’s why I chose 600 bytes as the limit.  When I monitoring using the “tcpdump” command as before, I was surprise to see that the protocol adjusted the packet size automatically to 560 bytes to continue the transmission.  It tried with 1350 bytes for 3 times and as the acknowledgments were not received, it’s flow control mechanism reduced the packet size to 560 bytes and finished the transfer.  So, I had to redo the iptables rule:-

iptables -A FORWARD -i eth1 -m length -p tcp –length 600 512:65535 –dport 1863 -j DROP

It worked like charm.

The happiness did not last long.  When people logout and tried logging in, they were not able to login at all.  When I investigated the cause of this problem, I could see that the packets that are exchanged during the login process is more than 512 bytes (typically 1350 bytes).  So, I had to relax the rule for a brief time to let people login to MSN messenger service.  I enabled the file-transfer restriction after everybody logged in by enabling the iptables rule.
NOTE: iptables based filtering shall work only for packets that travel across the network.  If the MSN file-transfer happens inside the LAN, MSN cleverly does the file-transfer using P2P where the gateway is not involved at all.

Although, this is not a very good solution, it is definitely worth knowing about!
Happy firewalling!.

Compile 32bit C/C++ Application in 64bit Linux

October 8th, 2009 No comments

To build (cross compilation) 32 bit C/C++ applications on 64 bit linux box, use “-m32″ as a compiler argument.  You would need the following 32bit libraries in place.

  1. Install glibc.i386, glibc-devel.i386
  2. Install libgcc.i386
  3. Install libstdc++.i386

#include <cstdio>
#include <iostream>
main()
{
    std::cout << “C++” << std::endl;
    printf ( “long: %d\n”, sizeof(long) );
    printf ( “long long: %d\n”, sizeof(long long) );
    return 0;
}

To compile in native 64bit:
[sudar@tstsrv12 tmp]$ g++ -m64 -o out64 code.cpp

[sudar@tstsrv12 tmp]$ ./out64
C++
long: 8
long long: 8

[sudar@tstsrv12 tmp]$ ldd out64
        linux-vdso.so.1 =>  (0x00007fffc43fe000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003e7be00000)
        libm.so.6 => /lib64/libm.so.6 (0×0000000000601000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003e79e00000)
        libc.so.6 => /lib64/libc.so.6 (0×0000000000886000)
        /lib64/ld-linux-x86-64.so.2 (0×0000000000110000)

To compile in 32bit:
[sudar@tstsrv12 tmp]$ g++ -m32 -o out32 code.cpp

[sudar@tstsrv12 tmp]$ ./out32
C++
long: 4
long long: 8

[sudar@tstsrv12 tmp]$ ldd out32
        linux-gate.so.1 =>  (0×00130000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0×00133000)
        libm.so.6 => /lib/libm.so.6 (0×00223000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0024c000)
        libc.so.6 => /lib/libc.so.6 (0x0025a000)
        /lib/ld-linux.so.2 (0×00110000)