Setting up Javascript environment with NVM on Ubuntu 14.04

NVM provides you more convenient way to manage and set up your Javascript(Node.js) environment.

First install NVM, note git must be installed on your sistem:
^
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout git describe --abbrev=0 --tags
^
To activate nvm, you need to source it from your shell:
^
cd # go to home folder
^
source ~/.nvm/nvm.sh
^
If you want to see what versions of Node.js are available to install:
^
nvm ls-remote
^
To install Node.js v0.11.14 just run:
^
nvm install...

Ubuntu 12.04 TeamCity build agent installation

Download build agent archive from your TeamCity server:

wget http://your_teamcity.server.com:8111/update/buildAgent.zip

Unzip it in separate directory:

mkdir buildAgent

^
mv buildAgent.zip buildAgent
^
cd buildAgent
^
unzip buildAgent.zip
^
chown -R your_user:your_group ../buildAgent

Copy agent's settings file:

cp conf/buildAgent.dist.properties conf/buildAgent.properties

Edit this file:

nano conf/buildAgent.properties

There are fields which you must update:

# your TeamCity server address:

...

Javascript with Turbolinks in Rails 4

If some of your scripts don't work with turbolinks, you should do the following:

ready = ->
  #your code here
  
$(document).ready(ready)
$(document).on('page:load', ready)

Extract contents of pfx bundle with Openssl

This card is the copycat from this awesome article, all thanks to Zsolt Agoston.

# Extract the private key
openssl pkcs12 -in wild.pfx -nocerts -nodes -out priv.cer
 
# Extract the public key
openssl pkcs12 -in wild.pfx -clcerts -nokeys -out pub.cer
 
# Extract the CA cert chain
openssl pkcs12 -in wild.pfx -cacerts -nokeys -chain -out ca.cer

Arch linux system upgrade

sudo pacman-mirrors -f5 # to update mirror list
sudo pacman -Syyu # system upgrade

Or oneliner

sudo pacman-mirrors -f5 && sudo pacman -Syyu

Reset RabbitMQ (Manjaro linux)

To reset RabbitMQ Mnesia database ensure that RabbitMQ process is running on your system. Then stop the running application:

sudo rabbitmqctl stop_app

After that run the command:

sudo rabbitmqctl reset

And then start the app:

sudo rabbitmq start_app

Ubuntu 14.04 locales reconfiguration.

If you getting messages like this: perl: warning: Setting locale failed. in your console, then you must configure your locales. First run:

locale

You will see something like this:

LANG=C
LANGUAGE=
LC_CTYPE=fi_FI.UTF-8
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE=fi_FI.UTF-8
LC_MONETARY="C"
LC_MESSAGES=fi_FI.UTF-8
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

Then generate the missing locale and reconfigure locales...