~/.gitconfig
[diff]
external = /usr/local/bin/git-diff.sh
tool = meld
[merge]
tool = meld
[push]
default = simple
/usr/local/bin/git-diff.sh
#!/bin/bash
meld "$2" "$5" > /dev/null 2>&1
..then use git diff HEAD
1: sudo growpart /dev/xvdf 1
For a Linux ext2, ext3, or ext4 file system, use the following command, substituting the device name to extend:
2: sudo resize2fs /dev/xvdf1
full docs.aws
((input - min) * 100) / (max - min)
Good article
Singleton DI Container in JS
var container = {
dependencies: {},
register: function(key, value) {
this.dependencies[key] = value;
},
resolve: function(deps, func, scope) {
scope = scope || {}; scope.container = {};
for (var i = 0; i < deps.length; i++) {
scope.container[deps[i]] = this.get(deps[i]);
}
return function() {
func.apply(scope || {}, Array.prototype.slice.call(arguments, 0));
};
},
get: function(dependency) {
if (this.dependencies[dependency]) {
return this.dependencies[dependency];
}
throw new Error('Unable to find dependency ' + dependency);
}
};
How to use:
container.register('service', function() {
return { name: 'Service' };
});
container.register('router', function() {
return { name: 'Router' };
});
// adding dependencies when registrating dependency
container.register('test', function() {
this.service = container.get('service');
console.log(this.service().name === 'Service');
return 'yo';
});
var start = container.resolve(['service', 'router', 'test'], function(other) {
try {
console.log(this.container.service().name === 'Service');
console.log(this.container.router().name === 'Router');
console.log(this.container.test());
console.log('DONE');
} catch (ex) {
console.log(ex);
}
});
start("Other");
iostat -d <disk_name> | grep <disk_name> | awk '{ print $2; }' - avarage IOPS
iostat -dx <disk_name> | grep <disk_name> | awk '{ print $4; }' - Reads/sec
iostat -dx <disk_name> | grep <disk_name> | awk '{ print $5; }' - Writes/sec