Mak-kimchi 막김치

Years ago, my wife and I stayed overnight in Seoul on the way home from New Zealand. An amazing array of types of kimchi accompanied breakfast the following morning; and from then on, I was hooked on this Korean staple. For the last few years, I’ve gradually honed my kimchi-making skills. For simplicity, I tend to make mak-kimchi which means “roughly made kimchi.” In traditional kimchi, who cabbages are fermented intact (though usually split in half to permit the salt and later, spices to enter between the leaves.) However, getting the cabbages properly salted it very tricky and often neglected. So instead of making the more traditional kimchi, I’ve specialized in mak-kimchi. The main difference is in the way that the cabbages are handled. In this case, the cabbages are slided into approximately bite-sized pieces then salted, wilted, rinsed, mixed with the spices and allowed to ferment.

Automate hexo blogging tasks with Grunt

In my never-ending journey to find the optimal blogging platform, I wandered into the hexo camp. Among its many attributes is speed. Compared to Octopress, site generation is very fast. However, deployment has been tricky. Since I host my blogs from an Amazon S3 bucket, I tried to use the aws deployer commonly used with hexo; but I could never get it to install properly on OS X 10.11. So I wrote my own deployer that essentially just runs an AppleScript that handles the synchronization task. It is very slow. So I’m always on the lookout for faster deployment schemes. It looks like a Grunt-based system is the ticket.

Starting point for hexo automation

Chitrang Shah wrote a series of articles on setting up a blog using hexo, Amazon S3 and Grunt. His piece on automating deployment with Grunt was the starting point that I needed. His solution relies on the grunt-s3 plugin which unfortunately is no longer supported and doesn’t work with current versions of Grunt. But the concept is sound.

First more about Grunt:

About Grunt

As the Grunt page says, it’s a JavaScript task runner, meant for automating repetitive tasks like testing, deploying, etc. It installs easily:

npm install -g grunt-cli

The above will install grunt globally on the local machine. To use Grunt to automate your blogging tasks, you need to install the grunt shell plugin in the top level of your blog’s directory.

npm install grunt-shell --save-dev

Install Grunt plugins for sitemap and robots.txt

Install two additional plugins grunt-sitemap and grunt-robots-txt.

npm install grunt-sitemap --save-dev
npm install grunt-robots-txt --save-dev

Install Grunt plugin for S3 deployment

Here is where this solution diverges from Chitrang Shah’s. Instead of grunt-s3, I’m using grunt-aws.

npm install --save-dev grunt-aws

To use this plugin, you’ll have to modify Shah’s Gruntfile.js. Create the Gruntfile.js at the root level of your blog’s local directory. This file specifies the actions that are available from the command line.

module.exports = function(grunt){
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		aws: grunt.file.readJSON('grunt-aws.json'),
        // additional Configuration
    });
    // load and register tasks
};

Loading the npm tasks is straightfoward:

//Load NPM tasks
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-robots-txt')
grunt.loadNpmTasks('grunt-sitemap');
grunt.loadNpmTasks('grunt-aws');

Then we just need to string the tasks together in logical sequence.

//Grunt tasks
grunt.registerTask('default', ['shell:clean', 'shell:generate', 'sitemap:dev',
'robotstxt:dev', 'shell:server']);
//grunt.registerTask('staging', ['shell:clean','shell:generate','sitemap:staging',
'robotstxt:staging', 's3:staging']);
grunt.registerTask('deploy', ['shell:clean', 'shell:generate', 'sitemap:production', 'robotstxt:production',
's3']);

I’m ambivalent about staging for a small blog; so I’ve left it out. YMMV.

Use a separate file that is not checked into version control for your AWS credentials. My grunt-aws.json looks like this:

{
    "accessIdProduction" : "...",
    "accessKeyProduction" : "...",
    "bucketProduction" : "..."
}

The complete Gruntfile.js for this blog is available as a gist.

Finally, to use our new blog automation to clean, generate, and serve the blog locally, it’s just grunt. To clean, generate and deploy, it’s grunt deploy. This is a very straightforward way to automate your hexo blog and speedily deploy it to S3.

Kimchi and hypertension

Given my obsession with kimchi, I sometimes wonder whether the salt in kimchi promotes hypertension. The good news seems to be that it doesn’t.

In a retrospective recall study^[Consumption of kimchi, a salt fermented vegetable, is not associated with hypertension prevalence, Song, Hong Ji et al., Journal of Ethnic Foods , Volume 1 , Issue 1 , 8 - 12] of over 20,000 Korean adults, there was no association between kimchi consumption and the prevalence of hypertension.

Privacy vs. security: Just this once.

In the showdown between Apple and the FBI over an iPhone belonging to one of the San Bernardino attackers, some would argue that the company should acquiesce to the government’s request that it create a “backdoor” into the device allowing it to bypass the built-in strong encryption. Here’s what people who make this argument are missing: the law doesn’t work that way.

The government filed a motion in the U.S. District Court asking the court to direct assist law enforcement in bypassing the security features of the device. Magistrate Judge Sheri Pym approved the government’s request and ordered Apple to comply. The FBI and others argue that this is a one-off instance of bypassing security. But it is not.

On the lack of association between taxes, GDP and happiness

During a February 6, 2016 debate, U.S. presidential aspirant Donald Trump claimed that: “Right now we’re the highest taxed country in the world.”

Well, living in a country with much higher tax rates, I can tell you that his statement is patently false.^[Maybe he’s referring to the corporate tax rate which is quite high; but even that is irrelevant to the fact that all sorts of deductions and exclusions on the U.S. corporate tax return put the U.S. effective tax rate much lower than that of most counties.]

Trump meets computational linguistics

Trump orating

“I actually called her, and she never mentioned my name. You know, I - when I sold - oh, did I get a call from one of the Environmental Protection Agency, they couldn’t find it because it comes out in big globs, right, and you say to yourself, ‘How does that help us?’”

Trump is one of the most amusing orators in the history of presidential politics in the the U.S. But I wondered what would happen I took the text of a few of his speeches and fed it into a algorithm that uses Markov chains to shake things up a bit.

Stop Facebook tracking

network

Although I understand Facebook’s business model and I (basically) understand how money is made on the internet, I have no compunction about blocking ads, trackers, beacons and all manner of scripts. The current system creates layers upon layers of networks that exist to track one’s activities on the internet and market products and services more specifically. The problem is that unless I take specific action, I don’t get to choose what I reveal to companies that want to track me. Some have argued that using services like Facebook constitutes an implied contract between you - the user, and the internet application provider. It’s a ridiculous argument because I could make a similar argument that my use of their service implies a contract not to track.

Leaving something and taking something away.

Trump

“Every person passing through this life will unknowingly leave something and take something away. Most of this “something” cannot be seen or heard or numbered or scientifically detected or counted. It’s what we leave in the minds of other people and what they leave in ours. Memory. The census doesn’t count it. Nothing counts without it.” - Robert Fulghum All I Really Need to Know I Learned in Kindergarten

The anti-polarizing effect of keeping one's identity small.

Keeping your identity small

Keeping your identity small

Several years ago, Paul Graham, of Y Combinator fame wrote an essay entitled “Keep your Identity Small.” The premise is that discussions of religion and politics almost never result in anything resembling the give-and-take around other subjects. Two people can have an intelligent conversation about the pros and cons of certain brands of rice cookers^[We happen to use a Zojirushi and like it a lot; but I’d never introduce myself as a Zojirushian.]; but if the discussion turns to religion or politics, it’s essentially over. Graham’s conclusion is that religion and politics both engage a person’s identity. Once a conversation turns to identity, it’s hard to separate issues from people^[The best-selling book “Getting to Yes” by Fisher and Ury on negotiation techniques touched on this issue with it’s first principle of “Separate the people from the problem.” Emotions are a source of real problems in negotiation because people respond with anger when their personal interests are at stake. By treating issues as entities separate from the people that involve them, holiding them, inspecting and debating them on their own terms, it becomes easier to have conversations about them.]

Properly understanding ISIS

Islamic weapons

An interesting piece from The Atlantic on understanding ISIS on their own clearly-stated terms.

“We have misunderstood the nature of the Islamic State in at least two ways. First, we tend to see jihadism as monolithic, and to apply the logic of al‑Qaeda to an organization that has decisively eclipsed it…Bin Laden viewed his terrorism as a prologue to a caliphate he did not expect to see in his lifetime. The Islamic State, by contrast, requires territory to remain legitimate, and a top-down structure to rule it.”