Thursday, November 17, 2016

Versioning static files with S3 buckets

Although there's a trend of making single-page applications with frontend static files managed separately from backend api, the need of managing static files haven't gone away just yet. And everyone who does web is aware of common issues with it. Probably the most common one is browser cache. Files get cached in user's browser and are used even after you changed and deployed them. Cache-controlling headers can help somewhat but not much. That's my cache-boosting techniques are usually a must.

There are many ways to do cache boosting. Usually, it involves adding some version info into all static urls (e.g. /style.css becomes /style-13.29.css or /13.29/style.css), hence it's often called "versioning". If you use some Django app to manage your static files (compress, combine, minify, etc.) it often can provide you with some solution. Use it, it's probably reliable and easy. This proposal, however, is cool if you happen to use Amazon's S3 for your static hosting (directly, not behind cloudfront). Yeah, I'm mostly referring to Django in this post because that's what I use, but general principles apply anywhere.

What exactly I'm proposing? Url has two elements: domain and path, since you can create unlimited number of S3 buckets for free, you can create a bucket for every deployment with version in its name. So your static url will look like https://foo1329.s3.amazonaws.com/style.css

I won't include particular examples in this post but basic workflow is like this: always populate AWS_STATIC_STORAGE_BUCKET_NAME setting from environment or some similar source, create a bucket when a deployment starts, make sure new version (it could be git hash or anything, just like with any other tools) is available as environment variable and previous one is somehow available too, run manage.py collectstatic (it will be using new bucket but currently-running application will still use the old one), reload application when it's done, destroy the old bucket once every host is reloaded (if running on more than one server). Multi-server environments will probably need some way of communicating for destroying old buckets effectively, but it's beyond this short post. Other than that, all you need is some way of shuffling two environment variables (or something), a couple settings, and two very short custom management commands (for creating and destroying buckets), and IAM role for the instance it's running on with appropriate policy.

Is this much better than using a directory in a single S3 bucket? No, not much. Url could be somewhat shorter (bucket names must be unique and by adding version to them it could be easier not to clash with other users), garbage collection is easier (you just remove the whole bucket, no need to do any file operations), but that's about it. IAM policy will be a bit more complicated, you'll need a little bit of additional code, no way to use the same bucket for static and media files (which might be a bad idea anyway but still). Overall, I do not recommend this way for anyone who doesn't understand everything in my post, use it on your own risk, but I personally find this idea pretty neat.

Friday, September 30, 2016

HTTPS issues with blogger :(

As I wrote in my last post, I'm moving this blog to a new domain. I also decided to put it behind cloudflare to enforce HTTPS and other cool stuff (IPv6, HTTP/2, ChaCha20/Poly1305, etc.) Apparently, google doesn't like that. Now, instead of a nice 301 redirect I get this

Which will totally wreck my search results. I guess I'll have to turn off cloudflare until search engines reindex everything and only then turn it back on.

Thursday, September 29, 2016

New domain for this blog: geekburg.com

Some of my 3.5 loyal readers might see themselves to this new domain sometime next week when they care to come here.

What is this? Have I gone all corporate and will start to earn money on this somehow? I wish, bro. No, I just saw this domain in the expiring list yesterday and thought that it could fit my blog nicely and I never liked 3rd-level domains. The only reason I ever had a blog not on a custom domain is that I wasn't sure whether I'd be able to write more than a couple posts. It appears I was, after all, even though this is neither the most actively updated nor the most popular blog, so it's time to personalize it and make it possible to become google-independent one day if I ever want to.

As with everything else, custom domain is the way to be independent from any particular provider. It's true for blogs, it's true for email (I'm one of those who do have custom-domain emails yet are too lazy to migrate from gmail completely).

I'm not likely to move out of blogger any time soon either unless I manage to generate a good pelican template (writing stuff in markdown, using vim, and keeping all the content in a git repository is just more geeky) so search engines and other 3 of my loyal readers will have a few years to adjust. At least, if google does something bad or I desperately need some feature, I won't be locked in. Having options is always a good thing.

There might be some issues with dns, redirects, https, links in the days to come but it should all be sorted out by the end of this week. With any luck, I'll have blanket https with good ciphersuites and maybe even http/2. But we'll see, I guess.

Wednesday, September 21, 2016

Lenovo Yoga 900-ISK2: shame on you, Lenovo, never again

I have posted a review of Lenovo Yoga 900-ISK awhile back in which I concluded that it's probably the ultimate choice if you need a high-end machine for running Linux. Now that it got renewed to 900-ISK2 it's no longer the case and probably nobody should buy Lenovo products if running Linux is your intention.

900-ISK2 looks really sweet on the hardware side, even faster SSD, and slightly better CPU with IRIS video card (which is probably just enough for decoding 4k HEVC video) while everything else is the same old good. Yet, a slight change in its firmware hiding the AHCI option makes it virtually unusable, locked out without possibility to change the preinstalled OS.

A thread on Lenovo forums (19 pages at the time of this writing) included both a Lenovo person promising to escalate this issue with the developers and quote from some other unknown person telling that it's been done this way per agreement with Microsoft. Someone also mentioned that it's possible to modify the bios with a programmer with only moderate soldering. After that moderators started to moderate the thread and it's now unclear whether anything will be done in any reasonable amount of time. So far the only constructive thing said was that usually bios updates in the past required from several weeks to several months.

I suppose I could wait a couple months living out of an external HDD (with usb 3.0 it's not even that slow) if I knew that it's only temporary but I'd rather try to get a refund while it's still possible.

I hope firmware will be fixed. I also hope my wife will be able to return the device for refund tomorrow. But now it's absolutely unclear what should people use instead. New zenbook with power button instead of delete? XPS with its web camera looking up your nose (besides not having enough RAM)? Noisy and overheating spectre? Overpriced and outdated macbook? Everything would be so much simpler if Lenovo just fixed this thing and not locked users out in future.

Update (Sep. 22, 2016): We managed to return the device for full refund, guys at the store didn't even give us any hard time though it required two visits to get it done. Dell XPS 13 is a likely candidate for the next purchase, it has very similar hardware specs, although the RAM thingy (8 GIB is good but not quite enough) is a possible deal breaker there.

Update (Sep. 22, 2016): Additionally, Lenovo issued a press release yesterday, stating, in effect (after you cut through the PR bullshit), that it all was intentional and they won't fix it. They are going full superfish on their customers, it seems. And the forums thread just reached 24 pages.

Update (Sep. 26, 2016): Someone started a petition to demand the update from lenovo, forums admin started deleting every post linking to it. Thread reached 30 pages.

Tuesday, September 20, 2016

Samsung flagships comparison: S6 Edge

Today a delivery person came to collect my recalled Note7. I was given a temporary replacement S6 Edge for non-determined period of time, estimated about two weeks. And it sucks for two reasons: replacement is less than ideal and it's too long a wait. So, here's my short comparison of S6 Edge with everything else while I'm biding my time.

First of all, I don't like Edge's curved screen, I would've been better off with a non-edge version. Yes, I also tolerate Note7's one (I wouldn't uses as strong a word as "like" here) and it's nothing weird. Note7 feels very natural in hand with its symmetrical body, narrow bezel, and very smooth round edges (less so when using a cover but still), while Edge is way more angular and even somehow bulkier (though Note is both heavier and bigger).

Wider curves make Edge UI more useful than on Note, where it requires a very precise gesture to activate, but I'm not that big a fan of those panels and stuff anyway. I almost got used to the curves and I don't accidentally touch them while simply holding the device anymore but I still find them useless and not necessary. Flat is better for me.

I wouldn't mention all the things that got changed in 7th generation and if you are looking for advise whether to upgrade from S6 Edge to S7 Edge or something like that I'm simply not the person to ask. I never had a S7 Edge so I wouldn't know most of things and comparing it with non-edge is probably unfair. As a rule of thumb, almost everything that was true for non-edge S6, is true for Edge: short battery life, overheating, etc. Lack of newer features made my "samsung cloud" backups temporarily inaccessible, synced data (messages, in particular) cannot not be restored for unknown reasons, so I lost lots of data because I didn't have time to transfer it using smart switch, nothing critical, just annoying. I only hope cloud backups won't get destroyed or become outdated and I can restore them when I get a new Note.

Tuesday, September 13, 2016

Samsung flagships comparison: Note7 vs. S7

As I was saying, for half a year I was a proud S7 user and everything was well except somewhat smallish display. My wife started playing Pokemon GO seriously and S6's short battery life was quite frustrating for her. Meanwhile, Note7 was announced and I had to think hard whether I want one.

Good part was that hardware is just as good as in S7 (slightly better but who cares about one more gig of RAM and stuff like that) but with bigger screen and even bigger battery. Lack of a non-curved option sounded like a deal breaker to me though, I'd never buy an S7 Edge. Yet, after carefully watching all the video reviews I decided to try it. Curves are more sloped, with larger flat surface (mainly to make S Pen usable, I guess) and symmetrical design looked cool. Fortunately, my situation is not as it used to be a couple years ago and I don't have to limit myself with only one toy per year (although this year I did indulge myself quite a bit) and S7 didn't go to waste — I gave it to my wife and she doesn't criticize me for my spending habits anymore.

So I preordered it and after a very quick delivery I was a proud owner of officially the most expensive phone on the market (yes, it's official now: 32GB iPhone Plus is cheaper, even 256GB one is still cheaper than Note7 plus a good 256GB SDXC card). Turns out, I was right. Curve is much more tolerable than with Edge and it all feels very good in hand. Free Gear Fit 2 I found almost completely unusable but that's a minor issue, after all, it's free.

I won't even try to compare it to Note5, simply because I never had one. But I readily believe that Note7 is way cooler and more better.

How different is it from S7? Note very different yet slightly better in almost everything. Slightly bigger, somewhat heavier, slightly more RAM, slightly more curved display, IRIS scanner in addition to fingerprints, optimized UI, slightly more bullet-proof glass, has a stylus on top of that all.

Size feels just right to me. As I mentioned earlier, I have big palms and that half-inch is the difference between missing buttons and typing almost without errors. Yet not a 7" monster you have to buy cargo pants for. Might be not everyone's impression, but feels good to me which is what important.

Weight is not an issue, you can still hold it one hand and scroll and even type. Not for as long but for long enough.

RAM size is something to brag about but in comparison with S7 I don't feel any difference. The same goes for everything else (although CPU is just exactly the same one used in S7 so there should be no difference).

Curved display, as I said, is not as bad as I feared. Edge UI is only barely usable with such a slope but still there (I think you could actually use Edge UI without the curves, it's an artificial limit, but I don't like it too much anyway). Night clock is, again, less usable that with Edge and it also disables always-on display feature, I'm not sure if I like either anyway.

IRIS scanner might feel superfluous for someone as there is a fingerprint scanner already, which is arguably even faster and easier to use. Key difference is that it's harder to use it without you knowing (like when you're asleep). I use it mainly for Secure Folder though, which is, by the way, the single greatest feature ever.

Basically, it allows you two have two copies of every app you want, one of which is completely sandboxed and can be locked away. For example, you can have two facebook accounts or two google accounts which you can use at the same time (without logging out) and although service providers will probably notice that they share IP and device no data will be directly shared. Or you can have a secure browser for your porn, with bookmarks and history invisible to people just looking over your phone. Unlike the previously used "private mode" which allowed you to move your naked pictures to private gallery (ricking them being synced by google), now you can take then with secure camera to begin with with geo tags are automatically disabled. By the way, you can totally allow different permissions for secure and non-secure apps and, for example, hide your location from secure messenger while share your location with non-secure one (yes, of course, same IP, same device, facebook can still easily profile you). I don't know the exact details, like how data is encrypted, how hard is to hack it if phone is powered up and unlocked, but at least it should keep your stuff safe from the unsophisticated onlookers.

Other major UI changes include new settings menu (close to the stock android), built-in blue light filter, slightly different quick settings icons and notification grouped by app. Nothing is a big deal, but together a steady improvement.

It's the first device featuring Gorilla Glass 5 (I'm not sure if Apple will use it this year, no news mentioned it). According to a review I saw it's better protected from falls and punches but you should still use at least some protective case. I'll probably go with a silicone bottom (more friction = more convenient to hold) and maybe a tempered glass protector on the top. I despise flip cases, frankly (although I'll get myself one if only for travelling — it's safer because you often have to put phone into backpack with who knows what). I still don't believe it won't scratch but I'll have to try different protectors and see if I can tolerate them (I put on some film while I waiting for glass protectors and it feels horrible) otherwise I'll have to put up with those microscratches again. I hope someone will figure out sapphire displays or something real soon.

It felt like styluses were going to die when capacitive screens came to masses. Mostly because styluses intended for such screens were ugly and unneeded (short, thick, with a big soft tip to emulate your finger). S Pen is different, it's narrow and precise, with some hundreds of pressure levels, you can screenwrite and probably even draw a little bit (not that I remember how to do either). Samsung always adds some special cool features that don't necessarily require a stylus but here you can't use them without it (and it's probably better that way in this case). Screen magnifier, handwriting notes (including ones on always-on display), editing screenshots with cropping and writing on (very useful for my work), making GIFs (from videos or games), translating whatever you see (with some optical recognition even).

Of course, as everyone knows by now, Note7 devices are being recalled over a battery issue, but that's, again, is bad for marketing and not that bad for most users. Just be careful with charging for a couple weeks before you can replace it if you already have one. I personally charge it in several takes (about 30% a time) and unplug as soon as it becomes more than lukewarm, just to be safe. If you do not have one yet, be extra careful buying after-market devices or from unauthorized resellers (but you can probably find a good deal on refurbished in a few months, they have 2.5 million device to refurbish). Maybe Samsung will come up with some way to check whether a particular device is safe by serial number or something?

And I'm also curious about how many things they will allow me to keep when replacing. Of what came in the box, I mean (gifts are definitely mine to keep): will they take away used headphones with my earwax on them or, say, charger? Those headphones are the best oem buds I ever encountered and they cost about a $20 separately so I definitely intend to try and keep an extra pair (no, cheaper ones from aliexpress do not sound as good, I tried, some say they also break easier). And a good type C cable that can handle fast charge and is 1.2m long is just hard to come by on short notice and I'm known to break them. Most probably they will not allow me to keep the S Pen. It's not more than a $50 anyway, I can live with that if I manage to lose it — which is unlikely as I rarely use it at all. Stylus for Note5 goes for about $10 on aliexpress now, maybe this will become cheaper as well, in a year or two when I might need it if ever. But, anyway, we'll see.

Update(Oct. 4, 2016): Just got a call that I'll be receiving a new Note7 later this week. I'm so happy to finally get rid of this crappy temp S6 edge. For the record, I kept charger, headphones, and all the adapters (s-pen I did return, maybe I should've kept it as well) and nobody asked any questions whatsoever about that.

Update(Oct. 12, 2016): News say something about another Note7 recall. More than that, they seem to be discontinuing the line completely. Epic. Now I don't know what I'm going to use, definitely not some apple® ishit™. Maybe I should get myself something temporary until S8 or Note8 gets released next year, for some reason I still like Samsung's hardware. Or maybe I should check out what Google does with their Nexus/Pixel thingy, I heard some good feedback but I'm not sure I could live without a hi-res amoled display.

Monday, September 12, 2016

Samsung flagships comparison: S7 vs. S6

I'm very new to Samsung devices, not so long ago I was sure that expensive phones are not worth it. You have to replace them every year or two anyway, they don't provide new features to justify the price tag, cheaper devices come in better variety and you don't feel bad throwing them away if you don't like them, etc. So for a few years I used whatever cheap Chinese brick was on the market. And before that, well before that I didn't actually own a smartphone. And it was quite all right, comparing notes with friends I thought that annoying bugs and lags from time to time are universal, even if you have four CPU cores and 2 gigs of RAM, that it's mostly a software thing and Java is a bad language for mobile platform, and all that. And then, quite recently, I changed my mind about those things. Partly because my income situation changed slightly.

It all started when I needed a birthday present for my lovely wife last year and S6 was out for just a couple months. I love gifting electronics, she mentioned that she likes how AMOLED displays look, and I suspected she'd never buy an expensive phone for herself but she'd love it. It turned out I was right, she totally loved it. And then I noticed something: she always have bunch or recent apps open like it never lags enough to bother closing them (yeah, I know that minimized apps are not actually active, but "close all" is a thing everyone does first when their phone is slowing down). So I played with it a few times and noticed more stuff. Whatever lags I was used to (you open browser or switch apps and wait for fraction of a second before everything is drawn, or click into an input field and wait a couple seconds for keyboard to pop, take a photo and wait for it to save) and never actually felt were virtually non-existing there. And once you start seeing them, you cannot unsee. Way more powerful hardware multiplied by somewhat optimized soft equals less frustration and less wasted time. And both of them are important to me. Fingerprint lock also saves time while keeping your stuff more secure.

True, everything comes with a price. Battery life in S6 was also almost non-existing as well :) That's mostly why I didn't consider buying one for myself. Fast charge helps but even fast charge is inconvenient to use more than once a day. Plus a few other things I didn't like. Then S7 was announced and I almost immediately decided that it's what I want. It had everything S6 had plus bigger battery and water resistance (and slightly better CPU and somewhat more RAM but beyond certain point you just stop worrying about that, unless you host a database server on it, I honestly don't remember exact numbers fore either phone). So after a few considerations (along the lines of "Free Gear VR?! I must have it!") I preordered it and then picked up... well, local Samsung store is so crappy that they didn't actually have stock to cover preorders, I guess without advance payment not everyone comes to pick them up, but I still don't like those people. So, a week after the official release I picked it up (for that free Gear VR I had to wait one more week) and immediately went to test IP68 protection by submerging in a beer mug (it held well, to my mild surprise, but you must let it dry completely before charging).

Using S7 for several months alongside someone with S6 gives you an unique perspective, I guess. Battery life of the former is definitely much better. While I could charge my S7 to 60% (quite fast with fast charge) and go about my day my wife had to wait much longer until her S6 is on about 90% (charging speed is not constant, much slower after 50-60) and then pack the charger for future use despite always having power saving turned on. True, she's a more active user, but not that much more active. If you play Pokemon GO or something like that, neither will be enough for the whole day, get yourself a charging cover or a generic power bank. Performance is about the same, although I never did a side to side comparison (look for one on youtube). S7 is more ergonomic with slightly curved sides (both are non-edge, by the way, I hate those curves on Edge) but if you use any kind of cover you won't notice it anyway.

Gorilla Glass 4 did live up to my expectations, I must admit. After just a few days of cautious use I found a few microscratches (you usually can't make them with metal so I suspect microsand or something). They don't have any significant impact on usability but at certain angles you can see them and it's annoying. With those slight curves you can't use a traditional tempered glass protector and film protectors just feel wrong, nothing compared to bare glass (bare Gorilla actually feels better than glass protectors I tried). I think nowadays you can find curved protectors for everything if you look on aliexpress though. Display also has oleophobic coating and that's a reason why you should never clean it with alcohol or IPA and absolutely never, ever try to fix microscratches with polywatch (yeah, I tried both, obviously). There are substances on the market to restore that oleophobic coating, I tried proteger which had good reviews, but after polywatch it didn't help to any noticeable extent. Maybe it works better on IPA damage or coating worn with time, as far is I know at least it doesn't make it worse.

AMOLED matrix, on the other hand, is everything I expected. Vibrant colors, deep blacks, good view at angles. Once you try it, I don't think you can ever do without. And it has quite good resolution too, although 4k would've been better with Gear VR but nobody makes 4k phones yet anyway (maybe S8 will be 4k?). Overall, it's the best way to read comfortably and avoid excessive eye strain short of going e-ink (I never read books on my phone, I have a kindle for reading books).

Gear VR is about as I expected, not too bad but nothing fantastic. 1440p display divided by two eyes equals about 720p per eye. Multiplied by large virtual screen, pixels are very noticeable. Not helping are significant gaps between pixels (Oculus Rift uses some very special displays to overcome this particular issue, I believe). So, yes, you can totally watch 3D porn on it but not for too long. And not only because someone can walk on you without you noticing, at least my eyes strain a lot. I never managed to watch a whole 3D movie in a single sitting. They don't recommend using it for more than 20-30 minutes or so and it's a sound recommendation, you simply can't dive into the virtual reality just yet. Augmented reality is no better, you'd need two cameras on your phone for it to work well and somewhat less bulky gear. Or maybe to stop using phone's display, and connect like Rift, using HDMI over USB or whatever (cleaning dust of both display and lenses is an inconvenience). Lack of standard interfaces doesn't help either, we already have dozens of incompatible VR devices on the market. Anyway, a funny toy but we are not there just yet, let's enjoy the ride.

Camera it S7 is way better than in S6. Doesn't matter that much for your vacation photos but lack of blur is more aesthetically pleasing on anything. It also can do microSDXC card for your photos and videos, unlike S6, which is kinda important since base storage is smaller. Especially if you install all the Oculus apps and download a couple 3D movies. But downside is that the second sim card and sd card share a slot. You can't use both. I even googled some guide and tried to superglue sim card's chip to the sd card and almost broke the slot. I guess if you could file a millimeter or so from the sd card, it would be better but I never tried again, even after I bought a replacement sim tray.

In some situations for whatever reason S6 has more stable LTE data connection than S7. When you roam about and not every cell tower has LTE connectivity, it forces your handset to switch to 3G and for some reason S6 handles it better (yes, the some carrier) while S7 completely loses network for a few seconds. You can help it by switching to 3G only or by switching to a better carrier (moving to a better country ultimately, because I never had any troubles while in Thailand), but the fact that another device does it better is somewhat disturbing. Maybe it's a software bug and it gets fixed someday? Maybe it's my specific hardware revision and you won't experience it? Let me know in the comments if you did.

Should anyone upgrade from S6 to S7? Hardly, especially if you are ok with what you have, it's just not that different. Buy a power bank if don't have one yet and wait till next year for something even more better.

Anyway, one thing that I didn't like about either of those phones is their size. I have large palms, and tapping on a tiny screen is not that good, you can get used to it but I've had better. Yes, Huawei MediaPad X1 was a bit too big, but surely there can be some compromise. I even briefly considered not getting an S7 and waiting for the next Note instead (Note5 wasn't for my liking) but decided against it for some reason. But more about that in the next post tomorrow.

Sunday, September 11, 2016

Samsung Gear Fit2 Review

So, I've got a free Gear Fit2 with my Note 7 preorder. After trying it a little bit, I've decided I don't like it much and now I wonder who might want it (maybe my wife will). And now some photos and pros and contras.

Device feels very sleek, I could totally wear it if software were more usable. There is even some security, you can set a pin code that you need to enter after you take it off.

Display is large enough for analog clock and date

S Health app is not too bad overall (I like its approach to tracking exercise, for one) and syncs quickly but it does a poor job with sleep tracking which is a deal breaker to me. Doesn't estimate how much energy you spend during the day. S Health is not the only app that interacts with Gear, for some things you need to use Samsung Gear app, installing apps to the device is done with Galaxy Apps. There might be more of them. Not sure whether it's good or bad to have several apps for not so many features but probably good. There's some additional integration with my Note 7 (battery status and connection info on notification screen), but nothing too special.

HR monitor looks similar to fitbit and even better as it's almost completely flat. Though the whole device is significantly bigger.

Gear on the left, fitbit on the right
Unlike fitbit, HR monitoring is not continuous, it takes measuring only every 10 minutes or so. Hence, it can measure average or maximum/minimum but can't measure how much time you spend in a particular heart rate zone. Such data is not too useful for calorie counting as well.

"Smart" features, notifications, custom apps, color AMOLED display, dedicated GPS and standalone WiFi connection are very cool but I don't know any good use for all that. Installing Spotify on it sounds like a good idea but Spotify is not available in the region I'm currently in and Galaxy Apps doesn't do it like Play Store (uses location instead of billing address) so while I totally can install and update Spotify app on my phone, I can't do it with Gear.

Wrist band is just shitty, it's too easy to unclick it and loose the device. It also straps in counter-intuitive direction (from bottom to top), I wonder if you can switch its halves.

Counter-intuitive strap
Huawei straps in the other direction as you can see
Good news is, at least you can replace the band completely and it's popular enough for many of them to be available on the market.

As I said, it was good to try it for change but it's probably not the device I'll use and I don't know who might want it. If i don't find anyone maybe I'll just sell it on ebay while it's still almost new.

Friday, September 9, 2016

What to do if your wearable gadget comes with a crappy wrist band, a lifehack

Some devices come with a good wrist band. Take Fitbit Charge HR, for example:

Fitbit Charge HR and what wrist band is supposed to look like

It's comfortable and there almost no way to lose it between good buckle and additional security band (not shown that it has an additional claw inside to fix it in place).

While others are just crappy and too easy to lose:



Samsung Gear Fit 2
And how to lose it
Just unstrap it with your backpack or something and it slips right off, you'll never notice

Huawei Talkband B2

Not as expensive but just as easy to lose

I mentioned that Talkband B3's band, while looking the same, is marginally better. But not much better.

What to do with it all?

Obviously, the first thing you should do is to let the manufacturer know about this fault. Especially if you already lose some device, go write an angry tweet or post and contact the manufacturer. Repeat often enough and maybe they'll stop doing it.

Before than happens, you can also secure the band with an additional security band. They are sold separately, search amazon or ebay for one for your particular wearable or something close (it should look kinda like the first picture, although that particular one was built-in). Do not think that Fitbit is absolutely better, by the way, Fitbit Alta and Fitbit Flex are so popular and crappy that security bands for them are in fact the easiest to find. It should cost you couple bucks at most which is a good investment if it helps you not to lose a gadget that costs several hundred bucks, don't you think so?

And what to do before you find one and wait for it to be mailed to you? I'd recommend using anything short and elastic, like that tiny band that comes with TalkBand's usb cable, don't rush to throw it away:

A possible way to secure those crappy wrist bands, using an elastic band from usb cable.
Or a rubber band for money/plastic bags. The trick is to not make it too tight, so you still can unclick the pin yet tight to enough to require more efforts for unclicking and tight enough to provide more tension if it does unclick.

You can also try to use duct tape, pieces of wire, glue, threads or ropes. Let me know in the comments if anything works out for you.

Thursday, September 8, 2016

Ultimate fitness tracker comparison: Fitbit Charge HR vs. Samsung Gear Fit 2 vs. Huawei TalkBand B3

As I mentioned in my previous post, I have way too many fitness trackers for someone who is not a fitness person. How did this start?

Fitbit Charge HR, Huawei TalkBand B3, Samsung Gear Fit 2

Well, Huawei TalkBand B2 was my first wearable device ever and I quite liked it. This week I got a new TalkBand B3 to replace the lost one and it's slightly but better than B2, it's probably the only one I'll never get rid off because it's mostly a headset for me, not a fitness device or a watch. I actually never even considered getting a dedicated fitness device.

Then last year I found a Fitbit Charge HR on the beach (whoever lost it on Ta Yai, khop khun krap). And, to my surprise I liked how it works. you see, unlike most of fitness trackers, it's really useful even for occasional tracking: it measures your heart rate continuously so you get a complete data about how intense that quick stair-climbing was (it also counts floors using altimeter), it estimates calories you spend both passively and during exercise which is very useful for everyone (even if you don't count what you eat, with which it also can help, but more on that later), and it auto-detect most of exercise (at least long walks and running, I don't think it can do aerobics, but, again, more on that later). FitBit announced Charge 2 as a replacement for Charge and Charge HR so if you want a new one, better get that. I don't know if's worth an upgrade, I'm not planning such at this moment.

And, very recently, I got a free Samsung Gear Fit 2 with my preordered Note 7 (more on that in another post next week) which can do a lot more non-fitness stuff while also can do a lot of fitness things (it can detect aerobics to some extent, by the way).

Obviously, wearing all three of them is not an option so I needed to make a decision. This post is an attempt to highlight factors I considered. It's not a full review of all three devices (which would be just too long).

Unfortunately, you can't switch back and forth between different devices. They require proprietary app to be useful and integrations with third-party services are limited. There's no way to synchronize your data between three apps so if you switch you will at least loose your historical data.

Let's start with logistics. TalkBand is mostly a headset for me, everything else about it is secondary. So it has to stay on my non-dominant hand and wearing anything alongside it is next to impossible (makes taking the headset out very inconvenient, since it has two symmetric extraction buttons and you have to press both). That leaves the dominant hand for anything else, if anything. No way I'm wearing two devices there and touchscreen interaction is limited (I can only tap and scroll so much with my left) which suggests I should keep Fitbit if I'm also keeping TalkBand. If I want a single device, Gear has bigger and nicer display and more stuff there to use (you can even install custom apps and themes). Now let's highlight pros and contras of every device.

Firstly, Talkband. I already said that there's no equivalent for its headset part. Besides that and barely passable fitness tracking it can show some notifications (from any apps but within limited screen surface). Display is small, low-res, and monochrome but still quite nice (high-contrast PMOLED). It's rated IP57. If you don't talk much, battery is good for almost a week. App is very simple, basically it only shows you steps and sleep data and has very few settings. Simple, but not bad. Sync is very fast. It can do smart silent alarm (which might be not exactly 100% reliable and several non-smart alarms for notifications and stuff). Charges with standard microUSB cable, no idea why others don't do that.

Secondly, Charge HR. It's very good for fitness tracking. If I were a pro, I wouldn't consider anything else (except maybe something even more professional and specialized). Display is very small and interactivity is very limited, no "smart" features. Splash protected but not rated. It's good at auto-detecting exercises, at calculating calories, app allows you to track what you eat an drink (including calorie budget and food list from which you can add stuff relatively quickly), heart rate zones (continuous monitoring allows you to know exact time you spend in each zone, to a seconds), active hours, sleep schedule, logging weight (could be automatic with Fitbit Aria smart scales), add integrations with very many services and it's probably the best fitness app so far. Sync takes ridiculously long though. No smart alarm and only one non-smart one per day. Battery easily lasts a week. Requires proprietary cable for charging (which can be bought off aliexpress for about $3 if you loose it).

And, lastly, Gear Fit 2. Some say it's the best fitness device from Samsung. If so, they have very large room for improvement. It doesn't do continuous HR monitoring so heart rate data is mostly good for averages, you won't know exact time you spend in cardio or fat burn zone. Saves battery probably, which is important as it lasts couple days at best. Its shiny and hi-res AMOLED display is very good, if I new any apps that are good on such a small display, I might finds more uses for it. It can play music, I guess, and it can have a wifi connection of its own (but no mobile data so no walking with wearable edition of Spotify if there's something like that). Rated IP68 but still not designed for swimming (which it too bad, I like swimming). Dedicated GPS should help with tracking distance and routes. It can detect aerobics and S Health app knows more than a few types of exercise for manual tracking (yoga, rowing machine, you name it). Overall, it can do many things that fitbit can't (if only manually) and only a few things it does worse. But one of those things is sleep tracking (if I wake up for an hour in the middle of night it can't even show me total hours slept) so I mark Samsung devices as essentially unusable for me for now because of S Health (I can see the info required on device itself so it must be fixable). Sync is fast though, I like it. Charges with a proprietary cradle, very bulky to carry and probably expensive to replace. Device itself is bulkier than Fitbit. Wrist band is crappy, like Huawei's, I need to find some way to prevent losing it in some airport.

My preliminary verdict: unless I can found more uses for Gear Fit and/or fix it for my particular use cases, I'm going with combination of Fitbit and TalkBand. If I ever want or need to replace Charge HR, it'll probably be a similar Fitbit device, like new Charge 2. Maybe I'll write a short dedicated review for Gear Fit 2 and S Health app with more details about why I can't and won't use them, stay tuned.

Wednesday, September 7, 2016

Now to prevent Samsung Galaxy Note 7 from exploding

Even if Samsung branches in some countries would like to keep it so*, it's no secret that some Note 7 devices have been sold with a faulty battery and can catch on fire and even explode while charging or shortly thereafter. Samsung plans to replace all the devices sold to ensure our safety even though particular procedure is not always clear (in some countries, anyway).

But it will definitely take a few weeks to replace those batteries and deliver everything so what can and should you do meanwhile?

First of all, if you can, simply do not use the device at all. It's definitely the safest even though I'm pretty sure Samsung would replace it for you even it's caught on fire. Just turn it off, put it into the box, and wait for replacement. Samsung will probably appreciate its unused condition when refurbishing and restocking.

Second, if you still want to use it, make sure it does't overheat. Don't charge overnight, don't leave unattended while charging, don't Gear VR, don't do anything that can make it hot. When charging, keep it close to your body (like, in hand) and quickly unplug if you feel it getting hot. Probability of ending up with a faulty device is low to begin with and with measures like these you can minimize probability of anything fatal even further.

Third, you can get creative. You can tremendously enhance your safety when charging Note 7 if you put it into a glass of ice water.



Phone is water-resistant so why not use that? It will cool it off if it gets hot and even if it catches on fire or explodes, water will not allow fire to spread. There is some possibility of short-circuiting so still be careful. Make sure to keep USB port dry as it will refuse to charge otherwise. Leave phone in water for a few minutes after unplugging to make sure it does not explode and, after charging, wipe it dry with a paper towel.

* Samsung Russia is yet to publish any news about this even though mass-texting and follow-up calls did happen.

Disclaimer: Information in this post is not endorsed or sponsored or approved in any way by Samsung or any of its subsidiaries or partners and represents only author's personal opinion on subject. Use any advice on your own risk, some actions can void your warranty or put you in danger.

Huawei TalkBand B3 (active) review

Despite the fact that no manufacturer ever sent me any free gadget for review, I'm continuing doing it. Maybe I'll become a popular reviewer and they will change their mind. This post will be the first in this year's wearable gadget reviews.

To put it into perspective for those who don't know me, I'm not a fitness person, like at all. I eat healthy, I walk kinda a lot, I do some aerobics and occasional cardio but that's it. I'm too lazy even for jogging. But, for some reason, I currently have not one, not too, but three fitness trackers on my wrists. Yeah, crazy, I know, but that was the only way to compare them properly. By the way, wearing TalkBand on the same wrist with anything else is super inconvenient, you can hardly take it out for calls. But more on that later. Why do I need any fitness tracker? Apart from knowing time, I like to know how active I'm during the day, and, more importantly, track my sleep. I have some issues in that department so it's kinda important.

Also I don't like "classic" smart watches. I never wore normal watches, I don't wear suits, so smart ones are just too clumsy for me. Fitness trackers, on the other hand, are a good way to know time without having to take your phone out of pocket, in addition to fitness features. Notifications are kinda useful but I could leave without them. Apps and advanced stuff right on the watch are, in my opinion, waste of resources (gps is not, though, it helps tracking steps). I don't, for example, run with only tracker and headphones to make use of music player app. (If I workout, I usually have my phone with Spotify nearby which is easier than copying music files back and forth.)

Why TalkBand? For someone like me, a person who don't need very advanced fitness features and don't call a lot, it's a combination of passable tracker and good enough headset that is just right. It costs way more than a cheap headset but you can easily wear it on you wrist and take out for an occasional call. Most of normal headset are good only if you want to wear them in your ear all the time (otherwise you have to not forget to switch it off and on and might have issues when you forget that).




My general impression is that it feels somewhat cheaper than B2. Plastic is more squeaky, box is not quite as unnecessarily impressive (I'd be ok with cardboard if it saved me a couple bucks, really, it's not like I have any use for those boxes).



Someone might remember that I used to have a TalkBand B2 and liked. It had a problem with ear tip (that got flattened down to being unusable) but otherwise I'd still use it if I still had it. Unfortunately, the second serious problem it had (unreliable wrist band) proved fatal for mine. If you travel a lot with a backpack, it often can undo itself when you put backpack on or take it off and be lost. It was the second TalkBand in my household lost in an airport (whoever found it near security checkpoint in Don Mueang, you are welcome, mai pen rai krap).



Was anything done to fix that issue in B3? Well, the band has longer metal pin that prevents it from being completely unstrapped and unclicking requires more effort but I still recommend to replace the band with something with normal buckle. If you manage to find something comfortable enough, kindly let me know where to get it. Flattening ear tip? Well, it needed more than a couple months on continuous wearing to get there (I'll update if anything happens) but tip is different from B2's so that might help. Yes, it means it's incompatible with those spare tips I have lying around.



Main non-fitness-related change is that now you can initiate calls with it. You can add select contacts from the and call them, or call last-used number, not only accept calls and return missed ones. There are a few other small-time changes here and there but overall it seem to be about as good for everything as TalkBand B2 was. Some fitness tracking, occasional call, knowing time and date. Probably not worth upgrading but if you need one, better get the new one.

Short summary for those who didn't read TalkBand B2 reviews or haven't used any Huawei wearables before. Fitness features that work are steps counter and sleep tracking. You can manually track stuff like running or cycling, and it has some pretty useless calorie calculator. You can use it as a normal bluetooth headset (and it accepts calls and switches sound to itself when you take it out). Huawei Wear app is required for everything, flagship Huawei phones also have some additional integration (like showing TalkBand's battery level in status bar, not unlike what Samsung offers with its flagships and wearables). IP57 protection (do not swim in it but occasional splash or sweat is ok). That's pretty much it, nothing special, but a very good device in its niche.

Friday, May 6, 2016

Lenovo YOGA 900 in-depth hardware review

"In-depth" meaning that you get to see some circuits here. But we'll get to that, let's put some background first. Disclaimer: I'm not affiliated in any way with any trademark holders mentioned nor am I any kind of hardware engineer.

A few months ago I bought this laptop for mainly three reasons: cutting-edge hardware for ultraportables (including 512 GiB SSD, and especially 16 GiB RAM, something that leading competitors have yet to start including — RAM is not upgradable so it's important), normal keyboard without counter-intuitive keys (very rare among ultraportables), and super-cool wristwatch hinge, used also for ventilation which means that nothing usually blows hot air to your laps). And all that for price similar to the price of competitor laptops with the same chipset/cpu (keep in mind that even slower large SSDs are still quite expensive). I've found out that it's quite quiet for something having fans at all and quite powerful. I would very much prefer something with two SSDs so that I can RAID-1 them, but that's not very common and wasn't critical for me.

 Linux works on it surprisingly good (minus some software not supporting HiDPI yet), but
you'll have to dual-boot to update bios firmware. I usually just install Win10 to my swap partition, do what I need, wipe it, and use as a swap again.

Anyway, externals and software are reviewed on many other resources so I'll just stop here. Yesterday, I was working late and, when getting up from my desk, spilled about 100 mL of Corona Extra with lime (say what you want, I like it) on the keyboard. After the usual turning over and wiping to make sure nothing gets to deep inside (and finishing the bottle), I started disassembling to wipe and clean everything inside, assess damage, and clean the keyboard separately. It's not the first laptop I had repair after spillage (the first of my own though) so I new that first aid must come prompt. If you're already bored, summary is that I'll probably need a new keyboard and a new DC-in jack cable.  For everyone else, some photos follow.



This is what you see after you unscrew ten T-5 screws and struggle with hooks a little. Notice that motherboard does not carry any external ports and both I/O boards can be replaced separately (damage from electric discharge or some such will hopefully be limited to them, keep repair costs relatively low).

DC-in has a separate cable which I prefer in my laptops, because they tend to break from time to time and I both don't know how to and don't want to solder-in any parts into expensive circuit boards. In this particular case, however, there a minor catch. Unlike other ports, to remove that cable you have to pull upward, not away. Because I haven't studied the maintenance manual first and didn't look to close as it was an emergency situation I pulled in the wrong direction a little to hard and destroyed the connector. Now I'll have to wait while a replacement arrives.

Battery is generally the first thing you have to remove when dealing with spills. This one can be remove relatively easily but cable is connected to the motherboard from the bottom making it slightly uncomfortable to remove or replace.



I didn't stop to make photos while I was cleaning, and won't go further until I have a replacement keyboard (at which point I might post some additional photos here). But you can see part of the keyboard and note that it has some tape on it and is connected by a lot of screws. The tape, unfortunately, doesn't make it even slightly spill resistant even though it's a very simple an very important addition (some competitors do that, I'm not pointing to Acer R13 R7). It's not like there's any air circulation through the keyboard anyway.

Pretty standard M.2 for SSD and PCI-e for wireless card. Overall, my impression is very positive, some things might be not ideal but it's a solid piece of hardware that will probably serve me well for years... Once I fix it this time and stop spilling stuff on it.

Another thing you might've noticed is unused ports on the motherboard:


JP7 looks like a fan port (I'm totally guessing, could be anything). JP15 and JP10 have nothing soldered into them but I'm very curious whether I can connect USB or PCIe or at least GPIO or something to any of them. If only there were any test for that or some document. Maintenance manual doesn't say anything. Maybe I can find some spec sheet if I use info printed on motherboard?


Or maybe I should just go and ask Lenovo. Internal USB port would be very appreciated even though it's too thin for almost any additional device to fit inside (I'd try to put a hardware RNG circuit there, or something).

By the way, keyboard is still acting up even after I cleaned it thoroughly with alcohol and let it dry. So I'm going to replace it and get myself a new wireless keyboard, luckily, this laptop can stand on desk in a tent mode freeing space for an external one. I decided that it's time to try some mechanical one, so I might compose a review of that as well in a couple months.

Monday, April 25, 2016

How to use sudo and output redirection

It often happens that you need to echo or cat something to some config file, or maybe a log, or something else owned by root. It also often happens that you try to run it as a regular user and get a permission denied error. And normally you'd just prepend your command with sudo and be done with it, but output redirects are not that easy: current shell will handle them itself, they will not be passed to sudo and you will still have your permission problem.

Luckily, the fix is easy: instead of prepending the command, you just replace > somefile with | sudo tee somefile and >> somefile with | sudo tee -a somefile whatever the command before was. You may also add > /dev/null if you don't want if to echo everything.
Example:

echo "truncated" | sudo tee /var/log/toolong.log
echo "additional log record" | sudo tee -a /var/log/toolong.log

Of course, this is not the only way and it's not always the best but it works all the time, it's quite straight-forward (doesn't require any escaping or changing the original command in any way), and it doesn't require any additional programs to be installed.

Feel free to write about your preferred method in comments.

And a bonus tip about tee, not sudo-related:

wget -O - http://example.com/dvd.iso \
  | tee >(sha1sum > dvd.sha1) \
        >(md5sum > dvd.md5) \
  > dvd.iso