nvm: Setting a default Node.js version
To set a default Node version for new shells, use nvm alias default <VERSION>
:
nvm alias default 1.2.3
I like to use the most recent LTS version Show archive.org snapshot as my default:
nvm alias default lts/erbium
Related cards:
NVM: How to automatically switch version when changing directories
The Node Version Manager allows installing multiple NodeJS versions and switching between them.
By default, it does not automatically switch versions when entering a directory that holds a .nvmrc
file.
The project's [readme document](https://g...
ASDF: A Version Manager To Rule Them All
tl;dr
asdf
allows you to manage multiple runtime versions with a single CLI tool and is backwards compatible by supporting existing config files, like e.g..nvmrc
or.ruby-version
.
Getting Started
- Disable rbenv
1.1 Dele...
Mysql::Error: BLOB/TEXT column can't have a default value
mysql> SELECT @@global.version;
+------------------+
| @@global.version |
+------------------+
| 5.6.30 |
+------------------+
1 row in set (0,00 sec)
[MySQL 5.6 Reference Manual](https://dev.mysql.com/doc/refman/5.6/en/sql-mode...
Linux: Running a program with a different locale than your default
When your system is not running on English, you may sometimes want to run some applications and not use your system locale.
Use cases are scripts that parse output, or just using the (possibly) more common English labels or error messages. Here is...
Linux: Open a file with the default application
If you are on a Linux shell and want to open a file with whatever default application is configured for that type, this often works:
xdg-open Quote.odt
xdg-open invoice.pdf
xdg-open index.html
Pro Tip
Make an alias so you ...
git: find the version of a gem that releases a certain commit
Sometimes I ran across a GitHub merge request of a gem where it was not completely obvious in which version the change was released. This might be the case for a bugfix PR that you want to add to your project.
Git can help you to find the next gi...
Github: How to find the Readme for a certain version of a gem
When a gem author releases a new version to Rubygems, usually a tag with the version number (e.g. v1.2.0
) is created an pushed to Github, so everyone can check out or take a look at the source code at this point version release at a later time.
...
Running old ImageMagick versions in a Docker container
If your project depends on an old version of ImageMagick that you can no longer install in your system, you can choose the run an old ImageMagick in a Docker container.
Dockerized ImageMagick commands will only work with absolute path arguments. ...
xterm: Have a black background by default
xterm
by default uses black text on white background.
To change that to something like "light gray on black", do a
vim ~/.Xresources
...and put this in there:
xterm*background: black
xterm*foreground: lightgray
Afterwards, feed ...
Install a specific version of a gem
To install webmock 1.5.0:
sudo gem install webmock --version "=1.5.0"
or
sudo gem install webmock -v "=1.5.0"