Preserve bash history across multiple terminals and sessions

I use the bash command line on my Mac a lot. I typically have multiple tabs with multiple terminal panes open in iTerm2, often with multiple ssh sessions running. By default, the last terminal session to close trashes the bash history of all the other sessions. Is it possible to configure the terminal to preserve bash history?

Terminal windows with multiple panes to preserve bash history

Preserve bash history

It’s actually fairly straightforward to preserve the history.

Open up your ~/.bash_profile configuration file in an editor of your choice such as nano. Once you have it open, add these lines at the end:

Save the file an exit. In order for your configuration change to take effect, you will need to reload the configuration in all your open terminal sessions:

This configuration change has to be done per user per machine.

Backup your bash configuration

I use mackup together with Dropbox to keep my bash and other command line configuration files backed up. This makes it easy to transfer your command line configuration to a new primary machine.

iTerm2

Preserve bash history in iTerm2

iTerm2 is my terminal of choice on the Mac. It has great tab and pane management accessible via both keyboard and mouse, and some subtle quality of life features.

For example, if you ssh somewhere, it sets the tab title to the hostname of the remote machine, or the name of the local directory.

Alternatives

One drastic alternative would be to migrate from Bash to an alternate shell like Fish or, in the future, the Next Generation Shell (NGS).

No meta description has been specified

In the past year, I started checking my blog posts against the Yoast SEO plugin for WordPress. It provides great suggestions for improving readability and quality of writing, as well as making blog posts friendlier for search engines and social network sharing. It also has a cryptic suggestion about “no meta description”. Suggestions including meta description warning

Here is the cryptic suggestion in full:

No meta description has been specified, search engines will display copy from the page instead.

The reason it’s cryptic is that setting the meta description for a post is neither part of WordPress core functionality, nor something Yoast visible exposes in its own extended interface. There are WordPress plugins of questionable provenance for setting post meta descriptions, but installing small WordPress plugins only increases your blog’s attack surface for hackers.

Since I blog infrequently, every time I end up searching for what it is Yoast wants me to do to satisfy and dismiss the warning.

How to set meta description

It turns out that the ability to set a meta description is built into Yoast. It is simply hidden behind the seemingly unrelated “Edit Snippet” button. If you click on it, you can set the meta description and dismiss the stern warning.

Click on Edit Snippet to set the meta description

Motivation

One of the reasons I started using Yoast SEO is that my colleague Antonio Cangiano has written a blog and a book about Technical Blogging. I read it some time ago on my Kindle and found it a pretty good read.

Book about Technical Blogging, including things like meta description

 

Datathon For Diabetes in Boston

This weekend Brandon and I are at the Datathon for Diabetes in Boston. It starts tonight at 5 and goes all day Saturday. The goal is to use publicly available data to generate an insightful and innovative analysis of diabetes in United States and abroad.

Datathon for DiabetesFitBit Charge HR prize at Datathon for Diabetes

We’re sponsoring a prize for the team that makes best use of Data Scientist Workbench in their solution. Novo Nordisk and Deloitte are also sponsoring a prize each.

Our prize consists of a FitBit Charge HR for each member of the winning team.
I think it’s worthwhile to learn and apply Spark as a tool to the problem of diabetes. Spark is an open source framework that lets you run your data analysis in parallel on multiple machines for speed and ability to work with large amounts of data.

Data Scientist Workbench has Spark ready to use with Python, Scala, and R in Jupyter, Zeppelin, and R Studio IDE.

If you run into trouble at the datathon, come up and ask me any question you like. I’ll be there for the duration as a mentor. As always, if you run into a Data Scientist Workbench issue, you should also open a support ticket.

Open a Data Scientist Workbench support ticket for any issues at Datathon for Diabetes

Other events

May 11-12 is Datapalooza Beijing and May 19 is Datapalooza Denver. Also, Big Data University is now posting events on its Facebook page.

Datathon for Diabetes, Boston

Ottawa: Data Day 3.0 at Carleton

On Tuesday March 29, I’ll be demoing Data Scientist Workbench (DSWB) at Data Day 3.0 for the Carleton University Institute of Data Science.

I’m in Ottawa the weekend before, so feel free to ping me and connect. I’m on Twitter as @leonsp.

Data Scientist Workbench

DataScientistWorkbench.com hosts open source data science tools for you for free. The tools include Jupyter and Zeppelin notebooks for developing and documenting your algorithms, R Studio IDE for focusing on your R code, and OpenRefine for cleaning your data.

Data Day 3.0Data Day 3.0 takes place at Carleton University

The event  is organized by the Carleton University Institute of Data Science in Ottawa. It runs from 8am to 3:30pm in the River building. You can find more details on their event page.

 

Spark Summit East 2016

Next week I’ll be demoing Data Scientist Workbench at Spark Summit East (official site) in New York. Polong Lin will be there with me. Come by the expo floor next Wednesday and Thursday and chat with us.

Data Scientist Workbench is what my team builds. It hosts open source data science tools like Jupyter, OpenRefine, R Studio IDE, Zeppelin and others for you. There’s exciting stuff in the changelog every week.

I signed up in time to get into a training session at Spark Summit East, so I’ll be spending my Tuesday working with the Wikipedia data sets. In today’s industry jargon, I’m more of a data engineer than a data scientist, so I’m hoping my Spark skills are up to the level needed for the advanced course.

This week I’m at Datapalooza Seattle, which is a good opportunity to brush up and expand those same Spark skills. In fact, we just posted the Day 1 challenge for Datapalooza. If you’re following along at home, fire up your Data Scientist Workbench, open a Jupyter notebook, and give it a try.

Spark Summit East

 

Datapalooza Seattle on Feb 9-11

On February 9 through 11, I’ll be mentoring hackers and budding data scientists at Galvanize during Datapalooza Seattle. It should be a great conference covering topics like things like machine learning, natural language processing, and data engineering infrastructure.

Last year’s Datapalooza in San Francisco was a fantastic event with lots of in-depth sessions. I was impressed with the range of material on data science and data engineering. The upcoming Datapalooza Seattle looks equally as fascinating.

My team at work runs  Data Scientist Workbench which is free hosted suite of open source tools including Jupyter, Zeppelin, R Studio IDE, and OpenRefine. We also organize free data science education through Big Data University.

I’m expecting Antonio Cangiano, Polong Lin, and Leon Katsnelson to be at Datapalooza with me as fellow mentors.

Let me know if you’re in Seattle at the same time and we’ll connect.

Datapalooza Seattle

Intro to #datascience and #spark at #ibminsight 2015

I’ll be teaching two hands-on labs at Insight 2015 in Las Vegas:

LCD-3459 Introduction to Data Science
Data science is a very popular job profile and in great demand in a wide variety of industries. You no longer need a Ph.D. in mathematics or statistics to become a data scientist. Any data professional can upgrade their skills and study data science. This lab introduces the basic concepts of data science and provides hands-on examples to help you apply these concepts.

Update: Do the Intro to Data Science Lab on Big Data University

LCD-3479 Fundamentals of Spark
Spark is one of the most important technologies for big data analytics and Spark skills are in great demand. This lab session introduces Spark fundamentals and applies the concepts using hands-on examples with a Spark cluster in cloud. You can also download a Docker image to your own laptop and run the lab projects there.

Update: Do the Fundamentals of Spark Lab on Big Data University

If you can’t make it, you can teach yourself data science at your own pace at BigDataUniversity.com

Setting up a new Macbook

I’ve just migrated to a new Macbook Pro as my primary work machine. As part of setting it up, I installed the following:

  • Caffeine to prevent it from going to sleep when I don’t want it to go to sleep
  • BetterTouchTool so that I can middle-click (three finger tap) to close tabs and paste in the terminal
  • f.lux to reduce eye-strain at night
  • Firefox as my web browser
  • Chrome so that I can run Authy for two-factor authentication on the desktop
  • Ditto for running Google Hangouts
  • iTerm2 as a superior, multi-pane terminal
  • Atom because it’s handy to have a text editor
  • Homebrew as an excellent package manager for installing Unix services and tools
  • Divvy for resizing windows to fractions of the screen

Settings

  • System Preferences > Trackpad > Tap to Click, so that I can click without mashing the trackpad
  • System Preferences > Accessibility > Cursor Size > Larger, so that the cursor is easy to find
  • System Preferences > Accessibility > “Reduce transparency” to get a solid menu bar
  • System Preferences > Sound > “Show volume in menu bar”, so that I can quickly adjust sound (and configure devices by option-clicking the icon)

    Option-clicking the volume icon
    Option-clicking the volume icon
  • Keychain Access > Preferences > “Show keychain status in menu bar”, so that I can quickly lock my laptop

    Quickly lock the screen
    Quickly lock the screen

Tuning wifi on Mac OS 10.10.3 Yosemite

I’ve experienced increasingly bad wifi performance on my Macbook Air over time. This has been accentuated further by me being somewhere with a lot of network lag. I did some research and the following suggestions made the wifi faster and more responsive with Mac OS 10.10.3 Yosemite.

1. Disable Bluetooth. I don’t use any wireless mice/keyboard/headsets, so Bluetooth doesn’t do anything for me.

2. Disable Facetime. Command+Space, Facetime. File > Preferences > [ ] Enable this account. I’ve never used Facetime, but from what I understand it’s Apple’s clone of Skype that only works with other Apple users.

3. Disable Handoff. System Preferences > General > [ ] Allow Handoff between this Mac and your iCloud devices. Handoff is Apple’s recent attempt to increase platform lock-in for those unfortunate souls who use non-Macbook Apple devices. Seemingly, it negatively affects network performance.

These three steps noticeably improved my wifi performance.

If that doesn’t help, there are more involved things you can do to tune Yosemite wifi performance or work around other Yosemite bugs.

I, for one, look forward to the forthcoming release of Mac OS 10.11 El Capitan.

 

#DUTO2015 conference

I’m at the Data Unconference in Toronto today. Jarred Gaertner just gave a through-provoking keynote on the ethics of big data, and I’m about to dig my hands into some open data sets in Richard Pietro’s hands-on session.

My colleague Polong Lin will be on a panel about IBM’s data science tools this afternoon, which should be interesting if only because it’s hard to keep track of everything that’s out there.

#DUTO2015 is sponsored by my friends at Big Data University