Sunday, December 16, 2018

Ever felt angry about a terrible PDF document with tabulated data you like to analyze in spreadsheet? I did. I tried a lot of tools, including Adobe's import to table feature. Adobe Acrobat Standard at times can get the job done with some pretty poor formatting error.
Now, check out Tabula. It's a Java based tool, so, works in all platform. On execution, a web browser pops open where you need to upload you table filled PDF and ask Tabula to process it. On a next screen, you can pick and choose your table and tabula will do its magic to extract the table and export it to csv if you like.
For the most part, it works like a dream.

Wednesday, March 30, 2016

Operation Canon EF-S 17-55 f2.8


Craigslist can be the best place for picking up great deals on photography stuff if you are willing to take some risk. This preowned EF-S 17-55 f-2.8 was purchased from CL for $400, almost 1/2 off sticker price. The autofocus of the lens works great but manual focus ring is loose and was hated across board for shoddy construction. So, after a quick a google around, I go into operation table with my newly acquired tool. Below is the step by step dissection of the lens till i reach the focus ring. Tightening it up and put it back together in one hour. On my way, I had to deal with some very tiny screws and magnetic tips came in handy.





















Wednesday, July 29, 2015

United airlines UA82 and UA83.

I had the luck of flying out of Newark to new Delhi on United UA82 and coming back on UA83. Being spoiled by the asian airlines, I was expecting somewhat newer planes but was dumbfounded with the look of dated Boeing 777-200 that United was operating out of Newark.
these planes do not have personal air fan outlets. So like it or not, you are stuck with the common airflow of the plane. The entertainment system was sketchy at best. half the time the screen does not respond to my touch. Selection was good while I was able to use the proper touch. Another annoying thing about our plane, the downward graded food table. So putting anything in your food tray can spill right on your pant. Never had that before.
Now here is biggest peeve, the food. United decided to have some scumbugs to do their inflight menu selection. It was a complete mess and bears no resemblance to food from from anywhere of this world. It was out of ordinary in a bad way. Never in my life I have seen sausage served with a hot indian mango pickle. Food was still bad on my return journey, but it was slightly more edible.
So my advice, if you are flying out of Newark on UA82, pack your little box of comfort foods.

Thursday, June 18, 2015

Excel tricks-
I needed to generate fake data set for a project to verify the scalability of a db project. Need to create a string of random set of words in a cell. So here is my solution. It will okk for a cell that is no tblank in column A. It will index from cell A1 to A10 and create a random order of the indexed words in column B.


=IF(NOT(ISBLANK(A1)), INDEX($A$1:$A$10, RANDBETWEEN(1, ROWS($A$1:$A$10))))

Tuesday, April 22, 2014

Galaxy Note 2 battery drain after Android 4.3 upgrade

My Galaxy Note 2 was recently upgraded to JB 4.3 from a very old JB 4.1. To my horror, I saw my battery was draining like crazy and charger can not keep up with the drain when wifi is on. Initially I thought it is misbehaving app perhaps and therefor did a factory reset. That did not solve the problem. Went back to google and found out there may be a solution by enabling "developer mode". To achieve this small feat you need to click on your device properties and tap on 10 times (you read that right, so intuitive) on base band information. After that, everything seems normal now.

Tuesday, March 25, 2014




Monday, March 03, 2014

Ref- http://www.ramil.pro/2013/01/bash.html

1) If condition

There are 3 options:

1) if..then..else..fi

2) [ condition ] && ( expression-if-true ) || ( expression-if-false )

3) test condition && expression-if-true || expression-if-false

2)  Loops

1) Standard for..in

for arg in list;
do
 commands
done

2) C-like for (attention! double brackets!)

for (( i=1; i <= 10; i++ ));
do
 commands
done

3) While loop

while [ condition ];
do
 commands
done

or 

while (( C-like condition ));
do
 commands
done

4) Until loop

until [ condition ];
do
 commands
done

break [N] - exit the loop
continue [N] - start over

Example:

for (( j=0; j<3 -gt="" arr="" code="" do="" done="" fi="" for="" i="" if="" j="" then="" tmp="">

3) Functions

function function_name {
 commands
}

or

function_name() {
 commands
}

exit and return just work as usually

4) Arrays


declare -a array - declare the array first

define value:
a[13] = "foo"

retrieve value:
${a[13]} - only this way!

5) Strings

String length:
str="string"
len=${#str}

Substring:
${str:pos}
${str:pos:len}

Remove part of string:
${str#substring} - remove the shortest part from the beginning
${str##substring} - remove the longest part from the beginning

${str%substring} - remove the shortest part from the end
${str%%substring} - remove the shortest part from the end

Replacement:
${str#substring/replacement} - from the beginning
${str%substring/replacement} - from the end

6) case..in..esac 


case $variable in
condition 1)
 actions
;;
condition 2)
 actions
;;
esac

7) I/O

Read the input:
read -p "Input string: " str
echo $str

8) Features

$@ - arguments array
$1$2$n - arguments in order
$0 - program (self) name
$# - arguments number
$* - all arguments as one sting
$_ - last argument of the last command
$? - previous command return code
$$ - own PID
$! - PID of the last background process
!! - previous command as a string
(( a += 1 )) - double brackets let us code like C

$RANDOM - returns a pseudorandom value within 0..32767

declare -r constant - declare as read-only
declare -a - declare as array
declare -i - declare as integer

Tuesday, December 10, 2013

Source- http://groups.yahoo.com/neo/groups/linux_ipsr/conversations/topics/5818
http://192.168.1.125/~web/cgi- bin/webmo/login.cgi
WEBMO configuration for Ubuntu 10.04 [  Apache/2.2.14 (Ubuntu)  Server at  192.168.1.125 Port 80  ]
1) sudo apt-get install Perl 
2) sudo apt-get install libapache2-mod-perl2
3) sudo apt-get install VIM
4) $ sudo a2enmod module_name        
 (i) cgi,
(ii) cgid and
(iii) userdir 
         

 5) $ sudo /etc/init.d/apache2  restart
6) $ cd  ~
7) $ mkdir /home/web/public_html/webmo
8) 
$ mkdir /home/web/public_html/cgi-bin/ webmo


  • htmlBase: /home/web/public_html/webmo
  • cgiBase: /home/web/public_html/cgi-bin/ webmo
  • userBase: /home/web/webmo

9) $ cd /etc/apache2
10) $ sudo gedit  sites-available/default
11) ScriptAlias /cgi-bin/ /home/web/public_html/cgi-bin/
                     ScriptAlias /cgi-bin/  /home/web/public_html/cgi-bin/ webmo                    

 12) $ sudo /etc/init.d/apache2  restart

13) $ web@ubuntu:/etc/apache2$ sudo cp default defaultxyz

14) /etc/apache2/sites-enabled/

15) ln -s ../sites-available/default

13) $ web@ubuntu:/etc/apache2$ sudo cp default defaultxyz
14) /etc/apache2/sites-enabled/
15) ln -s ../sites-available/default
13) $ web@ubuntu:/etc/apache2$ sudo cp default defaultxyz
14) /etc/apache2/sites-enabled/
15) ln -s ../sites-available/default
13) $ web@ubuntu:/etc/apache2
$ sudo cp default defaultxyz
14) /etc/apache2/sites-enabled/
15) ln -s ../sites-available/default13) $ web@ubuntu:/etc/apache2$ sudo cp default defaultxyz
14) /etc/apache2/sites-enabled/
15) ln -s ../sites-available/default13) $ web@ubuntu:/etc/apache2$ sudo cp default defaultxyz
14) /etc/apache2/sites-enabled/15) ln -s ../sites-available/default

web@ubuntu:/etc/apache2$ sudo vim sites-available/default

    ServerAdmin webmaster@localhost

    DocumentRoot 
   
        Options FollowSymLinks
        AllowOverride None
   

   
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
   


    ScriptAlias /cgi-bin/ /home/web/public_html/cgi-bin/ webmo
   
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                SetHandler cgi-script
        Order allow,deny
        Allow from all
   


    ErrorLog /var/log/apache2/error.log


Wednesday, April 06, 2011

Six C of Career control

The Six C’s of Career Control

 
6 Votes

There are six methods that you can use on a day-to-day basis to help manage your chemistry career. These are applicable whether you work in a laboratory, management, sales, a non-traditional chemistry career or are self-employed. Practicing the “6 C’s” of career control will enable you to meet deadlines while providing high-quality work that meets your manager’s requirements. By practicing the 6 C’s, you’ll also reduce the stress associated with deadline pressures and increase your productivity. So what are the 6 C’s of control?
Control the clock
Some of us spend our entire careers struggling with time management. Time management is a skill that we are always developing. Even the best of us probably can improve. Some people manage their time well getting through an impressive amount of work in an 8-hour day. My manager in my first industrial research job used to advise me, “Work smarter, not harder.” I was doing the second but it took a while to learn how to do the first. Others work longer hours than necessary to complete an adequate amount of work. If you are a chemical consultant paid by the project, not by the hour, this means earning less than you otherwise would.
Effective time management requires productive work habits. Learn the length of time you can work productively without a break. Then schedule your time to provide for daily blocks of this length during which you work without interruptions. Use other, perhaps shorter time blocks, for checking e-mail, telephoning, reading, and other workplace chores. Also understand what times of day you are most productive. Then schedule your most demanding tasks for this time.
Tracking and scheduling your time helps you manage it more efficiently. I find the simplest methods are the most useful. I record deadlines and times of meetings on a large month-at-a-glance calendar hanging on the wall above my desk. I put my to-do list and appointments on a daily calendar. I’m old fashioned and list my daily tasks and note their completion on a paper planner with a separate page for each day.
Control your interruptions. Interruptions can kill productivity – primarily by disrupting your train of thought. The main culprit is the telephone. So use caller ID to screen phone calls and answer only the truly important ones immediately. Otherwise, schedule time blocks to answer telephone messages and to make calls of your own.
Control your concepts
Make good use of your creative imagination. When I’m exercising or engaged in intellectually undemanding tasks, I think about work projects. This strategy seems particularly useful for short tasks. As a result of my preliminary thinking, I often can write short memos, e-mails and other documents manuscripts quite quickly using short time blocks or unexpected openings in my schedule.
Control your contacts.
Who you know is how you grow. So focus your attention on productive colleagues both within and outside your employer. While you should strive to be helpful to others, your time is too valuable to spend it on people who are overly demanding or ungrateful for your assistance.
By the same token, make your networking contacts value you by providing value to them. This can be by providing advice, helping on projects or just being a sounding board when they want to talk about their problems or frustrations.
Control your communications
Periodically keep your manager, team leader and coworkers apprised of your progress on work projects. If there is a miscommunication regarding one of your assignments, this strategy can help resolve it before you spend too much time working on the wrong things.
Control your commitments
It’s hard to say no to managers and colleagues when they ask you to take on extra work. However, over-commitment can lead to slapdash work and missed deadlines. There is nothing that will destroy a relationship with a manager or team leader faster and more completely than not meeting a deadline or turning in substandard work.
I use a four-step process to meet deadlines:
• Use a month-at-a-glance calendar to track deadlines and your progress in meeting them.
• Set your own deadlines for all your projects. Make these at least a week before your manager’s deadlines. That way, if you fall behind schedule, you can still meet your deadlines.
• Develop intermediate goals (milestones) and deadlines for large projects. Achieving your milestones on schedule helps the entire large project on schedule.
• Negotiate a revised deadline as soon as you can see there will be a problem meeting your manager’s assigned deadline.
Meeting commitments is more than just meeting deadlines. It is also submitting high quality work that needs minimal changes to be acceptable. Doing this helps you win rewarding assignments later. During the course of my own career, I have found that what managers value most in their staff members is completing high-quality work on time.
Control your concerns
Much of our workplace is beyond our control. Frustrating situations are commonplace. One has to focus on productive projects and not dwell on these frustrations – easier said than done.
Controlling your emotions means not venting to a manager or a coworker who might not respect the privacy of your communication. Having trusted colleagues can enable you to vent your frustrations and discuss ways to bounce back from disappointments. This can be very valuable to both your emotional health and your career. You can develop these trusted relationships with a mentor, an occasional coworkers and friends from your academic days. Confiding in family members can also be helpful although if they aren’t chemists they may not understand the nuances of your workplace problems. Getting over these frustrations and moving on will enable you to better direct your energy towards future success.

Wednesday, March 16, 2011

Samsung Spinpoint F3 and SHA-1205SA

I have a Dell 667R desktop running as my NAS/web/ssh server and I always wanted to add some SATA drives to increase the storage and retire age old PATA drives. So, I got a Adaptec SHA-1205SA PCI Sata controller. Why Adaptec- I thought it should work since Adaptec is in the business for so long. I also got a Samsung Spinpoint F3 1Tb drive from Newegg in the mean time. I fired up my system with the new drive connected via Adaptec and bahm! it does not beyond Adaptec's BIOS post screen.
Aparantly, there can be problem with my SATA1 adaptec card and newer Sata2 drive. So, I downloaded estool from Samsung's website, remove the Samsung drive's SATA connector and fire up my linux server from a WinME floppy drive (really? I still have some around) and power on ESTOOL. I reconnected sata connector to the 1Tb drive and started estool. Estool recognize the drive with no problem and I assigned its speed to sata150 aka sata1 and rebooted the system.
All I get at the end- same old result. System hangs at Adaptec card's BIOS post page that identifies the drive and stays there infinitely. Bottom line, do not buy Adaptec SHA-1205SA card if you want to add SATA ports to your old machine.

Friday, February 18, 2011

STAB reaction

US2008261972Al, page 24

Sodium triacetoxyborohydride (14.5 g, 68.7 mmol)
was added to a solution of2,3-diaminopyridine (5.00 g, 45.8
mmol) and N-(tert-butoxycarbonyl)-4-piperidone (9.58 g,
48.1 mmol) in dichloroethane (75 mL) at room temperature.
After 5 h, additional sodium triacetoxyborohydride was
added (1.8 g) and again after another 2.5 h. The reaction was
stirred overnight, and quenched with 5% aqueous sodium
hydroxide. This was extracted with methylene chloride, and
washed with 5% aqueous sodium hydroxide, water and saturated
sodium chloride solution. After drying over sodium
sulfate, the solution was filtered and evaporated to give the
crude product. This was purified by chromatography (silica
gel, 3 to 5% methanol in methylene chloride gradient elution),
which gave the title compound (4.44 g). MS 293 (M+ I)
IHNMR(500MHz, CD30D) 67.32 (dd, J=5, I Hz, lH), 6.85
(dd, J=8, I Hz, lH), 6.59 (dd, 5 Hz, lH), 4.04 (d, J=13
Hz, 2H), 3.46 (m, lH), 2.98 (br s, 2H), 2.01 (dd, J=12, 2 Hz,
2H), 1.46 (s. 9H), 1.37 (qd. J=12. 4 Hz, 2H).
Step B. 2-0xo-l-(l-tert-butoxycarbonylpiperidin-4-