Categories
Life

Another stable orbit around the Sun

Time for taking stock for this year, check-point in a continuous development.

2013

Altogether it was a pretty different from what I have planned for, and in many ways exceeded my expectations, partly because external forces guided me on different paths than I have planned before – and in retrospect that’s a good thing.

I’ve travelled to Shanghai for the first time, and that was the only time out of Taiwan this year. Other than that, some fun trips within the country to Alishan, Sun Moon Lake, and other places. I got to quite like weekend or short getaways. Will have to do more of those in the future.

This blog had 18 posts (not counting this one), and while that’s pretty low, I feel they were pretty well researched and lasting, so even as I want to increase the frequency of writing, I will try to keep writing long-reads.

According to Goodreads, I’ve read 47 books (and planned to read 52). This year was different in a way that the books are divided pretty much half-half between fiction and non-fiction books. That didn’t happen before, maybe I was more down to earth? Or there were more interesting non-fiction recommendation from friends? The favorites this year are probably Peopleware and The Beginning of Infinity for one side, and Snow Crash and Hardboiled Wonderland and the End of the World on the other (though there wasn’t a book that I really didn’t like, hard choices).

Have given a conference talk at PyConTW, and published the talk in a paper – first time first author, which definitely have to be improved. Have given some other invited presentations (about the Taipei Hackerspace), held a class (at NTUST about innovation), and did a few workshops (in the Hackerspace). Lots of opportunity for development, I feel that my style and capabilities are improving, as well as I’m getting more opinionated about how these things (talks, classes, and papers) should have been done.

The biggest improvement was with Taipei Hackerspace, it has come a very long way this year, and there’s no end to it. I learned a lot of organization, interpersonal skills, and some technological skills as well.

This whole progress enabled kicking off my Project (with a capital P), Moonpunch, in which I want to put most of my energy into. Lots of science and development is there to do, I cannot wait to see what comes next – and not waiting, making it.

There are also a lot of small stuff, like finished my first Movember, learned a lot about Bitcoin, watched a lot of good movies, started to meditate (though stopped for a while).

Photo of the sky with airplane
The speck of dirt in the middle is an airplane flying by

2014

At the moment only one thing is sure – have no idea how anything will look more than about 4 months into the future. That’s a scarily short time frame.

Things I’m wishing for:

  • finding my modus operandi even better, and make more valuable contribution
  • preparing for a trip to Kyoto in the spring, would love to get back to Hungary in September for the 15 year high school reunion, and hope to fit in some travel to an unexpected place, somewhere off the beaten track.
  • re-start learning Japanese, and put more effort into Chinese
  • get back into meditation again, and a healthier life
  • find more good books, that’s always something to look out for

Re-reading that list right now, it feels like I have big aspirations, but no specific wishes, making this list really just a work in progress. (Maybe I should add “make a better list” to the end?). It will be a lot of “winging it.” That feels like a good way.

Categories
Computers Life

Two day dive into Bitcoin

Nudged by a number of different news about bitcoin, I decided that this is the time to give it a new look and try to learn as much about it as possible. I wanted to explore how to use it in practice, so I have spent the last two days figuring out as many aspects of bitcoin as I had energy to do.

Introduction

As a short intro for those who are not familiar with bitcoin, check the “What is Bitcoin” video, or the Bitcoin Wiki. In a nutshell, it’s a kind of currency, that lives all in computer, based on cryptographic algorithms, in a way that people can send each other amounts of bitcoin securely. The coins are created by “mining” by computers doing heavy work, your balance is stored in a “wallet” as special numbers, and you send them from and to bitcoin “addresses” (people can have as many addresses as they want). The value of these coins decided by people exchanging it, between each other, or from bitcoin to currencies or back. (any thoughts on this introduction can be given in the comments, though I hope to explain things simpler instead of “completely” right)

Mt.Gox bitcoin price chart of the last 1 week
Mt.Gox bitcoin price chart of the last 1 week

Getting some

Since mining is out of practical reach now, logically there are two ways to get bitcoins: buy them, or earn them. Buying sounds more straightforward, and let’s check that one out first.

Exchanges

It’s much easier to say than to do to exchange any money to bitcoin. For seller’s safety (since there are not chargebacks in bitcoin, but on most money-exchange platforms there are), one has to jump through hoops to get anywhere. So far for me there were just too many hoops, no matter how much I was jumping.

Mt.Gox is probably the most well known bitcoin exchange, based in Japan. I find it awesome that it was originally made to trade Magic: The Gathering gaming cards. A real effective pivot if I have ever seen one. The price is generally higher than on the other exchanges (better for sellers), requires verification to deposit, and as I read before, it has a history of suspending payouts when their cashflow is not good enough for it. I have started the verification just in case, hopefully their Japanese skills (ie. Kanji) help my Chinese language documents ahead. Don’t think I will use them to buy any coins, though.

Bitstamp seems to have somewhat lower prices (better for buyers), though the minimum deposit fee of $15 is pretty high. They also require verification though for me that didn’t work out: living in a Chinese writing country, even if my government ID has my address on it, and I typed in my Chinese address, they spit it back saying “we don’t read Chinese, get us a notarized English version”. That just doesn’t worth it.

Kraken seems to be another one that might work, since they seem to have a better connection to UK banks (will see in practice), and for historical reasons I still have an account in the UK with some pocket money that would be enough to experiment with. They seem to be the most  lenient in verification, and pretty responsive support emails.

AsiaNextGen is a Hong Kong based exchange, and when I heard about it from a friend, I had high hopes, though in practice it didn’t quite work out. It could use Alipay to deposit as well, and just recently heard how popular Alipay is in China for all kinds of online trading. No wonder, since it’s a pre-paid account, making things more secure in an environment where both buyers and sellers have to be extremely wary of fraudsters. But that’s for another story. At the moment it’s enough that the English site of Alipay seems to be only for businesses, so that’s all for now.

If I ever wanted to start my own exchange, for a few minutes it looked like I had found the tool for that in the form of Buttercoin, an open source trading platform. But the software development seems to have stopped a few months ago. They also appear to be turned into a company called Buttercoin, which would be also interesting, though they don’t ship anything yet..

ATM

Learning more about the whole ecosystem, the bitcoin ATM seems to be an even better idea than an exchange. The relevant corners of the internet are full with the success story of the (not really) first bitcoin ATM in Vancouver. It just makes sense due to its convenience.

Robocoin is I think the maker of that ATM, and they look very full featured – as much as I can tell regulatory compliance from gibberish. They only seem to target Canada at the moment, maybe because it’s been tested and worked.

Lamassu is another vendor, that looks really good, and e.g. already capable of accepting TWD. If I had a spare $5000… The design looks really good as well, definitely would attract interest here.

Lamassu bitcoin ATM
Lamassu bitcoin ATM

It’s not an ATM, but close enough – LocalBitcoins would let people exchange BTC/cash in person. Except in Taiwan nobody sells (well, there’s one guy, but my spidey-senses are tingling about that listing).

Work for your bitcoin

If I cannot buy some, let’s see if I can earn some. Now this turned out to be a short, eye-opening journey to the underbelly of the Internet. Not too deep, I didn’t go too far, but I’ve seen more seedy websites than I’ve seen in a very long time. Won’t name names here, just to be on the safe side. :)

It all started with Google searches like “free bitcoins” and “earn bitcoins”, and there are enough sites for listing a lot of the services like that. The results are falling into three main categories:

  1. Sites that don’t work anymore (most “free” giveaway sites).
  2. Sites that have some kind of useful service.
  3. Scams

The most are I think 1 and 3, and there’s some overlap between 2 and 3 as what’s useful for the “worker” is not always useful for the community as a whole.

I’ve spent about 2 days exploring how these different sites work.

The most useful was an Amazon Mechanical Turk style service, where people can fulfill tasks requested by others. All are very low payout at the current exchange rate (you’d be lucky to make few $cents/hour with them), though some of them are lower than other. I had some kind of article categorizing, author discovery work that someone’s running, I guess scraping the web for personal and mental health topics. That had snapped up I think more than 20.000 tasks (each a bunch of sub-tasks) in a day or so. A better paying task is checking profile pictures of some social networking (I guess dating) website for policy violations. It paid better, but the tasks were quickly snapped up, and I’m kinda glad. That was enough of it.

Other sites seem to be focusing on advertisements, paying you to visit sites and watch videos. The sites are usually other bitcoin related services (trading, betting), though there were other ones as well, like investing in a poker playing team. The videos were mostly crappy pop music from performers who I guess couldn’t make it popular otherwise. Though most of these seem to come through a service which has a name suggesting they offer making your media go “viral”. Good riddance to both the sites and the videos, I don’t think I have seen more than a dozen sites and half a dozen videos (with the sound off:).

The last type of sites I’ve seen were for solving CAPTCHAs. Being a sysadmin who hates spammers, I didn’t use any of these. I’m experimenting, at the previous sites I actually did something (marginally) useful, and to my surprise I was somewhat interested in the links and videos I’ve seen that I would not have heard of otherwise. Deliberately hurting other sites, as I know these solutions would be used for, is not acceptable. Of course, this is just scratching the surface, and I don’t want to go that deep to see the “real” underbelly of the Internet.

All in all, this 2 days resulted in 0.00103601BTC ($0.36 at current exchange rate on Mt.Gox). That’s not enough even to send it to anyone free on the network (need a minimum of 0.01BTC as I know), but it’s some learning. I call it a day.

One more thing, I found a website where one could mine bitcoin using a Java applet, and turned out I did mine 0.08+BTC back in 2011. The site turned out to be a scam, though, so I think I can consider as those coins were never mine.

Practicalities

Besides the finances, I tried to explore the practical aspects of bitcoin as well, using it day-to-day, or how it could work on the long term based on my understanding. Most things are only as good as they are easy to use and reliable, those are my main questions in general.

Clients

I’ve started checking the different bitcoin clients that can create and manage my wallets.

Multibit was the first one I’ve checked, and I keep using at the moment. It’s really quick to start, and now it’s less confusing than it was 2 days ago. It’s easy to create new addresses, my notifications are clear, and can use multiple wallets. Will have to figure out how to export and import wallets to other services, though.

Electrum is very interesting, because it’s based on a pass phrase of a list of words, and algorithmically generates the follow up addresses. This two features make it easier to keep the wallet safe against self-harm (hard to lose). The client was too simplistic, and some of the things I didn’t understand, so went back to Multibit later.

The official bitcoin-qt client might be the one that does the heavy lifting for the whole network (and for the previous two clients as well, so they can be snappy). I was just horrified that it takes 14Gb of data (and almost one whole day of computation) to set it up. That data is the total transaction record of the bitcoin network. I cannot even think what will it be like when it will be truly popular. I’m experimenting with this a bit as well, though likely that in the future I’ll try to find another computer instead of my laptop to run this and stay with thin clients.

Blockchain.info is a very useful site, and could be great to start with bitcoin. I like that it has “watch-only” addresses (no spend just monitor), and their Android app can notify me when I got transactions to those addresses that I watch. It has a lot of geeky information and tools too.

There are a bunch of other ones as well, Brainwallet, Bitcoin Wallet, Coinbase, Bitaddress, and more. Need to digest all of this new information and come up with a good way how to manage and keep safe the coins.

Bitcoin itself

I’m learning more about the technical side of bitcoin as well. I feel I understand it more now that I’ve tried in in practice, and can as better questions.

The trickiest part I think is the issue of micropayments. At the moment they are discouraged because the technical architecture of things cannot really handle it. The earning services seem to handle it by grouping multiple payouts into a single transaction, once an hour or once a day. On the other hand, if I want to make a micropayment (or even regroup my tiny amounts into a single address), then I’d have to pay for it dearly.

These transaction fees are the other question, that it’s not that straightforward how much those fees are. Looks like too small, and too big payments both incur fees, but there’s a bit of arbitrariness about it, and I don’t quite understand it.

The long term changes to bitcoin, the transformation of miner incentives from mining payout to transaction fees make these even more critical, though it’s likely years till that becomes an issue.

QR codes are very widely used, I guess that’s the intersection of large availability of mobile apps and the need for accurately entering a very long string that is a bitcoin address. It seems to be a good idea, and one example I’ll use further down.

Overall experience

I’m really impressed by this first experience. There are a lot of issues ahead, but when it works, bitcoin does an awesome work. It is borderless so anyone can be paid very easily (good because more opportunities) and many people are striving to get a piece of the pie (not that good because the opportunities are quickly exhausted).

The technical side feels truly futuristic, and I feel much more enabled, and just a little bit scared by the “what haven’t I think of” when operating things. That user experience will surely be even better in the future. Merchant tools offered by different places (eg. on Mt.Gox) are also seem to be pretty good enablers (once people can actually freely exchange currency and BTC).

I’m also very impressed how many different services people created based on bitcoin. There are truly awesome services, and also a lot more “also runs” who are still clearly more than a minimum-viable-product. If so many people are creating so many things, I am thinking why does it take so long for me to get my own (much smaller) project going?

Now let’s see what does the future bring. I hope I can contribute to this as well in some useful way.

Bitcoin donation link to 1Pem9zU7AMMif4t6zyP6r84T2BaEsY6USgIf you like the blog, bitcoin, and want to experiment, you can throw some bitcoin at me at 1Pem9zU7AMMif4t6zyP6r84T2BaEsY6USg. All donation I will use for good, among others to support the Taipei Hackerspace (there’s a direct donation link on their website as well).

Categories
Maker Taiwan

Make the most of solar power

It didn’t take the arrival of a horrendous electricity bill to the Taipei Hackerspace to start thinking about reducing my electricity footprint. In the last half a year there were two solar power projects on Kickstarter that I signed up for: the Solar Pocket Factory (SPF), and the Foldable USB Solar Cell (FUSC). Generally there’s a lot of sunshine here in Taiwan (when we don’t have a typhoon), and even if I cannot power my laptops from it, could certainly try to power my smartphone…

It turned out that I needed both Kickstarter projects to make one good device.

The Foldable USB Solar Cell looks awesome and not bad at 7W and 5W (the two pieces I have). The voltage output doesn’t seem to be very stable, or has strange behaviour as it doesn’t charge my attached phone when there’s too much direct sunshine. Thus I cannot really use this directly with devices.

The tiny solar panels in the Solar Pocket Factory are very fragile and I couldn’t really make them into an actual working cell yet. On the other hand, it came with a 2000mAh battery and a circuit called Li-Po Rider Pro, by Seeed Studio. This circuit us solar cell or USB input to charge a battery , plus have a good output circuit to charge a USB device either from the battery when there’s no sunshine or from the input when there is.

Putting together the Foldable USB Solar Cell and the Li-Po Rider Pro, we have something that kicks arse indeed! Since I only have one circuit and Seeed doesn’t seem to sell it separately, I thought I could improve on things if I use both solar

USB adapter for parallel panels

The easiest idea I could come up with is creating a USB adapter to connect the panels in parallel (thus practically summing them up as current sources).

USB connector wiring, from the Tech Support Guy forums
USB connector wiring, from the Tech Support Guy forums

This plan needs two male USB A connectors (the “cable” type on the picture) to plug into the panels, and one female USB A (the “device” type) to provide the single output. Then female VCC pin is wired to both male VCC pins, and the GND pin similarly to the GND pins. The D-/D+ pins are not in use in this case.

Parts on the working desk
Part for the solar panel connector. One female and two male

The connectors came in as $0.40 each, the wire I don’t remember but probably a few cents. I fortunately had both black and red to use with the GND and VCC. Things are better colour coded.

Soldering together the middle two pins, and hook the ones on the side with wires (here the black wire for the Ground line)
Soldering together the middle two pins, and hook the ones on the side with wires (here the black wire for the Ground line)

First the middle two pins of a male and a female connector is soldered together, just to provide mechanical support. The end of the cable is stripped and hooked around the touching pins (the GND pins on this picture). The two pins + wire is then soldered together, with enough solder to stay, but not that much that the other pins could touch.

Finished soldering, a bit too much solder, but at least it holds
Finished soldering, a bit too much solder, but at least it holds

Did the same thing for the VCC pins + red wire. Finally added some more solder to the central pins. It was pretty stable like this, though I guess it would be better to have some sort of external housing for it or another way to increase the mechanical rigidity of the connection.

The extension cord to the extra male connector
The extension cord to the extra male connector

Finally the other connector is soldered, making sure that the right pins are connected (the same as the other male USB). The connectors are then wrapped in a bit of duck tape for some rough insulation. These parts will be outside, both in sun and rain, nothing much can break, but better not test whether I’m right about this particular point…

Cover and plug into the secondary solar panel
Cover and plug into the secondary solar panel

Plugged into the secondary (5W) solar panel, and into the primary (7W) one as well. Duck taped everything down onto the roof well enough that they are not blown away too easily (though I’d better check on them in a bit, the wind is howling just now outside).

Primary solar panel with the adaptors
Primary solar panel with the adaptors

As an aside, the duck tape doesn’t seem to like the sunshine. It sticks its sticky parts on everything, that part doesn’t seem to spell fun for the future.

Ready to charge

When everything is connected, the panels will get pretty good sunshine for the bigger part of the day. I don’t think they reach max capacity, because the angle is never ideal, but from the practical point of view, they get enough sunshine to max out the attached 2000mAh battery between device charges.

Hold the panels down, plenty on sunshine (at least this afternoon
Hold the panels down, plenty on sunshine (at least this afternoon

The Li-Po Rider Pro circuit is under the roof, so it doesn’t get any rain (at least I hope!), and has a little ledge to charge a phone safely as well.

solar8
Charging circuit and filling up my phone

Since all the devices were pretty much full when I checked in the Hackerspace after I finished this setup, the test whether combination of the two solar panels does indeed increase the power is not foolproof. Otherwise I would have charged a device from a low battery level to a bit higher with one panel, then later switch to two panels and see the different slope of the batter charge versus time. Normally at high charge levels (90%+) the slope is varied by the charging circuit (to preserve the lithium battery’s life), thus that level is not really good to test the difference between the single / dual panel situations.

One thing does suggest, though that the plan worked. Before this modification, charging a phone discharged the Li-Po Rider Pro’s own battery (there’s a touch switch on the circuit to get an approximate charge level, indicated by the lighting up of 0 to 4 LEDs on an LED bar), even in full sunshine. This time it seems that both the phone and the storage battery is charged up, indicating larger incoming power than before. I will check it again next time, though (the Nexus 7 tablet we have will be great for that, it has much larger internal battery than my HTC Butterfly phone)

Possible improvements

There are a few things I could improve on the setup, focusing on usability.

I hope to get a longer USB cable to reach from the roof to inside the Hackerspace, and set up a charging station within the room. This way people don’t have to keep their devices out of reach while charging, and there’s no chance of being ruined by a sudden rain.

I hope to get a larger capacity Li-Po battery. 5-10.000mAh could be good, then it would likely have enough power all the time to keep charging people’s devices, and not standing idle being full when not charging something, while easily emptied by a single device.

The roof also has plenty of more space, so getting a bunch of other panels, combined with the first two upgrades, would make it really beneficial. These foldable panels would be better portable, and keeping them in one place feels a sort of waste.

Ultimately it would be awesome if I could have a purely solar-powered phone. Because it would mean some money saved, but also, and mostly, because I can.

Categories
Programming

Automating the hell out of it

Even before the 4-Hour Work Week made me more serious about this, I really enjoyed automating tasks, that benefit from not needing to remember to do, or would be troublesome to do otherwise. This frees up a lot of time, keeps a bunch of problems away, and it is actually quite fun when the information comes to me instead me going to it.

Now I have automated checking my bank account and credit card balance, updating dynamic IP of server, ebook sales numbers, and network clock synchronizing. There are some general ideas that I summarize, then give an intro to all of those scripts.

Banking script

Tools

Most of my scripts are written in bash, because it’s relatively straightforward to hammer out simple stuff, and it is surprisingly simple to do a lot of things once I have thought enough about a problem. The Advanced Bash-Scripting Guide is always on my reading list, but I usually get to check only the parts that are relevant to the given problem. You can get quite far with a few simple constructs.

The most common parts I seem to come across:

  • if-then-else constructs: if [ -f ‘directory ‘]; then echo “Found!”; fi
  • for loops: for f in *.png; do optipng $f; done
  • loading the results of a command into a variable: VAR=$(command)

For most other problems with a little keyword-fu there’s always an answer on StackOverflow or on the web.

Another group of scripts uses Python, when a bit more data-manipulation is needed, like web scraping or JSON parsing. Actually, all of the scripts could be rewritten in Python for consistency, and it would probably be be simpler too, which is something for the future.

As a general tip, most of these scripts need tweaking, and all of them are sort of alpha-beta quality code. To facilitate hacking and reduce heartache of mangled clever code, I keep everything in git repos. I share those repos online, so have to make sure there are no secrets checked in, ever. It helps to strategically use .gitignore, separate files for the secrets, and having an example how that secrets file should look in the inside.

Most of these scripts are run periodically by cron, so it is worth having some basic knowledge about how to schedule it.

Some scripts send me emails under specific circumstances (some after every run, some when new information appears), and for good delivery I have set up postfix to use Gmail as an SMTP relay. This way I’m sure to receive the emails and receive them quickly.

Scripts

These are the scripts I use most often and the longest. Still, many of them are under development and adjust them whenever I learn how to do things better. I list the links to all their repos, where it can be improved.

Banking account balances

My two main bank accounts are queried once a day for available balance and I’m notified by email. Both accounts needed quite a bit of web scraping (and got them done at two different OpenHack Taipei events). The banks’ websites are pretty awfully organized (iframes within iframes within iframes; not using CSS classes and id), though it doesn’t have to be good for me, it has to be good for the bank.

Cathay United Bank

The cathaycheck (click for repo) script queries the available balance at Cathay United Bank by logging in with curl, and parsing the final page with Beautiful Soup. The script can be a skeleton for any other website where on has to log in and then navigate over a series of pages to get the information. The required HTML variable names can be extracted with the help of the Inspect Element tools in Chrome.

At the moment the credentials is stored in the crontab command, which is not really ideal, should rewrite to use a secrets file, though given that it runs on a server where I’m the only user (and root), for me there’s no practical difference at the moment. I have set it up to receive an email at the end of the day with the current balance.

ANZ Taiwan credit card

The anzcheck (click for repo) script queries my spending with the ANZ Taiwan credit card. Again bash for logging in and Beautiful Soup for parsing the final page. It needs a bit more logic extracting information from a table, because the websites developers added no classes or ids to the items to make it easier to understand – or for them to style, but that’s not my problem.

Just recently updated that it extracts the spending items added to my balance on a given day, so I can will never be caught by surprise again (hopefully). Since many of my charges go to companies that have Chinese names, I quickly run into the problem of having to tell my Heirloom Mailx (that I use to send emails on my ArchLinux box)  that the text I want to mail is plain text, not an attachment. With some hacking the solution was to add a few more commands to “mail” so it knows that the text is UTF-8. From “sendthatmail.sh” in the repo, the parameters needed are:

I could still extract some more information from the bank’s website, though nothing really urgent.

No-IP address updater

At the Taipei Hackerspace we have a handful of servers running, but the residential internet connection is provided by Chunghwa Telecom only gives us a dynamic IP address. Applying for a static IP seems to be pretty troublesome, so in the meantime I’m using a script on one of the servers to update the IP address associated with our dynamic tpehack.no-ip.biz address.

The no-ip-bash-updater (click for repo) script is forked originally from elsewhere, but I have rewritten it quite a bit so that it

  • needs no extra file to store the current IP address, but compares external IP with a DNS query
  • stores no secrets in the file

It uses a pretty straightforward API call with HTTP authentication, the only real logic in there is to check when that call actually needs to be made.

E-book sales

Recently I have helped a friend to publish an ebook version of How to Start a Business in Taiwan on Leanpub, and of course I want to know when there are any sales are made (disclaimer: I don’t get a cut of the sales, all goes to the author). The leanpubsales (click for repo) script is written in Python, because using JSON there is easier than it would be with bash. The call otherwise is quite simple, just keep an external file around to check if the sales number have increased or not, if yes then send an email. To send an email conditional on the output the the script the “ifne” command from moreutils is very useful (meaning: “if input is not empty”).

The query is run periodically, and lovely to receive the results. I will surely set up a script when I get my own book ideas published on Leanpub.

RTC correction

As a physicist in atomic physics, which is the area of science very much concerned about keeping precise time, keep all my servers’ times synchronized with network time protocol (NTP) using chrony. One difficulty is that the real-time clock (RTC) of those computers is pretty crappy and drifts away. Wouldn’t be a problem if I never restart them, but a pain if I do: after restart it can be tens of seconds away until the time is synchronized again.

Chrony can sync NTP and the RTC, but it doesn’t do that automatically, I have to trigger it manually. Instead I have written up an rtccorrect (click for repo) script that is run every 2 hours or so (could be done just once a day, actually), and eliminates the drift of the RTC.

Server backup

For backing up data between servers rsync has proven invaluable. I have a couple of scripts that do just that, though those are among my oldest ones and at that time I haven’t separated out personal information (way too easy to inline every credential, email, login, and all that), so I need to sanitize that. A couple of  ideas about these backup scripts:

  • sometimes higher transfer speed can be achieved by messing with the ssh algorithms, eg. passing “-e ‘ssh -c arcfour'” to rsync
  • more often there’s even better performance when there’s an rsync daemon running on the remote computer (though with Raspberry Pi, both cases are still frustratingly slow)
  • can exclude some files if no need to transfer them, eg: “–filter=’- *.part'”
  • using rsync not just to transfer but to mirror, the “–delete” (delete at target if doesn’t exist at origin) and “–archive” are pretty useful

For these backups I also use the Dead Man’s Snitch to know when things didn’t work out, e.g having a similar command in the cron list, where backup.sh is my script’s name, xxxxxxxx is the snitch ID from my account:

This way I got to know when my backup server was dying all the time because of bad heatsink, or my host server by flaky hosting company….

Afterword

I guess there will be just more automation in the future, and maybe many of these scripts can be ported onto a common base so new ones are made much easier. What else do you guys automate?

Categories
Startups Taiwan

First sale of an ebook I helped to publish

Recently I was helping a friend to publish the ebook version of his paper book, called How to Start a Business in Taiwan. About 50% the reason was that I like the book and hoped to get into more people’s hands, and 50% I wanted to see what is it like getting an ebook out the door and bought by people.

Just a while ago, it had its first sale (hopefully the first of many:). *champagne!*

How to Start a Business in Taiwan on Kindle
How to Start a Business in Taiwan on Kindle

I guess it is a very humbling experience that it took some 5 days of promotion effort to make that sale. That is even before I count how much time I have spent converting the Word doc into Markdown, and tweak the looks. The technical details to that I have written up in a guest blog post on the books website.

The marketing side is still under development, and the numbers are too low to draw a lot of conclusions from. The most surprising thing to me is how many people actually click the “buy this book” link and then they don’t follow through. Then also the half a dozen people who I followed up on earlier discussion to tell them about the ebook version, they say “ah, it’s awesome, I’ll go get it, I’ve been waiting for it” – then nothing happens.

Of course, there can be a lot of reasons for this, here are some of my guesses:

  • The website UX does not work well for them (ie. the are put off by the process)
  • People don’t know/like Leanpub
  • People are lazy
  • The price is too high
  • The sales copy is bad, so people don’t think a business book can worth that much for them (ie. price is perceived to be too high)
  • Spreading the word at the wrong places, thus wrong audience

… and probably a hundred other reason that I wouldn’t think of – or 171, since the book’s page had that many unique visitors in the last few days who left empty handed. I wonder what would be a natural next step to improve on this conversion rate.

It was a very fun thing to do, though, and got me psyched up to get my two idea-stage books going. And about ebook publishing in general, will definitely try to get more people onboard who have writing tendencies.

Also, this invaluable learning, as I’m setting up my startup now, a good reminder that people will not easily/often buy into my “awesome” idea, will have to work cleverer on that. Rejection therapy in its earnest.

(Disclaimer: I have no financial interest in the book,  ie. I won’t get any of the sales, which makes things even nicer. I received one original paper copy last spring to review and edit.)