Morning Dose of Git

Some fool has checked .settings, .project, and myCrazyProductionDB.properties files into your git repo. You can add them to .gitignore, but they’ll still show up as modified because they are already being tracked. If you really can’t delete them, you can at least stop tracking them with:

$ git update-index --assume-unchanged <file>

A Simple Example

$ git update-index --assume-unchanged .classpath

If Git needs to modify the file, it will fail gracefully. To merge changes, you’ll have to un-mark it as assume-unchanged.

To see which files you’ve marked:

$ git ls-files -v | grep "^[[:lower:]]"
h .classpath

This works because ls-files -v prints the marked file in lower-case.

Re-mark the file with:

$ git update-index --no-assume-unchanged .classpath
share this:Email this to someoneTweet about this on TwitterShare on LinkedInShare on Facebook

Installing Up-To-Date Node.js on Linux

I’m running a recent version of XUbuntu, and have installed Node.js via the package manager. But, the version in the Ubuntu repos is horribly out of date:

$ nodejs -v
v0.10.25

As of today, the LTS version is 4.4.0. It’s pretty easy to install from the source. But, there’s a better way. The Node.js project maintains a set of repos for most Linux distros, which includes excellent installation instructions. In my case, it was incredibly simple:

$ curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
[sudo] password for kenneth: 

## Installing the NodeSource Node.js 4.x LTS Argon repo...

...

## Adding the NodeSource signing key to your keyring...

## Creating apt sources list file for the NodeSource Node.js 4.x LTS Argon repo...

...

## Running `apt-get update` for you...

Then, I installed the shiny new Node.js using Aptitude – because Aptitude is the bomb:

$ sudo aptitude install nodejs
The following NEW packages will be installed:
rlwrap{a} 
The following packages will be upgraded:
nodejs{b} 
1 packages upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 8,781 kB of archives. After unpacking 38.6 MB will be used.
The following packages have unmet dependencies:
nodejs : Conflicts: nodejs-dev but 0.10.25~dfsg2-2ubuntu1 is installed.
      Conflicts: npm but 1.4.21+ds-2 is installed.
nodejs-dev : Depends: nodejs (= 0.10.25~dfsg2-2ubuntu1) but 4.4.0-1nodesource1~wily1 is to be installed.
The following actions will resolve these dependencies:

 Remove the following packages:
1)     nodejs-dev
2)     npm

No problem, Ghost Rider, just accept the solution to remove the original packages and roll on:

Accept this solution? [Y/n/q/?] y
The following NEW packages will be installed:
rlwrap{a} 
The following packages will be REMOVED:
...
The following packages will be upgraded:
  nodejs 
1 packages upgraded, 1 newly installed, 60 to remove and 1 not upgraded.
Setting up nodejs (4.4.0-1nodesource1~wily1) ...

All done!

nodejs -v
v4.4.0

Get your up-to-date Node.js on!

share this:Email this to someoneTweet about this on TwitterShare on LinkedInShare on Facebook

Morning Dose of Typography

The Google Fonts project has a ton of fantastic fonts. But, it can be overwhelming to figure out how to use them. A lot of the fonts will suck when used incorrectly. Get schooled by the collaborative google-type project.

The github project readme has links to a few excellent typographic resources. View the full-blown project examples here and get your typography on.

Example Font Pairing
Example Font Pairing

Resources

share this:Email this to someoneTweet about this on TwitterShare on LinkedInShare on Facebook

Encryption With Emacs

Of course it would be nice to encrypt/decrypt files from Emacs. EasyPG comes with GNU Emacs since Emacs23 (source file: epa-file.el). Simply add to your init file:

 (require 'epa-file)
 (epa-file-enable)

Visit *anyfile*.gpg and it will be encrypted when you save the buffer.

If you’re running X and you prefer a non-graphical keyphrase prompt, include in your config:

(setenv "GPG_AGENT_INFO" nil)

References

EasyPG Home Page.

EmacsWiki EasyPG Entry. Configuration and troubleshooting info.

share this:Email this to someoneTweet about this on TwitterShare on LinkedInShare on Facebook