Password Enforcement

Ryan Winchester has a nice post complaining about the stupid password rules that some sites enforce. It’s not that Winchester and the rest of us aren’t in favor of stronger passwords or even that we mind some rules that might help with making them stronger. It’s that the rules don’t actually help make them stronger.

A example makes this clear. A typical rule might be

  1. At least 8 characters
  2. At least one capital letter
  3. At least one lowercase letter
  4. At least one number

That seems like it would probably require a strong password but it doesn’t because it allows passwords like Abcd1234, which would be found almost instantly by a good password cracker. Even passwords like Loverboy1982 will be found fairly quickly by a decent password cracker. Notice that while our rule allows these two passwords—and many others—it doesn’t allow passwords like the famous correct horse battery staple which is actually much stronger than even the XKCD cartoon suggests1.

Read Winchester’s post for more examples and a possible solution (on the server side). As a user, you must use a password manager that will generate long random strings from the full character set. For your master password or in situations where the password manager is too inconvenient or impossible, choose 4–6 random words using a Diceware scheme (It’s important that the words be chosen randomly. Don’t choose any 4 words that pop into your mind.) It’s easy; even a sixth grader can do it.

One final reminder: If a site has rules that restrict the maximum length of your password or what types of characters are legal, it’s a sure sign that their password security is broken and that passwords exposed by an exploit can be easily recovered. Avoid such sites if you can. If you can’t, be sure to use a unique password for that site2.

UPDATE: batter → battery

Footnotes:

1

Or would be if everyone didn’t know it. You can be sure that password cracking programs will try it. Nonetheless, the point stands: four random words makes a strong password that would not be allowed by the rule.

2

You should do that anyway, of course, but even if you sometimes cheat, don’t do it on one of these sites.

Posted in General | Tagged | Leave a comment

Emacs as a C++ IDE

I often see Tweets or posts asking for help in finding a way of using Emacs as a C++ IDE. Mostly people turn to Eclipse for features such as

  • Jump to definition (of class, function, etc.)
  • Autocompletion
  • On-the-fly syntax highlighting
  • Find file in project
  • One key compilation
  • Graphical debuggers

Átila Neves, a long time Emacs user, took a job as a C++ programmer and started using Eclipse because everyone else at his new job was and because he wanted the features listed above. As every Emacs user will understand, he missed Emacs and started looking for a way to use it as an IDE that would provide at least the above functionality.

In this talk at CppCon 2015, Neves recounts how he made Emacs into a first class IDE that provides all the functionality that he was looking for. This involves using CMake, rtags, Flycheck, semantic, and a bit of custom Elisp (cmake-ide) to take information from the compiler about definitions and their locations and make them available to Emacs to enable easy navigation.

Neves has a quick demonstration of all this at work. Leveraging the compiler and CMake is a nice trick and provides for an intelligent IDE in a way that tools like CScope, that don’t actually understand the target language, can’t.

Neves’ talk is about 16 and quarter minutes so it’s easy to find time for it. If you’re looking for a great way to use Emacs as a C++ IDE, be sure to watch Neves’ video. It’s the best answer to the “How do I use Emacs as a C++ IDE?” question that I’ve seen. You can see his see his cmake-ide package on GitHub.

Posted in Programming | Tagged , , | Leave a comment

A Chat with Brian Kernighan

Arguably, the third most famous member of the Unix pantheon is Brian Kernighan. Although he did not, in fact, work on the development of the C language (he was the co-author along with Ritchie of the definitive book on C) his contributions were significant and seminal. I think of him as the ultimate tool builder—I have no idea if he would embrace that description—and master of the Unix Way™. After K&R, he’s probably best known for awk, a little language that is still in use today and has devoted adherents.

In a recent Computerphile video, Kernighan and Professor David Brailsford sit down to talk about Kernighan’s career and what it was like to work at Bell Labs in the glory days.

Kernighan talks about the introduction of pipes into Unix and the dramatic difference it made in the way people thought of and performed computations. In some sense, pipes were a necessity. Memory was in such short supply in those days that you pretty much had to stitch together a bunch of small programs to get things done.

If you’re at all interested in our shared history—and you should be—you will want to watch this video. It’s a bit over 28 minutes so you’ll have to schedule some time but it’s well worth it.

UPDATE: Added link to video.

Posted in General | Tagged | 4 Comments

Video on Using Org Mode for Your Init File 2

Two weeks ago, I wrote about Daniel Mai’s video on writing your Emacs configuration as an Org file. He showed how to organize your configuration in a literate programming way. Now he has a second video that ties everything together by showing how to load the configuration in the Org file when Emacs starts.

The idea is to use init.el as a sort of boot loader that does a small bit of preliminary initialization and then loads the config by calling org-babel-load-file. The files are set up so that he can drop this small init.el and his Org configuration file onto a new machine and have it download all his packages. If you find yourself setting up new Emacs installations frequently, that can be a big time saver: just pull the two files from some repository, start Emacs, and everything gets taken care of for you. Very nice.

The video is just 5 minutes, 15 seconds so it’s easy to watch during a coffee break. As I said in my previous post on this series, if you’re thinking of refactoring your Emacs configuration, consider making it an Org file and using Mai’s technique to load it.

Posted in General | Tagged , | Leave a comment

Emacs for Creative Writers

Yesterday I wrote about Emacs for Social Scientists so it’s only fair to mention how creative writers can benefit from Emacs too. I written about this before, of course, more than once but Balle over at I Love Emacs, has a post with some useful pointers for creative writers. He mentions Randall Wood’s guide and cheat sheet that I mentioned in the above post as well as a video on how to export your Org mode to the doc file that your publisher will surely insist upon.

It’s a nice post and worth a read if you make your living writing words and would like to do it in Emacs.

Posted in General | Tagged | Leave a comment

Emacs for the Social Sciences

Ista Zahn of Harvard’s Institute for Quantitative Social Sciences is a long time Emacs user. A year or so ago, a user asked for an Emacs configuration with a specific set of features and Zahn realized that his configuration already had most of what the user wanted. They got together and produced a configuration aimed at Social Science users.

As you might expect, the configuration is heavily slanted towards LaTeX, git, R, Stata, SAS, and Julia. If you follow the link to his dotemacs GitHub, you’ll see that the README (available as markdown and Org) is a nice discussion of what the configuration is trying to do as well as the actual implementation.

If you’re in the Social Sciences and tired of Word and other soul and energy sucking software, be sure to give Zahn’a configuration a try. As many others before you have found, Emacs will make you more productive and probably lower your blood pressure as well1. Even if you’re not a social scientist, you may find something useful in the configuration—many of us write in LaTeX and use R, after all.

Footnotes:

1

Well, at least after you get past the initial learning curve.

Posted in General | Tagged | Leave a comment

Wrap Region

Ben Maughan over at the excellent Pragmatic Emacs has a nice post about the wrap-region package. The idea is that you can arrange to wrap highlighted text with beginning and ending characters. For example, if you’re a C programmer you can arrange for / to wrap the highlighted text in /* and */. If you’re an Org mode user, you can use it to add the markup characters such as /, *, =, and ~.

Take a look at Maughan’s post to see how it works and how to set up your own wrappings. As Maughan points out, this composes nicely with Magnar Sveen’s expand region package. If you often find yourself adding wrapping characters after the fact, this package may be a real help.

UPDATE: *\*/

Posted in General | Tagged | Leave a comment

Remembering Dennis Ritchie

Jason Perlow over at ZD Net has a nice piece on Dennis Ritchie. Ritchie died a four years ago, about the same time as Steve Jobs. Everyone knows who Jobs was but most of the population—and sadly, some of our community’s younger members—don’t know who Ritchie was.

As Perlow recounts, almost none of modern computing would exist today if it weren’t for Ritchie’s work. Although his contributions were legion, he is mainly remembered as the inventor of C and the co-inventor of Unix.

It’s hard to overestimate either. Although many who haven’t bothered to learn it like to mock it as a latter day COBOL, C is, in fact, behind almost all the important software we use. Even “modern” languages like Python and Ruby take inspiration and syntax from C and are implemented in it. If you’re a Unix or Linux user, your operating system is written in it. If you’re a Windows user, your operating system is written in C’s unlovely child, C++. If you worship at the Church of Apple, your operating system is written in another C derivative, Objective C.

One of the most important contributions of C was to provide a portable systems language. Before C, almost all system software was written in the assembly language of the host machine. It was C that made Unix a portable operating system that ran on multiple hardware platforms. None of this would be possible without Ritchie’s C.

Unix, of course, has been so successful that Rob Pike once gave a talk bemoaning the fact that it had essentially killed operating system research. Even Windows, its archenemy for many years, has incorporated large parts of Unix. Today Unix is seen mostly on big iron providing back end processing but it lives on in smaller machines in the form of Linux. These days, any youngster can get a cheap computer, put Linux on it, and have a world class computing environment. At the same time Linux is powering much of the Internet so Unix’s influence extends to all of modern computing. Again, none of this would have been possible without Dennis Ritchie’s work.

Before he died, Ritchie was always adding interesting things to his Bell Labs Home Page—which Bell Labs still maintains—and I remembering checking it regularly for his latest offerings. Give Perlow’s article a look and celebrate one of computing’s heroes.

Posted in General | Tagged | Leave a comment

More Hydras

Speaking of hydras, as we did yesterday, Eric James Michael Ritz has a nice post on some of the hydras he uses. If you’re looking to see some good ways of using the hydra package, Ritz’s post is a worth taking a look at.

He begins by reconsidering abo-abo’s hydra to zoom the Emacs screen by adding a reset option and choosing keys that are more consistent with the default sequences. He has several other hydras that do things like navigate Org buffers, page breaks, and flycheck reports. He also has hydras for things like the Avy functions.

You’ll almost certainly find something useful for your own workflow in the post so it’s well worth taking a look. If you aren’t yet using the hydra package, I urge you to consider installing it. It’s just the thing for easing and speeding your workflow.

Posted in General | Tagged | 1 Comment

Navigation Hydras

John Kitchin has a couple of nice posts on building hydras to ease navigation. In the first, he considers commands that might be classified as “gotos.” They are in the isearch mold. About half of these are from the Avy package. The others make use of helm functionality. In a sense, none of this is new but adding them to a hydra means that you need remember only one key sequence to bring up the hydra menu. If you use a key chord such as 【Super+g】 as Kitchin recommends, then all these commands are only two keystrokes away. That’s pretty handy. Of course, you can still use whatever keystrokes you have assigned to them already, if you prefer, and use the hydra for the less used ones that you can’t remember the key sequence for.

The second post is mostly about “small” cursor movements: move by character, word, lines, paragraphs, etc. This hydra uses standard Emacs cursor movement commands and thus doesn’t require any add ons. The advantage of the hydra is that it makes these commands reachable in a couple of key strokes. Most experienced Emacsers will already have them burned into their muscle memory.

There’s a metapoint to be made here. Steve Yegge changed my life and the lives of countless others by recommending the use of isearch as a navigation tool. The introduction of ace-jump-mode (later replaced by avy) was a refinement of that technique: ways to get your cursor where you want it quickly and easily. They’re all about optimizing your navigation through the text you’re working on. All of the commands that Kitchin captures in his hydras serve this same purpose. It’s definitely worth taking a look at these two posts and using whatever parts you find useful for your workflow.

Posted in General | Tagged | Leave a comment