Hacker News new | ask | show | jobs
by EdCoffey 2915 days ago
1. When I plug my camera's SD card into the front of my Linux server it automatically copies off any new photos and sorts them into a YYYY/DD/MM folder structure.

2. I wrote a cryptocurrency trading bot because I'm too lazy/uninterested to actually learn anything about the market. It seemed to do pretty well when the market was flat or going up. Hard to tell if it's doing badly now or if it's just reflecting the state of the market. I almost forgot to include it in this list because it's so thoroughly automated that I rarely bother to check it.

3. I assisted the owner of pvoutput.org with adding support for the automated data upload format from my PV inverter. Then I wrote a script that automatically polls my electricity meter using a RAVEn USB device to upload the net import/export of power.

4. Maybe other things that I've forgotten about because they're automated...

4 comments

For #1, do you have any way of detecting dupes? For example if you inserted the same SD Card twice would you get two copies of the photos?
I only use one SD card and one camera, so I just store the name of the last file copied (e.g. DSC02745.ARW) and the next time the card is inserted I only copy files that come after that one when sorted by name. It would be pretty easy to extend to multiple cards and/or cameras, but I've never had the need.
If you really wanted to avoid dupes you could just hash the pics, save a list of hashes in a txt and then lookup against new ones, but it's less efficient than what OP proposes.
Can you share how you do the SD card thing?

I'm not sure how to autorun when an SD card is inserted (using ubuntu here).

I used udev to run the script as soon as the drive is mounted. The tricky part was ensuring the drive would mount automatically when inserted, even if I wasn't logged in. I tried a range of different tools, and eventually settled on autofs.
for number 2 how do you handle tax season? Mine was very complicated last year and I didn't fully automate my trading.
tl;dr: I don't.

There are a couple of reasons why I don't bother:

The first is that I consider what I'm doing to be a hobby, and therefore tax-exempt. The point was more about the challenge of writing the bot than seriously imagining that my trivial algorithm could make money. Because it's currency trading, I expect the Australian Tax Office would disagree with my definition, but there is one thing in my favour -

The second reason is that, despite hitting almost A$2000 profit around January, as we head into tax time it's sitting at less than $500. Also, I've never realised any of these profits - I withdrew the original A$500 investment, but everything else just keeps getting reinvested. I don't think the ATO is going to be too troubled that I've got a little under A$500 worth of pretend-money floating around in the aether somewhere.

Bottom line, I'm not going to worry about tax until there's enough profit that I can pay an accountant to worry about it for me, and possibly pay some backdated taxes. The up-side to automated trading, even for small-time personal investors, is that the ATO regards it as "carrying on a business of share trading" rather than investing as an individual, and their rules appear to be a bit simpler in that situation.

Ah I thought I was in a similar position until I did some reading up on US tax law. Turns out that even though I sold and bought back within a very short time period the sale amount - cost basis = taxable income.

I was doing some swing trading near the top and it ended up that I am paying significantly more taxes than I ever put into it.

Oh well, live and learn.

What exchange service are you using in #2?
And sorry, that folder structure in #1 has no sense
Oops, I meant to write YYYY/MM/DD. I even proofread it before submitting.
Bittrex.