Skip to content

Instantly share code, notes, and snippets.

@snehasi
snehasi / ansibleupgrade.txt
Last active May 7, 2018 14:37
Updating the ansible version without using pip
Doing sudo -H pip install --upgrade ansible should have worked, but pip is failing build these days, and packages aren't gettig
installed with pip.
An alternative:
sneha@sneha-lenovo-z51-70:~$ sudo apt-get remove ansible
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
@snehasi
snehasi / ansiblessh.txt
Created May 7, 2018 14:44
sshconfig in ansible errror
sneha@sneha-lenovo-z51-70:~/experimenting/src/exchange$ script/dev/provision/localhost
[DEPRECATION WARNING]: DEFAULT_SUDO_EXE option, In favor of Ansible Become,
which is a generic framework. See become_exe. , use become instead. This
feature will be removed in version 2.8. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: DEFAULT_SUDO_USER option, In favor of Ansible Become,
which is a generic framework. See become_user. , use become instead. This
feature will be removed in version 2.8. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.
@snehasi
snehasi / fix-homebrew-npm.md
Created May 7, 2018 15:35 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

@snehasi
snehasi / successtilldb.txt
Created May 7, 2018 16:29
Set up the dev env successfully, the kernel log:
sneha@sneha-lenovo-z51-70:~/experimenting/src/exchange$ script/dev/provision/localhost
[DEPRECATION WARNING]: DEFAULT_SUDO_EXE option, In favor of Ansible Become, which is a generic framework. See become_exe. , use become instead. This feature will be removed in version 2.8. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: DEFAULT_SUDO_USER option, In favor of Ansible Become, which is a generic framework. See become_user. , use become instead. This feature will be removed in version 2.8. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
PLAY [all] *************************************************************************************************************************************************************************************************
TASK [Gathering Facts] ***********************************************************************************************************************************************
@snehasi
snehasi / gist:10da468589fe311844e7e53c9c72e83e
Created May 8, 2018 03:19
Switching between ruby versions without rvm on ubuntu14.04
sudo apt-get install ruby2.5
sudo apt-get install ruby-switch
ruby-switch --list
sudo ruby-switch --set ruby2.5
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 100 columns, instead of 75 in line 2.
cycles, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
offers, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 30, 31, 31, 32, 31, 32, 33, 34, 34, 35, 36, 37, 36, 37, 38, 39, 40, 41, 39, 40, 41, 42, 43, 44, 45, 46, 45, 46, 46, 47, 47, 48, 45, 46, 44, 45, 45, 46, 45, 46, 47, 48, 47, 48, 48, 49, 50, 51, 51, 52, 52, 53, 51, 52, 53, 54, 55, 56, 56, 57, 56, 57, 55, 56, 55
contracts, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 7, 7, 8, 8, 10, 10, 10, 10, 11, 11, 11,
run 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59 2018-06-09 07:58:59
days 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
open issues at the end of a day 4.0 6.0 4.0 4.0 3.0 4.0 5.0 5.0 0.0 4.0 6.0 2.0 5.0 5.0 4.0
closed issues at the end of a day 0.0 3.0 7.0 3.0 3.0 7.0 2.0 3.0 4.0 4.0 3.0 5.0 4.0 4.0 7.0
run 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47 2018-05-30 11:02:47
var renderChart = function(data) {
var chart_data = formatDataForChart(data)
var ctx = document.getElementById('canvas').getContext('2d')
window.my_chart = new Chart(ctx, {
//your chart scaffolding
})
}
var formatDataForChart = function(content) {
var first_item = _.get(content, '[0]', {})
var column_labels = _.map(_.omit(first_item, ['cycles']), function(val, key) {