Extended Attributes support for symbolic links in EncFS

In developing a new (and hopefully more straightforward and user-friendly than what exists today) GUI-based, Time Machine-like backup utility for Ubuntu, I decided to use EncFS for encryption of backups. EncFS is a cryptographic filesystem, aiming to make securing data easy. To do this, it implements a user-space, stackable cryptographic filesystem. It has a relatively gentle learning curve compared to other Linux encrypted filesystems.

Ensuring that EncFS would maintain fidelity of files once encrypted and then decrypted again is of critical importance, as if data loss is encountered due to failure in the underlying cryptographic components, then any other part of the backup software would be for naught. Full system backups need to preserve, among obvious components like file names, paths, and data, links (both symbolic and hard), modification times, and extended attributes. In verifying EncFS’s ability to preserve these components during both forward and backward encryption, I quickly found that when using EncFS, if a symlink to a regular file exists in a decrypted directory, the extended attributes on the target of the link cannot be read.

I’ve patched this problem in EncFS myself, though backporting these patches into Ubuntu through official channels (the EncFS owner) seems to not be a frequent occurrence. So, I’ve patched EncFS for the currently supported versions (as of 3/24/2017) of Ubuntu (14.04, 16.04, and 16.10) and placed these patches in my own PPA.

Anyone wishing to ensure that their EncFS maintains proper extended attributes on files passed through symlinks may use my PPA to easily update their version.


sudo add-apt-repository ppa:track16/ppa
sudo apt-get update
sudo apt-get install encfs

and you’re done!

Read More

Faster, easier web page browsing with PageAccel

For those of you who are eager to jump to the chase and use my PageAccel plugin, please head over to the PageAccel home page and install (should take 10 seconds, tops).


 

I recently learned about the Accelerated Mobile Pages (AMP) Project, an open-source initiative led by Google to accelerate content on mobile devices. The idea, in short, is this: by streamlining web page content to include only the most critical pieces, web users on mobile devices can experience pages which load faster, are easier to read, and do not have the “clunkiness” which plagues content originally created for desktop browsers. Google’s goal is two-fold: to drastically improve the mobile user experience by providing simplified web pages, as well as providing a programming framework for web designers and developers to use in creating this content.

According to a report at SearchEngineLand reported by Google, “The median load time for AMP is 0.7 seconds, the time it takes for your eye to blink twice. By contrast, the median load time for non-AMPs is 22.0 seconds, the time it takes for you to leave the site and never come back.” Which page would you rather view?

I recently started noticing some of this AMP content myself on my own mobile device, as Google has been incorporating AMP pages in its web search content for a several months now. From Google’s own blog post on the search result incorporation, “[this] shows an experience where web results that that have AMP versions are labeled with The AMP Logo. When you tap on these results, you will be directed to the corresponding AMP page within the AMP viewer.”

See Google’s own view of the differences side by side (on the left is a non-AMP experience, and the right is the AMP experience):

amp2
amp1

Here is an additional slide deck from Google, which describes the project:

 

If you’ve not viewed any AMP pages yourself, I’ll tell you that my own personal experience has been excellent. Having streamlined, faster loading pages without much of the cruft that typically is served has been excellent.

I quickly began craving this experience in my own desktop browser.

The vision

I started formulating some goals:

  • I wanted a painless experience to closely replicate the AMP experience on my mobile device.
  • If I clicked or navigated to a page with AMP content, I wanted that to load in my browser.
  • If I wanted to switch back and forth between AMP content and standard desktop content, I should be able to do that.
    • And I wanted to be able to save that choice permanently for a website. Much in the way that AdBlock Plus allows enabling and disabling for a given web site, I should be able to do that, too.

The more I pondered this, the more I realized that a simple Chrome extension (as Chrome is my current browser of choice) could likely achieve this. I had never built a Chrome extension before, and so this would be both a good learning experience and also provide an avenue to share my work with others (through the Chrome Web Store).

The Chrome extension – PageAccel

I set out to build my first Chrome extension. I won’t go into detail about the challenges that I faced in developing the work; I will say that I did learn quite a bit about the race conditions which quickly pop up when programming a Chrome extension (given Chrome’s highly asynchronous, callback-based APIs) and dealing with Chrome’s Web Store support team (which is highly automated and thin on actual humans to answer seemingly simple questions).

In the end, I had built my first simple Chrome extension, PageAccel, which is satisfying the goals that I laid out. It’s basic yet totally functional, doesn’t require any input from the user, and successfully detects when AMP content is available and switches the user to use that content seamlessly and painlessly. The extension indicates visually to the user when browsing AMP content, if it’s not already obvious due to the “lightining” fast load time and simplified pages (I chose a lightning icon for the extension itself). The entire project is open-sourced in GitHub, and I’m hoping to receive some feedback from the internet at large if others find this extension useful as I do!

What is it like to use PageAccel?

Rather than explain with more words, I’ve included the screenshots which are part of the PageAccel page in the Chrome Web store:

screenshot1
screenshot2
screenshot3
screenshot4

 

Does it help? Yes!

In my own use in the last few weeks (which of course is not a uniform sample of all web content), I’m seeing that somewhere between 10% – 25% of the pages that I visit have AMP content. Much of this simplified, accelerated content has been authored by mass media (some randomly selected news websites: BBC, The Guardian, CNN, and the like (c’mon NPR, switch over!)) and tech blogs and information sources (not a big surprise here). I’m hoping over time I’ll continue to see an uptick in fraction of pages which have AMP versions overall; if the growth rate reported by SearchEngineLand is any indication (“only three percent were using AMP in March 2016, versus 11.6 percent in June 2016”), then my extension will become more and more useful over time – at the very least, to me.

 

Read More

A new succulent pot

A trip to Flora Grubb yesterday (during which we expected to find a few specimens to add to our collection) resulted in a sizable purchase, after we realized that we had arrived on a “20% off all stock” day!

We purchased a variety of small and medium succulents and repotted them in an old pot which was overflowing with tiny aloe.

Unfortunately, I don’t know all of the species in here, but I know I have at least one echevaria, a hawarthia, and an aloe (one of the old ones).

February Succulents 1

February Succulents 2

If you know what species we have (or even the genus), please comment down below so we (and everyone else) knows what we’ve got potted!

Some succulent-specific basics I’ve learned (or already knew):

  • Don’t overwater. Watering twice per month in the growing season (late spring – early fall) and once per month other times is plenty. Watch out especially for pots with poor drainage.
    • Don’t water the leaves. If the pot has drainage holes in the bottom, just set the pot in a bowl of water and let the water soak up to the top of the soil.
  • Use well-draining / cactus soil
    • For example, 1/3 humus, 1/3 perlite, 1/3 sand would work.
  • Be careful – leaves are fragile. On some species, they can be knocked off with a very light touch.

Read More

What is a scientific evidence-based treatment for the common cold?

We all get common colds from time to time; they’re no fun, but rarely life threatening. The common cold in humans is primarily caused by a family of viruses called rhinoviruses, of which there over ninety nine types, which makes finding a “common cure” for all of them unlikely. While no silver bullet cure is likely in sight, at least something to lessen the annoying symptoms would be nice: the cough, the runny nose, the headache, the body soreness, the fatigue.

Clearly, there are steps that one can take when already infected to lessen the intensity and duration of symptoms, including getting enough rest and drinking plenty of rehydrating liquids. As a former biologist, I’ve long been interested in how viruses operate in the body and how we can best treat them pharmacologically (with drugs). While there are many over-the-counter remedies marketed to us, today I became very interested in what drugs I should be reaching for to keep me the happiest when a common rhinovirus has made its home in my sinuses. Which drugs should I purchase that have been proven by scientific study to actually help with cold symptoms, rather than being clever medicinal cocktails that simply sound great in marketing material?

one

A scientific, evidence-based checklist for treating the common cold with drugs

I’ve put together some very straightforward guidelines for what to do and take when needing relief:

  • Begin treatment as soon as you notice cold symptoms
  • Take a sustained-release first generation anti-histamine
  • Take a nonsteroidal anti-inflammatory (NSAID)
  • Continue taking these every 12 hours until cold symptoms go away
  • Add an oral decongestant if the anti-histamine and NSAID treatment does not relieve symptoms

All of these pointers came directly from www.commoncold.org, a website with comprehensive yet digestible scientific evidence-based information about the common cold, prevention tips, and treatments. The site has been put together by two medical doctors who specialize in virology and infectious diseases. See their credentials here and here. These tips come from published, peer-reviewed clinical trials, not just anecdotes, “common knowledge”, or hearsay.

Let’s go through the most interesting recommendations one by one and pick them apart.

Begin treatment as soon as you notice cold symptoms

This may be obvious to some people, but for others: the facts here are that “cold symptoms appear as early as 10 hours after a cold infection has started and increase in frequency and severity for 48 hours. After 48 hours, the symptoms usually begin to decline as the result of the natural course of the illness. For this reason, a cold treatment will do the most good when taken at the first recognition of symptoms. The treatment is thus applied over the period when most illness is expected (the first 3 days of infection).”

Another reason to treat early is that nose blowing is very likely to cause sinus disease in colds, and early treatment reduces the frequency of nose blowing by reducing nasal mucous.

A third reason (if you didn’t have enough already) is that the majority of common cold sufferers have clogging of the eustachian tubes between the ar and the throat, which may reduce the frequency of complications involving ear infections.

Take a sustained-release first generation anti-histamine

This one was the big news to me. I had previously thought that no anti-histamines would help reduce symptoms of the common cold, but it turns out that the first generation of anti-histamines can actually reduce symptoms. The first generation of anti-histamines are known as sedating; they often cause drowsiness as a side effect. (References 1, 2, 3)

I have a hard time finding them in stores, but they include:

  • chlorpheniramine (Chlortabs, etc)
  • brompheniramine (Bromfed, Dimetapp, Bromfenex, Dimetane, BPN, Lodrane, etc)
  • clemastine (Tavist)

They have all been shown to be effective in randomized, double-blind studies and sustained-release versions of them are the most effective.

Important: second generation anti-histamines, those which are non-drowsy, are not as effective as the first generation.

Take a nonsteroidal anti-inflammatory drug

We know these as NSAIDs, perhaps the most popular being Ibuprofen. NSAIDs are great for pain relief, inflammation, and fever, which often accompany nasal discomfort (Reference 5). Not as much research has gone into this area, but there are some clinical trials for using NSAIDs for the common cold.

Add an oral decongestant if the anti-histamine and NSAID treatment does not relieve symptoms

Decongestants shrink the tiny blood vessels in the nose, which are most at fault for causing nasal congestion. Nasal sprays work wonders very quickly, but wear off fast and can cause burning. Taking oral decongestants are less powerful and don’t work as quickly, but don’t cause as much discomfort. They are safe in recommended doses, even for those with high-blood pressure, but they typically don’t work for more than three days straight. (Reference 6).

What doesn’t work

There are plenty of items to buy at the nearby Walgreens, and plenty of medication that your doctor can give you that will NOT work for treating the common cold.

  • Cough medicine
  • Expectorants
  • Vitamin C mega-doses
  • Antibiotics

Let’s pick these claims apart, too.

Cough medicine

Medicines that work have well-documented clinical trials showing that they work; cough medicines have little such documented medical trials for in colds. It’s no surprise that few studies showing high effectiveness show up in medical journals – they are not effective, at least not at the doses which are safe for us to take.

Expectorants

Expectorants help with thinning mucous, which can help to prevent secondary infection. But they do little to help with the primary viral infection of the common cold. At best, they help with cough, but their effectiveness is mixed.

The Vitamin C myth

“There have been at least twenty well controlled studies on the use of mega doses of vitamin C in the prevention of colds, the treating the duration of colds, and in treatment of the severity of colds, and in none of those instances has there been any, really good evidence that vitamin C in mega doses does anything.” – Dr. Marvin Lipman, NPR

So why do people so adamantly believe that a mega-dose of vitamin C is an effective treatment for the common cold? For one, vitamin C is good for you – very good for you. Most people believe that if something is good for you, more of it must be better. However, this isn’t really based in any kind of real science – about 200mg is all the body can absorb per day. Perhaps equally (if not more convincing) is the placebo effect – the psychological effect (but not truly physical effect) of drugs. In other words, if you want to take a mega-dose of vitamin C, go ahead – but just know that it is not treating your symptoms.

Antibiotics

Antibiotics are some of the worlds greatest medicines – many of them exist on the list of the World Health Organizations list of Essential Medicines. However, they are useful to destroy bacteria, not viruses. Common colds are caused by viruses, and no dose or type of antibiotic known to medical doctors or researchers destroys viruses. Let me be clear – your doctor might prescribe antibiotics for something that feels like a virus – but know that your doctor is prescribing it to clean up a bacterial infection (which they may feel in their professional opinion is causing your symptoms). You may not have a common cold, after all. I’ll not get into antibiotic over-prescription here; that is a huge topic on its own.

Extra references

I included some references without direct web urls.

1. Doyle, W.J., T.P. McBride, D.P. Skoner, B.R. Maddern, J.M. Gwaltney, Jr., and M. Uhrin. 1988. A double-blind, placebo-controlled clinical trial of the effect of chlorpheniramine on the response of the nasal airway, middle ear and eustachian tube to provocative rhinovirus challenge. Pediatric Infectious Disease Journal. 7:229-238.

2. Gwaltney, J.M.Jr., J. Paul, D.A. Edelman, R.R. O’Connor, and R.B. Turner. 1996. Randomized controlled trial of clemastine fumarate for treatment of experimental rhinovirus colds. Clin. Infect Dis. 22:656-662.

3. Gwaltney, J.M., Jr., and H.M. Druce. 1997. Efficacy of brompheniramine maleate for the treatment of rhinovirus colds. Clinical Infectious Diseases. 25:1188-1194.

4. Gaffey, M.J., D.L. Kaiser, and F.G. Hayden. 1988. Ineffectiveness of oral terfenadine in natural colds: evidence against histamine as a mediator of common cold symptoms. Pediatric Infectious Disease Journal. 7:223-228.

5. Insel, P.A. 1996. Analgesic-antipyretin and antiinflammatory agents and drugs employed in the treatment of gout. In Goodman and Gilman’s The Pharmacological Basis of Therapeutics, 9th ed. J.G. Hardman, L.E. Limbird, P.B. Molinoff, R.W. Ruddon, and A.G. Gilman, editors. McGraw Hill, New York. 617-657.

6. Hoffman, B.B., and R.J. Lefkowitz. 1996. Catecholamines, sympathomimetic drugs, and adrenergic receptor antagonists. In Goodman and Gilman’s The Pharmacological Basis of Therapeutics, 9th ed. J.G. Hardman, L.E. Limbird, P.B. Molinoff, R.W. Ruddon, and A.G. Gilman, editors. McGraw Hill, New York. 199-248.

Read More