# This code snippet is runnable
# Download Elasticsearch zip
curl -O https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.7.zip
# Unzip to desired location
unzip elasticsearch-0.90.7.zip -d $HOME
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############################################################################### | |
| # The MIT License | |
| # | |
| # Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>. | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1) In your terminal, open the file using vim: | |
| vim file_name | |
| 2) Remove all BOM characters: | |
| :set nobomb | |
| 3) Save the file: | |
| :wq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # read more at https://terrty.net/2014/ssl-tls-in-nginx/ | |
| # latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf | |
| # security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net | |
| # your nginx version might not have all directives included, test this configuration before using in production against your nginx: | |
| # $ nginx -c /etc/nginx/nginx.conf -t | |
| server { | |
| # public key, contains your public key and class 1 certificate, to create: | |
| # (example for startssl) | |
| # $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var request = require('request'); | |
| var fs = require('fs'); | |
| var sox = require('sox'); | |
| var spawn = require('child_process').spawn; | |
| var WATSON_USER = ''; | |
| var WATSON_PASS = ''; | |
| var url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize'; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class BigNumber { | |
| static INTERNAL_RADIX = 16777216; | |
| static DEFAULT_REAL_PRECISION = 4; | |
| constructor(value, dotPos, sign) { | |
| if (value === undefined) { | |
| value = 0; | |
| } | |
| if (Array.isArray(value)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### KERNEL TUNING ### | |
| # Increase size of file handles and inode cache | |
| fs.file-max = 2097152 | |
| # Do less swapping | |
| vm.swappiness = 10 | |
| vm.dirty_ratio = 60 | |
| vm.dirty_background_ratio = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copied from: https://ethfiddle.com/09YbyJRfiI | |
| // CryptoKitties Source code | |
| // Copied from: https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code | |
| pragma solidity ^0.4.11; | |
| /** | |
| * @title Ownable | |
| * @dev The Ownable contract has an owner address, and provides basic authorization control |
OlderNewer