Friday, October 13, 2017

How to start off an aquarium hobby


So here are some tips to get you started off on the right foot. It may not be a complete guide but it will at least help in the long run as it helped me when I started out.

1)      You would need at least 2 aquariums at any point in time.
Ø  Main Display aquarium
Ø  Quarantine aquarium

For the main display aquarium you should buy the at least something bigger than 40 gallon and up to 55 gallon. These are decent sizes for the main display aquarium. The reason I went with these dimensions are because
·      You are starting this hobby to watch the fish grow and enjoy how they move in the tank.   So give them the space they would need.
·     You would want more fish at least 15 to 20 in your tank. If you buy a small 20 Gallon   aquarium you would be able to accommodate only 5 to 6 fish.
·        They say 1inch per gallon. So the 1 inch should be calculated based on mature size of the   fish and not when it’s really small. This is a very safe calculation.
·      You could add more but then you need more filtration in your tank. For example, your   filter should be able to cycle the tank water at least 3 times in an hour. But if you can     cycle them more than 6 to 8 times in an hour then you could add couple more fish into   the tank.
·        You may start off with 2 or 3 gold fish in a 5 gallon or 10 gallon tank but soon they will     outgrow the tank. So choose wisely. Stores do not buy back fish.

For the quarantine aquarium get a decent 20 gallon aquarium. This should be sufficient. The reason you need a quarantine aquarium is for 3 reasons
·     When you buy fish from the fish store, you do not know what infection or disease they   carry. So you need to quarantine time for at least 3 weeks before moving them to the   main tank. You do not want the fishes in your main tank to get affected and end up   losing more livestock.
·        Let’s face it, even in the main display aquarium there could be some sort of infections that can crop up. You would need to keep a watch out and move the infected fish out as quickly as possible to the quarantine tank.
·      Say you had only a main display and you had live plants in that aquarium. If you were to add medication to it, then you risk killing all the beneficial bacteria and also losing the plants as most plants don’t do well with medication used to cure the fish illness.

So don’t start off on the wrong foot. Make sure you have plans for 2 aquariums for the reasons listed out. It will help in the long run

2)      Cost involved in building these 2 aquariums.

Everyone underestimates the cost involved in setting up an aquarium. You would buy a tank based on a 1$ per gallon deal, but soon you will realize that the accessory cost would mount up. Let me list out the items you would need to start a 55 gallon aquarium.

Ø   Tank. Prices can range from 55$ - 400$ depending on the type of tank. There are 2 types of tank that you can get. There are pros and cons to both. Described later on.

Ø  Heater based on aquarium size

Ø  Filter based on aquarium size, either canister or hang on the back. Everyone says that the filter is where the beneficial bacteria reside, but I tend to disagree and more bacteria resides in the gravel etc.. within the tank..

Ø  Python No Spill Clean and Fill Aquarium Maintenance System. This will save a lot of water spills and time performing water changes.


Ø  For cleaning glass or acrylic: Use an old credit card to scrape of algae ;-).

Ø  API Water tester: Buy the API kit. This will save a lot of time and headache in figuring out what parameters are going wrong or right within the tank and take necessary action.



Ø  Chemical removers: If you are going to use tap water, you would need to remove the Chlorine, Chloramine and other harmful chemicals. Use Seachem Prime for the same. Buy from amazon it’s has always been cheaper there.


Ø  Plant Additives: it’s a closed environment, you may need to add additives once in a while to make sure the plants are getting the necessary nutrition they need. Seachem Flourish Excel or Advance should be good..

Ø  Medicines: Always have Seachem Paraguard handy to treat fish with any illness or disease. Make sure to keep them separated for at least 3 to 4 weeks before re-introducing them back into the main tank.

Ø  Lights: If you are planning to do a live planted tank, then select good lighting. 6500K or 10000K Beamswork LED lighting should be good. Select based on aquarium size. Minimum 8 hours a day or lighting


Ø  Aeration tubes, stones and pumps: Air stones. 1 or 2 depending on the size of the tank. Possibly get the air stones which generate the smaller bubbles. The bubbles are not what increase the oxygen in the water, the disturbance which the bubbles cause at the surface cause better oxygenation to take place.

Ø  Check Valves: If placing the air pump below the aquarium, this is a must to prevent an automatic siphon to be created when the pump is switched off or when power is lost. If not you are looking at water all over your floor.


Ø  Décor: You can take your time and decide what type of theme you would like to have. Don’t add any décor into the aquarium without testing it a week or two for PH changes, other chemicals that it may slowly leach into the water. Fish are sensitive to PH changes which decreases their immunity.

Ø  Fish: Try to get fish based on the following matching factors if planning for a community tanks
o   Behavior and how they co-exist with different varieties
o   PH levels they prefer
o   Top, mid and lower level fish
o   Temperature they prefer.
                 All the above have to match, if not it would be out of balance.

Ø  Gravel: Sand or rocks

Ø  Fish Food : Different types flakes, blood worms, shrimp pellets. Don't feed more than what fish can eat within 10 minutes nor should you feed them more than once a day. Resist the temptation to feed them when someone requests you too. More food is more waste, and more waste is more ammonia, nitrates etc. I either do once a day or alternate days.

Ø  Automatic fish food feeder : when planning for vacations. I use the Eheim Battery Operated Auto Fish Feeder and it seems to be doing a good job



Ø  Hand Towels:  Have a bunch of them always in hand. You would need them after you dip your hand in the tank and out.

Ø  A Cover or top for the tank, so that fish do not jump out. Trust me they do jump out. I have had two fishes jump out to date and luckily both are still alive as I saw them lying on the floor on time.


Try to estimate the cost of all this added together. The bigger the tank, the more of the above you would need.. You can buy some across time but 80% of it would be required on day one.

Aquarium Maintenance

You would need to spend some time at least 1/2 hour a week or once in 2 weeks in maintenance and upkeep of the aquarium, as its a closed environment.

1) Regular Water Changes: 20 to 30%. This is your friend. But don’t perform more than 30% water changes over a span of 3 or 4 days as you would be adding more chemicals into the tank and that could play a more detrimental role to the balance in the tank.

2) Test the water to make sure Ammonia, PH, & Nitrate parameters are proper. The sooner you take corrective action the better. If not there could be a PH collapse and everything collapses with that.

PH : 7.0
Ammonia : 0 ppm
Nitrites : 0 ppm
Nitrates : <20 p="" ppm="">

If you have more nitrates, then it would start forming brown algae or start affecting the fish. Nitrate poisoning is what its called. You can add a money plant or Pothos with their roots dipped in the water to suck the nitrates out of the tank.. but sometimes water changes are the only resolution.







Glass or Acrylic

Glass tanks are very heavy almost 5 to 10 times the weight of the acrylic. They are commonly available in rectangular shapes. The sides are stuck together with glue. Possibility of a crack forming is high if hit by a sharp object.  These are the cheapest, commonly available, and widely used tanks around. All pet stores or Local Fish Stores (LFS) carry them. Only the outer rims of the tank need to be supported by the table. The tanks are not flexible and rigid.Below is a Glass tank


Acrylic tanks are very light weight and 10x stronger than glass. They tend to get expensive. This is the material used in almost all public aquariums. Instead of being stuck together with glue, they are welded together with a product called Weld-on. The full base needs to supported by the table. After having both aquarium types, I have to say acrylic looks better but its just personal preference as it gives better color depth and originality. Below is an acrylic tank



This is an expensive hobby if you do not get the things right and have patience at the start. But if you do it right at the beginning it will cost very less to maintain it for years. The aquarium hobby is addictive, i.e. you would start off with 1 small tank and before you even realize what’s going on, you would have couple of tanks to maintain and more effort and cost.

 If you feel anything is not accurately portrayed, please feel free to comment and I will try to rectify the same. Also I am not advertising any product here.. It worked for me so I have added their pictures and references here.. 


Friday, March 17, 2017

Federal Taxes and Investments

Guide for investing in US for beginners who just have a single source of income like salary and just do the basic like 401k match or employer stocks, pay a large sum in tax and have the remaining sitting in a savings account earning a meagre 0.0.1% - 1% interest. So how do we save, maximize our profits as well as avoid tax at the same time?

So let’s start with the basics.

Standard Deduction / Itemized Deduction

First understand what is standard deduction vs itemized deductions and the difference between the two. Suppose you earn a salary of 100,000$ and you are married. Let say 12700$ is the standard deduction. Now your taxable income is 100000 – 12700 = 87700$. Suppose you were going to pay 10% tax. If you did not apply standard deduction, you would pay 10000$ in tax. Since standard deduction is applicable to everyone and set forth by the US government, you get to apply the same. So now your tax reduces to 8770$. So basically you have saved 1230$.  The standard deduction amount changes every year. Most of you will fall into this category.

Now if both spouse and you are working, then there is a chance that you would fall into itemized deduction. Why?? This is because itemized deduction includes state taxes. For a simple example consider, the salaries earned are 100000$ each. Now we have to pay both federal taxes and state taxes. Say we paid 7000$ each in state tax. So total would be 14000$. Now this is greater than the 12700$ which we used above for standard deduction. So now remember your income has increased to 200000$. If you were to apply standard deduction, then the taxable income would be on 187300$ (200000 – 12700). Instead in this case we can use itemized deductions which would be 186000$ (200000 – 14000). Considering the same 10% tax, we would do 10% of 200000 = 20000 and 10% of 186000 = 18600. So the difference is 1400$ and that is saved money. It would have been great if the calculations were going to be so simple. No it’s not. L

Also note when you itemize deductions, there are more ways you can itemize deductions to increase the amount. I will cover them shortly.

Now understand that tax is not going to be 10%. Like your electric bill, it is based on slabs or brackets. The moment you start earning more, you tend to fall in the next slab and the tax rate increases and you have to pay Uncle Sam more. 

For example, for married filing joint the brackets break down as follows
0-18650$ = 10% = 1865$
18651-75900$ = 20% = 20% of 57250 = 11450$
75901-153100$ = 25% = 25% of 77200 = 19300$
153101-233350$ = 28% = 28% of 80250 = 22470$
And so on… Above 470700$ tax is charged at 39.6%

These slabs keep changing yearly. So the calculations also change..

So for 187300$, we would have paid a tax of 1865 + 11450 + 19300 + 9576 = 42191$. This is an effective tax rate of 22.52% (42191 / 187300).

If we go based on 186000$, we would have paid a tax of 1865 + 11450 + 19300 + 9212 = 41827$. This is an effective tax rate of 22.19%. But if you noticed the difference is only 364$, meaning the more you earn the more you pay tax, unless you know how to save on tax by using the initiatives programs, and strategies the government has set forward.

So in the above example, 187300 or 186000 is your taxable income.

Exemptions

So as you have seen standard deductions apply by default or you can itemize, similarly personal and dependent exemptions apply by default for both standard and itemized calculations. Its 4050$ per person and dependent is also 4050$. So if you are married and have 2 kids, then you get a total exemption of 16200$.
So this has now further reduced your taxable income to 169800$ (186000 – 16200). Tax is now 1865 + 11450 + 19300 + 4676 = 37291$
So we have again lowered tax payable by about 4536$


So all the above apply by default. There is nothing extra to do on your side when filing tax returns. We need to reduce it to lower our tax and fall into a lower tax bracket.

Let’s go through the easiest saving methods first,

401k

401k is for retirement purposes. Any sum you contribute is tax deductible but you can withdraw it only after the age of 59 ½. Most companies will match your 401k up to a certain percentage 3%, or 75% of the first 6%, or 50% of the 6% of your income. This is a big addition to savings. For example say you contribute 3000$ to your 401k over the year, and you earn 100000$, which is 3%. The company matches the first 3% which you contribute, which means they add another 3000$ for a total of $6000 to your retirement. So first and foremost make sure you contribute as much as your employer would match. You do not want to leave money on the table which you are getting as an extra bonus.

Remember if you withdraw this earlier than 59 1/2, you have to pay a 10% penalty and the tax rate at that point in time.

How much can you contribute to 401k. The limit keeps changing every year. This year its 18000$ per person with a company sponsored retirement plan. So if your married and both employers are offering a retirement plan, then you get to contribute 36000$ in total. Still it would be 18000$ each per account.
Now how does this lower your tax? In the previous example let’s now deduct the 401k amount 200000 – 14000 – 16200 - 36000 = 133800. 133800 is the new taxable income. If you notice we moved to the 25% slab as our income is below 153100$. So let’s calculate the tax once more. 1865 + 11450 + 14475 = 27790$

So from 37291$ we have brought it down to 27790$. So we have saved 9501$. Basically for a 36000$ investment, you have saved close to 10000$, and you have covered some part of your retirement or investing in yourself and family.

Property taxes and Mortgage Interest

Paying rent for an apartment or owning a house, which is better?

Say you pay 1500$ in rent every month (total 18000$ a year), do you get any returns on it? Plain answer is NO and that money goes down the drain, but it helps promote the economy. 

Buy a house with an affordable EMI which encompasses (Principal + Mortgage Interest + Insurance + Property tax) = 1500$ instead. The principal portion of the EMI, you are investing in your house equity, which when you sell, you get back. Mortgage interest is unavoidable, unless you had boatloads of cash and paid in full for the house. Mortgage Interest is the second itemized deduction category. Property tax is the third itemized deduction category. Out of 18000$ lets divide it in the following manner (6000 + 8000 + 1000 + 3000). Now 8000 + 3000 = 11000 gets added to you itemized deductions which was previously at 14000$. Now it is 25000$ (14000 + 11000).

Let recalculate the tax again.

200000 – 25000 – 16200 – 36000 = 122800. 1865 + 11450 + 11725 = 25040$.

Another 2750$ saved. The savings keep adding up right? I know, it’s good isn’t? J 

Now let me put it forth in a different perspective.. Instead of spending 18000$ in rent, you got back 2750$, you invest 6000$ in equity. So total 8750$ invested. Only 9250$ is spent. But then think about it, you owned a house shouldering more responsibility like your parents did before you, or even better your kids will always call this place as home and have some more good memories. Doesn’t that feel good!!!

Charity Deductions

I have been talking about saving all this time, but then sometimes it’s better to give to save more. This is the 4th category in itemized deductions.  Say you gave 1000$ to an organization for charity. It adds to the 25000 (14000 + 11000) .. So now we have 26000.

Let recalculate the tax again.

200000 – 26000 – 16200 – 36000 = 121800. 1865 + 11450 + 11475 = 24790$.

So for a 1000$ charity contribution, you get back 250$. So effectively you gave 750$ for charity. Instead of paying the 250$ for tax, it helped someone else J

Personal Property Taxes (Car registrations)

This is the next item in itemized deductions. Guess you have lost track by now how many deductions we covered. Let me remind you. We are at the 5th item.  

The ad valorem tax that is paid is tax deductible. It comes to about 100 to 200$. So 26200$ is the new itemized deduction amount.

 Let recalculate the tax again.

200000 – 26200 – 16200 – 36000 = 121800. 1865 + 11450 + 11425 = 24740$.

40$ savings. Seems the savings are getting smaller??? Hmmm.. Let’s see if we can reverse the trend.

Child Care, Child Tax Credit and DCFSA

Children go to daycare if both parents are employed and we all know daycare is expensive. How can we best utilize the same for a tax deduction.

The default method the government is providing you with is a tax credit. Please note, I am mentioning this as a credit and not a deduction.

We get upto 3000$ per child if you have spent more than 3000$ in daycare expenses, and 20% of 3000$ is offered as credit = 600$

So for 2 kids, its 1200

So now the tax reduces from 24740 – 1200 = $23540.

Next comes Child Tax Credit, this is at present 1000$ per child, but it has a limit of 110000$ of AGI (Adjusted gross income). AGI can be simply calculated as Gross Income - 401k or any other deduction like educator fees, tution fees etc... If the AGI is above 110000$, then for every 1000$ increase there would be a reduction in 50$ in credit. In this case our AGI is above 110000$ at 164000$, so we cannot claim this credit.. To get even a 50$ credit, the AGI would need to be 129000$.

Now if your employer offers DCFSA go ahead and apply for the same. It’s called Dependent Care Flexible Spending Account. You can contribute 5000$ per child. They would give you debit card which you can use to pay the day care expenses. This 5000$ is reduced from your taxable income..
200000 – 26200 – 16200 – 36000 – (5000 * 2) = 111800 = 1865 + 11450 + 8975 = 22290$

So 24740 – 22290 = 2450$ savings. Now any amount spent over 5000$ can be claimed from the first section of child care credit. So if you spent 8000$ in total per child, the remaining 3000$ per child can be accounted there.

Now we have 22290 – 1200 = 21090$.

So that’s another 3650$ in savings. See we are on the increasing trend again…

Let’s take a look back though, we started off by paying 37291$ and now we are at 21090$. That’s a total of 16201$ in savings in tax, while we invested in retirement and equity.

Sadly for now I have to stop taking back the government money.

I will continue more in Part 2 on more itemized deductions, IRAs etc.


Disclaimer: Please note the calculations may change every year as the deductions changes, the rules changes, the tax brackets changes. So consider this post only to look up some of the very straightforward avenues to save on tax while investing at the same time. For this post I have considered only Federal Tax for Married filing jointly and both spouses working with 2 kids, and taken the 2017 numbers for all calculations, and was based on a round off income of 200000$ as it was easy to work the math out..

Friday, March 18, 2016

Compiling sysbench.exe in Windows

Since there is relatively no information other than the README-WIN file which is shipped along with the sysbench source code as to how to compile sysbench, I thought I would detail the steps I had done as I had to go through many hurdles to get this to compile.

Download the latest source files for sysbench from github

https://github.com/akopytov/sysbench

I was using sysbench-0.4.12.10 for my compilation.

Now this is how the README-WIN looks like.. Fairly simple right?? I also assumed so..

How to build on Windows

You need CMake (download from http://www.cmake.org/) and Visual Studio 2005 or 
later (free Express edition should work ok)

1.Open Visual Studio command line prompt
2.To build with MySQL support, you will need mysql.h header file and client 
library libmysqld.lib
One can get them e.g by downloading and unpacking the "zip" distribution of mysql

- Append directory where libmysql.lib is located to environment variable LIB, e.g
  set LIB=%LIB%;G:\mysql-noinstall-6.0.6-alpha-win32\mysql-6.0.6-alpha-win32\lib\opt

- Append directory where mysql.h is located to environment variable INCLUDE, e.g
  set INCLUDE=%INCLUDE%;G:\mysql-noinstall-6.0.6-alpha-win32\mysql-6.0.6-alpha-win32\include
3.In the sysbench directory, execute cmake -G "Visual Studio 9 2008" 
4.Open sysbench.sln in Explorer and build Relwithdebinfo target.
  Alternatively, from the command line, issue  
  vcbuild /useenv sysbench.sln "Relwithdebinfo|Win32"


I already had Microsoft Visual Studio 2010 Express Edition installed on my Windows 7 machine. So I proceeded to download CMake utility from https://cmake.org/.

I installed CMake. Now my intention was to run a MySQL benchmark. So I had to compile it with the MySQL header files and libraries. So I downloaded the MySQL edition "mysql-installer-community-5.7.11.0".

Now this is the step which took me a while to figure out. When you install MySQL on a 64 bit machine, install the x86 binaries for MySQL by going to the Advanced option during installation. Do not install the 64 bit binaries. This will cause linking issues later on when compiling sysbench.

Now you can follow the steps for installation as per the README-WIN. The Visual Studio command prompt can be found under Programs->Visual Studio 2010 Express ( in my case ).

The INCLUDE directory which I had set was C:\Program Files (x86)\MySQL\MySQL Server 5.7\include

This should container the mysql.h file.

The LIB directory which I had set was C:\Program Files (x86)\MySQL\MySQL Server 5.7\lib. 

This should contain the libmysql.dll and libmysql.lib files.

Another snag which I hit in compilation issue during cmake "fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt"

Basically if you have .Net Framework 4 installation in the same machine, it would render the cvtres.exe file in the 2010 folder corrupt. So I did a search for the cvtres.exe in my machine. Copied the cvtres.exe from the .Netframework folder to the VC2010 bin location or you can also rename the cvtres.exe in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" to cvtres-old.exe

Navigate to the sysbench directory in the Visual Studio Command prompt and execute 

cmake -G "Visual Studio 10 2010"

It should make fine.

Open the sysbench.sln file and build with the Relwithdebinfo|Win32 in the Debug options.


Add the following paths in the include directories and the lib directories in Project properties, VC++ directories.

C:\Program Files (x86)\MySQL\MySQL Connector.C 6.1\include;C:\Program Files (x86)\MySQL\MySQL Server 5.7\include;

C:\Program Files (x86)\MySQL\MySQL Connector.C 6.1\lib;C:\Program Files (x86)\MySQL\MySQL Server 5.7\lib

You are ready to build and should possibly not face any issues.



Tuesday, July 9, 2013

Measuring Boot time in Windows 7 using a script


It was hard to find a script like this to get the boottime in Windows.. So I ended up writing one.. it uses the command "wevtutil"..

It can be tested manually by running the following command locally

wevtutil qe Microsoft-Windows-Diagnostics-Performance/Operational /rd:true /q:"*[System[(EventID=100)]]" /e:Events /c:1 /f:text | FINDSTR "Date Duration""

or from a remote system using the following command

wevtutil qe Microsoft-Windows-Diagnostics-Performance/Operational /rd:true /q:"*[System[(EventID=100)]]" /e:Events /c:1 /f:text /r:$vmname /u:username /p:password | FINDSTR "Date Duration""

For $vmname.. you can either give the ipaddress or the FQDN name of the remote system. You normally need admin access to get the access to the event.


Perl Script to get for about 50 virtual machines.. to measure bootimes.. and sort it based on the boot time.. To install File::Slurp you can use the following command in linux

"yum install perl-File-Slurp"

Below is the script

use File::Slurp;
use strict;

open (OUTPUT, "+>>bootTimes.txt") or die "Can not open bootTime.txt: $!";

my $VM = 1;

for ($VM;$VM<=50;$VM++){
                        my $vmname = "vmlc1-$VM.vdi.test.com";
                        my $cmd = "wevtutil qe Microsoft-Windows-Diagnostics-Performance\/Operational \/rd:true \/q:\"\*\[System\[\(EventID\=100\)\]\]\" \/e\:Events \/c\:1 \/f\:text \/r\:$vmname \/u:Administrator \/p:password \| FINDSTR \"Date Duration\"";
                        my $bootmsg = qx($cmd);
                        if ( $bootmsg =~ m/\s+Date:\s+(.+)\s+\S+\s+\S+\s+:\s+(.+)ms/){
                                    my $bootDate = $1;
                                    my $bootTime = $2;
                            my $message = "vmlc1-$VM.vdi.test.com, $bootDate, $bootTime\n";
                                    print OUTPUT $message;
                        }      
}

my $str = read_file("bootTimes.txt");
print $str;

$str = join "",
       map { $_->[0]."\n" }
       sort { $a->[1] <=> $b->[1] }
       map { [$_, (split)[-1]] }
       split /\n/, $str;

print $str;



Monday, September 8, 2008

US : Sand Harbor, Lake Tahoe, Nevada

This is the most beautiful place I have ever seen. Located on Highway 28N it has the best scenic shoreline and best beaches I have ever seen. The water is crystal clear that you can see up to a depth of 75 feet.


An accessible boardwalk spans fragile and unique sand. They say that the sand under your feet was blown by the wind. Its particles are smaller, smoother, and lighter in weight than other sand around the lake. The sand provides a cushion underfoot..


The scenery was breathtaking... You can find activities like swimming, boating, etc at this scenic location. There are also group-use and picnic areas, amphi-theater and park headquarters...





If you are interested in scuba diving, this is the perfect place. The northern parts of the beach is filled with huge granite boulders which is quite safe to navigate through..




What more when I was visiting the place there was gorgeous couple having their marriage ceremony conducted by the shore next to the granite boulders...