Check cluster health (how many nodes are up?):
curl -s -XGET "http://127.0.0.1:9200/_cluster/health?pretty=true" | jq .
Check cluster nodes names:
curl -s -XGET 'http://localhost:9200/_nodes' | jq '.nodes[].name'
package test | |
import com.holdenkarau.spark.testing.{ DataFrameSuiteBase } | |
import org.apache.spark.sql.{ DataFrame } | |
import org.apache.spark.sql.SparkSession | |
import org.apache.spark.sql.functions.{ array, col, collect_set, udf } | |
import org.graphframes.GraphFrame | |
import org.graphframes.lib.AggregateMessages | |
import org.scalatest.FunSuite |
exports.handler = (event, context, callback) => { | |
const response = { | |
statusCode: 301, | |
headers: { | |
Location: 'https://google.com', | |
} | |
}; | |
return callback(null, response); | |
} |
# ---------------------------------------------- | |
# hashcash.py: Hashcash implementation | |
# ---------------------------------------------- | |
""" | |
Hashcash is a "proof of work." | |
Example: | |
>>> import sha | |
>>> sha.new('denmark2890CF').hexdigest() '000000cf89643370c24e413ec0886ab92bd7f6e8' |
# /tmp/test = EBS-SSD | |
# /mnt/test = instance-store | |
root@ip-10-0-2-6:~# dd bs=1M count=256 if=/dev/zero of=/tmp/test | |
256+0 records in | |
256+0 records out | |
268435456 bytes (268 MB) copied, 3.26957 s, 82.1 MB/s | |
root@ip-10-0-2-6:~# dd bs=1M count=256 if=/dev/zero of=/tmp/test | |
256+0 records in | |
256+0 records out |
var MyApp = angular.module('MyApp'); | |
MyApp.factory('msgBus', ['$rootScope', function($rootScope) { | |
var msgBus = {}; | |
msgBus.emitMsg = function(msg, data) { | |
data = data || {}; | |
$rootScope.$emit(msg, data); | |
}; | |
msgBus.onMsg = function(msg, func, scope) { | |
var unbind = $rootScope.$on(msg, func); | |
if (scope) { |
// In app.js or main.js or whatever: | |
// var myApp = angular.module('askchisne', ['ngSanitize', 'ngAnimate', 'ui.bootstrap', 'ui.bootstrap.tpls']); | |
// This filter makes the assumption that the input will be in decimal form (i.e. 17% is 0.17). | |
myApp.filter('percentage', ['$filter', function ($filter) { | |
return function (input, decimals) { | |
return $filter('number')(input * 100, decimals) + '%'; | |
}; | |
}]); |
javascript: (function () { | |
function c() { | |
var e = document.createElement("link"); | |
e.setAttribute("type", "text/css"); | |
e.setAttribute("rel", "stylesheet"); | |
e.setAttribute("href", f); | |
e.setAttribute("class", l); | |
document.body.appendChild(e) | |
} | |
function h() { |
As configured in my dotfiles.
start new:
tmux
start new with session name: