Wednesday, February 11, 2015

postLunch Nonsense

Of the very limited set of I/O devices

    eyes [i] :  too strained
    ears [i] : I dont give a damn * abt wht others say
    nose [i] : pokin around is not ma hobby either
    skin [i] : occasional spurts of overload
    tongue [i] : tasteless job; am a lonely cook

Some one proposed a restructuring.
>>Install espeak and load the 'ears'
so there you go.

1. open terminal
2. pa@palin:~$ esp[tab]
    pa@palin:~$ espdiff[Enter]
    Please concentrate...
    No brainwave activity detected.  Aborting.
3. omg.
    pa@palin:~$ man espdiff[Enter]

4. Notable features
espdiff applies the appropriate transformation to a patch or set of
patches, depending on what you intend to accomplish.

Usage:
espdiff [--deep-brainwave-mode] [--recurse] [--compare] [file...]

>>
You may find it useful to cross your fingers while the program performs its task, or to screw your eyes tight shut while imagining it doing the right thing.

"--compare" Allows the program to scan the current directory examining existing patches to determine areas of code you are likely to change again, and concentrating on these areas more closely.

Limitations:
Do not use this program while sleep-walking, or before your first cup of coffee
<<

5. Cousins    //today, Ammu got a new cousin

   a. ESP-Based Forwarding. Refer rfc5984
   b. "about:mozilla"
   b. "about:robots" ['am coming]
   c. Android::Settings::AboutPhone::
       for index in range (5 or so):
            tap [Android version]  || [Build number] 

Tuesday, December 23, 2014

A Chilling story of a Blast Furnace!


A Blast Furnace at a German Steel works had suffered a "massive damage" following a security breach, says a report published by the German Federal Office for Information Security (BSI). The report says the attacker used spear phishing and social engineering to get into the plant network. This might be the second such high profile attacks in an industrial setup, the first being stuxnet. In fact, one can not stop wondering why such attacks are so rare, given the kinda security that we normally have in industrial installations.

Saturday, July 12, 2014

India's share in compromising the PKI

On 2nd of July 2014, Google's security Engineer Adam Langley posted in his blog about a serious security breach in the public key security infrastructure. Google found out that National Informatics Centre of India has issued several unauthorized digital certificates for google domains. NIC holds many intermediate certificates trusted by India's CCA, and the CCA's certificates are included in Microsoft's Root Store. So, the extend of compromise might be far and wide as several programs on windows might be afffected including chrome and ie. However, the blog post says that firefox is immune, so is chrome in other operating systems including android. As a security measure, in future Chrome release, India CCA root certificates will be limited to the domains/subdomains of gov.in, nic.in, ac.in, rbi.org.in, bankofindia.co.in, ncode.in, tcs.co.in (nic's site is maintained by TCS) 

I am very much curious as to how exactly this might have happened. Was it a kinda national-level surveillance/has someone hacked into the nic? Anyway, the most hilarious tweet I have read so far about the incident is by "Mikko Hypponen" @mikko "I'm not sure which explanation would be worse; that the National Informatics Centre of India was hacked. Or that they weren't."

Friday, June 27, 2014

Connect Rockwell's ControlLogix using OpenOPC*

OPC-based data exchage between a PLC and a computer system involves an OPC Server (like Rockwell's RS Linx, Siemen's WinCC etc ) and an OPC Client. As the protocols used in the domain of controllers are not so open as we have in usual computer networks, there is no (easy) way to eliminate the proprietary OPC Server that sits between your program and the PLC.

In the specific case that we are going to discuss here,  OPC Server is Rockwell's RS Linx. It is configured to communicate with Rockwell's ControlLogix 1756 Controller. A 'topic' is created, with appropriate data source/ip address. We use OPC Data Access specification 2.0 for exchanging data with the controllers. 

The code shows how to get data using OpenOPC, a python-based API that Barry Barnreiter has developed. It is free ( as in beer AND freedom! ) and is very easy to use as well. Most of the code listed  here is taken from OpenOPC's documentation itself. In fact, I had tried OpenOPC about an year ago at our lab, however, never used in real projects. At that time, it was used to exchange data with a linux box, using OpenOPC's gateway services to control a PowerFlex AC Drive through CompactLogix.

----------------------------------------------------------------------------------------------------------------
import os
import OpenOPC
import sqlite3
import time

print "Running Fresh Process" + time.asctime() + "\n"
dbfile='tagListSqlite3.db'      #database file
opcserver='RSLinx OPC Server'
topic='[test]'                          #Linx's topic
tag1='RIO_8:9:O.Ch0Data'
tag2='CURRENT_PASS'
taglist=[topic+tag1,topic+tag2]
sampletime=1                    
dbexist=os.path.exists(dbfile)  #checks if dbfile exists
db = sqlite3.connect(dbfile)
cur=db.cursor()
                                #create Table
                                #saves timestamps of all tags
                                #+might not be gud for u!
                                #we save a ref sys stamp as well
if not dbexist:
    sqlstring = 'CREATE TABLE opcdata (id INTEGER PRIMARY KEY, \
    tag1 TEXT, val1 TEXT, stat1 TEXT, timestamp1 TEXT, \
    tag2 TEXT, val2 TEXT, stat2 TEXT, timestamp2 TEXT, \
    atime TEXT)'
    cur.execute(sqlstring)
    db.commit()

while 1>0:                         
    opc=OpenOPC.client()
    opc.connect(opcserver)     
    [(opctag1, opcvalue1, opcstat1, opctime1), \
    (opctag2, opcvalue2, opcstat2, opctime2)] = opc.read(taglist)
    opc.close()
    
    atime = time.asctime()  
    sqlstring = 'INSERT INTO opcdata (id, \
    tag1, val1, stat1, timestamp1, \
    tag2, val2, stat2, timestamp2, \
    atime) \
    VALUES(NULL, \
    "%s", "%f", "%s", "%s", \
    "%s", "%f", "%s", "%s", \
    "%s")'\
    %(topic+tag1, opcvalue1, opcstat1, opctime1, \
    topic+tag2, opcvalue2, opcstat2, opctime2, \
    atime)
    cur.execute(sqlstring)
    db.commit()
    cur.execute('SELECT * FROM opcdata')
    dbvalues=cur.fetchall()
    dblen=len(dbvalues)
    print dbvalues[dblen-1]
    time.sleep(sampletime)

----------------------------------------------------------------------------------------------------------------

*OpenOPC is a copyright of Barry Barnreiter

Thursday, June 09, 2011

Thursday, June 02, 2011

Configure Grub 2 for Minix 3



Hardware: Eee PC 900 HA with Intel Atom Processor
OS Installed : Multiple - on hd0 - (hd0,1) : win; (hd0, 2) : ubuntu-lucid ; (hd 0, 3) : mint 10-julia; (hd 0,4) : Minix

Task: Configure Grub 2 to boot Minix 3, installed on 4th Primary Partition ; One may install Minix 3 on any primary partition, however it should not be too far away from MBR- plz refer user manual)

1. Edit file '40_custom' at /etc/grub.d/


Add following lines, however careful not to change the 'exec tail' line in the file.

insmod part-msdos
insmod minix
set root='(hd0,msdos4)'
chainloader +1


2. Backup grub.cfg (at /boot/grub/) and verify the change with

sudo grub-mkconfig


3. Update grub.cfg

sudo grub-mkconfig -o /boot/grub/grub.cfg

Friday, March 18, 2011

Another Interesting Stuff


>>P.J. Thomas, whose appointment as Central Vigilance Commissioner was quashed by the Supreme Court, on Wednesday petitioned President Pratibha Patil to obtain the apex court’s opinion on the legality of the judgment given by the three-member bench in his case.
“We have requested the President to invoke Article 143...The reason is that three judges’ judgment on the CVC is not legally valid because Article 145(3) clearly says that the minimum number of judges required for interpretation of Constitution is 5. In effect this judgment is null and void,” his lawyer Wills Mathews said. “Once it is null and void, it cannot be reviewed. That means there is a Constitutional crisis,” Mr. Mathews said <<

/dr-manmohan-singhs-fall-from-grace/

I never liked mms. How can he who has never won an election head the largest democracy...still he cud...still he manages to carry the tag of an honest person with impeccable integrity, howsoever a myth it is...not for long, I guess, if he is not so...the history is merciless in her dealings.

I had been thinking of giving a vent to my concerns over the way these people affect our lives. The democracy and its ideals offer not only  a workable solution for governance, but also instill a sense of worth, of pride in every citizen. Anyway, while going through a post in google buzz, came across a site which has very well expressed what is going on in Indian political scenario around mms. Have a look at this http://centreright.in/2011/02/dr-manmohan-singhs-fall-from-grace/http://centreright.in/2011/02/dr-manmohan-singhs-fall-from-grace/

Friday, March 11, 2011

Absolute Nothing

That day, he asked me several times whether I was serious about it, as if he had never expected me to make such a move at all, and in fact many of my friends  were as surprised as he was.

Early morning gives a fresh look at it.

As the self slowly evolves, it is bound to go through different phases. The innocent, "self-less" childhood gives its way to a restless teenage. Having no means to realize that it is a marathon, he sprints for some time, and then slows down into adolescence. The society and the life within seem to be a bit chaotic, still worthy of putting in effort. Confident about setting everything straight at the end of it, he embarks on a long journey, this time a bit overcautious as not to repeat the mistakes. However, gradually, he realizes that life too silly a journey. Anybody can win over it on his/her own terms - only on his/her own terms.

Do we really achieve anything through the life? 
Then what is the point in these debates.
Does it matter if it is capitalism/socialism?
Does it matter whether one lives for 10 yrs / 100 yrs?
What is the point of rewards/punishments?
Doesn't it make love as neutral as hatred?

I doubt whether this is my way to maturity for I still carry many a weakness. Nevertheless, I like the no-debate mode, and in fact I do perceive little conflicts within and without, hence the decision.