Skip to content

Instantly share code, notes, and snippets.

View dmpeters's full-sized avatar
👨‍🔧

David Peters dmpeters

👨‍🔧
View GitHub Profile
sudo apt-get update
sudo apt-get install openjdk-6-jdk
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.8.deb
sudo dpkg -i elasticsearch-0.19.8.deb
# be sure you add "action.disable_delete_all_indices" : true to the config!!
# if you want to remove it:
sudo dpkg -r elasticsearch
VERSION=0.20.6
sudo apt-get update
sudo apt-get install openjdk-6-jdk
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb
sudo dpkg -i elasticsearch-$VERSION.deb
# be sure you add "action.disable_delete_all_indices" : true to the config!!
<script type="text/javascript">
$(document).ready(function() {
var n = $("tbody>tr").length;
console.log(n);
$("#cts").text(n);
$(".filter").change(function () {
var r = $('tbody>tr:visible').length;
console.log(r);
})
@dmpeters
dmpeters / private_gist_to_public_gist.md
Last active December 17, 2015 20:59
How to move a private gist to public gist in 6 easy steps

How to move a private gist to public gist in 6 easy steps

  1. git clone git@gist.github.com:/[PRIVATE GIST UNIQUE ID].git private_gist_temp
  2. cd private_gist_temp
  3. create public temp gist
  4. git remote set-url origin git@gist.github.com:/[PUBLIC GIST UNIQUE ID].git
  5. git push -f
  6. refresh public gist
@dmpeters
dmpeters / fizzbuzz.js
Last active December 17, 2015 20:58
codersumo fizzbuzz in several languages
for(var i=1; i<=100; i++){
if (i % 15 == 0) {
print('FizzBuzz');
}
else if (i % 5 == 0) {
print('Buzz');
}
else if (i % 3 == 0) {
print('Fizz');
}
@dmpeters
dmpeters / git_tips.md
Last active December 17, 2015 02:38
Git Tips & Tricks
@dmpeters
dmpeters / bulk_index
Last active December 15, 2015 14:59
elastic search log and confusion
pyelasticsearch: DEBUG: Making a request equivalent to this: curl -XPOST 'http://localhost:9200/_bulk?op_type=create' -d '{"index": {"_type": "player", "_index": "nba"}}
{"college": "Lanier HS/USA", "name": "Monta Ellis", "weight": 185, "years_pro": 7, "dob": "10/26/1985", "position": "G", "team": "Bucks", "number": 11, "height": "6-3"}
{"index": {"_type": "player", "_index": "nba"}}
{"college": "FC Barcelona/Turkey", "name": "Ersan Ilyasova", "weight": 235, "years_pro": 4, "dob": "05/15/1987", "position": "F", "team": "Bucks", "number": 7, "height": "6-10"}
{"index": {"_type": "player", "_index": "nba"}}
{"college": "Colorado/USA", "name": "Chauncey Billups", "weight": 210, "years_pro": 15, "dob": "09/25/1976", "position": "G", "team": "Clippers", "number": 1, "height": "6-3"}
{"index": {"_type": "player", "_index": "nba"}}
{"college": "Kentucky/USA", "name": "Eric Bledsoe", "weight": 195, "years_pro": 2, "dob": "12/09/1989", "position": "G", "team": "Clippers", "number": 12, "height": "6-1"}
{"index": {"_ty
@dmpeters
dmpeters / cable_modem.md
Created March 25, 2013 04:48
Ambit Cable Modem Model: U10C018

Ambit Cable Modem Model: U10C018

Login Details: Web Address: http://192.168.100.1/

User: Username - user Password - user

Admin:

@dmpeters
dmpeters / salt_osx_setup.md
Created March 25, 2013 01:57
getting started with salt on osx

getting started with salt

a little adventurous tale of setting up salt on osx...

salt osx docs: http://goo.gl/E6ZtA

overall, seemed pretty straight forward...(?)

  • preliminary steps:
    • brew update (I did this to make sure I was up to date)
    • brew upgrade (I did this to upgrade what I was not up to date with)
  • brew doctor (I did this to make sure I was 'raring to brew')
@dmpeters
dmpeters / elasticsearch_notes.md
Created February 25, 2013 00:33
Hacker News - February Meetup - elasticsearch Notes

Hacker News - February Meetup

elasticsearch notes

What is elasticsearch

  • a way to search... things
  • way to search data in terms of naturla language and mocuh more...
  • distributed JSON API
  • fancy cluster

What is lucene?